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


PHP r::cli方法代碼示例

本文整理匯總了PHP中r::cli方法的典型用法代碼示例。如果您正苦於以下問題:PHP r::cli方法的具體用法?PHP r::cli怎麽用?PHP r::cli使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在r的用法示例。


在下文中一共展示了r::cli方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index()
 {
     if (isset($this->index)) {
         return $this->index;
     }
     if (r::cli()) {
         return $this->index = '/';
     } else {
         return $this->index = url::base() . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
     }
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:11,代碼來源:urls.php

示例2: index

 public function index()
 {
     if (isset($this->index)) {
         return $this->index;
     }
     // this value is used by the Panel
     $this->indexDetected = true;
     if (r::cli()) {
         return $this->index = '/';
     } else {
         return $this->index = url::base() . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
     }
 }
開發者ID:parasutcom,項目名稱:styleguide,代碼行數:13,代碼來源:urls.php

示例3: index

 public function index()
 {
     if (isset($this->index)) {
         return $this->index;
     }
     if (r::cli()) {
         $index = '/';
     } else {
         $index = url::base() . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
     }
     // fix index URL for the Panel
     if (function_exists('panel')) {
         $index = dirname($index);
     }
     return $this->index = $index;
 }
開發者ID:nsteiner,項目名稱:kdoc,代碼行數:16,代碼來源:urls.php

示例4: dump

/**
 * Dumps any array or object in a human readable way
 *
 * @param mixed $variable Whatever you like to inspect
 * @param boolean $echo
 * @return string
 */
function dump($variable, $echo = true)
{
    if (r::cli()) {
        $output = print_r($variable, true) . PHP_EOL;
    } else {
        $output = '<pre>' . print_r($variable, true) . '</pre>';
    }
    if ($echo == true) {
        echo $output;
    }
    return $output;
}
開發者ID:muten84,項目名稱:luigibifulco.it,代碼行數:19,代碼來源:helpers.php

示例5: index

 /**
  * Returns the URL for document root no 
  * matter what the path is. 
  * 
  * @return string
  */
 public static function index()
 {
     if (r::cli()) {
         return '/';
     } else {
         return static::base() . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
     }
 }
開發者ID:LucasFyl,項目名稱:korakia,代碼行數:14,代碼來源:url.php

示例6: fingerprint

 /**
  * Generates a fingerprint from the user agent string
  * 
  * @return string
  */
 public static function fingerprint()
 {
     if (!r::cli()) {
         return sha1($_SERVER['HTTP_USER_AGENT'] . (ip2long($_SERVER['REMOTE_ADDR']) & ip2long('255.255.0.0')));
     } else {
         return '';
     }
 }
開發者ID:irenehilber,項目名稱:kirby-base,代碼行數:13,代碼來源:s.php

示例7: fingerprint

 /**
  * Generates a fingerprint from the user agent string
  * 
  * @return string
  */
 public static function fingerprint()
 {
     if (!r::cli()) {
         return sha1(Visitor::ua() . (ip2long($_SERVER['REMOTE_ADDR']) & ip2long('255.255.0.0')));
     } else {
         return '';
     }
 }
開發者ID:kgchoy,項目名稱:main-portfolio-website,代碼行數:13,代碼來源:s.php

示例8: url

 /**
  * Returns the proper base url for the installation
  *
  * @return string
  */
 protected static function url()
 {
     // auto-detect the url
     if (empty(c::$data['url'])) {
         if (r::cli()) {
             return c::$data['url'] = '/';
         } else {
             return c::$data['url'] = url::scheme() . '://' . server::get('HTTP_HOST') . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
         }
     } else {
         return c::$data['url'];
     }
 }
開發者ID:gBokiau,項目名稱:kirby,代碼行數:18,代碼來源:kirby.php

示例9: testCli

 public function testCli()
 {
     $this->assertTrue(r::cli());
 }
開發者ID:aoimedia,項目名稱:kosmonautensofa,代碼行數:4,代碼來源:RTest.php


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