class loader

1 view
Skip to first unread message

Beau Simensen

unread,
Oct 15, 2010, 2:58:52 PM10/15/10
to substr...@googlegroups.com
hi aek,

what was the class loader you are using? i want to minimize dependencies on third party libraries as much as possible but i want to make sure that the system is extremely flexible and meets the needs of someone wanting to use whatever technology they like/want/need to use.

right now neither halo nor substrate have any hard third party dependancies outside of stuff i've written and control. (substrate, halo, skittle (not really required, but halo will not function out of the box without it), dd-configuration-php, dd-logging-php) i would like to keep it that way, but i would also like to be able to make it easy for you to use the class loader/path manager you prefer if at all possible.

if you can send me your bootstrapping process, the name of your preferred class auto loader and any implementation of how you had to tweak it and/or substrate and halo to get it to work, i can start looking at how i can make it easier for you to integrate w/ the new code.


--

Beau D. Simensen


Dragonfly Development Inc
http://dflydev.com/

aek

unread,
Oct 18, 2010, 1:04:24 PM10/18/10
to Substrate General Discussion
This is my bootsrap proccess and uploaded at:
http://gist.github.com/632575
When a class need to be loaded the function __autoload in the file
Classloader.php will search it and cache it for me. There is no need
for require_once anymore, and works ok with halo, substrate, and
repose.

Beau Simensen

unread,
Oct 18, 2010, 1:06:50 PM10/18/10
to substr...@googlegroups.com
OK, I won't worry about this particular auto loader.

Out of curiosity, do you know when that kicks in? Does it kick in for "class_exists()" calls, or once new() is called?



--

Beau D. Simensen


Dragonfly Development Inc
http://dflydev.com/



--
You received this message because you are subscribed to the Google Groups "Substrate General Discussion" group.
To post to this group, send email to substr...@googlegroups.com.
To unsubscribe from this group, send email to substrate-ph...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/substrate-php?hl=en.


aek

unread,
Oct 18, 2010, 3:52:31 PM10/18/10
to Substrate General Discussion
> Out of curiosity, do you know when that kicks in? Does it kick in for
> "class_exists()" calls, or once new() is called?

This is the your last opportunity in PHP to load a class that need to
be used and it's not include it, before an error is raised. PHP call
this function if the class are not loaded yet and there is no explicit
way to load the class.

Beau Simensen

unread,
Oct 18, 2010, 3:56:03 PM10/18/10
to substr...@googlegroups.com
Interesting. OK. In this case Substrate default class loader might actually be worse for you than not. I will create a NULL class loader for you and make sure to show you how to enable it. :) That way when Substrate tries to load a class it will just return immediately instead of trying to do the default path search for every class.



--

Beau D. Simensen


Dragonfly Development Inc
http://dflydev.com/



--

aek

unread,
Oct 19, 2010, 9:08:18 AM10/19/10
to Substrate General Discussion
that's very useful for performance tweeks
Reply all
Reply to author
Forward
0 new messages