/** * Init - the commandline parser * Init - load functions and classes. * Init - Add major options, like -v */ public static function init() { // Init parent with base commands parent::init(); self::$parser->description = <<<EOF /\\_/\\ ____/ o o \\ /~____ =ø= / (______)__m_m) Miau. A modulized command line program EOF; self::$parser->version = '0.0.1'; // Adding a main option for setting domain self::$parser->addOption('domain', array('short_name' => '-m', 'long_name' => '--mice', 'description' => 'Just to add option with no meaning', 'action' => 'StoreString', 'default' => 'default')); self::beforeParse(); }
public static function init() { $m = new modules(); $m->autoloadRegister(); // Define all system constants conf::defineCommon(); // Set include path - based on config.ini conf::setIncludePath(); // Load config file conf::load(); // Set log level - based on config.ini log::setErrorLog(); log::setLogLevel(); // Set locales intl::setLocale(); // Set default timezone intl::setTimezone(); // Load language $l = new lang(); $base = conf::pathBase(); $l->setDirsInsideDir("{$base}/modules/"); $l->setDirsInsideDir("{$base}/htdocs/templates/"); $l->setSingleDir("{$base}/vendor/diversen/simple-php-classes"); $l->loadLanguage(conf::getMainIni('lang')); // Init parent with base commands parent::init(); self::$parser->description = <<<EOF _ _ _ ___ ___ ___ ___| (_) ___| |__ / __/ _ \\/ __|/ __| | | / __| '_ \\ | (_| (_) \\__ \\ (__| | |_\\__ \\ | | | \\___\\___/|___/\\___|_|_(_)___/_| |_| Modulized Command line program EOF; self::$parser->version = '0.0.1'; // Adding a main option for setting domain self::$parser->addOption('domain', array('short_name' => '-d', 'long_name' => '--domain', 'description' => 'Domain to use if using multi hosts. If not set we will use default domain', 'action' => 'StoreString', 'default' => 'default')); self::beforeParse(); }