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


PHP Folder::read方法代码示例

本文整理汇总了PHP中Folder::read方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::read方法的具体用法?PHP Folder::read怎么用?PHP Folder::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Folder的用法示例。


在下文中一共展示了Folder::read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: main

 /**
  * The main method: where things happen
  * 
  * @access public
  */
 function main()
 {
     if (isset($this->params['quiet'])) {
         $this->quiet = true;
     }
     $tmp = new Folder(TMP);
     $folders = reset($tmp->read());
     // read only directories (array[0])
     foreach ($folders as $folder) {
         $tmp->cd(TMP);
         $tmp->cd($folder);
         $files = end($tmp->read());
         // read only files (array[1])
         if (in_array('last_interaction', $files)) {
             $file_interaction = (int) file_get_contents($tmp->pwd() . DS . 'last_interaction');
             // as each piece is 1Mb, this will give the user the chance of uploading at 13,7 kbps (1,7 kb/s)
             if (time() - $file_interaction > 600) {
                 $this->out("Removing {$folder}");
                 foreach ($files as $file) {
                     unlink($tmp->pwd() . DS . $file);
                 }
                 $tmp->delete();
             }
         }
     }
 }
开发者ID:rcaravita,项目名称:jodeljodel,代码行数:31,代码来源:upload_gc.php

示例2: getJobs

 function getJobs()
 {
     App::import('Core', 'Folder');
     $Folder = new Folder();
     $jobs = array();
     if ($Folder->cd(APP . 'vendors' . DS . 'shells' . DS . 'jobs' . DS)) {
         $x = $Folder->read(true, true, true);
         $jobs = array_merge($jobs, $x[1]);
     }
     if ($Folder->cd(VENDORS . DS . 'shells' . DS . 'jobs' . DS)) {
         $x = $Folder->read(true, true, true);
         $jobs = array_merge($jobs, $x[1]);
     }
     return $jobs;
 }
开发者ID:revolution-messaging,项目名称:CakePHP-PHP-Resque-Plugin,代码行数:15,代码来源:resque_utility.php

示例3: _copyFonts

 /**
  * Copy font files used by admin ui
  *
  * @throws Exception
  */
 protected function _copyFonts()
 {
     $fontAwesomePath = WWW_ROOT . 'fontAwesome';
     if (!file_exists($fontAwesomePath)) {
         if (!$this->_clone) {
             throw new Exception('You don\'t have "fontAwesome" in ' . WWW_ROOT);
         }
         CakeLog::info('Cloning FontAwesome...</info>');
         exec('git clone git://github.com/FortAwesome/Font-Awesome ' . $fontAwesomePath);
     }
     chdir($fontAwesomePath);
     exec('git checkout -f master');
     $targetPath = WWW_ROOT . 'font' . DS;
     $Folder = new Folder($targetPath, true);
     $fontPath = WWW_ROOT . 'fontAwesome' . DS . 'font';
     $Folder = new Folder($fontPath);
     $files = $Folder->read();
     if (empty($files[1])) {
         CakeLog::error('No font files found');
         $this->_stop();
     }
     foreach ($files[1] as $file) {
         $File = new File($fontPath . DS . $file);
         $newFile = $targetPath . $file;
         if ($File->copy($newFile)) {
             $text = __('Font: %s copied', $file);
             CakeLog::info($text);
         } else {
             $text = __('File: %s not copied', $file);
             CakeLog::error($text);
         }
     }
 }
开发者ID:laiello,项目名称:plankonindia,代码行数:38,代码来源:AssetGenerator.php

