当前位置: 首页>>代码示例>>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;未经允许,请勿转载。