OpenDir problem

From: Date: Fri, 05 Apr 2002 08:42:33 +0000
Subject: OpenDir problem
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-39@lists.php.net to get a copy of this message
Hi Everybody, Short abstract for readers with little time: Smarty has a problem generating it's internal paths for different operating systems. I had an 'OpenDir' Warning in Smarty.. After I have tracked down the problem now and I would like to discuss it with you and the solution for it The system showed the following warnings: ============================== Debug Warning: smarty\Smarty_Compiler.class.php Zeile 1284 - OpenDir: Invalid argument (errno 22) Debug Warning: smarty\Smarty_Compiler.class.php Zeile 1285 - Supplied argument is not a valid Directory resource Debug Warning: smarty\Smarty_Compiler.class.php Zeile 1305 - Supplied argument is not a valid Directory resource I tried to track down the problem and included some 'echo'. Used code to track down the problem in SMARTY_COMPILER.CLASS.php ===================================================== /*===========================================*\ Function: _load_filters Purpose: load pre- and post-filters \*===========================================*/ function _load_filters() { $plugins_dir = SMARTY_DIR . $this->plugins_dir; echo "<b>smarty_dir</b> ".SMARTY_DIR."<br>"; echo "<b>this->plugins_dir</b> ".$this->plugins_dir."<br>"; echo '<b>$plugins_dir</b> '.$plugins_dir."<br>"; What you get: =========: smarty_dir c:\apache\htdocs\development\includes\smarty/ this->plugins_dir plugins $plugins_dir c:\apache\htdocs\development\includes\smarty/plugins So you can see that by generating 'smarty_dir' a slash instead of an backslash was appended. This caused all my problems. As you can easily derive from c:/apache/... , I am using Smarty in a Windows based development environment. It works fine. The production side will be hosted on a Linux system. Therefore the source code should work on both systems without change. This would be the perfect solution. My question: Is there a variable I can set to influence whether a '/' or a ,\' is appended? Or must there be a change somewhere in the coding? Strange enough: I did not change the default settings and other paths like the templates and templates_c directory are found on the windows environment. Are they generated differently? P.S.: Looking through the mailing list for similar problems, I found an email like 'the config files entries seem to be lost in certain situations'. This could have the same reason (wrong path generation) . Bye manfred

« previous php.smarty.dev (#39) next »