Yii Framework Forum: Including Zend - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Including Zend having trouble to include Zend Libs the way others do Rate Topic: -----

#1 User is offline   as_lh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 05-January 10

Posted 15 February 2010 - 04:41 AM

Hi,

i try to use the Zend XmlRPC Client so i did put the Libs in a folder called "Zend" in the vendors folder in my core yii installation. Then i used the following code as i found it many times on the web:
Yii::import('application.vendors.*');
require_once 'Zend/XmlRpc/Client.php';


Still yii replys:
require_once(/Zend/XmlRpc/Client.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory


Any idea what i could have done wrong?
0

#2 User is offline   as_lh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 05-January 10

Posted 15 February 2010 - 06:45 AM

Okay, i did add an include path to the php.ini file
; UNIX: "/path1:/path2"  
include_path = ".:/Applications/MAMP/bin/php5/lib/php:/Users/as/Sites/yii/framework/vendors/"

And now the Client.php is included by yii but it gives the following Error:
include(Zend_Uri_Http.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

But that file does exist exactly where it should.
Anyone any experience with this?
Any good ideas?
0

#3 User is offline   as_lh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 05-January 10

Posted 15 February 2010 - 07:47 AM

Though i haven't figured it out yet, it seems to be related to the autoloader.
require works but the Zend autoloader doesn't.

#0 /Users/as/Sites/yii/framework/YiiBase.php(338): autoload()
#1 unknown(0): autoload()
#2 unknown(0): spl_autoload_call()
#3 /Users/as/Sites/yii/framework/vendors/Zend/Uri.php(125): class_exists()
#4 /Users/as/Sites/yii/framework/vendors/Zend/Http/Client.php(268): factory()
#5 /Users/as/Sites/yii/framework/vendors/Zend/XmlRpc/Client.php(266): Zend_Http_Client->setUri()
[...]


in Zend/Uri.php the Line 125 to 128 go:
if (!class_exists($className))
    require_once 'Zend/Loader.php';
    Zend_Loader::loadClass($className);
}


Also the Zend Loader uses "include" instead of "require" though i can't see where that should be the problem.
include should use the include path set in the php.ini as well right?

Anyone any ideas?
0

#4 User is offline   basva 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 19-August 09

Posted 16 February 2010 - 07:27 AM

Hi,

Not sure if any help, but for the PHPExcel classes I used something like this:

spl_autoload_unregister(array('YiiBase','autoload'));
require_once('PHPExcel/IOFactory.php');
...doing stuff with PHPExcel...
spl_autoload_register(array('YiiBase','autoload'));


That way it could register the autoload from PHPExcel....

Bas
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users