public function testPurge() { $result = \Comodojo\Extender\Cache::purge(); $this->assertTrue($result); }
/** * Disable a schedule * * @param string $name * * @return bool * @throws \Comodojo\Exception\DatabaseException * @throws \Exception */ public static final function disableSchedule($name) { if (empty($name)) { throw new Exception("Invalid or empty job name"); } try { $db = new EnhancedDatabase(EXTENDER_DATABASE_MODEL, EXTENDER_DATABASE_HOST, EXTENDER_DATABASE_PORT, EXTENDER_DATABASE_NAME, EXTENDER_DATABASE_USER, EXTENDER_DATABASE_PASS); $result = $db->tablePrefix(EXTENDER_DATABASE_PREFIX)->table(EXTENDER_DATABASE_TABLE_JOBS)->keys("enabled")->values(array(false))->where("name", "=", $name)->update(); } catch (DatabaseException $de) { throw $de; } Cache::purge(); Planner::release(); return $result->getAffectedRows() == 1 ? true : false; }