real() 공개 정적인 메소드

public static real ( string $path ) : string
$path string
리턴 string
예제 #1
0
파일: Driver.php 프로젝트: jbzoo/less
 /**
  * @param string $fullPath
  * @param string $relPath
  * @return string
  */
 public function compile($fullPath, $relPath)
 {
     $this->_initCompiler();
     $fullPath = FS::real($fullPath);
     $result = $this->_compile($fullPath, $relPath);
     return $result;
 }
예제 #2
0
파일: Cache.php 프로젝트: UnionCMS/Core
 /**
  * @return string
  */
 protected function _getResultFile()
 {
     // Normalize relative path
     $relPath = Slug::filter($this->_hash, '_');
     $relPath = Str::low($relPath);
     // Gett full clean path
     $fullPath = FS::real($this->_options->get('cache_path')) . '/' . $relPath . '.css';
     $fullPath = FS::clean($fullPath);
     return $fullPath;
 }
예제 #3
0
파일: Less.php 프로젝트: jbzoo/less
 /**
  * @param array $options
  * @return Data
  * @throws Exception
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 protected function _prepareOptions(array $options)
 {
     // Default data for current system
     $this->_default['root_url'] = Url::root();
     $this->_default['root_path'] = Sys::getDocRoot();
     $options = array_merge($this->_default, $options);
     // Check cache directory
     $cachePath = FS::clean($options['cache_path']);
     if (!$cachePath) {
         throw new Exception('Option "cache_path" is empty!');
     }
     if (!FS::isDir($cachePath)) {
         mkdir($cachePath, 0755, true);
     }
     $options['cache_path'] = FS::real($cachePath);
     $options['root_url'] = rtrim($options['root_url'], '/');
     $options['root_path'] = FS::real($options['root_path']);
     $options['driver'] = ucfirst(strtolower(trim($options['driver'])));
     // Check mixin paths
     $lessFile = (array) $options['autoload'];
     foreach ($lessFile as $key => $mixin) {
         $lessFile[$key] = FS::real($mixin);
     }
     $options['autoload'] = array_filter($lessFile);
     // Check imported paths
     $importPaths = [];
     foreach ((array) $options['import_paths'] as $path => $uri) {
         if ($cleanPath = FS::real($path)) {
             $importPaths[$cleanPath] = $uri;
         }
     }
     $importPaths[$options['root_path']] = $options['root_url'];
     // Forced add root path in the end of list!
     $options['import_paths'] = array_filter($importPaths);
     return new Data($options);
 }
예제 #4
0
 /**
  * Load current config
  */
 protected function _initCurrentConfig()
 {
     $this->_config = new PHPArray();
     $isProfile = $this->_in->hasOption('profile');
     $configName = str_replace(':', '-', strtolower($this->_in->getFirstArgument()));
     $configName = $isProfile ? $configName . '-' . $this->_getOpt('profile') : $configName;
     $configPath = JBZOO_CLI_ROOT . '/configs/' . $configName . '.php';
     if ($path = FS::real($configPath)) {
         $this->_config = new PHPArray($path);
     } elseif ($isProfile) {
         throw new Exception('Config file "' . $configPath . '" not found');
     }
 }
예제 #5
0
파일: defines.php 프로젝트: JBZoo/CCK-Cli
<?php

/**
 * JBZoo CCK Cli
 *
 * This file is part of the JBZoo CCK package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package   CCK Cli
 * @license   MIT
 * @copyright Copyright (C) JBZoo.com,  All rights reserved.
 * @link      https://github.com/JBZoo/CCK-Cli
 * @author    Denis Smetannikov <*****@*****.**>
 */
use JBZoo\Utils\FS;
// Define important constatns
define('JBZOO_CLI', true);
// simple security
define('JBZOO_CLI_ROOT', FS::real(__DIR__ . '/../'));
!defined('DIRECTORY_SEPERATOR') && define('DIRECTORY_SEPERATOR', '/');
// Try to find Joomla root path
$jrootPath = FS::real(__DIR__ . '/../../../');
$jconfigPath = FS::real($jrootPath . '/configuration.php');
$path = $jconfigPath ? $jrootPath : getenv('JOOMLA_DEV_PATH');
// placeholder for developer
if (!$path) {
    throw new Exception('Joomla Root Path is not found!');
}
define('JBZOO_CLI_JOOMLA_ROOT', FS::real($path));
예제 #6
0
 /**
  * @param string $file
  * @param string $name
  * @return bool
  */
 public function addAttachment($file, $name = null)
 {
     if ($file = FS::real($file)) {
         if (!$name) {
             $name = FS::base($file);
         }
         $this->_atachments[$file] = $name;
         return true;
     }
     return false;
 }
예제 #7
0
<?php

/**
 * JBZoo CrossCMS
 *
 * This file is part of the JBZoo CCK package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @package   CrossCMS
 * @license   MIT
 * @copyright Copyright (C) JBZoo.com,  All rights reserved.
 * @link      https://github.com/JBZoo/CrossCMS
 * @author    Denis Smetannikov <*****@*****.**>
 */
use JBZoo\Utils\FS;
require_once realpath('./vendor/autoload.php');
$configPath = FS::real('./resources/joomla/configuration.php');
if ($configPath) {
    $config = FS::openFile($configPath);
    $config = preg_replace('#\'smtp\'#ius', "'mail'", $config);
    $config = preg_replace('#\'default\'#ius', "'development'", $config);
    file_put_contents($configPath, $config);
} else {
    throw new \Exception('Joomla configuration file not found!');
}
예제 #8
0
 public function testReal()
 {
     isSame(__FILE__, FS::real(__FILE__));
 }