Example #1
0
 private function loadConfig()
 {
     Config::suggest($this->path . '/' . 'config.yaml', 'zoop.' . $this->getConfigPath());
 }
Example #2
0
File: zn.php Project: rgigger/zinc
// 1. if there is one in the current directory then use it
// 2. check for a -D flag. If it is set then use that as the directory
// 3. check for a -I flag. If it is set then check for the user config to see if
//		there is an instance name and directory set up.  If so use that
// 4. if there is an environmental variable INSTANCE_DIR set then use that
// 2-4 above not done
// include the basic Zinc stuff
if (file_exists('./init.php')) {
    include 'init.php';
} else {
    include dirname(dirname(__DIR__)) . '/Zinc.php';
    Zinc::registerLib('core');
    Zinc::loadMod('cli');
}
// load the default zn config
Config::suggest(__DIR__ . '/config.yaml');
// process the command line args and determine which Command* class to use
$args = $argv;
array_shift($args);
$wordlist = Config::get('zn.commands');
$counts = array();
foreach (Config::get('zn.commands') as $commandName => $keywords) {
    $count = 0;
    foreach ($keywords as $word) {
        if (in_array($word, $args)) {
            $count++;
        }
    }
    $counts[$commandName] = $count;
}
$highestCommand = false;