Ejemplo n.º 1
0
 /**
  * create a directory
  * It creates also all necessary parent directory
  * @param string $dir the path of the directory
  */
 public static function createDir($dir, $chmod = null)
 {
     if ($chmod === null && jApp::config()) {
         $chmod = jApp::config()->chmodDir;
     }
     return Directory::create($dir, $chmod);
 }
Ejemplo n.º 2
0
    exit(1);
}
array_shift($_SERVER['argv']);
// shift the script name
$restrictedDirectory = '';
$options = array('verbose' => false);
if (substr($_SERVER['argv'][0], 0, 1) == '-') {
    $sw = substr(array_shift($_SERVER['argv']), 1);
    $options['verbose'] = strpos($sw, 'v') !== false;
    if (strpos($sw, 'd') !== false) {
        $restrictedDirectory = array_shift($_SERVER['argv']);
    }
}
list($sourcefile, $distfile) = $_SERVER['argv'];
if ($restrictedDirectory != '') {
    $s = realpath($sourcefile);
    if (strpos($s, $restrictedDirectory) !== 0) {
        exit(1);
    }
}
try {
    $proc = new \Jelix\BuildTools\PreProcessor\PreProcessor();
    $proc->setVars($_SERVER);
    $dist = $proc->parseFile($sourcefile);
} catch (Exception $e) {
    echo $e;
    exit(1);
}
\Jelix\FileUtilities\Directory::create(dirname($distfile));
file_put_contents($distfile, $dist);
exit(0);
Ejemplo n.º 3
0
 public function createDir($dir)
 {
     return \Jelix\FileUtilities\Directory::create($this->rootPath . $dir);
 }
Ejemplo n.º 4
0
 /**
  * create a directory.
  *
  * @return bool false if the directory did already exist
  * @deprecated
  */
 public static function createDir($dir)
 {
     return Directory::create($dir);
 }