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


PHP files::scandir方法代碼示例

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


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

示例1: isDeletable

 function isDeletable($f)
 {
     if (is_file($f)) {
         return is_writable(dirname($f));
     } elseif (is_dir($f)) {
         return is_writable(dirname($f)) && count(files::scandir($f)) <= 2;
     }
 }
開發者ID:YesWiki,項目名稱:yeswiki-sandstorm,代碼行數:8,代碼來源:lib.files.php

示例2: array_merge

$ductile_counts = array_merge($ductile_counts_base, $ductile_counts);
$ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme . '_stickers');
$ductile_stickers = @unserialize($ductile_stickers);
// If no stickers defined, add feed Atom one
if (!is_array($ductile_stickers)) {
    $ductile_stickers = array(array('label' => __('Subscribe'), 'url' => $core->blog->url . $core->url->getURLFor('feed', 'atom'), 'image' => 'sticker-feed.png'));
}
$ductile_stickers_full = array();
// Get all sticker images already used
if (is_array($ductile_stickers)) {
    foreach ($ductile_stickers as $v) {
        $ductile_stickers_full[] = $v['image'];
    }
}
// Get all sticker-*.png in img folder of theme
$ductile_stickers_images = files::scandir($img_path);
if (is_array($ductile_stickers_images)) {
    foreach ($ductile_stickers_images as $v) {
        if (preg_match('/^sticker\\-(.*)\\.png$/', $v)) {
            if (!in_array($v, $ductile_stickers_full)) {
                // image not already used
                $ductile_stickers[] = array('label' => null, 'url' => null, 'image' => $v);
            }
        }
    }
}
$conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html';
if (!empty($_POST)) {
    try {
        # HTML
        if ($conf_tab == 'html') {
開發者ID:nikrou,項目名稱:dotclear,代碼行數:31,代碼來源:_config.php

示例3: ductileEntriesList

 public static function ductileEntriesList($attr)
 {
     global $core;
     $tpl_path = dirname(__FILE__) . '/tpl/';
     $list_types = array('title', 'short', 'full');
     // Get all _entry-*.html in tpl folder of theme
     $list_types_templates = files::scandir($tpl_path);
     if (is_array($list_types_templates)) {
         foreach ($list_types_templates as $v) {
             if (preg_match('/^_entry\\-(.*)\\.html$/', $v, $m)) {
                 if (isset($m[1])) {
                     if (!in_array($m[1], $list_types)) {
                         // template not already in full list
                         $list_types[] = $m[1];
                     }
                 }
             }
         }
     }
     $default = isset($attr['default']) ? trim($attr['default']) : 'short';
     $ret = '<?php ' . "\n" . 'switch (tplDuctileTheme::ductileEntriesListHelper(\'' . $default . '\')) {' . "\n";
     foreach ($list_types as $v) {
         $ret .= '	case \'' . $v . '\':' . "\n" . '?>' . "\n" . $core->tpl->includeFile(array('src' => '_entry-' . $v . '.html')) . "\n" . '<?php ' . "\n" . '		break;' . "\n";
     }
     $ret .= '}' . "\n" . '?>';
     return $ret;
 }
開發者ID:nikrou,項目名稱:dotclear,代碼行數:27,代碼來源:_public.php


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