當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。