phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/cron/asyncservices.php, 1.5


From: nomail
Subject: [Phpgroupware-cvs] phpgwapi/cron/asyncservices.php, 1.5
Date: Thu, 30 Dec 2004 07:47:26 +0100

Update of /phpgwapi/cron
Added Files:
        Branch: 
          asyncservices.php

date: 2004/12/30 06:47:26;  author: skwashd;  state: Exp;  lines: +2 -2

Log Message:
new HEAD
=====================================================================
#!/usr/bin/php -q
<?php
        
/**************************************************************************\
        * phpGroupWare API - Timed Asynchron Services for phpGroupWare          
   *
        * Written by Ralf Becker <address@hidden>                  *
        * Class for creating cron-job like timed calls of phpGroupWare methods  
   *
        * 
-------------------------------------------------------------------------*
        * This library is part of the phpGroupWare API                          
   *
        * http://www.phpgroupware.org/                                          
   *
        * 
------------------------------------------------------------------------ *
        * This library is free software; you can redistribute it and/or modify 
it  *
        * under the terms of the GNU Lesser General Public License as published 
by *
        * the Free Software Foundation; either version 2.1 of the License,      
   *
        * or any later version.                                                 
   *
        * This library is distributed in the hope that it will be useful, but   
   *
        * WITHOUT ANY WARRANTY; without even the implied warranty of            
   *
        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  
   *
        * See the GNU Lesser General Public License for more details.           
   *
        * You should have received a copy of the GNU Lesser General Public 
License *
        * along with this library; if not, write to the Free Software 
Foundation,  *
        * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
   *
        
\**************************************************************************/

        /* $Id: asyncservices.php,v 1.5 2004/12/30 06:47:26 skwashd Exp $ */

        $path_to_phpgroupware = dirname(__FILE__) . '/../..';   // need to be 
adapted if this script is moved somewhere else
        $_GET['domain'] = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 
'default';

        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'login',
                'noapi'      => True            // this stops header.inc.php to 
include phpgwapi/inc/function.inc.php
        );
        include($path_to_phpgroupware.'/header.inc.php');
        unset($GLOBALS['phpgw_info']['flags']['noapi']);

        $db_type = $GLOBALS['phpgw_domain'][$_GET['domain']]['db_type'];
        if (!extension_loaded($db_type) && !dl($db_type.'.so'))
        {
                echo "Extension '$db_type' is not loaded and can't be loaded 
via dl('$db_type.so') !!!\n";
        }
        
        $GLOBALS['phpgw_info']['server']['sessions_type'] = 'db';

        include(PHPGW_API_INC.'/functions.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]