phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/cron asyncservices.php,1.1.2.3,1.1.2.4


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/cron asyncservices.php,1.1.2.3,1.1.2.4
Date: Fri, 13 Jun 2003 06:42:56 -0400

Update of /cvsroot/phpgroupware/phpgwapi/cron
In directory subversions:/tmp/cvs-serv32254

Modified Files:
      Tag: Version-0_9_16-branch
        asyncservices.php 
Log Message:
loading mysql and pgsql extensions, if they are not compiled in or automaticaly 
loaded as it is the case on debian


Index: asyncservices.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/cron/asyncservices.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** asyncservices.php   1 Jun 2003 09:17:29 -0000       1.1.2.3
--- asyncservices.php   13 Jun 2003 10:42:52 -0000      1.1.2.4
***************
*** 27,42 ****
        $_GET['domain'] = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 
'default';
  
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'login'
        );
        include($path_to_phpgroupware.'/header.inc.php');
- 
        $num = ExecMethod('phpgwapi.asyncservice.check_run','crontab');
-       
        // if the following comment got removed, you will get an email from 
cron for every check performed
        //echo date('Y/m/d H:i:s ').$_GET['domain'].': '.($num ? "$num job(s) 
executed" : 'Nothing to execute')."\n";
  
        $GLOBALS['phpgw']->common->phpgw_exit();
- 
- 
- 
--- 27,55 ----
        $_GET['domain'] = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 
'default';
  
+       // As debian does not compile the db-support into the cgi-binary of php 
we have to load it manualy.
+       // Unfortunaly we cant include the header to find out which db to use, 
as header.inc.php includes
+       // phpgwapi/inc/functions.inc.php which includes/CreateObject's the 
db-class. The first call of the
+       // db-class fails on debian as mysql or pgsql is not loaded.
+       // Therefore we now load mysql and pgsql support if its not already 
loaded.
+ 
+       $db_extensions_to_load = array(
+               'mysql' => 'mysql',
+               'pgsql' => 'pgsql'
+       );
+       foreach ($db_extensions_to_load as $db => $extension_name)
+       {
+               if (!extension_loaded($extension_name) && 
!dl($extension_name.'.so'))
+               {
+                       echo "Extension '$db' is not loaded and can't be loaded 
via dl('$extension_name.so') !!!\n";
+               }       
+       }
+ 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'login'
        );
        include($path_to_phpgroupware.'/header.inc.php');
        $num = ExecMethod('phpgwapi.asyncservice.check_run','crontab');
        // if the following comment got removed, you will get an email from 
cron for every check performed
        //echo date('Y/m/d H:i:s ').$_GET['domain'].': '.($num ? "$num job(s) 
executed" : 'Nothing to execute')."\n";
  
        $GLOBALS['phpgw']->common->phpgw_exit();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]