当前位置: 首页>>代码示例>>PHP>>正文


PHP HFile::findFiles方法代码示例

本文整理汇总了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"));
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:12,代码来源:m130523_112000_ygin.php

示例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;
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:13,代码来源:DefaultController.php

示例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;
             }
         }
     }
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:49,代码来源:BackendModule.php

示例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;
 }
开发者ID:kot-ezhva,项目名称:ygin,代码行数:14,代码来源:FileUploadAction.php


注:本文中的HFile::findFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。