protected static function MarkStopped() { self::UpdateStats(array(self::STAT_RUNNING => false)); Cache_MySQL::Cache(self::$CACHE_PID, 0); }
$DB->Update(GetDBCreate('tbx_imported')); // Create tbx_thumb_queue if doesn't already exist $DB->Update(GetDBCreate('tbx_thumb_queue')); // Create tbx_search_term_new if doesn't already exist $DB->Update(GetDBCreate('tbx_search_term_new')); #### Create database tables ======================================================================================================= #### Update database ============================================================================================================== // Prepare for new QueueProcessor stats format $stats = ThumbQueue::LoadStats(); if (!isset($stats[ThumbQueue::STAT_PROCESSED_ITEMS])) { Cache_MySQL::Remove('thumb-queue-stats'); } // Prepare for new QueueProcessor stats format $stats = ConversionQueue::LoadStats(); if (!isset($stats[ConversionQueue::STAT_PROCESSED_ITEMS])) { Cache_MySQL::Remove('conversion-queue-stats'); } // Update sponsor video counts if ($DB->QuerySingleColumn('SELECT MAX(`videos`) FROM `tbx_sponsor`') == 0) { UpdateSponsorStats(); } // Update status in tbx_video_feed $DB->Update("ALTER TABLE `tbx_video_feed` MODIFY `status` ENUM('Pending','Scheduled','Active','Disabled') NOT NULL"); // Add image_id to tbx_category $columns = $DB->GetColumns('tbx_category'); if (!in_array('image_id', $columns)) { $DB->Update('ALTER TABLE `tbx_category` ADD COLUMN `image_id` INT UNSIGNED'); } // Add image_id to tbx_video_feed $columns = $DB->GetColumns('tbx_video_feed'); if (!in_array('flag_convert', $columns)) {
public static function GetCached() { if (is_object(self::$instance)) { return self::$instance; } $cached = Cache_MySQL::Get(self::CACHE_NAME); if (empty($cached)) { return self::Get(true); } $si = unserialize($cached); if (time() - $si->generated >= self::CACHE_LIFETIME) { return self::Get(true); } self::$instance = $si; return self::$instance; }