本文整理汇总了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 & 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));
示例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();?>
示例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!');
}
}