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


PHP Preferences::valueForModuleWithKey方法代码示例

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


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

示例1: getCounts

 /**
  * Returns information about the aggregate of photos on the site
  *
  * @access public
  * @return array
  */
 public function getCounts()
 {
     $this->counts['albums'] = Database::selectOne('albums', 'COUNT(*)');
     $this->counts['topics'] = Database::selectOne('albums', 'COUNT(DISTINCT topic)');
     $this->counts['photos'] = Database::selectOne('photos', 'COUNT(*)');
     $this->counts['pixels'] = Database::selectOne('photos', 'SUM(width*height)');
     $this->counts['albumhits'] = Database::selectOne('albums', 'SUM(hits)');
     $this->counts['photohits'] = Database::selectOne('photos', 'SUM(hits)');
     $this->counts['maxphotohits'] = Database::selectOne('photos', 'MAX(hits)');
     $this->counts['maxalbumhits'] = Database::selectOne('albums', 'MAX(hits)');
     $this->counts['daysonline'] = floor((time() - strtotime(Preferences::valueForModuleWithKey('CameraLife', 'sitedate'))) / 86400);
     return $this->counts;
 }
开发者ID:fulldecent,项目名称:cameralife,代码行数:19,代码来源:Statistics.php

示例2: fileStoreWithName

 /**
  * fileStoreWithName function.
  *
  * @access public
  * @param  string $name -- 'photo' or 'other'
  * @return void
  */
 public static function fileStoreWithName($name)
 {
     $retval = new FileStore();
     $path = null;
     if ($name == 'photo') {
         $path = Preferences::valueForModuleWithKey('LocalFileStore', 'photo_dir');
     } elseif ($name = 'other') {
         $path = Preferences::valueForModuleWithKey('LocalFileStore', 'cache_dir');
     } else {
         throw new \Exception('Bad FileStore name');
     }
     if (!realpath($path)) {
         throw new \Exception('FileStore path does not exist for ' . $path);
     }
     $retval->baseDir = realpath($path);
     return $retval;
 }
开发者ID:fulldecent,项目名称:cameralife,代码行数:24,代码来源:FileStore.php

示例3: isCacheMissing

 /**
  * isCacheMissing function.
  * Return true if thumbnail is missing or if needed _mod is missing
  *
  * @access public
  * @return bool
  */
 public function isCacheMissing()
 {
     if ($this->record['modified'] == '1') {
         return true;
         //legacy before 2.7
     }
     $cacheBucket = FileStore::fileStoreWithName('other');
     if ($this->record['modified']) {
         $filename = '/' . $this->record['id'] . '_mod.' . $this->extension;
         $stat = $cacheBucket->listFiles($filename);
         if (!count($stat)) {
             return true;
         }
     }
     $sizes = array();
     $sizes[] = Preferences::valueForModuleWithKey('CameraLife', 'thumbsize');
     $sizes[] = Preferences::valueForModuleWithKey('CameraLife', 'scaledsize');
     $options = Preferences::valueForModuleWithKey('CameraLife', 'optionsizes');
     preg_match_all('/[0-9]+/', $options, $matches);
     $sizes = array_merge($sizes, $matches[0]);
     foreach ($sizes as $cursize) {
         $filename = '/' . $this->record['id'] . '_' . $cursize . '.' . $this->extension;
         $stat = $cacheBucket->listFiles($filename);
         if (!count($stat)) {
             return true;
         }
     }
     return false;
 }
开发者ID:fulldecent,项目名称:cameralife,代码行数:36,代码来源:Photo.php


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