Example #1
0
 public static function init(array $a)
 {
     // Override any defaults due to operating system constraints
     // and copy defaults to working optionArray
     if ($newInit = is_null(self::$optionArray)) {
         // By default, Windows does not support colors on the console.
         // ANSICON by Jason Hood (http://adoxa.110mb.com/ansicon/index.html)
         // can be used to provide colors at the console on Windows.
         // Color output can still be enabled via the command line parameters --color
         if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
             self::$optionArrayDefault['color_output'] = false;
         }
         self::$optionArray = self::$optionArrayDefault;
     }
     // now merge other options
     self::$optionArray = array_merge(self::$optionArray, (array) $a);
     if ($newInit) {
         // Always set saveconfig to false for a new initialization, even after restoring
         // a save configuration. This allows additional options to be added at the
         // command line without them being automatically saved.
         self::$optionArray['saveconfig'] = false;
         // As well as the quit option.
         self::$optionArray['quit'] = false;
         // Set the error reporting level to the restored level.
         error_reporting($GLOBALS['olderrrep'] | self::$optionArray['verbose']);
     }
 }
Example #2
0
 public static function init(array $a)
 {
     // add the include-path to the package dirs
     $include_path = explode(PATH_SEPARATOR, get_include_path());
     foreach ($include_path as $dir) {
         if ($dir != __INSTALLDIR__) {
             self::$optionArray['package_dirs'][] = $dir;
         }
     }
     // now merge other options
     self::$optionArray = array_merge(self::$optionArray, (array) $a);
 }