Add a zend_initialize($class) function to load a Zend Framework class....

zend_initialize(Zend_Gdata);
// loads zend_include('Zend/Gdata.php');

Comments

robloach’s picture

mustafau’s picture

My suggestion for zend_initialize:

 function zend_initialize($class) {
  zend_require('Zend/Loader.php');
  
  try {
    Zend_Loader::loadClass($class);
  }
  catch (Zend_Feed_Exception $e) {
    return FALSE;
  }
  
  return TRUE;
} 
robloach’s picture

mustafau’s picture

Zend_Feed_Exception should be Zend_Exception. Sorry for the mistake.

Also I vote for changing this functions name to zend_loader().

robloach’s picture

Assigned: Unassigned » robloach
Status: Fixed » Reviewed & tested by the community

Sounds good to me. Would you like CVS write access to stick it into both 5.x and 6.x branches? Or shall I put this in?

robloach’s picture

Priority: Normal » Critical

I believe if we change it to zend_loader, we end up with a naming conflict between the class (Zend_Loader), and the function (zend_loader). Therefore, the only change that can go in is Zend_Feed_Exception to Zend_Exception.

robloach’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
robloach’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.