[zi-cvs] packages/com.zzoss.plugin.lib Plugin.php,1.14,1.15

Sandro Zic <[email protected]> Tue, 06 Apr 2004 14:45:19 +0000
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32569/com.zzoss.plugin.lib

Modified Files:
	Plugin.php 
Log Message:
make plugins sandbox work

Index: Plugin.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib/Plugin.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Plugin.php	5 Apr 2004 16:40:33 -0000	1.14
--- Plugin.php	6 Apr 2004 14:45:17 -0000	1.15
***************
*** 122,126 ****
      {
          if(!$xml = $this->registry->getPackageDescr($package_xml)){
!             return PEAR::raiseError('Cannot read \''.$package_xml.'\'');
          }
          
--- 122,127 ----
      {
          if(!$xml = $this->registry->getPackageDescr($package_xml)){
!             trigger_error('Cannot read \''.$package_xml.'\'');
!             return false;
          }
          
***************
*** 398,402 ****
              case 'install':
                  if(!is_dir(dirname($GLOBALS['ZI']['file_dest']))){
!                     System::mkDir(array("-p",dirname($GLOBALS['ZI']['file_dest'])));
                      $GLOBALS['ZI']['plugin_log'] .= 'Created directory '.dirname($GLOBALS['ZI']['file_dest'])."\n";
                  }
--- 399,403 ----
              case 'install':
                  if(!is_dir(dirname($GLOBALS['ZI']['file_dest']))){
!                     ZZOSS_InstallerUtils::mkDir(dirname($GLOBALS['ZI']['file_dest']));
                      $GLOBALS['ZI']['plugin_log'] .= 'Created directory '.dirname($GLOBALS['ZI']['file_dest'])."\n";
                  }
***************
*** 470,495 ****
              
              // remember include path
!             //$inc_path_old = ini_get('include_path');
              // set include path to allow only relative includes,
              // which will immediately throw an error if a plugin
              // relies on a class external to the plugins runtime
              // environment (e.g. a class provided by the installer).
!             //ini_set('include_path', '.');
              
              // set global vars ($GLOBALS['ZI'])
              $this->initGlobalVariables();
              
!             
!             //echo $include.'<br/>';
              
              // include plugin
              include($include);
!             //phpinfo();
!             /*$plugin_res = popen('/usr/bin/php '.$include, 'r');
!             $contents = fread($plugin_res, 12000);
!             pclose($plugin_res);
!             echo 'Inhalt: '.$contents;*/
              // reset include path
!             //ini_set('include_path', $inc_path_old);
              
              
--- 471,491 ----
              
              // remember include path
!             $inc_path_old = ini_get('include_path');
              // set include path to allow only relative includes,
              // which will immediately throw an error if a plugin
              // relies on a class external to the plugins runtime
              // environment (e.g. a class provided by the installer).
!             ini_set('include_path', '.');
              
              // set global vars ($GLOBALS['ZI'])
              $this->initGlobalVariables();
              
!             //print_r(get_included_files());
              
              // include plugin
              include($include);
!             
              // reset include path
!             ini_set('include_path', $inc_path_old);
              
              
***************
*** 606,620 ****
                  // Log info
                  $this->log .= $this->plugin_action." plugin file ".$file_path." with role '".$role."'\n";
-                 /*
-                 // move files to installer's plugins/ directory
-                 $src = ZZOSS_InstallerUtils::fixPath($this->package["install"]["path"].$file["@"]["name"]);
-                 $zi_plugin_dir = $this->dest_dir.DIRECTORY_SEPARATOR.$this->package['name'].'-'.$this->package['release']['version'].DIRECTORY_SEPARATOR;
-                 $dest = ZZOSS_InstallerUtils::fixPath($zi_plugin_dir.$file["@"]["name"]);
-                 
-                 System::mkdir(array('-p', $zi_plugin_dir));
-                 if(!@copy($src,$dest)) {
-                     $this->log .= 'error writing '.$dest."\n";
-                 }
-                 */
              }
              
--- 602,605 ----
***************
*** 660,664 ****
          $GLOBALS['ZI']['plugin_data_dir'] = $this->data_dir.DIRECTORY_SEPARATOR;
          
!         $GLOBALS['ZI']['plugins_re'] = $this->dest_dir;
          
          // GUI
--- 645,649 ----
          $GLOBALS['ZI']['plugin_data_dir'] = $this->data_dir.DIRECTORY_SEPARATOR;
          
!         $GLOBALS['ZI']['plugins_re'] = $this->registry->getApplicationPath().'plugins_re'.DIRECTORY_SEPARATOR;
          
          // GUI



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click