[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/cron stalesessions.php, 1.5 asyncservices.ph
From: |
powerstat |
Subject: |
[Phpgroupware-cvs] phpgwapi/cron stalesessions.php, 1.5 asyncservices.php, 1.6 |
Date: |
Thu, 28 Apr 2005 10:11:00 +0200 |
Update of phpgwapi/cron
Modified Files:
Branch: MAIN
stalesessions.php lines: +27 -31
asyncservices.php lines: +19 -22
Log Message:
phpdocs added to the rest outside inc
====================================================
Index: phpgwapi/cron/stalesessions.php
diff -u phpgwapi/cron/stalesessions.php:1.4 phpgwapi/cron/stalesessions.php:1.5
--- phpgwapi/cron/stalesessions.php:1.4 Thu Dec 30 06:47:26 2004
+++ phpgwapi/cron/stalesessions.php Thu Apr 28 08:11:59 2005
@@ -1,33 +1,29 @@
-<?php
- /**************************************************************************\
- * phpGroupWare *
- * http://www.phpgroupware.org *
- * -------------------------------------------- *
- * This program is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU General Public License as published by the *
- * Free Software Foundation; either version 2 of the License, or (at your *
- * option) any later version. *
- \**************************************************************************/
+<?php
+ /**
+ * Timed Asynchron Services
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @package phpgwapi
+ * @subpackage cron
+ * @version $Id$
+ * @internal stalesession.php - to use instead of stalesession.pl
+ * @internal may be invoked via cron with "php stalesession.php"
+ */
+
+ // config start
+ $purgedelay = "3600"; // define allowed idle time before deletion in seconds
+ $purgetime = time() - $purgedelay;
+ $db_user = $ARGV[1];
+ $db_pwd = "my_pass";
+ $db_server = "localhost";
+ $db_db = "phpGroupWare";
+ // config end - do not edit after here unless you really know what you do!
- /* $Id$ */
+ // establish link:
+ $link = mysql_connect("$db_server","$db_user","$db_pwd");
+ mysql_query("use $db_db", $link);
- // stalesession.php - to use instead of stalesession.pl
- // may be invoked via cron with "php stalesession.php"
-
- // config start
- $purgedelay = "3600"; // define allowed idle time before deletion in seconds
- $purgetime = time() - $purgedelay;
- $db_user = $ARGV[1];
- $db_pwd = "my_pass";
- $db_server = "localhost";
- $db_db = "phpGroupWare";
- // config end - do not edit after here unless you really know what you do!
-
- // establish link:
- $link = mysql_connect("$db_server","$db_user","$db_pwd");
- mysql_query("use $db_db", $link);
-
- // delete old (timed out) sessions
- $query = sprintf("delete from phpgw_sessions where session_dla <=
'$purgetime'");
- $res = mysql_query($query, $link);
-?>
+ // delete old (timed out) sessions
+ $query = sprintf("delete from phpgw_sessions where session_dla <=
'$purgetime'");
+ $res = mysql_query($query, $link);
+?>
====================================================
Index: phpgwapi/cron/asyncservices.php
diff -u phpgwapi/cron/asyncservices.php:1.5 phpgwapi/cron/asyncservices.php:1.6
--- phpgwapi/cron/asyncservices.php:1.5 Thu Dec 30 06:47:26 2004
+++ phpgwapi/cron/asyncservices.php Thu Apr 28 08:11:59 2005
@@ -1,27 +1,14 @@
#!/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$ */
+ /**
+ * Timed Asynchron Services - cron-job like timed calls of phpGroupWare
methods
+ * @author Ralf Becker <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General
Public License
+ * @package phpgwapi
+ * @subpackage cron
+ * @version $Id$
+ */
$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';
@@ -30,7 +17,14 @@
'currentapp' => 'login',
'noapi' => True // this stops header.inc.php to
include phpgwapi/inc/function.inc.php
);
+
+
+ /**
+ * Include phpgroupware header
+ */
include($path_to_phpgroupware.'/header.inc.php');
+
+
unset($GLOBALS['phpgw_info']['flags']['noapi']);
$db_type = $GLOBALS['phpgw_domain'][$_GET['domain']]['db_type'];
@@ -41,6 +35,9 @@
$GLOBALS['phpgw_info']['server']['sessions_type'] = 'db';
+ /**
+ * Include API functions
+ */
include(PHPGW_API_INC.'/functions.inc.php');
$num = ExecMethod('phpgwapi.asyncservice.check_run','crontab');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/cron stalesessions.php, 1.5 asyncservices.php, 1.6,
powerstat <=