Exemple #1
0
 /**
  * Enables Shadowing on a Sugar Server
  *
  * @param STRING $server
  */
 static function shadow($server, $templatePath = null)
 {
     if (empty($templatePath) && !empty($_SERVER['DOCUMENT_ROOT'])) {
         $templatePath = $_SERVER['DOCUMENT_ROOT'];
     }
     if (empty($templatePath) && !empty($_SERVER['SHADOW_ROOT'])) {
         $templatePath = $_SERVER['SHADOW_ROOT'];
     }
     $shadow = new SugarShadow($server);
     $info = $shadow->getServerInfo();
     if (empty($templatePath) || empty($info)) {
         die('<h3>Invalid SugarCRM Instance</h3>');
     } else {
         if (!file_exists($info['path'])) {
             die('<h3>Invalid SugarCRM Instance</h3>');
         }
         shadow($templatePath, $info['path'], array('cache', 'upload', 'config.php'));
     }
 }
Exemple #2
0
 /**
  *
  * Enables Shadowing on a Sugar Server
  * @param STRING $server
  */
 static function shadow($server)
 {
     $shadow = new SugarShadow($server);
     $info = $shadow->getServerInfo();
     if (empty($info)) {
         die('<h3>Invalid SugarCRM Instance</h3>');
     } else {
         if (!file_exists($info['path'])) {
             if ($shadow->config['shadow']['createDir']) {
                 $shadow->createInstance($info['path']);
             } else {
                 die('<h3>Invalid SugarCRM Instance</h3>');
             }
         }
         shadow(dirname(__FILE__), $info['path'], array('cache', 'config.php'));
     }
 }