c3537b7aa8bf848c7cc809ac5296b985bbf91896
[yaffs-website] / vendor / drush / drush / tests / unish.inc
1 <?php
2
3 /**
4  * Discover key directories for the System-Under-Test. Used by Unish launcher
5  * scripts and by \Unish\UnishTestCase::__construct.
6  *
7  * @return array
8  *   A list of paths.
9  */
10 function unishGetPaths()
11 {
12     $unish_tmp = getenv('UNISH_TMP') ?: sys_get_temp_dir();
13     @mkdir($unish_tmp);
14     $unish_tmp = realpath($unish_tmp);
15     $unish_sandbox = $unish_tmp . DIRECTORY_SEPARATOR . 'drush-sandbox';
16     $unish_drush_dir = dirname($unish_sandbox) . '/drush-sut/vendor/drush/drush';
17     return [$unish_tmp, $unish_sandbox, $unish_drush_dir];
18 }
19
20 function unishIsVerbose()
21 {
22     $verbose = false;
23     foreach (['-v','-vv','-vvv','--verbose', '--debug', '-d', '-dv'] as $needle) {
24         if (in_array($needle, $_SERVER['argv'])) {
25             $verbose = $needle;
26         }
27     }
28     return $verbose;
29 }