本文整理汇总了PHP中Folder::getFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getFiles方法的具体用法?PHP Folder::getFiles怎么用?PHP Folder::getFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::getFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectData
public function selectData(CustomExternalFieldData &$data)
{
$path = $this->getUploadDir();
$dir = new Folder($path);
$files = $dir->getFiles();
foreach ($files as $key => $file) {
$files[$key] = new GalleryImage($path, $file->name());
}
$data->setData(null, $files);
}
示例2: end
<?php
require SYSPATH . '/helpers/Folder' . EXT;
/**
* Bootstrap File
*/
/**
* Getting all config files,
* check application directory first then the system directory.
*/
$config_dir = 'config/';
$files = Folder::getFiles(SYSPATH . $config_dir);
foreach ($files as $file) {
$ext = end(explode('.', $file));
if ($ext === 'php') {
if (file_exists(APPPATH . $config_dir . $file)) {
include APPPATH . $config_dir . $file;
} else {
include SYSPATH . $config_dir . $file;
}
}
}
// Set default controller and action
define('DEFAULT_CONTROLLER', $route['_default']);
define('DEFAULT_ACTION', 'index');
// Load core files
require SYSPATH . '/core/Model' . EXT;
require SYSPATH . '/core/View' . EXT;
require SYSPATH . '/core/Controller' . EXT;
require SYSPATH . '/helpers/Inflector' . EXT;
require SYSPATH . '/core/Benchmark' . EXT;
示例3: array
<?php
$MODULE = array('getFiles' => function () {
$path = post('path');
$FOLDER = new Folder($path);
return array('files' => $FOLDER->getFiles(function ($file) use($FOLDER) {
return $file->path != $FOLDER->path;
}, function ($file) {
return $file->toArray();
}), 'info' => $FOLDER->toFileArray());
}, 'newFile' => function () {
$path = post('path');
return array('error' => File::create($path));
}, 'newFolder' => function () {
$path = post('path');
return array('error' => Folder::create($path));
}, 'delete' => function () {
$path = post('path');
$err = _is_dir($path) ? Folder::delete($path) : File::delete($path);
return array('error' => $err);
}, 'unlock' => function () {
$path = post('path');
return array('error' => File::unlock($path));
});