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