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


PHP rglob函数代码示例

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


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

示例1: bootPackage

 function bootPackage($package)
 {
     $booters = rglob('*.php', 0, base_path('vendor/' . $package . '/src/boot'));
     foreach ($booters as $booter) {
         include_once $booter;
     }
 }
开发者ID:larakit,项目名称:lk-boot,代码行数:7,代码来源:ServiceProvider.php

示例2: rglob

/**
 *
 *
 * Recursive glob()
 *
 * @access public
 * @package Utils
 * @category Files
 *
 * @uses is_array()
 * @param int|string $pattern
 * the pattern passed to glob()
 * @param int $flags
 * the flags passed to glob()
 * @param string $path
 * the path to scan
 * @return mixed
 * an array of files in the given path matching the pattern.
 */
function rglob($pattern = '*', $flags = 0, $path = '')
{
    if (!$path && ($dir = dirname($pattern)) != '.') {
        if ($dir == '\\' || $dir == '/') {
            $dir = '';
        }
        return rglob(basename($pattern), $flags, $dir . DS);
    }
    $path = normalize_path($path, 1);
    $paths = glob($path . '*', GLOB_ONLYDIR | GLOB_NOSORT);
    $files = glob($path . $pattern, $flags);
    if (is_array($paths)) {
        foreach ($paths as $p) {
            $temp = rglob($pattern, false, $p . DS);
            if (is_array($temp) and is_array($files) and !empty($files)) {
                $files = array_merge($files, $temp);
            } else {
                if (is_array($temp) and !empty($temp)) {
                    $files = $temp;
                }
            }
        }
    }
    return $files;
}
开发者ID:hyrmedia,项目名称:microweber,代码行数:44,代码来源:filesystem.php

示例3: rglob

