Andi Gutmans wrote:
> Hi Ralf and all,
>
> Bill and I spent some time reviewing all the proposals and also
> brainstorming on what we think is right for Zend Framework. Our
> suggestion is very close to what Ralf is suggesting but with a few
> minor tweaks.
Good to see movement on this issue :)
> Breaking them each out into separate classes
> and files would probably lead to a real performance hit and would
> require people to require_once() all those components over and over
> again (which would also be a PITA).
I don't understand the "real performance hit". Could you elaborate?
I'd also be interested to see use-cases that show people having to
require_once() "over and over again" too. With autoload you just need to:
require('Zend/Loader.php');
spl_autoload_register(array('Zend_Loader', 'loadClass'));
If you don't want to autoload, then you care about performance to such a
degree that you probably only want to require the exact classes you need
when you need them and will manage that accordingly.
> library/Zend/Core.php:
> ----------------------
>
> class Zend_Registry {
> static public function register($index, $newval) null);
> static public function registry($index = null);
> static public function isRegistered($index);
> static public function initRegistry($registry = 'Zend_Registry');
> static public function __unsetRegistry();
> }
I don't see the registry as core functionality unless another component
relies on it?
Also we already have a Zend/Registry.php containing Zend_Registry. If a
static interface is required for the registry, then we may as well just
add it to the current class.
> class Zend_Loader {
> static public function loadClass($class, $dirs = null);
> static public function loadFile($filename, $dirs = null, $once = false);
> static public function isReadable($filename);
> }
I can see the argument that this is core as other components rely on it.
> class Zend_Framework {
> static public function compareVersion($version)
> const VERSION = '0.8.0dev';
> }
>
I can see the argument for the VERSION const. I'm not 100% sure that
it's core, but can live with it.
I don't think Zend_Framework is a good class name though. Zend_Version
or Zend_FrameworkVersion would at least stop me thinking the class was
actually a Framework in itself. I'm easy on this though.
> class Zend_Exception { ... }
Not core. It's not in Zend.php at the moment and seems to load itself
when needed.
> // Could live with the following outside of Core.php but it's so small
> it really isn't a big deal to keep it for convenience
> class Zend_Debug {
> static public function dump($var, $label=null, $echo=true)
> }
Definitely not core. This will limit our ability to put in a more "fully
featured" Zend/Debug.php at a later date. Better to do that now and put
this class in its own file.
Regards,
Rob...