public function testSet() { $result = \Comodojo\Extender\Cache::set($this->cache_data); $this->assertNotFalse($result); $this->assertGreaterThan(1, $result); }
/** * Get planned jobs * * @return array * @throws \Comodojo\Exception\DatabaseException */ private static function getJobs() { $jobs = Cache::get(); if ($jobs !== false) { return $jobs; } 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(array("id", "name", "task", "description", "min", "hour", "dayofmonth", "month", "dayofweek", "year", "params", "lastrun", "firstrun"))->where("enabled", "=", true)->get(); } catch (DatabaseException $de) { unset($db); throw $de; } unset($db); $jobs = $result->getData(); Cache::set($jobs); return $jobs; }