示例4: update

 public function update()
 {
     if ($this->type == 'app') {
         $plugins = CakePlugin::loaded();
     } else {
         $plugins[] = $this->type;
     }
     $this->out(__d('cake_console', '<info>-- Migration status in app --</info>'));
     $this->dispatchShell('Migrations.migration status -i ' . $this->connection);
     $this->hr(1, 100);
     if ($this->type == 'app') {
         $this->out(__d('cake_console', '<info>-- Application core database migrations --</info>'));
         $this->dispatchShell('Migrations.migration run all -i ' . $this->connection);
         $this->out(__d('cake_console', '<info>- Application core database updated</info>'));
         $this->hr(1, 100);
     }
     foreach ($plugins as $plugin) {
         $plugin_migration_folder = new Folder(CakePlugin::path($plugin) . 'Config' . DS . 'Migration');
         list($m_folders, $m_files) = $plugin_migration_folder->read(true, array('empty'));
         if (count($m_files)) {
             $this->out(__d('cake_console', '<info>-- %s plugin database migrations</info>', $plugin));
             $this->dispatchShell('migration run all --plugin ' . $plugin . ' -i ' . $this->connection);
             $this->out(__d('cake_console', '<info>- %s plugin database updated</info>', $plugin));
             $this->hr(1, 100);
         }
     }
     $this->out(__d('cake_console', '<info>-- Build static assets --</info>'));
     $this->dispatchShell('AssetCompress.AssetCompress build -f');
     $this->hr(1, 100);
     $this->out(__d('cake_console', '<warning>All done</warning>'));
 }
开发者ID:nilBora,项目名称:konstruktor,代码行数:31,代码来源:SetupShell.php

示例5: __loadEventHandlers

 /**
  * Loads all available event handler classes for enabled plugins
  *
  */
 private function __loadEventHandlers()
 {
     $this->__eventHandlerCache = Cache::read('event_handlers', 'core');
     if (empty($this->__eventHandlerCache)) {
         App::import('Core', 'Folder');
         $folder = new Folder();
         $pluginsPaths = App::path('plugins');
         foreach ($pluginsPaths as $pluginsPath) {
             $folder->cd($pluginsPath);
             $plugins = $folder->read();
             $plugins = $plugins[0];
             if (count($plugins)) {
                 foreach ($plugins as $pluginName) {
                     $filename = $pluginsPath . $pluginName . DS . $pluginName . '_events.php';
                     $className = Inflector::camelize($pluginName . '_events');
                     if (file_exists($filename)) {
                         if (EventCore::__loadEventClass($className, $filename)) {
                             EventCore::__getAvailableHandlers($this->__eventClasses[$className]);
                         }
                     }
                 }
             }
         }
         Cache::write('event_handlers', $this->__eventHandlerCache, 'core');
     }
 }
开发者ID:rchavik,项目名称:infinitas,代码行数:30,代码来源:events.php

示例6: clear

 public function clear()
 {
     $this->out("Cleanup CACHE directories");
     $dirs = array("models", "persistent", "views");
     $i = $failed = 0;
     foreach ($dirs as $dir) {
         $this->hr();
         $path = CACHE . $dir;
         if (!is_dir($path)) {
             $this->out("<error>{$path} is not a directory</error>");
             continue;
         }
         $this->out("<info>Clear directory {$path}</info>");
         $Folder = new Folder($path);
         list(, $files) = $Folder->read(true, array('.', 'empty'), true);
         foreach ($files as $file) {
             if (!unlink($file)) {
                 $failed++;
                 $this->out("<error>Failed to delete file {$file}</error>");
                 continue;
             }
             $this->out("<success>Deleted file {$file}</success>");
             $i++;
         }
     }
     $this->out("<success>{$i} files deleted</success>");
     $this->out("<error>{$failed} files failed</error>");
     $this->hr();
 }
开发者ID:fm-labs,项目名称:cakephp-backend,代码行数:29,代码来源:CacheTask.php

