本文整理匯總了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));
});