Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks all for your answers. However the solution that worked for me came from this site <a href="http://www.robotsystematic.com/2009/howto/zend-framework-cron/" rel="noreferrer">Howto: Zend Framework Cron</a>. The original link is dead, but <a href="http://web.archive.org/web/20100414183145/http://www.robotsystematic.com/2009/howto/zend-framework-cron/" rel="noreferrer">its copy</a> can be found on Internet Archive.</p> <p>I am posting a cut of the code here. But please this is not my solution. All credits goes to the original author.</p> <blockquote> <p>The trick with cronjobs is that you do not want to load the whole View part of ZF, we don't need any kind of HTML output! To get this to work, I defined a new constant in the cronjob.php which I will check for in the index.php.</p> </blockquote> <h3>cronjob.php</h3> <pre><code>define("_CRONJOB_",true); require('/var/www/vhosts/domain.com/public/index.php'); // rest of your code goes here, you can use all Zend components now! </code></pre> <h3>index.php</h3> <pre><code>date_default_timezone_set('Europe/Amsterdam'); // 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')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), get_include_path(), ))); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); $application-&gt;bootstrap(); /** Cronjobs don't need all the extra's **/ if(!defined('_CRONJOB_') || _CRONJOB_ == false) { $application-&gt;bootstrap()-&gt;run(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload