本文整理汇总了PHP中Dir::listFolders方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::listFolders方法的具体用法?PHP Dir::listFolders怎么用?PHP Dir::listFolders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::listFolders方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function get_available_rotators()
{
$result = array();
$d = new Dir(self::ROTATOR_GALLERIES_ROOT_PATH);
$dirs = $d->listFolders();
foreach ($dirs as $d) {
$result[] = $d->getName();
}
return $result;
}
示例2: get_available_configurations
public static function get_available_configurations()
{
$d = new Dir(self::CONFIG_DIR);
$folders = $d->listFolders();
$result = array();
foreach ($folders as $fold) {
if ($fold->getName() != self::COMMON_CONFIG) {
$result[] = $fold->getName();
}
}
return $result;
}
示例3: array
static function get_all_available_by_category($nome_categoria)
{
$result = array();
$category_root = new Dir(DS . ModuleUtils::get_modules_path() . DS . $nome_categoria . DS);
if ($category_root->exists() && $category_root->isDir()) {
$all_folders = $category_root->listFolders();
foreach ($all_folders as $mod) {
//aggiunto controllo su esistenza modulo definizione
$mod_def = new File($mod->getPath() . self::MODULE_DEFINITION_FILE);
if ($mod_def->exists()) {
$result[] = $mod->getName();
}
}
}
if ($nome_categoria == ModuleUtils::FRAMEWORK_CATEGORY_NAME) {
$result[] = ModuleUtils::FRAMEWORK_MODULE_NAME;
}
return $result;
}
示例4: index
function index()
{
$current_folder = new Dir($this->get_current_folder());
$all_subfolders = $current_folder->listFolders();
$result = array();
$result["elements"] = array();
foreach ($all_subfolders as $fold) {
$gallery_marker = $fold->newFile("_gallery.ini");
$f = array();
if ($gallery_marker->exists()) {
$f = array();
$f["type"] = "gallery";
$f["name"] = $fold->getName();
} else {
$f = array();
$f["type"] = "folder";
$f["name"] = $fold->getName();
}
$result["elements"][] = $f;
}
return $result;
}
示例5: File
static function delete_image_thumbnails($path)
{
if ($path instanceof File) {
$image_file = $path;
} else {
$image_file = new File($path);
}
$image_dir = $image_file->getDirectory();
$full_cache_dir = new Dir(self::THUMBNAILS_DIR . $image_dir->getPath());
$folders = $full_cache_dir->listFolders();
foreach ($folders as $f) {
$image_thumb = $f->newFile($image_file->getFilename());
if ($image_thumb->exists()) {
$image_thumb->delete();
}
if ($f->isEmpty()) {
$f->delete();
}
}
if ($full_cache_dir->isEmpty()) {
$full_cache_dir->delete();
}
}