CampCache::IsEnabled PHP Method

IsEnabled() public static method

Returns true if the given cache engine was enabled
public static IsEnabled ( $p_cacheEngine = null ) : boolean
$p_cacheEngine
return boolean TRUE on success, FALSE on failure
    public static function IsEnabled($p_cacheEngine = null)
    {
        /**
         * @deprecated from 4.3, removed in 4.4, use newscoop.cache service
         */
        return false;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Gets an issues list based on the given parameters.
  *
  * @param integer $p_context_id
  *    The Context Box Identifier
  * @param string $p_order
  *    An array of columns and directions to order by
  * @param integer $p_start
  *    The record number to start the list
  * @param integer $p_limit
  *    The offset. How many records from $p_start will be retrieved.
  * @param integer $p_count
  *    The total count of the elements; this count is computed without
  *    applying the start ($p_start) and limit parameters ($p_limit)
  *
  * @return array $issuesList
  *    An array of Issue objects
  */
 public static function GetList($p_context_id, $p_order = null, $p_start = 0, $p_limit = 0, &$p_count, $p_skipCache = false)
 {
     global $g_ado_db;
     if (!$p_skipCache && CampCache::IsEnabled()) {
         $paramsArray['parameters'] = serialize($p_parameters);
         $paramsArray['order'] = is_null($p_order) ? 'id desc' : $p_order;
         $paramsArray['start'] = $p_start;
         $paramsArray['limit'] = $p_limit;
         $cacheListObj = new CampCacheList($paramsArray, __METHOD__);
         $issuesList = $cacheListObj->fetchFromCache();
         if ($issuesList !== false && is_array($issuesList)) {
             return $issuesList;
         }
     }
     $returnArray = array();
     $sql = 'SELECT fk_article_no FROM context_articles
             WHERE fk_context_id = ' . $p_context_id . '
             ORDER BY id desc';
     $rows = $g_ado_db->GetAll($sql);
     if (is_array($rows)) {
         foreach ($rows as $row) {
             $returnArray[] = $row['fk_article_no'];
         }
     }
     $p_count = count($returnArray);
     return array_reverse($returnArray);
 }
All Usage Examples Of CampCache::IsEnabled