Apache Zeta Components Manual :: File Source for plain.php

Source for file plain.php

Documentation is available at plain.php

  1. <?php
  2. /**
  3.  * File containing the ezcCacheStorageApcPlain class.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @package Cache
  23.  * @version //autogentag//
  24.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25.  * @filesource
  26.  */
  27.  
  28. /**
  29.  * This storage implementation stores data in an APC cache.
  30.  *
  31.  * This storage can also be used with {@link ezcCacheStack}. However, APC
  32.  * version 3.0.16 or newer is required for that.
  33.  *
  34.  * @package Cache
  35.  * @version //autogentag//
  36.  */
  37. {
  38.     /**
  39.      * Fetches data from the cache.
  40.      *
  41.      * @param string $identifier The file to fetch data from
  42.      * @param bool $object return the object and not the clean data
  43.      * @return mixed The fetched data or false on failure
  44.      */
  45.     protected function fetchData$identifier$object false )
  46.     {
  47.         $data $this->backend->fetch$identifier );
  48.         if is_object$data && $object === false )
  49.         {
  50.             return $data->data;
  51.         }
  52.         if is_object$data && $object !== false )
  53.         {
  54.             return $data;
  55.         }
  56.         else
  57.         {
  58.             return false;
  59.         }
  60.     }
  61.  
  62.     /**
  63.      * Wraps the data in an ezcCacheStorageMemoryDataStruct structure in order
  64.      * to store it.
  65.      *
  66.      * @throws ezcCacheInvalidDataException
  67.      *          If the data submitted can not be handled by this storage (resource).
  68.      *
  69.      * @param mixed $data Simple type or array
  70.      * @return ezcCacheStorageMemoryDataStruct Prepared data
  71.      */
  72.     protected function prepareData$data )
  73.     {
  74.         if is_resource$data ) )
  75.         {
  76.             throw new ezcCacheInvalidDataExceptiongettype$data )array'simple''array''object' ) );
  77.         }
  78.         return new ezcCacheStorageMemoryDataStruct$data$this->properties['location');
  79.     }
  80. }
  81. ?>
Documentation generated by phpDocumentor 1.4.3