本文整理汇总了PHP中HFile::findFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP HFile::findFiles方法的具体用法?PHP HFile::findFiles怎么用?PHP HFile::findFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HFile
的用法示例。
在下文中一共展示了HFile::findFiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: safeUp
public function safeUp()
{
$files = HFile::findFiles(Yii::getPathOfAlias('application'));
$files = array_merge($files, HFile::findFiles(Yii::getPathOfAlias('application') . '/../themes/'));
foreach ($files as $file) {
@HFile::replaceData('ngin.', 'ygin.', $file);
}
@HFile::replaceData('/../ngin/assets/', '/../ygin/assets/', Yii::getPathOfAlias('webroot') . '/themes/business/views/layouts/main.php');
Yii::app()->attachEventHandler('onEndRequest', array($this, 'renameNgin'));
$path = dirname(__FILE__) . "/../../assets/";
@HFile::removeDirectoryRecursive($path, false, false, false, array(".gitignore"));
}
示例2: getFiles
public function getFiles($path)
{
$files = file_exists($path) ? HFile::findFiles($path) : array();
$result = array();
foreach ($files as $key => $file) {
$item = new OverrideDataItem();
$item->name = mb_substr($file, mb_strlen($path));
$item->path = $file;
$item->mayBeEmpty = true;
$result[] = $item;
}
return $result;
}
示例3: init
public function init()
{
$this->setImport(array('backend.models.*', 'backend.components.*', 'backend.components.event.*', 'backend.interface.*', 'backend.widgets.*', 'backend.widgets.hiddenField.HiddenFieldWidget', 'backend.widgets.textField.TextFieldWidget', 'backend.widgets.checkBox.CheckBoxWidget', 'backend.widgets.textarea.TextareaWidget', 'backend.widgets.tinymce.TinymceWidget', 'backend.widgets.dropDownList.*', 'backend.widgets.dateTime.DateTimeWidget', 'backend.widgets.upload.singleFileUpload.SingleFileUploadWidget', 'backend.widgets.upload.listFileUpload.ListFileUploadWidget'));
$ass = Yii::getPathOfAlias('backend.assets.css.jquery-ui.images') . DIRECTORY_SEPARATOR;
Yii::app()->clientScript->addDependResource('jquery-ui.custom.min.css', array($ass . 'pbar-ani.gif' => './images/', $ass . 'ui-bg_diagonals-thick_90_eeeeee_40x40.png' => 'images/', $ass . 'ui-bg_flat_15_cd0a0a_40x100.png' => 'images/', $ass . 'ui-bg_glass_100_c5c9cb_1x400.png' => 'images/', $ass . 'ui-bg_glass_100_eaeaea_1x400.png' => 'images/', $ass . 'ui-bg_glass_80_000000_1x400.png' => 'images/', $ass . 'ui-bg_gloss-wave_50_18359d_500x100.png' => 'images/', $ass . 'ui-bg_highlight-hard_100_f2f5f7_1x100.png' => 'images/', $ass . 'ui-bg_highlight-hard_70_000000_1x100.png' => 'images/', $ass . 'ui-bg_highlight-soft_25_ffef8f_1x100.png' => 'images/', $ass . 'ui-icons_000000_256x240.png' => 'images/', $ass . 'ui-icons_2e83ff_256x240.png' => 'images/', $ass . 'ui-icons_ffffff_256x240.png' => 'images/'));
Yii::app()->setComponent('backend', $this);
// инициализацию проводим тут, т.к. надо добавить в приложение правила обработки урлов
// папки с расширениями, которые автоматически подключаем к модулю
array_unshift($this->autoExtensionDir, 'backend.extensions');
foreach ($this->autoExtensionDir as $dir) {
if (strpos($dir, '/') === false) {
$dir = Yii::getPathOfAlias($dir);
}
$files = HFile::findFiles($dir, array('level' => 1));
foreach ($files as $f) {
if (basename($f) != 'config.php') {
continue;
}
$extName = str_replace('config.php', '', str_replace($dir, '', $f));
$extName = trim($extName, DIRECTORY_SEPARATOR);
if ($extName == '') {
continue;
}
$this->extensions = array($extName => require $f);
}
}
// подключение расширений, зарегистрированных в базе
// TODO
//
//$this->addExtension($this);
// TODO - кэшить настройки расширений
foreach ($this->_extensions as $ext) {
if (!is_array($ext)) {
continue;
}
if (isset($ext['rules'])) {
Yii::app()->urlManager->addRules($ext['rules'], false);
if (isset($ext['application']['controllerMap'])) {
Yii::app()->controllerMap = CMap::mergeArray(Yii::app()->controllerMap, $ext['application']['controllerMap']);
unset($ext['application']['controllerMap']);
}
}
if (isset($ext['application'])) {
foreach ($ext['application'] as $param => $value) {
Yii::app()->{$param} = $value;
}
}
}
}
示例4: getCopyFileName
protected function getCopyFileName($filePath)
{
$path = HFile::getDir($filePath);
$files = file_exists($path) ? HFile::findFiles($path) : array();
$files = array_flip($files);
$ext = HFile::getExtension($this->fileName);
$file = HFile::getFileNameByPath($this->fileName, true);
$i = 0;
$copyFileName = '';
do {
$copyFileName = $file . '(' . ++$i . ').' . $ext;
} while (array_key_exists($copyFileName, $files));
return $copyFileName;
}