Note that there are some explanatory texts on larger screens.

plurals
  1. POIssues with Codeigniter and Cron Bootstrapper
    primarykey
    data
    text
    <p>I am trying to create a cron job while taking advantage of my current CI setup and the use of Controllers and Models. I am using Cron Bootstrapper (http://codeigniter.com/wiki/Cron_job_bootstrapper/) because it gives me easy access to test the process locally on-demand or be available as a traditional cron process on a server. I can reach the controller using the bootstrapper file and the command line, however, I am getting many different error messages or alerts depending on how I set up my controller.</p> <p>If I keep the controller as it should be with <code>parent::Controller();</code>, I get the following message:</p> <blockquote> <p>Unable to connect to your database server using the provided settings.</p> </blockquote> <p>The error is coming from the DB_driver.php <code>initialize()</code> method.</p> <p>If I remove the call to <code>parent::Controller()</code> from the controller then I get the following alert:</p> <pre><code> &lt;p&gt;Severity: Warning&lt;/p&gt; &lt;p&gt;Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead&lt;/p&gt; &lt;p&gt;Filename: htdocs/cron.php&lt;/p&gt; &lt;p&gt;Line Number: 122&lt;/p&gt;` </code></pre> <p>By removing the <code>parent::Controller();</code> I am not able to access any models via <code>$this-&gt;load-&gt;model('model');</code> and I get the following message:</p> <blockquote> <p>Fatal error: Call to a member function model() on a non-object in /Applications/MAMP/htdocs/my_site/system/application/controllers/cron.php on line 9</p> </blockquote> <p>Any info that will allow me to use the bootstrapper file with CI will be very helpful.</p>
    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. 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