Zend framework and Qcodo

thread: 12 messages  |  last: a year ago  |  started: tuesday, december 4, 2007, 11:48 pm pst


#1  |  Riccardo Tacconi (Leamington Spa, UK) United Kingdom
Tuesday, December 4, 2007, 11:48 PM PST

Hi,

I am thinking to test the Zend framework. We can use ZF for acl, pdf creation and many other things. I think that the directory, Zend, it only need to be included in the configuration file as _ZEND_ constant. So, on request, we can include the framework where it is needed.

#2  |  Gelmar (Saint Louis, MO) United States of America
Friday, December 21, 2007, 9:54 AM PST

rtacconi,
have you been able to implement this? Please let me know. I am interested in using some Zend components in my Qcodo application (like the zend_PDF).
Thanks,

#3  |  Riccardo Tacconi (Leamington Spa, UK) United Kingdom
Friday, December 21, 2007, 10:23 AM PST

I had not enough the time. However I will try. What I needed is just a simple way to include the framework in qcodo. Then, when it is included, classes form ZF can be used.

#4  |  Gelmar (Saint Louis, MO) United States of America
Friday, December 21, 2007, 10:59 AM PST

that's exactly all I am trying to accomplish. A simple way to include Zend framwework classes into QCodo. I will try to look into it as well. Let's share what we find. Thanks

#5  |  Riccardo Tacconi (Leamington Spa, UK) United Kingdom
Friday, December 21, 2007, 1:25 PM PST

I have defined a _ZEND_ constant:

define('__ZEND__', _INCLUDES_ . '/Zend');

in configuration.inc.php

and copied the Zend folder into the includes dir of Qcodo. But the ZF needs to be in the include_path. But I don't know how to do it. I have tried:

set_include_path(get_include_path() . PATH_SEPARATOR . _ZEND_);    

without success :-(

#6  |  Riccardo Tacconi (Leamington Spa, UK) United Kingdom
Friday, December 21, 2007, 1:32 PM PST

Put this in configuration.inc.php:

define('__ZEND__', __INCLUDES__ . '/Zend');
set_include_path(get_include_path() . PATH_SEPARATOR . __INCLUDES__);

It works, I do not have any notice/warning/error.

Or even better:

define('__ZEND__', __INCLUDES__ . '/Zend');
if (is_dir(__ZEND__))
    set_include_path(get_include_path() . PATH_SEPARATOR . __INCLUDES__);

Then you can call try to include a class in a file after the prepend.inc.php

require(__ZEND__ . '/Pdf.php');
$pdf1 = new Zend_Pdf();

The new object will be created without problems.

#7  |  Gelmar (Saint Louis, MO) United States of America
Friday, December 21, 2007, 2:12 PM PST

rtacconi!! this is sweet....I will give it a try....thanx!!!

#8  |  phpcoder India
Monday, May 17, 2010, 10:16 PM PDT

I did same thing with Date object but I am getting some errors
-----------
require_once(Zend/Date/DateObject.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory
Exception Type:   E_WARNING

Rendered Page:   Click here to view contents able to be rendered

Source File:   C:\wamp\www\QCODO\includes\Zend\Date.php     Line:   25

Line 20:     */
Line 21:    
Line 22:    /**
Line 23:     * Include needed Date classes
Line 24:     */
Line 25:    require_once 'Zend/Date/DateObject.php';
Line 26:    require_once 'Zend/Locale.php';
Line 27:    require_once 'Zend/Locale/Format.php';
Line 28:    require_once 'Zend/Locale/Math.php';
Line 29:    
Line 30:    /**


Call Stack:

#0 C:\wamp\www\QCODO\includes\qcodo\_core\framework\_functions.inc.php(21): QErrorHandler::HandleError()
#1 C:\wamp\www\QCODO\includes\Zend\Date.php(25): __qcodo_handle_error()
#2 C:\wamp\www\QCODO\includes\Zend\Date.php(25): require_once()
#3 C:\wamp\www\QCODO\www\sample.php(11): require()

-------------



I am using qcodo stable build and sample database, downloaded Zend using qcodo API and set the zend path in configuration.inc.php
define ('__ZEND__', _INCLUDES_ . '/Zend');
if (is_dir(_ZEND_))    
{
   set_include_path(get_include_path() . PATH_SEPARATOR . _INCLUDES_);
}

in sample.php
----------------
if( is_dir(_ZEND_))
   require(_ZEND_ . '/Date.php');

$dtDate = new Zend_Date();



is anything I am missing ???

#9  |  phpcoder India
Tuesday, May 18, 2010, 12:29 AM PDT

OK I figure out this there was path issue in some files.

Thanks

#10  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, May 18, 2010, 8:19 AM PDT

Also, note that there has been a ZF QPM package for quite some time now at http://www.qcodo.com/qpm/package.php/zend_framework



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.