本文整理汇总了PHP中Path::isDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Path::isDir方法的具体用法?PHP Path::isDir怎么用?PHP Path::isDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::isDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPathFields
protected static function getPathFields(Path $path)
{
$ret = array();
$ret['path'] = $path->getRelative();
$ret['path_hash'] = $path->getHash();
$ret['directory'] = $path->isDir();
$ret['size'] = $path->getSize();
$ret['created'] = date('Y-m-d H:i:s', $path->getCTime());
$ret['modified'] = date('Y-m-d H:i:s', $path->getMTime());
return $ret;
}
示例2: addWatches
protected function addWatches($in, Path $path, &$watches)
{
if (!$path->isDir()) {
// not in a directory, bail
return;
}
$wd = inotify_add_watch($in, $path->getPathname(), $this->computedMask);
$watches[$wd] = $path;
printf("\rAdding watches... %d", count($watches));
// recurse into this directory's children
$children = $path->getChildren();
foreach ($children as $child) {
if ($child->isDir()) {
$this->addWatches($in, $child, $watches);
}
}
}
示例3: getInfosHelper
private function getInfosHelper($currentPath, $infoKind, $searchOptions, &$infos)
{
$paths = array_diff(scandir($currentPath), array('..', '.'));
foreach ($paths as $path) {
$path = Path::combine($currentPath, $path);
if (Path::isDir($path)) {
if (($infoKind & self::DIRECTORY) != 0) {
$directoryInfo = new DirectoryInfo($path);
array_push($infos, $directoryInfo);
}
if ($searchOptions === self::ALL_DIRECTORIES) {
$this->getInfosHelper($path, $infoKind, $searchOptions, $infos);
}
} else {
if (($infoKind & self::FILE) != 0) {
$fileInfo = new FileInfo($path);
array_push($infos, $fileInfo);
}
}
}
}