本文整理匯總了PHP中FileUtils::getFiles方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileUtils::getFiles方法的具體用法?PHP FileUtils::getFiles怎麽用?PHP FileUtils::getFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileUtils
的用法示例。
在下文中一共展示了FileUtils::getFiles方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: clearOldFiles
function clearOldFiles()
{
$files = FileUtils::getFiles("../tmpworksheets");
foreach ($files as $fName) {
if (filectime($fName) < time() - 1 * 60 * 60) {
unlink($fName);
}
}
}
示例2: longHelp
public function longHelp($params)
{
if (count($params) == 0) {
$this->line('Invoques an app-specific subcommand');
$this->line('Usage:');
$this->line('app [COMMAND_NAME] [[COMMAND_PARAMETERS]]');
$this->line('');
$this->line('You can also get help from a subcommand if provided using:');
$this->line('help app [COMMAND_NAME]');
$this->line('============');
$this->line('Here is a list of available app-specific commands:');
$commandsPath = APP_ROOT . 'app/' . APP_NAME . '/commands/';
foreach (FileUtils::getFiles($commandsPath, 'php') as $afile) {
$commandName = strtolower(basename($afile, '.php'));
$command = self::factory($commandName);
$this->line("\t" . $commandName);
$command->shortHelp();
}
} else {
$commandName = array_shift($params);
self::factory($commandName)->longHelp($params);
}
}
示例3: _migrations_in_folder
protected static function _migrations_in_folder($folder, &$out)
{
foreach (FileUtils::getFiles($folder) as $file) {
if (preg_match('`^(\\d+)_(.+)\\.(php|sql)$`', basename($file), $matches)) {
$out[$matches[1]] = array('file' => $folder . $file, 'class' => 'Migration_' . Strings::camel($matches[2]), 'description' => str_replace('_', ' ', $matches[2]), 'type' => $matches[3]);
}
}
}