Beispiel #1
0
 function getLocalConflictBasePath($product)
 {
     $FileSystemHelper = new FileSystemHelper();
     $path = $this->getLocalBasePath($product) . "backup/";
     if (!JFolder::exists($path)) {
         if (!$FileSystemHelper->createDirRecursive($path, 0755)) {
             return false;
         }
     }
     return $path;
 }
Beispiel #2
0
 function _doBackupConflictedFiles($path, $relativePath, $data)
 {
     $conflicted = false;
     foreach ($data as $k => $item) {
         if (is_object($item)) {
             $subPath = $path . $k . DS;
             $relativeSubPath = $relativePath . $k . "/";
             FileSystemHelper::createDirRecursive($subPath, 0777);
             $subConflicted = $this->_doBackupConflictedFiles($subPath, $relativeSubPath, $item);
             if ($subConflicted) {
                 $conflicted = true;
             }
         } else {
             if ($item == 'bmodified') {
                 //the files which is modified by both user and developer
                 //is conflicted file
                 $conflicted = true;
                 $destPath = $path . $k;
                 $relativeFile = $relativePath . $k;
                 $srcPath = $this->getFilePath($relativeFile);
                 FileSystemHelper::cp($srcPath, $destPath);
             }
         }
     }
     return $conflicted;
 }
 function getLocalConflictBasePath($product)
 {
     $path = $this->getLocalBasePath($product) . "backup" . DS;
     if (!is_dir($path)) {
         if (!FileSystemHelper::createDirRecursive($path, 0777)) {
             return false;
         }
     }
     return $path;
 }