Wordpress And Zend - zend-framework

I am wanting to do stuff with the Google Data API, the contacts specifically. The easist method i have found so far is using Zend. The problem I am having is adding the Zend framework. Does anyone know how to do this with WordPress?
Thanks

you can use "hardcoded" includes if you fail to setup autoloading ->
in /wp-content/themes/levitation/send.php insert to the first line:
require_once 'your/path/to/zend/Zend/GData/ClientLogin.php';
Problem is you need to get through all the errors and alwas include the missing class (inside classes are the includes taken care of...
Or in the main file (guess index.php) insert:
set_include_path(get_include_path() . PATH_SEPARATOR . 'your/path/to/zend/');
//for ZF below 1.8
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
//for ZF > 1.8
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::setFallbackAutoloader(true);

It should be pretty trivial.
Write and test some bootstrap code that sets up ZF's autoloading and make sure it generally works.
Stick that code in a wordpress plugin, and tie things up to the right hooks in wordpress.

Try this http://blueberryware.net/2008/09/04/wp-library-autoloader-plugin
I think all you need is there.

Make sure that you are calling:
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
before you are using that class. And that you have a developer key.

Related

TYPO3 Hook not found

I am currently trying to write a Hook to add extra fields to a Flexform. Therefore I followed this tutorial: https://docs.typo3.org/typo3cms/extensions/news/DeveloperManual/ExtendNews/ExtendFlexforms/Index.html?fref=gc&dti=250938618364487#extend-flexforms-with-custom-fields
But when I go to a page in the backend that contains an options from a Flexform I get the following Error:
Class 'ID\SearchBarAdditional\Hooks\FlexFormHook' not found.
I register the Hook in the ext_localconf like this:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][] = \ID\SearchBarAdditional\Hooks\FlexFormHook::class;
and my Hook-file is here: typo3conf/ext/search_bar_additional/Classes/Hooks
and is initialized that way:
namespace ID\SearchBarAdditional\Hooks;
class FlexFormHook { /* ... */
So in my opinion everything is in the right place and should work, but I do still get the error that TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("ID\SearchBarAdditional\Hooks\FlexFormHook") fails.
Do you guys have any ideas, what could be wrong? Do I have to register the Hook in \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( or something similar (as the posted code is really the only thing I've done)?
This is a typical class loading error. Check that you added your PHP namespaces to composer autoloading and/or ext_emconf.php and make sure your filenames are correctly named according to PSR-4. If in doubt you can inspect the class loading map files generated by composer in vendor/composer (if you use composer for class loading, which you definitely should do).
I found the mistake: My Hook does indeed not get loaded. I tried to 'include' it in the ext_localconf.php and it is working now.
But as this is of course an extremely ugly solution I posted a second question, how to load a hook here: Typo3 8.X - autoload Hook
Thank you for your help!!!

Using zend framework in joomla

Is that possible? How do i do it? I have tried installing in the plugin manager but still it's not reflected in the plugin screen. Any hints or guide would be much appreciated!
Thanks!
Zend Framework works as a library as well as an MVC Framework.
What you can do is copy the Zend Framework library into your project. Then you can basically include the relevant classes you would like to use.
This is an example for using the Zend_Json::encode() function:
$zend_library_path = 'ZendFramework/library/Zend';
set_include_path ( get_include_path() . PATH_SEPARATOR . $zend_library_path);
include_once('Json.php');
echo Zend_Json::encode( array('hello'=>'world') );

configuration in Zend Framework

i am new to ZF and i am making a project in ZF .i got basic knowledge of ZF but need more.
i studied configuration in ZF in many different ways like
Using Array Configuration
Creating File Configuration
Using INI File Configuration
Using XML File Configuration
i need to know what is best and efficient way among all these in sense of Maintainability and security ??
also can anyon plz tell me (Quick advise) how to start my first project so that its easy for me in order to maintain and upgrade.i am bit confuse with layouts that is header , footer and sidebar etc
how to intigrate this in my bootstrap like this but its not working
// Register the autoloader
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
// Initialise Zend_Layout's MVC helpers
Zend_Layout::startMvc(array('layoutPath' => ROOT_DIR.'/app/views/layouts'));
For configuration the answer is: use what you like best. All Zend_Config classes have same functionality. They just differ with the syntax.
As for something not working you must write more details. Again - what do you mean by 'not working'? What are the errors?

zend framework under document root in subdir

I developed a application with Zend Framework and now I want to be able to place the app in an subdirectory of a Documentroot.
e.g. http://www.example.com/myapp/
I read quite a lot of Docu how this could work, but all in all these solutions don´t fit my needs. Is there a trivial way to do the subdir thing, without adding the concrete path to any file which generates the pages.
There are some examples in the net, where a basePath is set in the application enviroment and so there is a method call bevor each "form" creation which prepends the path before the link.
$form->setAction($this->_request->getBaseUrl() . $this->_helper->url('sign'));
This was from: http://johnmee.com/2008/11/zend-framework-quickstart-tutorial-deploy-to-a-subdirectory-instead-of-web-root/
But this is only works for small examples, I have tons of forms, tons of views and tons of scripts. I can´t belive this (lets call it hack :) ) is the only solution to do this.
Any ideas?
You don't have to do anything special. See my tutorial at http://akrabat.com/Zend-framework-tutorial which is developed entirely within a sub-directory.
As they say on the web page:
I’m told this last issue has been
lodged has a defect and not necessary
from releases “1.7″ and beyond. The
helper->url will henceforth prepend
the baseUrl to its result.
So you should be fine. Do you actually use the $form->setAction() method on every form already? Because if you use it in combination with the url helper, the baseUrl will already be included.

Bootstrap modules using Zend Framework 1.8

I'm trying to figure out how to implement a modular structure with autoloader and Zend_Application.
I've got an structure that goes ok, but with the last commit to the tag 1.8 stop working.
Can anybody try this code and see what's happened?
Thanks in advance
Have you read autloading-modular-forms-models-in-zend-framework-18? I'd suggest just posting the content of your Bootstrap.php file here.