当前位置: 首页>>代码示例>>PHP>>正文


PHP glob_recursive函数代码示例

本文整理汇总了PHP中glob_recursive函数的典型用法代码示例。如果您正苦于以下问题:PHP glob_recursive函数的具体用法?PHP glob_recursive怎么用?PHP glob_recursive使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了glob_recursive函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pestle_cli

/**
* 
* @command check_class_and_namespace
*/
function pestle_cli($argv)
{
    $path = inputOrIndex('Which folder?', '/path/to/magento/app/code/Pulsestorm', $argv, 0);
    $files = glob_recursive($path . '/*');
    foreach ($files as $file) {
        $file = realpath($file);
        if (strpos($file, '.php') === false) {
            output("NOT .php: Skipping {$file}");
            continue;
        }
        $contents = file_get_contents($file);
        $namespace = parseNamespace($contents);
        if (!$namespace) {
            output("No Namspace: Skipping {$file}");
            continue;
        }
        $class = parseClass($contents);
        if (!$class) {
            output("No Class: Skipping {$class}");
            continue;
        }
        $full_class = $namespace . '\\' . $class;
        $path = str_replace('\\', '/', $full_class) . '.php';
        if (strpos($file, $path) === false) {
            output("ERROR: Path `{$path}` not in");
            output($file);
        } else {
            output('.');
        }
    }
}
开发者ID:astorm,项目名称:pestle,代码行数:35,代码来源:module.php

示例2: glob_recursive

 function glob_recursive($directory, &$directories = array())
 {
     foreach (glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder) {
         $directories[] = $folder;
         glob_recursive("{$folder}/*", $directories);
     }
 }
开发者ID:TahicheVivo,项目名称:CREditor,代码行数:7,代码来源:Images.php

示例3: glob_recursive

 function glob_recursive($pattern, $flags = 0)
 {
     $files = glob($pattern, $flags);
     foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
         $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));
     }
     return $files;
 }
开发者ID:buuum,项目名称:app,代码行数:8,代码来源:css.php

示例4: glob_recursive

function glob_recursive($pattern, $flags = 0)
{
    //http://www.php.net/manual/en/function.glob.php#106595
    $files = glob($pattern, $flags);
    foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
        $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));
    }
    return $files;
}
开发者ID:leokaplan,项目名称:love-webplayer,代码行数:9,代码来源:index.php

示例5: getMenuXmlFiles

function getMenuXmlFiles()
{
    $base = getBaseMagentoDir();
    // $results = `find $base/vendor -name menu.xml`;
    // $results = explode("\n", $results);
    $results = glob_recursive("{$base}/vendor/menu.xml");
    $results = array_filter($results);
    return $results;
}
开发者ID:astorm,项目名称:pestle,代码行数:9,代码来源:module.php

示例6: getAllControllerFiles

function getAllControllerFiles($base)
{
    $files = glob($base . '/*');
    $controllers = array_filter($files, function ($item) {
        return is_dir($item . '/Controller/');
    });
    $controllers = array_map(function ($item) {
        return glob_recursive($item . '/Controller/*.php');
    }, $files);
    return $controllers;
}
开发者ID:mrtuvn,项目名称:pestle,代码行数:11,代码来源:module.php

示例7: getFiles

function getFiles($folder, $extension_string)
{
    if (file_exists($folder) && !is_dir($folder)) {
        return [$folder];
    }
    $extensions = array_filter(explode(',', $extension_string));
    $files = [];
    foreach ($extensions as $extension) {
        $files = array_merge($files, glob_recursive($folder . '/*.' . $extension));
    }
    return $files;
}
开发者ID:astorm,项目名称:pestle,代码行数:12,代码来源:module.php

示例8: theme_manifest

 public function theme_manifest()
 {
     $this->line("");
     $this->comment("Theme Manifest");
     $theme_folder = get_theme_root() . "/" . get_stylesheet();
     $asset_folder = "/public";
     $uri_path = $theme_folder . $asset_folder;
     $files_array = glob_recursive($uri_path . "/*.*", GLOB_ERR);
     $files_array = array_map(array($this, 'root_to_relative_url'), $files_array);
     foreach ($files_array as $file) {
         $this->line($file);
     }
 }
开发者ID:shortlist-digital,项目名称:agreable-pugpig-plugin,代码行数:13,代码来源:shortlist-manifest-generator.php

示例9: glob_recursive