示例7: main

 /**
  * undocumented function
  *
  * @return void
  */
 function main()
 {
     $result = $folder = null;
     $mainfiles = explode(',', $this->args[0]);
     $target = !empty($this->params['ext']) ? $this->args[0] . '.' . $this->params['ext'] : $this->args[0] . '.min';
     $jsroot = $this->params['working'] . DS . $this->params['webroot'] . DS . 'js' . DS;
     foreach ((array) $mainfiles as $mainfile) {
         $mainfile = strpos($mainfile, '/') === false ? $jsroot . $mainfile : $mainfile;
         $Pack = new File(str_replace('.js', '', $mainfile) . '.js');
         $result .= JsMin::minify($Pack->read());
     }
     if (!empty($this->args[1])) {
         $folder = $this->args[1] . DS;
         $Js = new Folder($jsroot . $folder);
         list($ds, $files) = $Js->read();
         foreach ((array) $files as $file) {
             $file = strpos($file, '/') === false ? $jsroot . $folder . $file : $file;
             $Pack = new File(str_replace('.js', '', $file) . '.js');
             $result .= JsMin::minify($Pack->read());
         }
     }
     $Packed = new File($jsroot . $target . '.js');
     if ($Packed->write($result, 'w', true)) {
         $this->out($Packed->name() . ' created');
     }
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:31,代码来源:minify.php

示例8: _findSubthemes

 /**
  * Find the paths to all the installed shell themes extensions in the app.
  *
  * @return array Array of bake themes that are installed.
  */
 protected function _findSubthemes()
 {
     $paths = App::path('shells');
     $plugins = App::objects('plugin');
     foreach ($plugins as $plugin) {
         $paths[$plugin] = $this->_pluginPath($plugin) . 'Console' . DS;
     }
     foreach ($paths as $i => $path) {
         $paths[$i] = rtrim($path, DS) . DS;
     }
     $subthemes = array();
     foreach ($paths as $plugin => $path) {
         $Folder = new Folder($path . 'SubTemplates', false);
         $contents = $Folder->read();
         $subDirs = $contents[0];
         foreach ($subDirs as $dir) {
             if (empty($dir) || preg_match('@^skel$|_skel|\\..+$@', $dir)) {
                 continue;
             }
             $Folder = new Folder($path . 'SubTemplates' . DS . $dir);
             $contents = $Folder->read();
             $subDirs = $contents[0];
             $templateDir = $path . 'SubTemplates' . DS . $dir . DS;
             $subthemes[$plugin . '.' . $dir] = $templateDir;
         }
     }
     return $subthemes;
 }
开发者ID:pmoraes,项目名称:templates,代码行数:33,代码来源:SubTemplateShell.php

示例9: view

 public function view($id = null)
 {
     $this->layout = 'index';
     $this->Anotacion->id = $id;
     $user = $this->User->findByUsername('transparenciapasiva');
     if (!$this->Anotacion->exists() || $this->Anotacion->field('user_id') != $user['User']['id']) {
         $this->Session->setFlash('<h2 class="alert alert-error">La Anotacion no Existe</h2>', 'default', array(), 'buscar');
         $this->redirect(array('controller' => 'home', 'action' => 'index/tab:3'));
     }
     $this->set('anotacion', $this->Anotacion->read(null, $id));
     $folder_anot = new Folder(WWW_ROOT . 'files' . DS . 'Anotaciones' . DS . 'anot_' . $this->Anotacion->id);
     $files_url = array();
     foreach ($folder_anot->find('.*') as $file) {
         $files_url[] = basename($folder_anot->pwd()) . DS . $file;
     }
     $this->set('files', $files_url);
     ////////////////////////////////////////////////////////////////////
     $folder_anot = new Folder(WWW_ROOT . 'files' . DS . 'Anotaciones' . DS . 'anot_' . $this->Anotacion->id . DS . 'Respuestas');
     $files_url = array();
     $dir = $folder_anot->read(true, false, true);
     foreach ($dir[0] as $key => $value) {
         $folder = new Folder($value);
         foreach ($folder->find('.*') as $file) {
             $files_url[basename($folder->pwd())][] = $file;
         }
     }
     $this->set('files_res', $files_url);
 }
开发者ID:penalolen,项目名称:Oirs-Digital,代码行数:28,代码来源:TransparenciaPasivasController.php

示例10: isUpToDate

 /**
  * Verifica se os menus do banco estão atualizados com os do arquivo
  * @param $aDados- array de menus do banco
  * @return boolean
  */
 public function isUpToDate($aDados)
 {
     $aDados = Set::combine($aDados, "/Menu/id", "/Menu");
     App::import("Xml");
     App::import("Folder");
     App::import("File");
     $sCaminhosArquivos = Configure::read("Cms.CheckPoint.menus");
     $oFolder = new Folder($sCaminhosArquivos);
     $aConteudo = $oFolder->read();
     $aArquivos = Set::sort($aConteudo[1], "{n}", "desc");
     if (empty($aArquivos)) {
         return false;
     }
     $oFile = new File($sCaminhosArquivos . $aArquivos[0]);
     $oXml = new Xml($oFile->read());
     $aAntigo = $oXml->toArray();
     foreach ($aDados as &$aMenu) {
         $aMenu['Menu']['content'] = str_replace("\r\n", " ", $aMenu['Menu']['content']);
     }
     if (isset($aAntigo["menus"])) {
         $aAntigo["Menus"] = $aAntigo["menus"];
         unset($aAntigo["menus"]);
     }
     if (isset($aAntigo["Menus"])) {
         $aAntigo = Set::combine($aAntigo["Menus"], "/Menu/id", "/Menu");
         $aRetorno = Set::diff($aDados, $aAntigo);
     }
     return empty($aRetorno);
 }
开发者ID:niltonfelipe,项目名称:e-cidade_transparencia,代码行数:34,代码来源:check_point.php

示例11: Folder

 /**
  * テーマ一覧
  *
  * @return void
  * @access public
  */
 function admin_index()
 {
     $this->pageTitle = 'テーマ一覧';
     $path = WWW_ROOT . 'themed';
     $folder = new Folder($path);
     $files = $folder->read(true, true);
     foreach ($files[0] as $themename) {
         if ($themename != 'core') {
             $themeName = $title = $description = $author = $url = $screenshot = '';
             if (file_exists($path . DS . $themename . DS . 'config.php')) {
                 include $path . DS . $themename . DS . 'config.php';
             }
             if (file_exists($path . DS . $themename . DS . 'screenshot.png')) {
                 $theme['screenshot'] = true;
             } else {
                 $theme['screenshot'] = false;
             }
             $theme['name'] = $themename;
             $theme['title'] = $title;
             $theme['description'] = $description;
             $theme['author'] = $author;
             $theme['url'] = $url;
             $theme['version'] = $this->getThemeVersion($theme['name']);
             $themes[] = $theme;
         }
     }
     $themes[] = array('name' => 'core', 'title' => 'BaserCMSコア', 'version' => $this->getBaserVersion(), 'description' => 'BaserCMSのコアファイル。現在のテーマにコピーして利用する事ができます。', 'author' => 'basercms', 'url' => 'http://basercms.net');
     $this->set('themes', $themes);
     $this->subMenuElements = array('site_configs', 'themes');
 }
开发者ID:nazo,项目名称:phpcondo,代码行数:36,代码来源:themes_controller.php

示例12: beforeFind

 public function beforeFind($queryData)
 {
     $this->basePath = Configure::read('Filemanager.base_path');
     if (empty($this->basePath)) {
         $this->validationErrors[] = array('field' => 'basePath', 'message' => __('Base path does not exist'));
         return false;
     }
     $this->path = $this->basePath;
     if (isset($queryData['conditions']['path'])) {
         $this->path = $this->basePath . $queryData['conditions']['path'];
     }
     App::import('Folder');
     App::import('File');
     $Folder = new Folder($this->path);
     if (empty($Folder->path)) {
         $this->validationErrors[] = array('field' => 'path', 'message' => __('Path does not exist'));
         return false;
     }
     $this->fileList = $Folder->read();
     unset($this->fileList[1]);
     if (!empty($queryData['order'])) {
         $this->__order($queryData['order']);
     }
     return true;
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:25,代码来源:Folders.php

示例13: index

 public function index()
 {
     $this->layout = '/xml/sitemap';
     $publish_date = date('2016-02-28');
     //sitemap公開日を最終更新日用に設定しておく
     $link_map = $this->Link->find('first', array('conditions' => array('Link.publish' => 1), 'order' => array('Link.modified' => 'desc')));
     $erg_lists = $this->Game->find('all', array('conditions' => array('Game.publish' => 1), 'order' => array('Game.modified' => 'desc'), 'fields' => array('Game.id', 'Game.modified')));
     $mh_last = $this->Information->find('first', array('conditions' => array('Information.publish' => 1, 'Information.title LIKE' => '%' . 'モンハンメモ' . '%'), 'order' => array('Information.id' => 'desc')));
     /* モンハンメモのページ一覧を取得ここから */
     $folder = new Folder('../View/mh');
     $mh = $folder->read();
     foreach ($mh[1] as $key => &$value) {
         $value = str_replace('.ctp', '', $value);
         if ($value == 'index') {
             $index_key = $key;
             //indexページを後で除くため
         }
     }
     unset($mh[1][$index_key]);
     $mh_lists = $mh[1];
     /* モンハンメモのページ一覧を取得ここまで */
     $tool_last = $this->Information->find('first', array('conditions' => array('Information.publish' => 1, 'Information.title LIKE' => '%' . '自作ツール' . '%'), 'order' => array('Information.id' => 'desc')));
     /* 自作ツールのページ一覧を取得ここから */
     $array_tools = $this->Tool->getArrayTools();
     $tool_lists = $array_tools['list'];
     /* 自作ツールのページ一覧を取得ここまで */
     $voice_lists = $this->Voice->find('list', array('conditions' => array('Voice.publish' => 1), 'fields' => 'system_name'));
     $diary_lists = $this->Diary->find('all', array('conditions' => array('Diary.publish' => 1), 'order' => array('Diary.modified' => 'desc'), 'fields' => array('Diary.id', 'Diary.modified')));
     $this->set(compact('publish_date', 'link_map', 'erg_lists', 'mh_last', 'mh_lists', 'tool_last', 'tool_lists', 'voice_lists', 'diary_lists'));
     $this->RequestHandler->respondAs('xml');
     //xmlファイルとして読み込む
 }
开发者ID:klapp303,项目名称:sister,代码行数:32,代码来源:SiteMapsController.php

示例14: main

 /**
  * undocumented function
  *
  * @return void
  */
 function main()
 {
     $choice = '';
     $Tasks = new Folder(dirname(__FILE__) . DS . 'tasks');
     list($folders, $files) = $Tasks->read();
     $i = 1;
     $choices = array();
     foreach ($files as $file) {
         if (preg_match('/upgrade_/', $file)) {
             $choices[$i] = basename($file, '.php');
             $this->out($i++ . '. ' . basename($file, '.php'));
         }
     }
     while ($choice == '') {
         $choice = $this->in("Enter a number from the list above, or 'q' to exit", null, 'q');
         if ($choice === 'q') {
             $this->out("Exit");
             $this->_stop();
         }
         if ($choice == '' || intval($choice) > count($choices)) {
             $this->err("The number you selected was not an option. Please try again.");
             $choice = '';
         }
     }
     if (intval($choice) > 0 && intval($choice) <= count($choices)) {
         $upgrade = Inflector::classify($choices[intval($choice)]);
     }
     $this->tasks = array($upgrade);
     $this->loadTasks();
     return $this->{$upgrade}->execute();
 }
开发者ID:Galvanio,项目名称:Kinspir,代码行数:36,代码来源:chaw_upgrade.php

示例15: getTemplates

 /**
  * レイアウトテンプレートを取得
  * コンボボックスのソースとして利用
  * 
  * @return array
  * @access public
  */
 function getTemplates()
 {
     $templatesPathes = array();
     if ($this->Baser->siteConfig['theme']) {
         $templatesPathes[] = WWW_ROOT . 'themed' . DS . $this->Baser->siteConfig['theme'] . DS . 'feed' . DS;
     }
     $templatesPathes[] = BASER_PLUGINS . 'feed' . DS . 'views' . DS . 'feed' . DS;
     $_templates = array();
     foreach ($templatesPathes as $templatesPath) {
         $folder = new Folder($templatesPath);
         $files = $folder->read(true, true);
         $foler = null;
         if ($files[1]) {
             if ($_templates) {
                 $_templates = am($_templates, $files[1]);
             } else {
                 $_templates = $files[1];
             }
         }
     }
     $templates = array();
     foreach ($_templates as $template) {
         if ($template != 'ajax.ctp' && $template != 'error.ctp') {
             $template = basename($template, '.ctp');
             $templates[$template] = $template;
         }
     }
     return $templates;
 }
开发者ID:nazo,项目名称:phpcondo,代码行数:36,代码来源:feed.php


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