[limb-svn] r5967 - in 3.x/trunk/limb/core: . tests/cases
svn at limb-project.com
svn at limb-project.com
Fri Jun 8 14:00:14 MSD 2007
Author: pachanga
Date: 2007-06-08 14:00:14 +0400 (Fri, 08 Jun 2007)
New Revision: 5967
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5967
Modified:
3.x/trunk/limb/core/common.inc.php
3.x/trunk/limb/core/tests/cases/lmbRequireTest.class.php
Log:
-- lmb_require_optional quick fix + test
Modified: 3.x/trunk/limb/core/common.inc.php
===================================================================
--- 3.x/trunk/limb/core/common.inc.php 2007-06-08 09:54:46 UTC (rev 5966)
+++ 3.x/trunk/limb/core/common.inc.php 2007-06-08 10:00:14 UTC (rev 5967)
@@ -74,7 +74,7 @@
if(strpos($file_path, '*') !== false)
{
foreach(lmb_glob($file_path) as $path)
- lmb_require($path);
+ lmb_require($path, $optional);
return;
}
@@ -106,7 +106,7 @@
function lmb_require_optional($file_path)
{
- lmb_require('limb/dbal/common.inc.php', true);
+ lmb_require($file_path, true);
}
function lmb_autoload($name)
Modified: 3.x/trunk/limb/core/tests/cases/lmbRequireTest.class.php
===================================================================
--- 3.x/trunk/limb/core/tests/cases/lmbRequireTest.class.php 2007-06-08 09:54:46 UTC (rev 5966)
+++ 3.x/trunk/limb/core/tests/cases/lmbRequireTest.class.php 2007-06-08 10:00:14 UTC (rev 5967)
@@ -154,6 +154,16 @@
lmb_require($file = 'foo_' . mt_rand() . '.inc.php', true);
}
+ function testRequireOptional()
+ {
+ $name = $this->_rndName();
+ $path = $this->_writeModule("$name.class.php", "<?php \$foo = new $name(); class $name {} ?>");
+
+ lmb_require_optional($path);
+
+ $foo = new $name();
+ }
+
function _locateIncludeOnceLine($file, $start_line)
{
$c = 0;
More information about the limb-svn
mailing list