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


PHP Files::path方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     ci()->load->config('files/files');
     self::$path = config_item('files:path');
     self::$_cache_path = config_item('cache_dir') . 'cloud_cache/';
     if ($providers = Settings::get('files_enabled_providers')) {
         self::$providers = explode(',', $providers);
         // make 'local' mandatory. We search for the value because of backwards compatibility
         if (!in_array('local', self::$providers)) {
             array_unshift(self::$providers, 'local');
         }
     } else {
         self::$providers = array('local');
     }
     // work out the most restrictive ini setting
     $post_max = str_replace('M', '', ini_get('post_max_size'));
     $file_max = str_replace('M', '', ini_get('upload_max_filesize'));
     // set the largest size the server can handle and the largest the admin set
     self::$max_size_possible = ($file_max > $post_max ? $post_max : $file_max) * 1048576;
     // convert to bytes
     self::$max_size_allowed = Settings::get('files_upload_limit') * 1048576;
     // convert this to bytes also
     set_exception_handler(array($this, 'exception_handler'));
     set_error_handler(array($this, 'error_handler'));
     ci()->load->model('files/file_m');
     ci()->load->model('files/file_folders_m');
     ci()->load->spark('cloudmanic-storage/1.0.4');
 }
开发者ID:nockout,项目名称:tshpro,代码行数:28,代码来源:Files.php

示例2: create

 public static function create($path)
 {
     Log::debug("Reading monitor configuration from directory '{$path}'...");
     $xmls = self::scanXmls($path);
     $reader = new MonitorXmlReader();
     $monitor = new self();
     foreach ($xmls as $xml) {
         if ($reader->read(Files::path($path, $xml))) {
             foreach ($reader->getSources() as $source) {
                 $monitor->tReadSources[] = $source;
                 Log::debug("Read source '{$source}'");
             }
             foreach ($reader->getNetworkmaps() as $networkmap) {
                 $monitor->tReadNetworkmaps[] = $networkmap;
                 Log::debug("Read network map '{$networkmap}'");
             }
             foreach ($reader->getUserdbs() as $userdb) {
                 $monitor->tReadUserdbs[] = $userdb;
                 Log::debug("Read user db '{$userdb}'");
             }
             foreach ($reader->getEvents() as $event) {
                 $monitor->tReadEvents[] = $event;
                 Log::debug("Read event '{$event}'");
             }
         }
     }
     self::validateSourceReferences($monitor->tReadSources, $monitor->tReadNetworkmaps, $monitor->tReadUserdbs, $monitor->tReadEvents);
     $monitor->tEnabledSources = self::filterUnreferencedSources(self::filterDuplicateSources($monitor->tReadSources), $monitor->tReadNetworkmaps, $monitor->tReadUserdbs, $monitor->tReadEvents);
     if (count($monitor->tEnabledSources) == 0) {
         Log::err("Found no active source/events definitions while reading monitor configuration from directory '{$path}'");
         $monitor = false;
     }
     return $monitor;
 }
开发者ID:TheBillPleaseZA,项目名称:phplogmon,代码行数:34,代码来源:Monitor.class.php

示例3: scanLogFiles

 private function scanLogFiles($file)
 {
     $logfiles = array();
     $pathinfo = pathinfo($file);
     $path = $pathinfo["dirname"];
     $pattern = $pathinfo["basename"];
     $dir = Files::safeOpendir($path);
     while (($logfile = Files::readdirMatch($dir, $pattern)) !== false) {
         $logfiles[] = Files::path($path, $logfile);
     }
     closedir($dir);
     asort($logfiles);
     return $logfiles;
 }
开发者ID:TheBillPleaseZA,项目名称:phplogmon,代码行数:14,代码来源:Processor.class.php


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