本文整理汇总了PHP中Setting::getInteger方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getInteger方法的具体用法?PHP Setting::getInteger怎么用?PHP Setting::getInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::getInteger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the component
*/
public function init()
{
// Connect to the current backend
$this->_backend = Yii::app()->backendManager->getCurrent();
$hostname = Backend::normalizeAddress($this->_backend->hostname);
$endpoint = 'http://' . $hostname . ':' . $this->_backend->port . '/jsonrpc';
$clientFlags = JsonRPCClient::FLAG_ATTEMPT_UTF8_RECOVERY;
$clientOptions = array('timeout' => Setting::getInteger('requestTimeout'));
$this->_client = new JsonRPCClient($endpoint, $this->_backend->username, $this->_backend->password, $clientFlags, $clientOptions);
// Initialize the VFS helper
$this->_vfsHelper = new VFSHelper();
parent::init();
}
示例2: __construct
/**
* Class constructor
* @param Media[] $rawData the data
* @param array $config the component configuration (optional)
*/
public function __construct($rawData, $config = array())
{
// Optionally apply pagination, unless it has been explicitly disabled
$pagesize = Setting::getInteger('pagesize');
if (!isset($config['pagination'])) {
$config['pagination'] = $pagesize ? array('pageSize' => $pagesize) : false;
}
// Determine the key field from the first item
if (isset($rawData[0])) {
$config['keyField'] = $rawData[0]->getIdField();
}
parent::__construct($rawData, $config);
}
示例3: init
/**
* Initializes the controller. The application name and language is set here.
*/
public function init()
{
// Use the defined request timeout as execution time limit
$requestTimeout = Setting::getInteger('requestTimeout');
set_time_limit($requestTimeout);
// Fallback to XBMC Video Server if the user has removed the
// application name
$name = Setting::getString('applicationName');
if (!$name) {
$name = 'XBMC Video Server';
}
Yii::app()->name = $name;
Yii::app()->language = Yii::app()->languageManager->getCurrent();
parent::init();
}
示例4: generate
/**
* Generates and stores a cached copy of this thumbnail. It first retrieves
* the original image to a temporary location for processing. This is done
* because Kodi doesn't like the HTTP/1.0 requests that the built-in PHP
* image manipulation functions (as well as file_get_contents()) use.
*/
public function generate()
{
// Create a HTTP/1.1 stream context
$context = stream_context_create(array('http' => array('timeout' => Setting::getInteger('requestTimeout'), 'protocol_version' => 1.1, 'header' => 'Connection: close')));
// Retrieve the image data and store it in a temporary file
$imageData = file_get_contents($this->getOriginalUrl(), false, $context);
$imageFile = tempnam(sys_get_temp_dir(), self::TEMP_FILE_PREFIX);
if ($imageData === false || file_put_contents($imageFile, $imageData) === false) {
return;
}
// Resize and cache the thumbnail
$imagine = $this->imagineFactory();
$imagine->open($imageFile)->thumbnail(new \Imagine\Image\Box($this->_size, PHP_INT_MAX))->save($this->_cache->getCachePath() . DIRECTORY_SEPARATOR . $this->getFilename(), array('jpeg_quality' => 70));
// Delete the temporary file
unlink($imageFile);
}