function glob_recursive($pattern, $flags = 0, $prefix_remove = false, $prefix_add = "")
{
    //http://www.php.net/manual/en/function.glob.php#106595
    $files = glob($pattern, $flags);
    $prefix_remove_len = $prefix_remove ? strlen($prefix_remove) : 0;
    foreach ($files as $k => $file) {
        $files[$k] = $prefix_add . substr($file, $prefix_remove_len);
    }
    foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
        $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags, $prefix_remove, $prefix_add));
    }
    return $files;
}
开发者ID:leokaplan,项目名称:love-webplayer,代码行数:13,代码来源:filelist.php

示例10: get_theme_files

 function get_theme_files($extension = 'php', $directory = '/')
 {
     $theme_dir = CMS_ROOT . 'themes/' . $this->settings->theme . '/';
     $pattern = $theme_dir . trim($directory, '/') . '/*.' . $extension;
     $file_array = array();
     $files = glob_recursive($pattern, GLOB_BRACE);
     foreach ($files as $file) {
         $relative_path = str_replace(dirname($pattern) . '/', '', $file);
         $theme_path = str_replace($theme_dir, '', $file);
         $file_array[$relative_path] = array('hash' => url_base64_encode($theme_path), 'theme_path' => $theme_path, 'relative_path' => $relative_path, 'title' => ucwords(str_replace(array('_', '-'), ' ', basename($file, '.' . $extension))));
     }
     return $file_array;
 }
开发者ID:mamtasingh87,项目名称:bytecode,代码行数:13,代码来源:theme_editor_model.php

示例11: getUsedAclRuleIdsFromControllerFiles

function getUsedAclRuleIdsFromControllerFiles($dir)
{
    $files = glob_recursive($dir . '/*/Controller/*.php');
    $code = array_map(function ($file) {
        $function = getFunctionFromCode(file_get_contents($file), '_isAllowed');
        if (strpos($function, '_isAllowed')) {
            return getAclRulesFromIsAllowedFunction($function);
        }
        return false;
    }, $files);
    $code = array_filter($code);
    return $code;
}
开发者ID:astorm,项目名称:pestle,代码行数:13,代码来源:module.php

示例12: testLintErrors

 function testLintErrors() {
     $exit = 0;
     $root = get_osticket_root_path();
     foreach (glob_recursive("$root/*.js") as $s) {
         ob_start();
         system("jsl -process $s", $exit);
         $line = ob_get_contents();
         ob_end_clean();
         if ($exit == 3)
             $this->fail($s, 0, $line);
         else
             $this->pass();
     }
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:14,代码来源:test.jslint.php

示例13: glob_recursive

 function glob_recursive($pattern, $flags = 0)
 {
     $files = glob($pattern, $flags);
     $dirs = glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT);
     if (is_array($files) && !empty($dirs)) {
         foreach ($dirs as $dir) {
             $_files = glob_recursive($dir . '/' . basename($pattern), $flags);
             if (is_array($_files)) {
                 $files = array_merge($files, $_files);
             }
         }
     }
     return $files;
 }
开发者ID:pompalini,项目名称:emngo,代码行数:14,代码来源:MY_file_helper.php

示例14: glob_recursive

function glob_recursive($pattern, $int_flags = 0)
{
    $files = glob($pattern, $int_flags);
    if (!$files) {
        $files = array();
    }
    foreach ($files as $k => $filename) {
        if (is_dir($filename)) {
            unset($files[$k]);
            $subfiles = glob_recursive($filename . '/*', $int_flags);
            $files = array_merge($files, $subfiles);
        }
    }
    return $files;
}
开发者ID:Aphax,项目名称:markfalc,代码行数:15,代码来源:adminFunctions.php

示例15: get_tpl_contents

 function get_tpl_contents($theme = 'default')
 {
     require DATA_PATH . 'themes/' . $theme . '/info.php';
     $pfiles = array();
     if (isset($info['parent_theme'])) {
         $pfiles = glob_recursive(DATA_PATH . 'themes/' . $info['parent_theme'] . '/*.tpl');
     }
     $cfiles = glob_recursive(DATA_PATH . 'themes/' . $theme . '/*.tpl');
     $files = array_merge($pfiles, $cfiles);
     $tcontent = "";
     foreach ($files as $file) {
         $tcontent .= file_get_contents($file);
     }
     return $tcontent;
 }
开发者ID:kertkulp,项目名称:php-ruhmatoo-projekt,代码行数:15,代码来源:pages.php


注:本文中的glob_recursive函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。