本文整理匯總了PHP中FileHelper::getFilenames方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileHelper::getFilenames方法的具體用法?PHP FileHelper::getFilenames怎麽用?PHP FileHelper::getFilenames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileHelper
的用法示例。
在下文中一共展示了FileHelper::getFilenames方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Rebuild
/**
* Rebuilds the cache file by reading & parsing all ChordPro song files.
* @return array song list
*/
public function Rebuild()
{
// large song collections (1,000's of songs) might timeout, set max number of seconds for this task
set_time_limit(45);
$files = FileHelper::getFilenames(Config::$SongDirectory);
$songList = $this->buildFileList($files);
$this->cache->put(Config::SongCacheKey_FileName, serialize($songList));
return $songList;
}
示例2: Build
/**
* Populates SongList View Model by reading and parsing filenames in the source directory
* @return SongList_Vm
*/
public function Build()
{
$files = FileHelper::getFilenames(Config::$SongDirectory);
$viewModel = new SongList_Vm();
foreach ($files as $filename) {
// Parse the filename (to make a Title) and create URL.
$s = preg_replace(Config::FileNamePattern, '$1', $filename);
$viewModel->Add($this->getTitle($s), Ugs::MakeUri(Actions::Song, $s));
}
$viewModel->Sort();
return $viewModel;
}