コード例 #1
0
ファイル: URLManager.php プロジェクト: kirkbauer2/kirkxc
 /**
  * Remove trailing slashes from URL
  *
  * @param string $url URL to prepare
  *
  * @return string
  */
 public static function trimTrailingSlashes($url)
 {
     return \Includes\Utils\Converter::trimTrailingChars($url, '/');
 }
コード例 #2
0
ファイル: FileManager.php プロジェクト: kingsj/core
 /**
  * Prepare file path
  *
  * @param string  $dir   Dir to prepare
  * @param boolean $check Flag OPTIONAL
  *
  * @return string
  */
 public static function getCanonicalDir($dir, $check = true)
 {
     if ($check) {
         $dir = static::getRealPath($dir);
     }
     if (!$check || !empty($dir) && static::isDir($dir)) {
         $dir = \Includes\Utils\Converter::trimTrailingChars($dir, LC_DS) . LC_DS;
     }
     return $dir ?: null;
 }
コード例 #3
0
ファイル: Marketplace.php プロジェクト: kingsj/core
 /**
  * Get enpoint URL for certain action
  *
  * @param string $action Action name
  *
  * @return string
  */
 protected function getMarketplaceActionURL($action)
 {
     return \Includes\Utils\Converter::trimTrailingChars($this->getMarketplaceURL(), '/') . '/' . $action;
 }
コード例 #4
0
ファイル: Install.php プロジェクト: kingsj/core
 /**
  * Get purchase page URL
  *
  * :FIXME: is it really needed?
  *
  * @return string
  */
 protected function getPurchaseURL()
 {
     $apiURL = trim(\Includes\Utils\Converter::trimTrailingChars(\XLite\Core\Marketplace::getInstance()->getMarketplaceURL(), '/'));
     // Remove 'api' directory
     $apiURL = preg_replace('/\\?q=.+/Ss', '', $apiURL);
     $apiURL = preg_replace('/\\/api$/Ss', '/', $apiURL);
     return $apiURL;
 }