本文整理匯總了PHP中application::is_deployed方法的典型用法代碼示例。如果您正苦於以下問題:PHP application::is_deployed方法的具體用法?PHP application::is_deployed怎麽用?PHP application::is_deployed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類application
的用法示例。
在下文中一共展示了application::is_deployed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: connect
/**
* Connect
*
* @param array $options
* @return array
*/
public function connect($options)
{
$result = ['success' => false, 'error' => []];
$this->options = $options;
// for deployed code the directory is different because we relate it based on code
if (!empty($this->options['dir']) && application::is_deployed()) {
$temp = $this->options['dir'][0] . $this->options['dir'][1];
if ($temp == './') {
$this->options['dir'] = './.' . $this->options['dir'];
} else {
$this->options['dir'] = '../';
}
}
// check if we have valid directory
if (empty($this->options['dir'])) {
$result['error'][] = 'Storage directory does not exists or not provided!';
} else {
// fixing path
$this->options['dir'] = rtrim($this->options['dir'], '/') . '/';
// we need to create directory
if (!empty($this->cache_key)) {
$this->options['dir'] .= $this->cache_key . '/';
}
// we need to create cache directory
if (!is_dir($this->options['dir'])) {
if (!helper_file::mkdir($this->options['dir'], 0777)) {
$result['error'][] = 'Unable to create caching directory!';
return $result;
}
}
$result['success'] = true;
}
return $result;
}
示例2: get_version
/**
* Get application version
*
* @return int
*/
public static function get_version()
{
if (empty(self::$version)) {
$filename = application::get(['application', 'path_full']) . (application::is_deployed() ? '../../../deployed' : '../../deployed');
self::$version = filemtime($filename);
}
return self::$version;
}