Ejemplo n.º 1
0
 public function install_client_files()
 {
     if (!isset($this->installdefs['clientfiles']) || !is_array($this->installdefs['clientfiles'])) {
         return;
     }
     // clientfiles contains five identical lists of files for each of the
     // activities relationships, this condenses them so we only copy once.
     $copyList = array();
     foreach ($this->installdefs['clientfiles'] as $outer) {
         foreach ($outer as $to => $from) {
             $copyList[$to] = $from;
         }
     }
     foreach ($copyList as $to => $from) {
         $contents = file_get_contents($from);
         SugarAutoloader::ensureDir(dirname($to));
         SugarAutoloader::put($to, $contents, false);
     }
     SugarAutoloader::saveMap();
 }
Ejemplo n.º 2
0
 /**
  * FUNCTION IS DEPRECATED FOR SUGAR 6.5+
  * @codeCoverageIgnore
  * @param $file
  * @return bool
  */
 public function fileExists($file)
 {
     global $sugar_flavor, $sugar_version;
     $version = explode('.', $sugar_version);
     //$flavor = strpos($sugar_flavor, 'OD');
     //if ($flavor === false) {
     if (!((int) $version[0] == 6 && (int) $version[1] >= 7)) {
         require_once "include/utils.php";
         //if the $check_path exists in custom, $path will be returned as "custom/{$check_path}", otherwise $check_path will be returned
         $path = get_custom_file_if_exists($file);
         if ($file != $path) {
             return true;
         } else {
             return false;
         }
         //            return file_exists($file);
     } else {
         //For Sugar On-Demand
         return SugarAutoloader::fileExists($file);
     }
 }
Ejemplo n.º 3
0
 protected function saveClientFiles($basepath, $installDefPrefix, $relationshipName, $moduleClientFileList)
 {
     $installDefs = array();
     foreach ($moduleClientFileList as $moduleName => $clientFileList) {
         mkdir_recursive("{$basepath}/{$moduleName}/clients");
         foreach ($clientFileList as $fileName => $contents) {
             $from = "{$basepath}/{$moduleName}/" . $fileName;
             $to = "modules/{$moduleName}/" . $fileName;
             $installDefs[$moduleName][$to] = $from;
             SugarAutoloader::ensureDir(dirname($from));
             sugar_file_put_contents($from, $contents);
         }
     }
     return $installDefs;
 }