function action_plugin_deactivation($file)
 {
     // Remove the periodical execution event
     CronTab::delete_cronjob('incoming_links');
     // Clear the cached links
     Cache::expire('incoming_links');
 }
예제 #2
0
 public function action_plugin_deactivation($file)
 {
     if (realpath($file) == __FILE__) {
         CronTab::delete_cronjob('pbem_check_accounts');
         ACL::destroy_token('PBEM');
     }
 }
 public function action_plugin_deactivation($file = '')
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         CronTab::delete_cronjob('optimize database tables initial');
         CronTab::delete_cronjob('optimize database tables');
         Options::delete('database_optimizer__frequency');
     }
 }
예제 #4
0
 function action_plugin_deactivation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         // remove the module from the dash if it is active
         Modules::remove_by_name('Incoming Links');
         // Remove the periodical execution event
         CronTab::delete_cronjob('incoming_links');
         // Clear the cached links
         Cache::expire('incoming_links');
     }
 }
예제 #5
0
파일: test_cron.php 프로젝트: habari/tests
 public function test_delete_on_fail()
 {
     $job = CronTab::add_single_cron('test_delete_fail', 'this_cron_hook_doesnt_exist', DateTime::create(), 'Test Cron');
     for ($z = 0; $z < 10; $z++) {
         $job = CronTab::get_cronjob('test_delete_fail');
         Options::set('next_cron', 0);
         Options::delete('cron_running');
         $job->execute();
     }
     $this->assert_false($job->active, 'The cron is still active after failing more than the allowed number of times.');
     CronTab::delete_cronjob('test_delete_fail');
 }
예제 #6
0
 /**
  * function update_scheduled_posts_cronjob
  *
  * Creates or recreates the cronjob to publish
  * scheduled posts. It is called whenever a post
  * is updated or created
  *
  */
 public static function update_scheduled_posts_cronjob()
 {
     $min_time = DB::get_value('SELECT MIN(pubdate) FROM {posts} WHERE status = ?', array(Post::status('scheduled')));
     CronTab::delete_cronjob('publish_scheduled_posts');
     if ($min_time) {
         CronTab::add_single_cron('publish_scheduled_posts', array('Posts', 'publish_scheduled_posts'), $min_time, 'Next run: ' . HabariDateTime::date_create($min_time)->get('c'));
     }
 }
 public function updated_config($ui)
 {
     $ui->save();
     // if they selected an option other than manually, set up the cron
     $frequency = Options::get('exportsnapshot__frequency');
     // delete the crontab entry, if there is one
     CronTab::delete_cronjob('snapshot');
     switch ($frequency) {
         case 'manually':
             // do nothing
             break;
         case 'hourly':
             CronTab::add_hourly_cron('snapshot', array('ExportSnapshot', 'run'), _t('Hourly Export Snapshot', 'exportsnapshot'));
             break;
         case 'daily':
             CronTab::add_daily_cron('snapshot', array('ExportSnapshot', 'run'), _t('Daily Export Snapshot', 'exportsnapshot'));
             break;
         case 'weekly':
             CronTab::add_weekly_cron('snapshot', array('ExportSnapshot', 'run'), _t('Weekly Export Snapshot', 'exportsnapshot'));
             break;
         case 'monthly':
             CronTab::add_monthly_cron('snapshot', array('ExportSnapshot', 'run'), _t('Monthly Export Snapshot', 'exportsnapshot'));
             break;
     }
     return false;
 }
 public function action_plugin_deactivation($file)
 {
     if (Plugins::id_from_file($file) == Plugins::id_from_file(__FILE__)) {
         CronTab::delete_cronjob('spamcrondelete');
     }
 }
예제 #9
0
 public function on_success($form)
 {
     $form->save();
     $params = array('name' => 'fireeagle:refresh', 'callback' => 'fireeagle_refresh', 'increment' => Options::get('fireeagle__refresh_interval'), 'description' => 'Refreshing Fire Eagle Location');
     CronTab::delete_cronjob($params['name']);
     CronTab::add_cron($params);
     return false;
 }
예제 #10
0
 private function upgrade_db_post_5107()
 {
     // delete the current un-namespaced CronJobs by these names
     CronTab::delete_cronjob('trim_log');
     CronTab::delete_cronjob('update_check');
     // we could have a bunch of the single update crons now, and there's no way to handle that using CronTab, so do it manually
     $crons = DB::get_results('SELECT * FROM {crontab} WHERE name = ?', array('update_check_single'), '\\Habari\\CronJob');
     foreach ($crons as $cron) {
         $cron->delete();
     }
     // Add the cronjob to trim the log so that it doesn't get too big
     CronTab::add_daily_cron('trim_log', Method::create('\\Habari\\EventLog', 'trim'), _t('Trim the log table'));
     // Add the cronjob to check for plugin updates
     CronTab::add_daily_cron('update_check', Method::create('\\Habari\\Update', 'cron'), _t('Perform a check for plugin updates.'));
 }
예제 #11
0
 public function action_plugin_deactivation($file)
 {
     if (realpath($file) == __FILE__) {
         CronTab::delete_cronjob('autoclose_check_posts');
     }
 }
예제 #12
0
	private function upgrade_db_post_4571()
	{
		
		// remove the old truncate_log cronjob
		CronTab::delete_cronjob( 'truncate_log' );
		
		// add the new trim_log cronjob
		CronTab::add_daily_cron( 'trim_log', array( 'EventLog', 'trim' ), _t( 'Trim the log table' ) );
		
	}
예제 #13
0
 /**
  * Run deactivation routines.
  */
 public function action_plugin_deactivation($file)
 {
     CronTab::delete_cronjob('blogroll:update');
     Options::delete('blogroll__api_version');
 }
예제 #14
0
 /**
  * Perform actions when the admin plugin form is successfully submitted. 
  * 
  * @param FormUI $ui The form that successfully completed
  * @return boolean True if the normal processing should occur to save plugin options from the form to the database
  */
 public function updated_config($ui)
 {
     $ui->save();
     // Delete the cached feed data
     DB::query('TRUNCATE {feedlist}');
     // Reset the cronjob so that it runs immediately with the change
     CronTab::delete_cronjob('feedlist');
     CronTab::add_hourly_cron('feedlist', 'load_feeds', 'Load feeds for feedlist plugin.');
     return false;
 }
예제 #15
0
 function action_plugin_deactivation($file)
 {
     CronTab::delete_cronjob('lastrecent');
     Cache::expire(array('lastrecent'));
 }