コード例 #1
0
 function _createModelAndIncludeThem($table_name, $object_name)
 {
     $table = $this->conn->getDatabaseInfo()->getTable($table_name);
     $model_constructor = new lmbModelConstructor(new lmbProjectConstructor($this->dir_for_test_case, new lmbCliOutput()), $this->conn->getDatabaseInfo(), $table, $object_name);
     $model_constructor->create();
     foreach (lmb_glob($this->dir_for_test_case . '/src/model/*.class.php') as $file) {
         lmb_require($file);
     }
 }
コード例 #2
0
 function getLocations($params = array())
 {
     $resolved = array();
     foreach ($this->paths as $path) {
         foreach (lmb_glob($path) as $dir) {
             $resolved[] = $dir;
         }
     }
     return $resolved;
 }
コード例 #3
0
 function _getThisAndImmediateDirectories($dir)
 {
     $dirs = array();
     foreach (lmb_glob("{$dir}/*") as $item) {
         if ($item != '.' && $item != '..' && is_dir($item)) {
             $dirs[] = $item;
         }
     }
     $dirs[] = $dir;
     return $dirs;
 }
コード例 #4
0
 function testGlobForAbsolutePath()
 {
     $_ = $this->_rnd();
     file_put_contents(LIMB_VAR_DIR . "/tmp/{$_}bar.inc.php", "bar");
     file_put_contents(LIMB_VAR_DIR . "/tmp/{$_}foo.inc.php", "foo");
     file_put_contents(LIMB_VAR_DIR . "/tmp/{$_}zoo.inc.php", "zoo");
     $files = lmb_glob(LIMB_VAR_DIR . "/tmp/{$_}*.inc.php");
     sort($files);
     $this->assertEqual(sizeof($files), 3);
     $this->assertEqual(file_get_contents($files[0]), "bar");
     $this->assertEqual(file_get_contents($files[1]), "foo");
     $this->assertEqual(file_get_contents($files[2]), "zoo");
 }
コード例 #5
0
 function load(lmbMacroConfig $config)
 {
     $this->cache_dir = $config->cache_dir;
     if (!$config->forcescan && $this->_loadCache()) {
         return;
     }
     //compatibility with PHP 5.1.6
     $filters_scan_dirs = $config->filters_scan_dirs;
     foreach ($filters_scan_dirs as $dir) {
         foreach (lmb_glob($dir . '/*.filter.php') as $file) {
             $this->registerFromFile($file);
         }
     }
     $this->_saveCache();
 }
コード例 #6
0
ファイル: common.inc.php プロジェクト: knevcher/korchasa_limb
function lmb_require_glob($file_path)
{
    if (strpos($file_path, '*') !== false) {
        foreach (lmb_glob($file_path) as $path) {
            lmb_require($path);
        }
    } else {
        lmb_require($path);
    }
}
コード例 #7
0
 static function getPathByRuleName($rule_name)
 {
     $start_dirs = explode(';', LIMB_RULES_INCLUDE_PATH);
     $rule_file_name = self::getLmbRule($rule_name);
     foreach ($start_dirs as $dir) {
         $full_path = $dir . '/' . $rule_file_name;
         if (lmb_glob($full_path)) {
             return $full_path;
         }
     }
     throw new lmbException("Rule {$rule_name} was not found in " . LIMB_RULES_INCLUDE_PATH);
 }
コード例 #8
0
ファイル: lmbCliRunner.class.php プロジェクト: knevcher/limb
 protected function _mapCommandToObject($command_name)
 {
     $items = explode(';', $this->search_path);
     foreach ($items as $item) {
         $class = self::commandToClass($command_name);
         $path = $item . '/' . $class . '.class.php';
         if ($resolved = lmb_glob($path)) {
             require_once $resolved[0];
             return new $class($this->output);
         }
     }
 }