original_string: function _write($data)
      {
          if ($this->_hashedDirectoryLevel > 0) {
              $hash = md5($this->_fileName);
              $root = $this->_cacheDir;
              for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) {
                  $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/';
                  if (!(@is_dir($root))) {
  					if (@mkdir($root))
  					{
  						@chmod($root, $this->_hashedDirectoryUmask);
  						if (! is_null($this->_hashedDirectoryGroup))
  							@chgrp($root, $this->_hashedDirectoryGroup);
  					}
                  }
              }
          }
  		// if both _cacheFileMode and _cacheFileGroup is null, then we don't need to call
  		// file_exists (see below: if ($is_newfile) ...)
  		$is_newfile = (! is_null($this->_cacheFileMode) || !is_null($this->_cacheFileGroup)) 
  			&& ! @file_exists($this->_file);
          $fp = @fopen($this->_file, "wb");
          if ($fp) {
              if ($this->_fileLocking) @flock($fp, LOCK_EX);
  			if ($is_newfile)
  			{
  				if (! is_null($this->_cacheFileMode))
  					@chmod($this->_file, $this->_cacheFileMode);
  				if (! is_null($this->_cacheFileGroup))
  					@chgrp($this->_file, $this->_cacheFileGroup);
  			}
              if ($this->_readControl) {
                  @fwrite($fp, $this->_hash($data, $this->_readControlType), 32);
              }
              $mqr = get_magic_quotes_runtime();
              if ($mqr) {
                  set_magic_quotes_runtime(0);
              }
              @fwrite($fp, $data);
              if ($mqr) {
                  set_magic_quotes_runtime($mqr);
              }
              if ($this->_fileLocking) @flock($fp, LOCK_UN);
              @fclose($fp);
              return true;
          }      
          return $this->raiseError('Cache_Lite : Unable to write cache file : '.$this->_file, -1);
      }
code: function _write($data)
      {
          if ($this->_hashedDirectoryLevel > 0) {
              $hash = md5($this->_fileName);
              $root = $this->_cacheDir;
              for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) {
                  $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/';
                  if (!(@is_dir($root))) {
  					if (@mkdir($root))
  					{
  						@chmod($root, $this->_hashedDirectoryUmask);
  						if (! is_null($this->_hashedDirectoryGroup))
  							@chgrp($root, $this->_hashedDirectoryGroup);
  					}
                  }
              }
          }
  		// if both _cacheFileMode and _cacheFileGroup is null, then we don't need to call
  		// file_exists (see below: if ($is_newfile) ...)
  		$is_newfile = (! is_null($this->_cacheFileMode) || !is_null($this->_cacheFileGroup)) 
  			&& ! @file_exists($this->_file);
          $fp = @fopen($this->_file, "wb");
          if ($fp) {
              if ($this->_fileLocking) @flock($fp, LOCK_EX);
  			if ($is_newfile)
  			{
  				if (! is_null($this->_cacheFileMode))
  					@chmod($this->_file, $this->_cacheFileMode);
  				if (! is_null($this->_cacheFileGroup))
  					@chgrp($this->_file, $this->_cacheFileGroup);
  			}
              if ($this->_readControl) {
                  @fwrite($fp, $this->_hash($data, $this->_readControlType), 32);
              }
              $mqr = get_magic_quotes_runtime();
              if ($mqr) {
                  set_magic_quotes_runtime(0);
              }
              @fwrite($fp, $data);
              if ($mqr) {
                  set_magic_quotes_runtime($mqr);
              }
              if ($this->_fileLocking) @flock($fp, LOCK_UN);
              @fclose($fp);
              return true;
          }      
          return $this->raiseError('Cache_Lite : Unable to write cache file : '.$this->_file, -1);
      }
code_tokens: function _write ( $ data ) { if ( $ this -> _hashedDirectoryLevel > 0 ) { $ hash = md5 ( $ this -> _fileName ) ; $ root = $ this -> _cacheDir ; for ( $ i = 0 ; $ i < $ this -> _hashedDirectoryLevel ; $ i ++ ) { $ root = $ root . 'cache_' . substr ( $ hash , 0 , $ i + 1 ) . '/' ; if ( ! ( @ is_dir ( $ root ) ) ) { if ( @ mkdir ( $ root ) ) { @ chmod ( $ root , $ this -> _hashedDirectoryUmask ) ; if ( ! is_null ( $ this -> _hashedDirectoryGroup ) ) @ chgrp ( $ root , $ this -> _hashedDirectoryGroup ) ; } } } } // if both _cacheFileMode and _cacheFileGroup is null, then we don't need to call // file_exists (see below: if ($is_newfile) ...) $ is_newfile = ( ! is_null ( $ this -> _cacheFileMode ) || ! is_null ( $ this -> _cacheFileGroup ) ) && ! @ file_exists ( $ this -> _file ) ; $ fp = @ fopen ( $ this -> _file , "wb" ) ; if ( $ fp ) { if ( $ this -> _fileLocking ) @ flock ( $ fp , LOCK_EX ) ; if ( $ is_newfile ) { if ( ! is_null ( $ this -> _cacheFileMode ) ) @ chmod ( $ this -> _file , $ this -> _cacheFileMode ) ; if ( ! is_null ( $ this -> _cacheFileGroup ) ) @ chgrp ( $ this -> _file , $ this -> _cacheFileGroup ) ; } if ( $ this -> _readControl ) { @ fwrite ( $ fp , $ this -> _hash ( $ data , $ this -> _readControlType ) , 32 ) ; } $ mqr = get_magic_quotes_runtime ( ) ; if ( $ mqr ) { set_magic_quotes_runtime ( 0 ) ; } @ fwrite ( $ fp , $ data ) ; if ( $ mqr ) { set_magic_quotes_runtime ( $ mqr ) ; } if ( $ this -> _fileLocking ) @ flock ( $ fp , LOCK_UN ) ; @ fclose ( $ fp ) ; return true ; } return $ this -> raiseError ( 'Cache_Lite : Unable to write cache file : ' . $ this -> _file , - 1 ) ; }
docstring: Write the given data in the cache file
  
  @param string $data data to put in cache
  @return boolean true if ok (a PEAR_Error object else)
  @access private
docstring_tokens: Write the given data in the cache file