/**
  * FUNCTION: _prepareDirs
  * prepares the directory structure
  *
  */
 function _prepareDirs($file)
 {
     if (empty($file)) {
         die('no filename');
     }
     //do error in future
     $filepath = dirname($file);
     if (is_dir($filepath)) {
         return true;
     }
     $dirs = preg_split('[\\/]', $filepath);
     $currpath = "";
     foreach ($dirs as $dir) {
         $currpath .= $dir . '/';
         $type = @filetype($currpath);
         $type == 'link' and $type = 'dir';
         if ($type != 'dir' && $type != false && !empty($type)) {
             vlibTemplateError::raiseError('VT_ERROR_WRONG_CACHE_TYPE', KILL, 'directory: ' . $currpath . ', type: ' . $type);
         }
         if ($type == 'dir') {
             continue;
         } else {
             $s = @mkdir($currpath, 0775);
             if (!$s) {
                 vlibTemplateError::raiseError('VT_ERROR_CACHE_MKDIR_FAILURE', KILL, 'directory: ' . $currpath);
             }
         }
     }
     return true;
 }
Exemple #2
0
 function setCacheExtension()
 {
     vlibTemplateError::raiseError('VT_WARNING_NOT_CACHE_OBJ', WARNING, 'setCacheExtension()');
 }
Exemple #3
0
 /**
  * FUNCTION: _prepareDirs
  * prepares the directory structure
  *
  */
 function _prepareDirs($file)
 {
     if (empty($file)) {
         die('no filename');
     }
     //do error in future
     $filepath = dirname($file);
     if (is_dir($filepath)) {
         return true;
     }
     $dirs = preg_split("#[\\/\\\\]#", $filepath);
     // "/" ou "\"
     $currpath = $this->OPTIONS['CACHE_DIRECTORY'];
     foreach ($dirs as $dir) {
         if (empty($dir)) {
             continue;
         }
         $currpath .= $dir . '/';
         $type = @filetype($currpath);
         $type == 'link' && ($type = 'dir');
         if ($type != 'dir' and $type != false and !empty($type)) {
             vlibTemplateError::raiseError('VT_ERROR_WRONG_CACHE_TYPE', KILL, 'directory: ' . $currpath . ', type: ' . $type);
         }
         if ($type == 'dir') {
             continue;
         } else {
             $s = @mkdir($currpath, 0775) || @mkdir($currpath);
             if (!$s) {
                 @system("mkdir -m 0775 -p '" . $this->OPTIONS['CACHE_DIRECTORY'] . "'");
                 @system("mkdir -m 0775 -p '{$currpath}'");
                 vlibTemplateError::raiseError('VT_ERROR_CACHE_MKDIR_FAILURE', KILL, 'directory: ' . $currpath);
             }
         }
     }
     return true;
 }