function rglob($pattern, $files = 1, $dirs = 0, $flags = 0)
{
    $dirname = dirname($pattern);
    $basename = basename($pattern);
    $glob = glob($pattern, $flags);
    $files = array();
    $dirlist = array();
    foreach ($glob as $path) {
        if (is_file($path) && !$files) {
            continue;
        }
        if (is_dir($path)) {
            $dirlist[] = $path;
            if (!$dirs) {
                continue;
            }
        }
        $files[] = $path;
    }
    foreach (glob("{$dirname}/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
        $dirfiles = rglob($dir . '/' . $basename, $files, $dirs, $flags);
        $files = array_merge($files, $dirfiles);
    }
    return $files;
}
开发者ID:jaredballou,项目名称:squad-tools,代码行数:25,代码来源:functions.php

示例4: larakitRegisterMenuSubpages

 static function larakitRegisterMenuSubpages($package, $alias)
 {
     //автоматическая регистрация дочерних страниц Subpages
     $dir = base_path('vendor/' . $package . '/src/config/larakit/subpages/');
     $dir = HelperFile::normalizeFilePath($dir);
     if (file_exists($dir)) {
         $dirs = rglob('*.php', 0, $dir);
         foreach ($dirs as $d) {
             $d = str_replace($dir, '', $d);
             $d = str_replace('.php', '', $d);
             $d = trim($d, '/');
             $menus_subpages = (array) \Config::get($alias . '::larakit/subpages/' . $d);
             if (count($menus_subpages)) {
                 foreach ($menus_subpages as $page => $items) {
                     $manager = \Larakit\Widget\WidgetSubpages::factory($page);
                     foreach ($items as $as => $props) {
                         $style = Arr::get($props, 'style', 'bg-aqua');
                         $is_curtain = Arr::get($props, 'is_curtain', false);
                         $manager->add($as, $style, $is_curtain);
                     }
                 }
             }
         }
     }
 }
开发者ID:larakit,项目名称:lk,代码行数:25,代码来源:ManagerPackage.php

示例5: rglob

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

示例6: rglob

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

示例7: rglob

/**
 * 递归返回指定目录,指定样式文件
 * 
 * @param string $pattern 文件模板
 * @param int $flags 修改标志
 * @param string $path 路径
 * @return array 文件名路径数组
 */
function rglob($pattern = '*', $flags = 0, $path = '')
{
    $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
    $files = glob($path . $pattern, $flags);
    foreach ($paths as $path) {
        $files = array_merge($files, rglob($pattern, $flags, $path));
    }
    return $files;
}
开发者ID:jinguanio,项目名称:david,代码行数:17,代码来源:functions.php

示例8: rglob

 function rglob($pattern, $flags = 0, $path = '') {
     if (!$path && ($dir = dirname($pattern)) != '.') {
         if ($dir == '\\' || $dir == '/') $dir = '';
         return rglob(basename($pattern), $flags, $dir . '/');
     }
     $paths = glob($path . '*', GLOB_ONLYDIR | GLOB_NOSORT);
     $files = glob($path . $pattern, $flags);
     foreach ($paths as $p) $files = array_merge($files, rglob($pattern, $flags, $p . '/'));
     return $files;
 }
开发者ID:jakubmalusevic,项目名称:Zend-website1,代码行数:10,代码来源:exp.php

示例9: init_package

 static function init_package($package, $dir = 'init')
 {
     $path = dirname(dirname(dirname(__DIR__))) . '/' . $package . '/src/' . $dir;
     if (file_exists($path)) {
         $inits = rglob('*.php', 0, $path);
         foreach ($inits as $init) {
             include_once $init;
         }
     }
 }
开发者ID:larakit,项目名称:lk-boot,代码行数:10,代码来源:Boot.php

示例10: test

 public function test()
 {
     $ret = rglob(ROOT_PATH . '/*.php');
     assert(1 < count($ret));
     assertEquals('autoload.php', basename($ret[0]));
     $ret = rglob(ROOT_PATH . '/*.php', 0, RGLOB_UP);
     assert(1 < count($ret));
     assertNotEquals('autoload.php', basename($ret[0]));
     assertEquals('autoload.php', basename($ret[count($ret) - 1]));
 }
开发者ID:tapiau,项目名称:muyo,代码行数:10,代码来源:FileSystem.php

示例11: rglob

function rglob($dir, $pattern = '*', $flags = 0)
{
    $paths = glob($dir . DIRECTORY_SEPARATOR . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
    $files = glob($dir . DIRECTORY_SEPARATOR . $pattern, $flags);
    foreach ($paths as $path) {
        if ($path != '.' && $path != '..') {
            $files = array_merge($files, rglob($path, $pattern, $flags));
        }
    }
    return $files;
}
开发者ID:jorik041,项目名称:libpywebhack,代码行数:11,代码来源:args_grabber.php

示例12: rglob

function rglob($pattern, $flags = 0)
{
    // Funcion para hacer un glob() recursivo. Tomado de:
    // http://stackoverflow.com/a/17161106
    $files = glob($pattern, $flags);
    //foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
    foreach (glob(dirname($pattern) . '/*') as $dir) {
        $files = array_merge($files, rglob($dir . '/' . basename($pattern), $flags));
    }
    return $files;
}
开发者ID:eduardokraus,项目名称:htdocsMe,代码行数:11,代码来源:index.php

示例13: AllTests

 function AllTests()
 {
     $this->TestSuite('Tutti i tests');
     // Considera solamente queste cartelle quando si cerca per i files di test
     $paths = array("core", "restful");
     foreach ($paths as $path) {
         foreach (rglob(ROOT_PATH . "{$path}/*/*Test.php") as $filename) {
             $this->addFile($filename);
         }
     }
 }
开发者ID:pierotofy,项目名称:pierotofy.it,代码行数:11,代码来源:run_all.php

示例14: rglob

function rglob($pattern, $flags = 0)
{
    $files = glob($pattern, $flags);
    foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
        // avoid auto-removing the database
        if (strpos($dir, "malicious_code") === false) {
            $files = array_merge($files, rglob($dir . '/' . basename($pattern), $flags));
        }
    }
    return $files;
}
开发者ID:systemmovie,项目名称:CleanSite,代码行数:11,代码来源:run.php

示例15: rglob

 function rglob($pattern = '*', $flags = 0, $path = false)
 {
     if (!$path) {
         $path = dirname($pattern) . DIRECTORY_SEPARATOR;
     }
     $pattern = basename($pattern);
     $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
     $files = glob($path . $pattern, $flags);
     foreach ($paths as $path) {
         $files = array_merge($files, rglob($pattern, $flags, $path));
     }
     return $files;
 }
开发者ID:yaddabristol,项目名称:crud,代码行数:13,代码来源:helpers.php


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