svn: /phd/trunk/ render.php
| From: | Christian Weiske | Date: | Fri, 30 Oct 2009 14:33:34 +0000 |
| Subject: | svn: /phd/trunk/ render.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5242@lists.php.net to get a copy of this message | ||
cweiske Fri, 30 Oct 2009 14:33:34 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=290076
Log:
fopen(,,true) uses include path - is_readable not!
Revert "use is_readable instead of fopen to test file existence because does not produce
warning and uses less resources"
This reverts commit b293464a9a7850d1ed9cd2aa9fa30d4b45c39606.
Changed paths:
U phd/trunk/render.php
Modified: phd/trunk/render.php
===================================================================
--- phd/trunk/render.php 2009-10-30 14:25:26 UTC (rev 290075)
+++ phd/trunk/render.php 2009-10-30 14:33:34 UTC (rev 290076)
@@ -10,9 +10,10 @@
function autoload($name)
{
$file = __INSTALLDIR__ . DIRECTORY_SEPARATOR . str_replace(array('\\',
'_'), '/', $name) . '.php';
- if (!is_readable($file)) {
+ if (!$fp = fopen($file,'r', true)) {
throw new \Exception('Cannot find file for ' . $name . ': ' . $file);
}
+ fclose($fp);
require $file;
}
spl_autoload_register(__NAMESPACE__ . '\\autoload');