當前位置: 首頁>>代碼示例>>PHP>>正文


PHP application::is_deployed方法代碼示例

本文整理匯總了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;
 }
開發者ID:volodymyr-volynets,項目名稱:backend,代碼行數:40,代碼來源:base.php

示例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;
 }
開發者ID:volodymyr-volynets,項目名稱:framework,代碼行數:13,代碼來源:layout.php


注:本文中的application::is_deployed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。