resources.router.routes.termsofuse.route = "termsofuse/"
resources.router.routes.termsofuse.defaults.controller = "termsofuse"
resources.router.routes.termsofuse.defaults.action = "index"
-; cron/
-resources.router.routes.cron.route = "cron/"
-resources.router.routes.cron.defaults.controller = "cron"
-resources.router.routes.cron.defaults.action = "index"
; newpwd/
resources.router.routes.newpwd.route = "newpwd/"
resources.router.routes.newpwd.defaults.controller = "newpwd"
+++ /dev/null
-<?php
-/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
- and is published under the AGPL license. */
-
-class CronController extends Zend_Controller_Action
-{
- public function init() {
- $ip = $this->getRequest()->getClientIp(true);
- if ($ip !== '127.0.0.1' and $ip !== '::1') {
- throw new Syj_Exception_Forbidden();
- }
- }
- public function indexAction() {
- $mapper = new Syj_Model_PendingMapper();
- foreach ($mapper->fetchAll() as $pending) {
- $pending->notify();
- }
- $this->_helper->SyjApi->setCode(200);
- }
-}
--- /dev/null
+<?php
+$mapper = new Syj_Model_PendingMapper();
+foreach ($mapper->fetchAll() as $pending) {
+ $pending->notify();
+}
<?php
-// Define path to application directory
-defined('APPLICATION_PATH')
- || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
+require_once ('init.php');
-// Define application environment
-defined('APPLICATION_ENV')
- || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
-
-// set include directories to '.' and ../library
-set_include_path('.' . PATH_SEPARATOR . realpath(APPLICATION_PATH . '/../library'));
-
-/** Zend_Application */
-require_once 'Zend/Application.php';
-
-// Create application, bootstrap, and run
-$application = new Zend_Application(
- APPLICATION_ENV,
- APPLICATION_PATH . '/configs/application.ini'
-);
-
-# we use this function as a marker so xgettext knows it must extract this
-# string. This function can be used when string must be translated, but not at
-# the place it's called. For example, Zend_Form uses a translator to translate
-# string it has been given. So, we must pass it a non translated string.
-function __($str) {
- return $str;
-}
-
-$application->bootstrap()
- ->run();
+$application->bootstrap()->run();
--- /dev/null
+<?php
+
+// Define path to application directory
+defined('APPLICATION_PATH')
+ || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
+
+// Define application environment
+defined('APPLICATION_ENV')
+ || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
+
+// set include directories to '.' and ../library
+set_include_path('.' . PATH_SEPARATOR . realpath(APPLICATION_PATH . '/../library'));
+
+/** Zend_Application */
+require_once 'Zend/Application.php';
+
+# we use this function as a marker so xgettext knows it must extract this
+# string. This function can be used when string must be translated, but not at
+# the place it's called. For example, Zend_Form uses a translator to translate
+# string it has been given. So, we must pass it a non translated string.
+function __($str) {
+ return $str;
+}
+
+$application = new Zend_Application(
+ APPLICATION_ENV,
+ APPLICATION_PATH . '/configs/application.ini'
+);
--- /dev/null
+#!/usr/bin/env php
+<?php
+
+require_once realpath(dirname(__FILE__) . '/../public/init.php');
+
+$application->bootstrap();
+
+foreach (glob(realpath(APPLICATION_PATH . '/crons') . '/*.php') as $fname) {
+ require_once ($fname);
+}
MAILTO=arno@renevier.net
# every 5 minutes, call syj php cron
-*/5 * * * * /usr/bin/wget --header="Host: osm-syj.crans.org" http://localhost/cron -O /dev/null -o /dev/null
+*/5 * * * * /data/project/syj/scripts/cron.php
# every month, update geoip db
12 3 3 * * /data/project/syj/scripts/updategeoip.sh
# every day, delete old sessions files