当前位置: 首页>>代码示例>>PHP>>正文


PHP DirectoryIterator::isReadable方法代码示例

本文整理汇总了PHP中DirectoryIterator::isReadable方法的典型用法代码示例。如果您正苦于以下问题:PHP DirectoryIterator::isReadable方法的具体用法?PHP DirectoryIterator::isReadable怎么用?PHP DirectoryIterator::isReadable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DirectoryIterator的用法示例。


在下文中一共展示了DirectoryIterator::isReadable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPlugins

 public function getPlugins()
 {
     $output = array();
     $it = new DirectoryIterator(BASE . 'plugins/');
     while ($it->valid()) {
         $xml_path = $it->getPath() . $it->getFilename() . '/';
         $xml_file = $xml_path . "plugin.xml";
         if ($it->isReadable() && $it->isDir() && file_exists($xml_file)) {
             $output[] = new PapyrinePlugin($xml_path);
         }
         $it->next();
     }
     return $output;
 }
开发者ID:BackupTheBerlios,项目名称:papyrine-svn,代码行数:14,代码来源:Papyrine.php

示例2: method1

 protected function method1($dir, $padLength = 0)
 {
     $thisDir = new \DirectoryIterator($dir);
     foreach ($thisDir as $value) {
         if ($thisDir->isDot()) {
             // Skip the dot directories
             continue;
         } else {
             if ($thisDir->isDir()) {
                 if ($thisDir->isReadable()) {
                     // if this is a new directory AND we have permission to read it, recurse into it.
                     echo str_repeat(' ', $padLength * 2) . $value . "\\\n";
                     $this->method1($dir . '/' . $value, $padLength + 1);
                 }
             } else {
                 // output the file
                 echo str_repeat(' ', $padLength * 2) . $value . "\n";
             }
         }
     }
     return;
 }
开发者ID:Stunt,项目名称:iterators,代码行数:22,代码来源:DirectoryCommand.php

示例3: exists

 /**
  * @param null $location
  * @return bool
  */
 public function exists($location = NULL)
 {
     if (!$location) {
         $location = $this->location;
     }
     $di = new \DirectoryIterator($location);
     return $di->isReadable();
 }
开发者ID:dman-coders,项目名称:drupal-code-metrics,代码行数:12,代码来源:Module.php

示例4: dirIterator

 /**
  * Directory iterator
  * 
  * @param string $fullpath - full path to the director we wish to iterate
  * @return array - numerical index of returned pages
  */
 private function dirIterator($fullpath)
 {
     $it = new DirectoryIterator($fullpath);
     while ($it->valid()) {
         if (!$it->isDot() && $it->isFile() && $it->isReadable() && substr($it->getFilename(), -4, 4) == '.php') {
             $files[] = $it->getFilename();
         }
         $it->next();
     }
     return $files;
 }
开发者ID:digideskio,项目名称:oscmax2,代码行数:17,代码来源:usu.php

示例5: label

}
$home = $_SERVER['HOME'];
$account_user = $_SERVER['LOGNAME'];
$begin_script = time();
function label($text)
{
    return "\n[" . date('r') . "] " . $text . "\n";
}
echo "#################################################\n";
echo "### Starting dreamhost account backup process ###\n";
echo "###      " . date('r') . "      ###\n";
echo "#################################################\n";
try {
    // Check if we can read/write to mysql subdir chosen
    $mysql_arquives = new DirectoryIterator($home . '/' . $backups_dir . '/' . $mysql_subdir);
    if (!$mysql_arquives->isReadable() || !$mysql_arquives->isWritable()) {
        throw new RuntimeException('No read or write access.');
    }
} catch (RuntimeException $e) {
    exit("Please make sure you provide a valid folder for the arquives, with read and write access.\n");
}
// Return an array with stdClass objects from API commands
function request_api($cmd)
{
    $api_key = $_SERVER['argv'][1];
    $xml = new SimpleXMLElement('https://api.dreamhost.com/?key=' . $api_key . '&cmd=' . $cmd . '&format=xml', null, true);
    if ((string) $xml->result != 'success') {
        exit("Request for '{$cmd}' unsuccessful.\n");
    }
    // Use json decode/encode to convert the SimpleXMLElement objects into stdClass objects
    return json_decode(json_encode($xml->xpath('/dreamhost/data')));
开发者ID:helderco,项目名称:Dreamhost-Full-Auto-Backup,代码行数:31,代码来源:dreamhost.backup.php


注:本文中的DirectoryIterator::isReadable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。