AppserverIo\Appserver\Meta\Composer\Script\Setup::prepareOsSpecificPath PHP Метод

prepareOsSpecificPath() публичный статический Метод

Prepares the passed path to work on the actual OS.
public static prepareOsSpecificPath ( string $path ) : string
$path string The path we want to perpare
Результат string The prepared path
    public static function prepareOsSpecificPath($path)
    {
        return str_replace('/', DIRECTORY_SEPARATOR, $path);
    }

Usage Example

Пример #1
0
 /**
  * Prepares the passed directory if necessary.
  *
  * @param string  $directory The directory to prepare
  * @param integer $mode      The mode of the directory
  *
  * @return void
  */
 public static function prepareDirectory($directory, $mode = 0775)
 {
     // make the passed directory OS compliant
     $toBePreapared = Setup::prepareOsSpecificPath($directory);
     // make sure the directory exists
     if (is_dir(dirname($toBePreapared)) === false) {
         mkdir(dirname($toBePreapared), $mode, true);
     }
 }