original_string: public function store( $id, $data, $attributes = array() )
      {
          // Generates the identifier
          $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes );
  
          // Purges the Registry Cache
          if ( isset( $this->registry[$filename] ) )
          {
              unset( $this->registry[$filename] );
          }
  
          // Deletes the files if it already exists on the filesystem
          if ( file_exists( $filename ) )
          {
              if ( unlink( $filename ) === false )
              {
                  throw new ezcBaseFilePermissionException( $filename, ezcBaseFileException::WRITE, 'Could not delete existing cache file.' );
              }
          }
  
          // Deletes the data from APC if it already exists
          $this->backend->delete( $filename );
  
          // Prepares the data for filesystem storage
          $dataStr = $this->prepareData( $data );
  
          // Tries to create the directory on the filesystem
          $dirname = dirname( $filename );
          if ( !is_dir( $dirname )
               && !mkdir( $dirname, 0777, true ) )
          {
              throw new ezcBaseFilePermissionException( $dirname, ezcBaseFileException::WRITE, 'Could not create directory to store cache file.' );
          }
  
          // Tries to write the file the filesystem
          if ( @file_put_contents( $filename, $dataStr ) !== strlen( $dataStr ) )
          {
              throw new ezcBaseFileIoException( $filename, ezcBaseFileException::WRITE, 'Could not write data to cache file.' );
          }
  
          // Tries to set the file permissions
          if ( ezcBaseFeatures::os() !== "Windows" )
          {
              chmod( $filename, $this->options->permissions );
          }
  
          // Prepares the data for APC storage
          $dataObj = $this->prepareData( $data, true );
          $dataObj->mtime = @filemtime( $filename );
          $dataObj->atime = time();
  
          // Stores it in APC
          $this->registerIdentifier( $id, $attributes, $filename );
          if ( !$this->backend->store( $filename, $dataObj, $this->properties['options']['ttl'] ) )
          {
              throw new ezcCacheApcException( "APC store failed." );
          }
  
          // Returns the ID for no good reason
          return $id;
      }
code: public function store( $id, $data, $attributes = array() )
      {
          // Generates the identifier
          $filename = $this->properties['location'] . $this->generateIdentifier( $id, $attributes );
  
          // Purges the Registry Cache
          if ( isset( $this->registry[$filename] ) )
          {
              unset( $this->registry[$filename] );
          }
  
          // Deletes the files if it already exists on the filesystem
          if ( file_exists( $filename ) )
          {
              if ( unlink( $filename ) === false )
              {
                  throw new ezcBaseFilePermissionException( $filename, ezcBaseFileException::WRITE, 'Could not delete existing cache file.' );
              }
          }
  
          // Deletes the data from APC if it already exists
          $this->backend->delete( $filename );
  
          // Prepares the data for filesystem storage
          $dataStr = $this->prepareData( $data );
  
          // Tries to create the directory on the filesystem
          $dirname = dirname( $filename );
          if ( !is_dir( $dirname )
               && !mkdir( $dirname, 0777, true ) )
          {
              throw new ezcBaseFilePermissionException( $dirname, ezcBaseFileException::WRITE, 'Could not create directory to store cache file.' );
          }
  
          // Tries to write the file the filesystem
          if ( @file_put_contents( $filename, $dataStr ) !== strlen( $dataStr ) )
          {
              throw new ezcBaseFileIoException( $filename, ezcBaseFileException::WRITE, 'Could not write data to cache file.' );
          }
  
          // Tries to set the file permissions
          if ( ezcBaseFeatures::os() !== "Windows" )
          {
              chmod( $filename, $this->options->permissions );
          }
  
          // Prepares the data for APC storage
          $dataObj = $this->prepareData( $data, true );
          $dataObj->mtime = @filemtime( $filename );
          $dataObj->atime = time();
  
          // Stores it in APC
          $this->registerIdentifier( $id, $attributes, $filename );
          if ( !$this->backend->store( $filename, $dataObj, $this->properties['options']['ttl'] ) )
          {
              throw new ezcCacheApcException( "APC store failed." );
          }
  
          // Returns the ID for no good reason
          return $id;
      }
code_tokens: public function store ( $ id , $ data , $ attributes = array ( ) ) { // Generates the identifier $ filename = $ this -> properties [ 'location' ] . $ this -> generateIdentifier ( $ id , $ attributes ) ; // Purges the Registry Cache if ( isset ( $ this -> registry [ $ filename ] ) ) { unset ( $ this -> registry [ $ filename ] ) ; } // Deletes the files if it already exists on the filesystem if ( file_exists ( $ filename ) ) { if ( unlink ( $ filename ) === false ) { throw new ezcBaseFilePermissionException ( $ filename , ezcBaseFileException :: WRITE , 'Could not delete existing cache file.' ) ; } } // Deletes the data from APC if it already exists $ this -> backend -> delete ( $ filename ) ; // Prepares the data for filesystem storage $ dataStr = $ this -> prepareData ( $ data ) ; // Tries to create the directory on the filesystem $ dirname = dirname ( $ filename ) ; if ( ! is_dir ( $ dirname ) && ! mkdir ( $ dirname , 0777 , true ) ) { throw new ezcBaseFilePermissionException ( $ dirname , ezcBaseFileException :: WRITE , 'Could not create directory to store cache file.' ) ; } // Tries to write the file the filesystem if ( @ file_put_contents ( $ filename , $ dataStr ) !== strlen ( $ dataStr ) ) { throw new ezcBaseFileIoException ( $ filename , ezcBaseFileException :: WRITE , 'Could not write data to cache file.' ) ; } // Tries to set the file permissions if ( ezcBaseFeatures :: os ( ) !== "Windows" ) { chmod ( $ filename , $ this -> options -> permissions ) ; } // Prepares the data for APC storage $ dataObj = $ this -> prepareData ( $ data , true ) ; $ dataObj -> mtime = @ filemtime ( $ filename ) ; $ dataObj -> atime = time ( ) ; // Stores it in APC $ this -> registerIdentifier ( $ id , $ attributes , $ filename ) ; if ( ! $ this -> backend -> store ( $ filename , $ dataObj , $ this -> properties [ 'options' ] [ 'ttl' ] ) ) { throw new ezcCacheApcException ( "APC store failed." ) ; } // Returns the ID for no good reason return $ id ; }
docstring: Stores data to the cache storage.
  
  @throws ezcBaseFilePermissionException
  If the directory to store the cache file could not be created.
  This exception means most likely that your cache directory
  has been corrupted by external influences (file permission
  change).
  @throws ezcBaseFileIoException
  If an error occured while writing the data to the cache. If this
  exception occurs, a serious error occured and your storage might
  be corruped (e.g. broken network connection, file system broken,
  ...).
  @throws ezcCacheInvalidDataException
  If the data submitted can not be handled by the implementation
  of {@link ezcCacheStorageFile}. Most implementations can not
  handle objects and resources.
  @throws ezcCacheApcException
  If the data could not be stored in APC.
  
  @param string $id Unique identifier
  @param mixed $data The data to store
  @param array(string=>string) $attributes Attributes describing the cached data
  @return string The ID string of the newly cached data
docstring_tokens: Stores data to the cache storage .