error message in importal 1.2.0v

Support for the IM Portal Project

Moderator: Integra Moderator

error message in importal 1.2.0v

PostAuthor: colubragens » Thu Nov 15, 2007 9:19 am

Your phpBB Version: 1.2.0.
phpBB Type: phpBB / IMPortal
MODs: No
Your knowledge: Beginner
Board URL: http://NO%20PUBLIC%20IP%20YET

PHP Version:
MySQL Version:


What was done before the problem appeared?
INSTALLED IM PORTAL


What was done to try to solve the problem?
CHECKED ALL CODE AND REINSTALLED



De.scription and Message

I keep getting the following error in the admin control panel

Warning: opendir(./../var_cache/) [<function>]: failed to open dir: Invalid argument in C:EasyWAMPwwwphpBBincludeslite.php on line 300

this is the code for lite.php
please help when this is fixed i will upgrade to 2.0
thanks
jamie

Code: Select all
<php> directory where to put the cache files (string),     *     'caching' => enable / disable caching (boolean),     *     'lifeTime' => cache lifetime in seconds (int),     *     'fileLocking' => enable / disable fileLocking (boolean),     *     'writeControl' => enable / disable write control (boolean),     *     'readControl' => enable / disable read control (boolean),     *     'readControlType' => type of read control 'crc32', 'md5', 'strlen' (string),     *     'pearErrorMode' => pear error mode (when raiseError is called) (cf PEAR doc) (int),     *     'memoryCaching' => enable / disable memory caching (boolean),     *     'onlyMemoryCaching' => enable / disable only memory caching (boolean),     *     'memoryCachingLimit' => max nbr of records to store into memory caching (int),     *     'fileNameProtection' => enable / disable automatic file name protection (boolean),     *     'automaticSerialization' => enable / disable automatic serialization (boolean)     * );     *     * @param array $options options     * @access public     */     function Cache_Lite($options = array(NULL))     {         $availableOptions = array('automaticSerialization', 'fileNameProtection', 'memoryCaching', 'onlyMemoryCaching', 'memoryCachingLimit', 'cacheDir', 'caching', 'lifeTime', 'fileLocking', 'writeControl', 'readControl', 'readControlType', 'pearErrorMode');         foreach($options as $key => $value) {             if(in_array($key, $availableOptions)) {                 $property = '_'.$key;                 $this->$property = $value;             }         }         $this->_refreshTime = time() - $this->_lifeTime;     }         /**     * Test if a cache is available and (if yes) return it     *     * @param string $id cache id     * @param string $group name of the cache group     * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested     * @return string data of the cache (or false if no cache available)     * @access public     */     function get($id, $lifetime=3600, $group = 'default', $doNotTestCacheValidity = false)     {       $this->setLifeTime($lifetime);         $this->_id = $id;         $this->_group = $group;         $data = false;         if ($this->_caching) {             $this->_setFileName($id, $group);             if ($doNotTestCacheValidity) {                 if (file_exists($this->_file)) {                     $data = $this->_read();                 }             } else {                 if (@filemtime($this->_file) > $this->_refreshTime) {                     $data = $this->_read();                 }             }             if (($this->_automaticSerialization) and (is_string($data))) {                 $data = unserialize($data);             }             return $data;         }         return false;     }         /**     * Save some data in a cache file     *     * @param string $data data to put in cache (can be another type than strings if automaticSerialization is on)     * @param string $id cache id     * @param string $group name of the cache group     * @return boolean true if no problem     * @access public     */     function save($data, $id = NULL, $group = 'default')     {         if ($this->_caching) {             if ($this->_automaticSerialization) {             $data = serialize($data);             }             if (isset($id)) {                 $this->_setFileName($id, $group);             }             if ($this->_writeControl) {                 if (!$this->_writeAndControl($data)) {                     @touch($this->_file, time() - 2*abs($this->_lifeTime));                     return false;                 } else {                     return true;                 }             } else {                 return $this->_write($data);             }         }         return false;     }       /**     * Remove a cache file     *     * @param string $id cache id     * @param string $group name of the cache group     * @return boolean true if no problem     * @access public     */     function remove($id, $group = 'default')     {         $this->_setFileName($id, $group);         if (!@unlink($this->_file)) {             $this->raiseError('Cache_Lite : Unable to remove cache !', -3);                 return false;         }         return true;     }       /**     * Clean the cache     *     * if no group is specified all cache files will be destroyed     * else only cache files of the specified group will be destroyed     *     * @param string $group name of the cache group     * @return boolean true if no problem     * @access public     */     function clean($group = false)           {         if ($this->_fileNameProtection) {             $motif = ($group) ? 'cache_'.md5($group).'_' : 'cache_';         } else {             $motif = ($group) ? 'cache_'.$group.'_' : 'cache_';         }         if (!($dh = opendir($this->_cacheDir))) {             $this->raiseError('Cache_Lite : Unable to open cache directory !', -4);             return false;         }         while ($file = readdir($dh)) {             if (($file != '.') && ($file != '..')) {                 $file = $this->_cacheDir . $file;                 if (is_file($file)) {                     if (strpos($file, $motif, 0)) {                         if (!@unlink($file)) {                             $this->raiseError('Cache_Lite : Unable to remove cache !', -3);                             return false;                         }                     }                 }             }         }         return true;     }         /**     * Set to debug mode     *     * When an error is found, the .script will stop and the message will be displayed     * (in debug mode only).     *     * @access public     */     function setToDebug()     {         $this->_pearErrorMode = CACHE_LITE_ERROR_DIE;     }       /**     * Set a new life time     *     * @param int $newLifeTime new life time (in seconds)     * @access public     */     function setLifeTime($newLifeTime)     {         $this->_lifeTime = $newLifeTime;         $this->_refreshTime = time() - $newLifeTime;     }       /**     * Return the cache last modification time     *     * BE CAREFUL : THIS METHOD IS FOR HACKING ONLY !     *     * @return int last modification time     */     function lastModified() {         return filemtime($this->_file);     }         /**     * Trigger a PEAR error     *     * To improve performances, the PEAR.php file is included dynamically.     * The file is so included only when an error is triggered. So, in most     * cases, the file isn't included and perfs are much better.     *     * @param string $msg error message     * @param int $code error code     * @access public     */     function raiseError($msg, $code)     {        // include_once('PEAR.php');        // PEAR::raiseError($msg, $code, $this->_pearErrorMode);     }       // --- Private methods ---       /**     * Make a file name (with path)     *     * @param string $id cache id     * @param string $group name of the group     * @access private     */     function _setFileName($id, $group)     {         if ($this->_fileNameProtection) {             $this->_file = ($this->_cacheDir.'cache_'.md5($group).'_'.md5($id));         } else {             $this->_file = $this->_cacheDir.'cache_'.$group.'_'.$id;         }     }         /**     * Read the cache file and return the content     *     * @return string content of the cache file     * @access private     */     function _read()     {         $fp = @fopen($this->_file, "rb");         if ($this->_fileLocking) @flock($fp, LOCK_SH);         if ($fp) {             clearstatcache(); // because the filesize can be cached by PHP itself...             $length = @filesize($this->_file);             $mqr = get_magic_quotes_runtime();             set_magic_quotes_runtime(0);             if ($this->_readControl) {                 $hashControl = @fread($fp, 32);                 $length = $length - 32;             }             $data = @fread($fp, $length);             set_magic_quotes_runtime($mqr);             if ($this->_fileLocking) @flock($fp, LOCK_UN);             @fclose($fp);             if ($this->_readControl) {                 $hashData = $this->_hash($data, $this->_readControlType);                 if ($hashData != $hashControl) {                     @touch($this->_file, time() - 2*abs($this->_lifeTime));                     return false;                 }             }             return $data;         }         $this->raiseError('Cache_Lite : Unable to read cache !', -2);             return false;     }         /**     * Write the given data in the cache file     *     * @param string $data data to put in cache     * @return boolean true if ok     * @access private     */     function _write($data)     {         $fp = @fopen($this->_file, "wb");         if ($fp) {             if ($this->_fileLocking) @flock($fp, LOCK_EX);             if ($this->_readControl) {                 @fwrite($fp, $this->_hash($data, $this->_readControlType), 32);             }             $len = strlen($data);             @fwrite($fp, $data, $len);             if ($this->_fileLocking) @flock($fp, LOCK_UN);             @fclose($fp);             return true;         }         $this->raiseError('Cache_Lite : Unable to write cache !', -1);         return false;     }         /**     * Write the given data in the cache file and control it just after to avoir corrupted cache entries     *     * @param string $data data to put in cache     * @return boolean true if the test is ok     * @access private     */     function _writeAndControl($data)     {         $this->_write($data);         $dataRead = $this->_read($data);         return ($dataRead==$data);     }         /**     * Make a control key with the string containing datas     *     * @param string $data data     * @param string $controlType type of control 'md5', 'crc32' or 'strlen'     * @return string control key     * @access private     */     function _hash($data, $controlType)     {         switch ($controlType) {         case 'md5':             return md5($data);         case 'crc32':             return sprintf('% 32d', crc32($data));         case 'strlen':             return sprintf('% 32d', strlen($data));         default:             $this->raiseError('Unknown controlType ! (available values are only 'md5', 'crc32', 'strlen')', -5);         }     }     }  ?>
Last edited by colubragens on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

colubragens
Newbie
Newbie
 
Posts: 1
Likes: 0 post
Liked in: 0 post
Joined: Thu Nov 15, 2007 8:59 am
Cash on hand: 0.00

Re: error message in importal 1.2.0v

PostAuthor: Helter » Sun Nov 18, 2007 12:44 pm

have you chmod'd forum root/var_cache to 777? this folder needs to be writtable
Last edited by Helter on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Always use Protection
Image


Please do not PM for support
User avatar
Helter
Administrator
Administrator
 
Posts: 4168
Likes: 0 post
Liked in: 0 post
Images: 0
Joined: Sat Mar 11, 2006 3:46 pm
Cash on hand: 187.60
Location: Seattle Wa
IntegraMOD version: IM 3


Return to IM Portal Support Forum

Who is online

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]