本文整理汇总了PHP中RecursiveDirectoryIterator::getFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP RecursiveDirectoryIterator::getFilename方法的具体用法?PHP RecursiveDirectoryIterator::getFilename怎么用?PHP RecursiveDirectoryIterator::getFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecursiveDirectoryIterator
的用法示例。
在下文中一共展示了RecursiveDirectoryIterator::getFilename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: valid
/**
* Returns true if file is valid.
* Valid Files: Directories and Files not beginning with a "." (dot).
*
* @todo make it more flexible to handle hidden dirs on demand etc,
* win/*nix compat
*
* @return boolean if current file entry is vali
*/
public function valid()
{
if (parent::valid()) {
if (parent::isDot() || parent::isDir() && strpos(parent::getFilename(), '.') === 0) {
parent::next();
// zum nächsten eintrag hüpfen
return $this->valid();
// nochmal prüfen
}
return true;
}
return false;
}
开发者ID:joshiausdemwald,项目名称:sfFilebasePlugin,代码行数:22,代码来源:sfFilebasePluginRecursiveDirectoryIterator.php
示例2: _recurseDirectory
/**
* Recursive directory function.
*
* @param RecursiveDirectoryIterator $iterator
*/
protected function _recurseDirectory($iterator)
{
while ($iterator->valid()) {
if ($iterator->isDir() && !$iterator->isDot()) {
if ($iterator->hasChildren()) {
$this->_recurseDirectory($iterator->getChildren());
}
} elseif ($iterator->isFile()) {
$path = $iterator->getPath() . '/' . $iterator->getFilename();
$pathinfo = pathinfo($path);
if ($this->_isPhpFile($path)) {
$this->addFile($path);
}
}
$iterator->next();
}
}
示例3: array
// outName returns the hml direct.
$resourceUriRoot = @$_REQUEST['resourceUriRoot'];
// URI prefix for the resources upload with forms.
//if no style given then try default, if default doesn't exist we our put raw xml
$importData = array();
$info = new SplFileInfo($formImportDir);
$i = 0;
$xmlForms = array("form" => array(), "resource" => array());
if ($info->isDir()) {
$iterator = new RecursiveDirectoryIterator($formImportDir);
while ($iterator->valid()) {
if ($iterator->isFile()) {
$ext = pathinfo($iterator->getPathname(), PATHINFO_EXTENSION);
if ($ext == "xml") {
// echo $prefix,$j," import ",$dirIterator->getPathname(), "<br>\n";
$xmlForms["form"][$iterator->getFilename()] = $iterator->getPathname();
} else {
$filepath = preg_replace("/" . preg_replace("/\\//", "\\\\/", HEURIST_UPLOAD_DIR) . "/", "/", $iterator->getPathname());
// echo $prefix,$j," resource ".$dirIterator->getFilename()." has path ".$filepath, "<br>\n";
$xmlForms["resource"][$iterator->getFilename()] = $filepath;
}
} else {
if ($iterator->isDir() && $iterator->hasChildren(false)) {
// echo $i,pathinfo($iterator->getPathname(),PATHINFO_FILENAME), "<br>\n";
processChildDir($iterator->getChildren(), $i . "-");
}
}
$iterator->next();
$i++;
}
} else {