I found the solution at collabnet (Which is now dead).
I am copying the solution here as ColabEdit sometimes removes posts:
<?php
/*
Cron directory setup:
Cron
config
module.config.php
src
Cron
Controller
IndexController.php
autoload_classmap.php
Module.php
NOTES: Remember to include the Cron module in the main config file (trunk/config/application.config.php)
Once you have the route in place, write your cron and call it from your webhost cron manager.
*/
// Cron/config/module.config.php
return array(
// Placeholder for console routes
'controllers' => array(
'invokables' => array(
'Cron\Controller\IndexController' => 'Cron\Controller\IndexController'
),
),
'console' => array(
'router' => array(
'routes' => array(
//CRON RESULTS SCRAPER
'my-first-route' => array(
'type' => 'simple', // <- simple route is created by default, we can skip that
'options' => array(
'route' => 'hello',
'defaults' => array(
'controller' => 'Cron\Controller\IndexController',
'action' => 'index'
)
)
)
),
),
),
);
<?php
// Cron/src/Cron/Controller/IndexController.php
namespace Cron\Controller;
use Zend\Mvc\Controller\AbstractActionController;
class IndexController extends AbstractActionControlle
{
public function indexAction()
{
echo "hello";
echo "\r\n";
}
}
From the console navigate to trunk (or public_html) (the directory before public) and run:
path/to/trunk>php public/index.php hello
hello
path/to/trunk>