本文整理汇总了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;
}
示例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;
}
示例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;
}