mailpoet
Last commit date
assets
7 years ago
generated
7 years ago
lang
7 years ago
lib
7 years ago
vendor
7 years ago
vendor-prefixed
7 years ago
views
7 years ago
index.php
9 years ago
license.txt
9 years ago
mailpoet-cron.php
7 years ago
mailpoet.php
7 years ago
mailpoet_initializer.php
9 years ago
readme.txt
7 years ago
uninstall.php
9 years ago
mailpoet-cron.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | ini_set("display_errors", "1"); |
| 4 | error_reporting(E_ALL); |
| 5 | |
| 6 | if(!isset($argv[1]) || !$argv[1]) { |
| 7 | echo 'You need to pass a WordPress root as an argument.'; |
| 8 | exit(1); |
| 9 | } |
| 10 | |
| 11 | $wp_load_file = $argv[1] . '/wp-load.php'; |
| 12 | if(!file_exists($wp_load_file)) { |
| 13 | echo 'WordPress root argument is not valid.'; |
| 14 | exit(1); |
| 15 | } |
| 16 | |
| 17 | if(!defined('ABSPATH')) { |
| 18 | /** Set up WordPress environment */ |
| 19 | require_once($wp_load_file); |
| 20 | } |
| 21 | |
| 22 | if(!is_plugin_active('mailpoet/mailpoet.php')) { |
| 23 | echo 'MailPoet plugin is not active'; |
| 24 | exit(1); |
| 25 | } |
| 26 | |
| 27 | // Check for minimum supported PHP version |
| 28 | if(version_compare(phpversion(), '5.6.0', '<')) { |
| 29 | echo 'MailPoet requires PHP version 5.6 or newer (version 7.2 recommended).'; |
| 30 | exit(1); |
| 31 | } |
| 32 | |
| 33 | if(strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { |
| 34 | set_time_limit(0); |
| 35 | } |
| 36 | |
| 37 | $data = \MailPoet\Cron\CronHelper::createDaemon(null); |
| 38 | $trigger = new \MailPoet\Cron\Daemon(); |
| 39 | $trigger->run($data); |
| 40 |