Others frameworks like PEAR - php

Do you know others frameworks like PEAR (http://pear.php.net) ? I want to use reusable PHP components without using the famous PEAR.
I already use a framework (Zend Framework) and i want to use php components who doesn't exists in ZF like payment, encryption, math...

Check out EZ Components. It is a very loosly coupled set of libraries that I always see as sitting somewhere between something like PEAR and Zend Framework. Superbly coded and up to date, it is something to take a close look at.

I don't really do that much php, but I've worked along side php developers for some time and I've heard comparisons between PEAR, SMARTY and Zend Framework all the time. I can't really tell you how much alike they are, but these are the ones I've heard about the most. I've also heard some saying they work with Cake PHP or Symfony, but not as many.
I also found two nice comparisons that might help, here and here. That's about all the help I can be. Good luck. :)

As a Zend Framework fan myself I don't see why you don't extend Zend Framework based to your needs. I use a rather simple method by having a classes folder inside my application folder which you need to set up in bootstrap or load with Zend_Loader and there you can define your own logic or import different modules you're interested in ( phpClasses might be also very helpful).
You also can find a lot of helpers made by Zend Framework's community which might be helpful at any given time. If you like to go and strip off pieces of code from different sources you might also want to try to import some of the modules from other frameworks like Code Igniter or CakePhp into Zend Framework and that probably would be a fun and useful thing for you and if you'd like to share, maybe for all the community based around ZF
And I should warn you about Symfony (that evilpenguin wrote about), if you're willing to try it just don't forget it's the "laziest" of them all.

Related

Zend mail code in my php code?

I've got some php code handling emails (not self written) which I want to integrate in my own self written system. In it, two Classes are used:
Zend_Mail_Storage_Pop3($params)
Zend_Mail_Storage_Imap($params)
I've heard of Zend before, but as far as I know it is some kind of full fledged php framework, not something I really what to incorporate in my system just to be able to use these two classes. So I downloaded Zend from the github page, but I can't even find those classes in there.
So my questions are:
Am I able (and if so, how?) to just use these two classes from Zend?
If not, is there an alternative to these two classes which are preferably very easy to use?
All tips are welcome!
It's hard to answer this question without knowing exactly what you want to do (you've just said what classes you think might achieve that goal), but hopefully I can point you in the right direction.
Zend Framework is a full PHP framework, but it was built as a collection of libraries, and to a certain extent you can just cherry pick individual components and only use those. The two classes you listed were from Zend Framework 1. What you downloaded from Github was Zend Framework 2, which is why you can't find them, but ZF2 does have equivalents.
Although you could download ZF1 and get your existing code to work, what I'd suggest you do instead is add just the ZF2 Mail component to your app using Composer. Then start here: http://framework.zend.com/manual/2.3/en/modules/zend.mail.read.html for the docs for the equivalent classes for what I'm guessing you're trying to do.

May I use zend framework together with php files not using it

I am now working in a team to build a website using php. Told that Zend framework can be fairly convenient, I hope to use it to write the pages. However, some of the members in the team did not use the framework in their previous works. I do not know whether there will be any possible problems if their works are used together with mine? So I wonder whether it is possible for us to use Zend frameworks for part of the website while other members of the team do not use this framework to build the rest of the website? Thank you.
i not really sure to undersand your question
but it's look complicated to use ZF for a part of the site, and PHP for the other. However, it's possible. You can, with a .htaccess say that an URL is not define by ZF (i ever used it for a blog attached on a ZF site)
Don't hesitate to comment for any other answer
It depends on how you are splitting up the work. Zend Framework is modular so you are not tied into using the whole framework. You can just select the components you need. I would advise that you use one framework for your application startup and routing at least. Merging these part would be a hassle to maintain imo.

Are there any other PHP frameworks like CodeIgniter?

I am looking for a "lite" php framework like codeigniter that doesn't generate anything or make me follow conventions, etc. I have a lot of legacy databases to connect to and I don't know whether or not CI will be able to connect to them all so I thought I'd see if anything else is out there.
Again, not after anything that worries me to death about singular and plural names, makes me have a database in a certain fashion, or anything that gets in my way. No offense by that. I have other projects where that is just fine and I use RoR for that. I just don't want that here because if a framework is built around that like RoR is they tend to be difficult to use with existing legacy databases.
Thank you.
CakePHP is the most popular.
There's a fork of CodeIgniter called Kohana.
The connectivity to the legacy database shouldn't be an issue of the framework though, I guess it's more a PHP issue if the connection won't work.
http://alternativeto.net/software/codeigniter/ Will give you a few alternatives.
Check out Laravel. http://laravel.com/
It is really clean and well documented and has some really useful features which I didn't find in CodeIgniter or CakePHP which I previously worked on. I tried it out for one of my recent projects and I was really impressed !
The Zend Framework might be your best bet:
Zend Framework is an open source,
object oriented web application
framework for PHP 5. Zend Framework is
often called a 'component library',
because it has many loosely coupled
components that you can use more or
less independently.
Since you can use the components independently, you will have more flexibility in choosing your models and data access. Be warned though, there is a steep learning curve.
apparently Qcodo is supposed to be a lot like rails according to http://gadgetopia.com/post/4726
other than that (and symfony, Yii, and CakePHP) if you're comfortable with CI, do go for Kohana, as Cassey mentioned
You could also just use PEAR or some wrappers. if you have legacy databases I wonder if you might have older php/mysql tht it sits on, in which case a lot of the newer frameworks that are updated for the latest/greatest might not work for you anyway.
I'd look at Kohana or Yii. Sure, Yii has scaffolding, but you don't HAVE to use that if you don't want to. Just as with Ruby on Rails.
Both are MVC frameworks that are very object oriented. How you connect to databases is totally up to you.
You can use the ORM in Kohana without following their naming conventions, you just have to let the Models know the name of your tables and primary keys (otherwise you have to follow the convention, of course).
Check out Symfony
The last version is very lite and all extra packages are optional and the core is so lite and also it is so clean and well documented .

