Integrate a Zend application into Drupal 6 / 7 - php

Given a "nacked" Zend application - is it possible to use the Drupal based layout and navigation?
What is the best way to integrate a Zend application into Drupal 6 / Drupal 7?
For Example:
User X visits my Drupal page.
He wants to use the Zend-Application called "Feedback".
This "Feedback" application should be able to use the layout of the Drupal page.
Everything but the outer layout would be written in PHP using Zend.

The module doesn't do Zend Framework app integration, it just allows you to use some of the ZF components (ie. Zend_Mail). I actually integrated a ZF app in Drupal 5, based on the Drake module (CakePHP integration).
It basically defines a Drupal menu with callbacks, these callbacks are passed to the ZF app (by including my zend bootstrap). Output of the ZF app is stored in a var (using the output buffering PHP functions), and I fetch the page title/js/css from the HTML, strip what isn't needed and then pass these back to Drupal (using drupal_set_title, drupal_add_js and drupal_set_html_head respectively). And yes, this is dirty, but it works for me...

Not sure this is quite what you want, but you can take out $application->run() from the Zend app's index.php and then include that file in any other application and have access to all of the resources of the Zend Framework and the Zend app itself.
Probably still quite involved to get it to do what you want though.

Joomla has a "wrapper" layout option which just shove some url into an iframe in the layout. I use this a a lot to glue standalone applications to a corporate intranet at work, we just have to tailor stylesheets to match.
It's a quick and dirty path but get you there fast and users really don't care.

I don't know drupal, but can't you simply include drupal files in your zend layout viewscript?

Related

How can I use both Laravel and Drupal in my website?

I have a website build in Drupal 7. Due to complexity of some pages I want to build those pages in framework like Laravel!
Can I do that?
I want to keep user login and some node functionality of Drupal and will use Drupal's db!
You can but you shouldn't. The Drupal and Laravel are both back-end frameworks. By keeping some part of Drupal and another from Laravel will create problems for you later if not now. Just for example, you will have to sync session management of both systems to keep things synced!
Rather, I would suggest you go for some Front-End frameworks like BackBone, Angular etc. It'll effectively work with Drupal, as Drupal provides the REST API support.

Ready made PHP modules

Are there any frame work / modules that I can use when building web apps from scratch (php, sql)?
I am sure that coders don't write login, signup, etc. features (of typical web 2.0 apps) from scratch, they got modules that they refer to / reuse.
Is there a possibility to gain access to those modules to use?
Thanks
I'm not exaggerating but there might be a thousand PHP frameworks. All you have to do is to google PHP Frameworks .
Some well known ones are :
Laravel
CakePHP
CodeIgnitor
Yii
Symfony
Zend
... and the list goes on and on
you can use laravel if you have basic concept about php and mvc framework you will be able to control over laravel very well, when you create module it will gives you crud methods by default you just have to get an idea about its namingConvention and use. please visit https://scotch.io/tutorials/simple-laravel-crud-with-resource-controllers

Drupal as a CMS and CodeIgniter as a framework?

Is it possible to create a web application using Drupal as a CMS and CodeIgniter as a framework?
Drupal does not really need something like CI and vice versa. If you are building a web application in Drupal and you really feel the need to have something like CI, then you should simply write your entire application in CI.
Drupal is somewhat of a prebuild house for a web application. You install it, already have everything in place like a backend, caching, login-mechanism, etc. Next you add some modules, customize a theme and done. Just like decorating your living room or building an extra garage.
CI is more of a solid foundation to build a house on. It has some functionality but you need to write your own functionality if you want everything you need. You need to build walls and all that stuff but in the end you have had 100% control over just about anything.
I don't see the point of having 2 bases for a web applications. Just makes things more complicated imho. Just pick Drupal if you want a more extended base than just a framework. Or pick CI if you want to build everything up from "just a framework".
First decide whether you want to build a CMS or not.
If you want to build a CMS then you can choose Drupal or Expression Engine or any other CMS frameworks like Joomla. The advantage of using Expression Engine is it is built on top of Codeigniter and you can add custom modules using Codeigniter/php style of coding.
If you don't want to build a CMS, then since you are familiar with Codeigniter, build a web application using only Codeigniter

PHP framework that can be included in other projects

I have a little specific concern, I hope you can help me, I have to develop an application in PHP that doesn't need to be linked to the exclusive use of its installation and could be used or "included" in other projects of PHP, I mean, to develop a web application (such as generation of a graph according to certain parameters passed) that can be used on different pages created for example in phpBB, Drupal, Dreamweaver or PHP Frameworks like CodeIgniter and Zend.
The best example of what I mean is "Google Charts Tools", you just print in the browser the access to the tool with the parameters and the tool does the rest, and this does not depend on the type of framework with which the home page was created.
In short, I'm looking for a framework or lightweight framework with which I can develop an application that simply could be called in an include() or require() on the destination page and can be used, a framework that can somehow "export" the project or application and could be used on one page without having to reinstall the framework on the target server, even the libraries could be included in the target page so you can run the application.
Was working with Codeigniter and tried to attach to a Joomla page but i couldn't because Codeigniter is linked to the URL of the page and I dont want to use Iframes.
Is there something like that?
First of all; I believe you would need some custimization, as frameworks just aren't build that way. But it isn't impossible. In Kohana for example (also codeigniter, but kohana is more flexible), you can build internal requests with Request::factory($uri). If you can find out a way to bypass direct access to index.php, or build a wrapper after which you can do stuff in the Kohana 'environment' you could do it. I don't have a ready-to-use solution, but if you try something and post the code we might be able to help you out some more!
Sounds to me like you want to write a library or class that can do certain things and which can be reused in other code. You can then build an example application around it, using a framework, which uses this library.
If you start with a whole framework, this often makes it really hard to reuse any part of the code, since the framework has certain assumptions or requirements which may not always be true for other projects. As a general rule: a framework is already a complete standalone application. What you want is something smaller than that.
Of course, you can have a look at a framework like Zend, which is basically just a loose collection of individual classes. Together they form a framework, but each part of it is individually usable. Something like CI is on the other end of the spectrum, much more heavily coupled and interdependent.

zend framework + core php integration

I have to convert a site in zend framework. Site is big I can't convert the site at a time in zend It will take abt 6 months. Is it possible that I update it module by module (parts) and keep on uploading in live site so some module of my site will run on zend and some on core php. Can I do any setting for url in zend framework so both on my url can work.
partially migrating onto a/another framework is strongly discouraged. Don't mess with live-sites (especially not big ones) unless you really(!) need to. You should better set up a testing/migration site in your local office and do a full migration, and thorough testing, before you release anything into the wild.
If you really want to do this you should start looking into .htaccess conditional request rewriting to redirect the request either to zend or to your proprietary PHP application.
Cheers,haggi

Categories