I want to know how can i use Zend Framework in my php project where my web host doesnt support it. Im using only bunch of the Zend classes, so can I put them inside my include folder and upload it to my site? Will this work?
2
-
Did you give it a try? Zend Framework is just a bunch of include files, so yea. It will work and your web host "not supporting" could be that their PHP Version is unsupported (IE PHP 4.x) by ZF. That would most likely be the main limitation, that and they may not offer some modules that certain ZF items require.Jim– Jim2010-11-24 04:43:41 +00:00Commented Nov 24, 2010 at 4:43
-
i didnt. but just curious, im going to do that, but need some clarifications..srisar– srisar2010-11-24 04:53:21 +00:00Commented Nov 24, 2010 at 4:53
Add a comment
|
2 Answers
First include autoloader class.
require_once 'lib/Zend/Loader/StandardAutoloader.php';
$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true));
$loader->registerNamespace('Http\PhpEnvironment', 'lib/Zend/Http');
//Register with spl_autoload:
$loader->register();
and then use below line
$a = new Zend\Http\PhpEnvironment\Request();
echo $a->getQuery()->get();
this is just the demo that you can use loosly coupled zend library to your project.
Comments
Here is great place to get started http://framework.zend.com/manual/en/
If you host supports PHP 5, then Zend Framework will work without any problems.
Usually Zend directory is placed inside of lib directory, look at Quick Start.
4 Comments
srisar
Thanks for the lightning speed reply, I asked the host about the zend support they said they dont support zend framework. That's why I got the doubt, becasue if i want to modify the php_include to make zend work, then i cannot do that, because host has to do that.
Alex
most likely your hosting misunderstood you and answered in respect to Zend Optimizer. It allows to run PHP code that was compiled by Zend Guard.
srisar
so putting the zend framework folder inside my project and uploading to the web will work as it should? then Im happy, im going to upload and test now. I asked the question because my net is slow that 25Mb will take much time to upload.
Alex
It will work for sure. Don't be silly uploading all files extracted... it will take long time. Instead upload a zip/tgz archive and extract it on the server.