本文整理汇总了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]);
}
}
}