CodeIgniter, ZF, etc

I use ZF a lot and I like it very much. I've learned how to solve a big part of perfomance problems with ZF, so it's became not "enormous" and "monstrous" for me.
But I'd like to know if there are any as powerful frameworks as Zend for PHP. Maybe CodeIgniter is? What is it? What are its cool features? Anything else?
And, are there any powerful frameworks which realises not MVC? Powerful means not just implementing of design pattern but a library of useful classes, functions, etc
There is a difference between frameworks, some are regualr frameworks (used to be called 'class libraries'), and some are 'full stack frameworks' (used to be called 'frameworks'). The web is and will always be about buzz-words...
Zend is a regular framework, which means you can use it's components separatly, and you aren't forced to use them. In a full stack framework, like CakePHP (I don't reallt know code igniter), you are locked inside. You can only use it's classes and they are hard to extend.
If you are looking for a competitor for ZF, be sure not to compare it with a 'full stack' framework, because it's a different thing, and it solves different problems...
Other then that, I don't know any frameworks that do not implement or give you the possibility to implement MVC, just because it's very applicable to web applications.
I'm a big ZF fan, but you can take a look to Symfony which is pretty powerfull but maybe a little to heavy sometimes.
I'd personally recommend Kohana. They just released 3.0 less than a week ago (it's in the forums, not on the dl page). It used to be a branch of CodeIgniter for PHP5, but it just underwent a big rewrite so now it's much cleaner and faster.
Basically, it does just enough to help you, but stays the hell out of your way. It's very lightweight and fast. It beats the pants off of pretty much any other framework I've used - Zend, Symfony, CakePHP, and CodeIgniter.
The thing about Zend is that you can actually decouple its components. You can use them without using the rest of the framework (just register the autoloader). Really, Zend to me is more like a heavy framework with a bunch of PEAR libraries in it. The framework is too heavy for normal use, but the components are nice.
I personally like CodeIgniter, it is good to start from 0 due to its great documentation and it can be easily expanded with the lot of plugins. It is considered pretty fast framwework (faster than ZF, Cake php and Symphony) however its speed is lowered by PHP4 support and any framework will lose its speed as you add new libraries and plugins there.
ZendFramework is the most powerfull php framework I have found. CodeIgniter is a lightweight MVC framework so its not powerful.
ZendFramework also has loose coupling so you can use some Classes without other classes like the front controller.
CodeIgniter MVC is not as powerful and the ZendFramework MVC but i haven't tried any other framework
I've choosen CodeIgniter because it is lightwight and because i'm not using a ORM and Smarty, this means i only need the router and controller/model class.
But it is missing a few features like user/login handling being the most serious.
I also use some zend classes like amazon access.

Beginning Zend Framework

I've read a couple of Related questions by the site, but can't find what I'm looking for.
After having done normal PHP without much extra(by which I mean a templating system) for a year now, I feel like trying Zend. Simply because it's the biggest name. I wanna try CakePHP too later.
I've been looking into the examples, but these are all inline-code examples.
In learning PHP, I've used a template system, in order to keep the PHP and the HTML completely separated. Is this possible with the Zend Framework, or should I use a template system alongside it?
Also, what's the deal with executing several .bat files? Is there really so much work in setting up folder-structures with the correct files in them should you did it manually?
Zend Framework is a quite good solution to use as separate modules or complete package as well. You can use only it's templater system (but it's not so super) or you can put on a whole system using Zend_Application, Zend_Controller, Zend_Db, Zend_View, etc.
The .bat (or .sh) file is for the Zend_Tool. It's an experimental command line tool to build modules and applications easier.
I guess you can use zend's built in template solution that comes with Zend View, roll your own, or even integrate something like Smarty. At the end of day, its your call. Zend is fairly flexible in terms of which of its component you want to use and which you don't.
frankly for me these components do the most of work and i dont think i will need more than
(Zend_view , Zend layout , Zend navigation ,Zend breadcrumb)
it's most likely to keep the PHP and the HTML completely separated
about zend tool : its just tool to make Zend development much easier
I highly recommend you take a look at the online tutorial found here. It's a step by step walk through the framework showing you the basics of how you'd build a small Zend Framework app, and shows you how to integrate things like access control, interface with the database, etc. It's written in really understandable language with great source code included.
As for the batch files, you may want to download a demo copy of Zend Studio. It allows you to create a ZF project and does all of the setup for you without requiring you to mess with the command line.
Good luck!
I highly recommend you must first understand the basic directory tree of Zend Framework including all setup needed and familiarization with bootstrapping and setting configurations with a .ini file.

Categories