TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-04-2008, 05:28 PM   #1 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default Speed vs Ease of use

I have a tad of a problem, well not a problem more of a fork at the roads and I'd like all yours opinion.

The issue at hand is whether to use __autoload to semi handle my framework or use my own construct function which looks like this


PHP Code:
public function __construct($aClassReject = array()){

            
$inc get_included_files();

            
$dir str_replace('\\','/',dirname(__FILE__));

            for(
$i 0;$i <= count($inc);++$i){

                if(
strstr($inc[$i],'.class.php') and !strstr($inc[$i],'core.class.php')){

                    
$className str_replace(array($dir.'/','.class.php'),'',str_replace('\\','/',$inc[$i]));

                    if(!
in_array($className,$aClassReject)){    

                        
$this->classArray[$className] = (is_array($aClassReject[$className])) ?
                                        new 
$className($aClassReject[$className]) :
                                        new 
$className;    

                    }

                }

                unset(
$className);

            }

            

            

            
//now that all classes are activated...check for their dependancies if any

            
foreach($this->classArray as $key  => $val){

                
$this->__fetchDep($key);

            }

        } 
The issue is with __autoload I'd need to activate the classes first where as with the above function I just include the files.

I hope I'm making sense, I'm just kinda wondering what choice would be the best to go with.
Enfernikus is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:50 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design