當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dir::ReadDirectories方法代碼示例

本文整理匯總了PHP中Dir::ReadDirectories方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dir::ReadDirectories方法的具體用法?PHP Dir::ReadDirectories怎麽用?PHP Dir::ReadDirectories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dir的用法示例。


在下文中一共展示了Dir::ReadDirectories方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

                </span>
              </div>
            </div>

          </div>


          <div class="fieldset">
            <div class="legend">Template &amp; Localization Settings</div>

            <div class="field">
              <label>Template Set:</label>
              <span class="field-container">
                <select name="template">
                  <?php 
$templates = Dir::ReadDirectories(BASE_DIR . '/templates', '~^[^._]~');
asort($templates);
echo Form_Field::OptionsSimple($templates, Config::Get('template'));
?>
                </select>
              </span>
            </div>

            <div class="field">
              <label>Language:</label>
              <span class="field-container">
                <select name="language">
                  <?php 
$languages = array();
foreach (glob(LANGUAGE_DIR . '/*.ini') as $ini) {
    $languages[] = preg_replace('~\\.ini$~', '', basename($ini));
開發者ID:hackingman,項目名稱:TubeX,代碼行數:31,代碼來源:cp-global-settings.php

示例2: foreach

        foreach ($xtable->xpath('./columns/column') as $xcolumn) {
            if ($xcolumn->name->val() != $table['field']) {
                XML_Schema::DeleteColumn($table['name'], $xcolumn->name->val());
            }
        }
    }
    // Remove all database tables
    foreach ($tables as $table) {
        $DB->Update('DROP TABLE IF EXISTS #', array($table));
    }
    // Clear out directories
    $dirs = array('temp', 'uploads', 'videos', 'templates/_cache');
    foreach ($dirs as $dir) {
        $dir = BASE_DIR . '/' . $dir;
        // Remove sub-directories and their contents
        $removals = Dir::ReadDirectories($dir, '~^[^.]~');
        foreach ($removals as $removal) {
            Dir::Remove($dir . '/' . $removal);
        }
        // Remove files
        $files = Dir::ReadFiles($dir, '~^[^.]~');
        foreach ($files as $file) {
            @unlink($dir . '/' . $file);
        }
    }
}
$fp = fopen(__FILE__, 'r');
fseek($fp, __COMPILER_HALT_OFFSET__);
eval(stream_get_contents($fp));
fclose($fp);
__halt_compiler();?>
開發者ID:hackingman,項目名稱:TubeX,代碼行數:31,代碼來源:reset-install.php

示例3: tbxTemplateCacheFlush

function tbxTemplateCacheFlush($quiet = false)
{
    Privileges::Check(Privileges::TEMPLATES);
    $dirs = Dir::ReadDirectories(TEMPLATE_CACHE_DIR, '~^[^.]~');
    foreach ($dirs as $dir) {
        Dir::Remove(TEMPLATE_CACHE_DIR . '/' . $dir);
    }
    if (!$quiet) {
        JSON::Success('Template cache has been flushed!');
    }
}
開發者ID:hackingman,項目名稱:TubeX,代碼行數:11,代碼來源:ajax.php


注:本文中的Dir::ReadDirectories方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。