Skip to content

Commit

Permalink
Cronjob did not work when installed via composer
Browse files Browse the repository at this point in the history
  • Loading branch information
Toflar committed Sep 10, 2015
1 parent 054d6f4 commit c5dd4db
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion bin/queue
Original file line number Diff line number Diff line change
@@ -12,7 +12,16 @@
*/

define('TL_MODE', 'FE');
require __DIR__ . '/../../../initialize.php';

if (file_exists(__DIR__ . '/../../../initialize.php')) {
// Regular way
require_once(__DIR__ . '/../../../initialize.php');
} else {
// Try composer location (see #77)
require_once(__DIR__ . '/../../../../../system/initialize.php');
}


$queueManager = $GLOBALS['NOTIFICATION_CENTER']['QUEUE_MANAGER'];

$queueManager->sendFromQueue($argv[2], $argv[4]);
8 changes: 7 additions & 1 deletion languages/en/tl_nc_gateway.php
Original file line number Diff line number Diff line change
@@ -83,4 +83,10 @@
<br><blockquote>5 * * * * /path/to/contao/system/modules/notification_center/bin/queue -s {gateway_id} -n 30</blockquote><br>
If you don\'t have access to real cronjobs then you can enable the poor man\'s cron. Note that it doesn\'t provide the same
flexibility in terms of interval settings and it is subject to the web execution context and thus certainly affected by
PHP configurations such as the maximum execution time. Thus, try to keep the number of messages sent per invocation as low as possible.';
PHP configurations such as the maximum execution time. Thus, try to keep the number of messages sent per invocation as low as possible.
<br><br>
<strong>Note: </strong>When you installed the notification center using Composer, the path to the binary differs:
<blockquote>
/path/to/contao/composer/vendor/terminal42/notification_center/bin/queue
</blockquote>
';

0 comments on commit c5dd4db

Please sign in to comment.