Invenzzia »

Pages: [1]   Go Down
  Print  
Author Topic: OPL: Opl_Loader::load() doesn't return false  (Read 353 times)
Description: If class file doesn't exist and file check file is turned off
0 Members and 2 Guests are viewing this topic.
whumble
User

Offline Offline

Posts: 10


View Profile
« on: October 24, 2010, 06:54:39 »

In load() documentation it should be added that
load() will halt execution (and not return false!!!)
if file doesn't exist and checking was not enabled with
setCheckFileExists(true) call.



Logged
whumble
User

Offline Offline

Posts: 10


View Profile
« Reply #1 on: October 24, 2010, 07:07:30 »

By the way, for performance considerations
you could use is_file() instead of file_exists()
in the following snippet of Opl_Loader::autoload()

Code:
if(self::$_fileCheck == true && !file_exists($file))
{
return true;
}

And it seems that it should be return false;,
otherwise it won't return false even after file check.
« Last Edit: October 24, 2010, 07:18:04 by whumble » Logged
Zyx
Your programmer
Administrator
User
*****
Offline Offline

Posts: 291



View Profile WWW
« Reply #2 on: October 24, 2010, 08:11:34 »

File checking should be enabled for debug purposes only, where the performance plays no significant role.

Anyway, the autoloader has been rewritten from scratch in OPL 2.1 - it is much simpler, faster, easy-to-use, and supports PHP 5.3 namespaces.
Logged

PozDrX, Zyx
---Invenzzia group---
Pages: [1]   Go Up
  Print  
 
Jump to:  

Subject Started by Replies Views Last post
Pomóż promować projekty Invenzzii! Zyx 3 1248 Last post March 05, 2009, 14:16:47
by megaweb
OPT:selectComponent pawlusss 3 1438 Last post April 25, 2008, 08:13:03
by Zyx
abercrombie outlet, seismic design and construction of hard galardef 0 11 Last post May 08, 2012, 03:33:21
by galardef
abercrombie sito ufficiale, galardef 0 84 Last post April 01, 2012, 06:33:01
by galardef
OPTv2: Gdzie mam błąd? - Sekcje hash 8 2032 Last post June 08, 2008, 05:34:47
by hash