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


PHP Storage::init方法代码示例

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


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

示例1: render

 /**
  * function that launch the framework
  * @param void
  * @return bool
  **/
 public static function render() : bool
 {
     self::get('confs');
     self::get(DIR_MODELS);
     self::get(DIR_CONTROLLERS);
     // ------------------------------------------------------------------------
     // get arguments
     $args = array_merge($_GET, $_POST);
     if (empty($args['url'])) {
         $args['url'] = '/';
     }
     try {
         // ------------------------------------------------------------------------
         // load external librairies
         Server::loadLibs();
         // ------------------------------------------------------------------------
         // allow storage for all applications
         Storage::init();
         // ------------------------------------------------------------------------
         // allow access to database
         Database::autoConnect();
         // ------------------------------------------------------------------------
         // launch controller
         if (!empty($args['task'])) {
             Task::exec($args['task'], $args);
         } else {
             Route::run($args['url'], $args);
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     return true;
 }
开发者ID:urazovm,项目名称:portfolio,代码行数:38,代码来源:main.dis.php

示例2: init

 public function init()
 {
     parent::init();
     $session = \Yii::$app->session;
     $file = $session->has('localStorageFile') ? $session->get('localStorageFile') : $session->getId();
     $this->file = ".json";
     if (file_exists($this->file)) {
         $this->data = json_decode(file_get_contents($this->file));
     } else {
         $this->data = new \stdClass();
     }
 }
开发者ID:hscstudio,项目名称:yii2-cart,代码行数:12,代码来源:LocalStorage.php

示例3: store

 /**
  * store a new version of a file.
  */
 public static function store($filename)
 {
     if (\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED) == 'true') {
         if (\OCP\App::isEnabled('files_sharing') && ($source = \OC_Share::getSource('/' . \OCP\User::getUser() . '/files' . $filename))) {
             $pos = strpos($source, '/files', 1);
             $uid = substr($source, 1, $pos - 1);
             $filename = substr($source, $pos + 6);
         } else {
             $uid = \OCP\User::getUser();
         }
         $versionsfoldername = \OCP\Config::getSystemValue('datadirectory') . '/' . $uid . '/' . \OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
         $filesfoldername = \OCP\Config::getSystemValue('datadirectory') . '/' . $uid . '/files';
         Storage::init();
         // check if filename is a directory
         if (is_dir($filesfoldername . '/' . $filename)) {
             return false;
         }
         // check filetype blacklist
         $blacklist = explode(' ', \OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
         foreach ($blacklist as $bl) {
             $parts = explode('.', $filename);
             $ext = end($parts);
             if (strtolower($ext) == $bl) {
                 return false;
             }
         }
         // check filesize
         if (filesize($filesfoldername . '/' . $filename) > \OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
             return false;
         }
         // check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
         if ($uid == \OCP\User::getUser()) {
             $matches = glob($versionsfoldername . '/' . $filename . '.v*');
             sort($matches);
             $parts = explode('.v', end($matches));
             if (end($parts) + Storage::DEFAULTMININTERVAL > time()) {
                 return false;
             }
         }
         // create all parent folders
         $info = pathinfo($filename);
         @mkdir($versionsfoldername . '/' . $info['dirname'], 0700, true);
         // store a new version of a file
         copy($filesfoldername . '/' . $filename, $versionsfoldername . '/' . $filename . '.v' . time());
         // expire old revisions
         Storage::expire($filename);
     }
 }
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:51,代码来源:versions.php

示例4: run

 /**
  * run
  *
  * Run application
  *
  * @return null
  */
 public static function run()
 {
     Request::init();
     if (self::getConfig('main')->system->session_handler == 'database') {
         Storage::setDatabaseHandler();
     }
     Storage::init();
     Member::init();
     Router::run();
 }
开发者ID:nsedenkov,项目名称:phpsu,代码行数:17,代码来源:App.php

示例5:

 * - DB - класс для работы с БД;
 * - Storage - класс для работы с кэшем;
 * - MG - класс содердащий функционал системы;
 * - URL - класс для работы со ссылками;
 * - PM - класс для работы с плагинами.
 * - User - класс для работы с профайлами пользователей;
 * - Mailer - класс для отправки писем.
 * 
 * @author Авдеев Марк <mark-avdeev@mail.ru>
 * @package moguta.cms
 * @subpackage Files
 */
MG::getConfigIni();
// Инициализация компонентов CMS.
DB::init();
Storage::init();
PM::init();
MG::init();
URL::init();
User::init();
Mailer::init();
// Если сайт временно закрыт, то выводитя заглушка, хранящаяся в корне движка.
if (MG::isDowntime()) {
    require_once 'downTime.html';
    exit;
}
// Запоминает откуда пришел пользователь.
MG::logReffererInfo();
// Подключить index.php всех плагинов.
PM::includePlugins();
// Хук выполняющийся до запуска движка.
开发者ID:WinGood,项目名称:24karcher,代码行数:31,代码来源:mg-start.php

示例6: createHtml

 /**
  * 生成静态
  * @param string $htmlFile 文件名
  * @param string $htmlPath 目录
  * @param string $template 模板文件
  */
 public function createHtml($htmlFile, $htmlPath, $template)
 {
     $content = $this->fetch($template);
     $file = $htmlPath . $htmlFile;
     $Storage = Storage::init();
     return $Storage->save($file, $content);
 }
开发者ID:hdbaiyu,项目名称:HDPHP,代码行数:13,代码来源:Controller.class.php

示例7: createHtml

 /**
  * 生成静态
  * @param string $htmlfile 文件名
  * @param string $htmlpath 目录
  * @param string $template 模板文件
  */
 public function createHtml($htmlfile, $htmlpath = '', $template = '')
 {
     $content = $this->fetch($template);
     $htmlpath = empty($htmlpath) ? C('HTML_PATH') : $htmlpath;
     $file = $htmlpath . $htmlfile . '.html';
     $Storage = Storage::init();
     return $Storage->save($file, $content);
 }
开发者ID:jyht,项目名称:v5,代码行数:14,代码来源:Control.class.php

示例8: init

 public function init()
 {
     parent::init();
 }
开发者ID:sdgdsffdsfff,项目名称:QUpload,代码行数:4,代码来源:qupload.php


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