<?php
$f3=require('lib/base.php');
$f3->set('AUTOLOAD','app/');
require_once 'applib/init.php';
$f3->route('GET /crontest', 'testing::test_cron');
$f3->run();
?><?php
$f3=require('lib/base.php');
$f3->set('AUTOLOAD','app/');
require_once 'applib/init.php';
$f3->route('GET /crontest',
function($f3) {
include 'app/testing.php';
testing::test_cron($f3);
}
);
$f3->run();
?>
class dolog{
function logit(){
$logger = new Log('check.log');
$logger->write("ok");
}
}
$f3->route('GET /log','dolog->logit');* * * * * curl http://localhost/fatfree-composer-app/logWhich logs every minute to check.log. I´m testing with latest f3.
Would you please post your crontab entry and check if your webserver error.log
logs something?
cheers,
- anatol
EDIT:
Just read your question again, it targets autoload therfore I´ve tested again having a file in folder app/contoller:
<?php
namespace Controller;
class dolog{
function logit(){
$logger = new \Log('check.log');
$logger->write("ok");
}
}and in my index:
$f3->set('AUTOLOAD', 'app/');
$f3->route('GET /log','Controller\dolog->logit');45 * * * * /usr/bin/php /home/mycat/public_html/index.php "/crontest"