Are there any other PHP frameworks like CodeIgniter? - php

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 .

Related

What is a good PHP framework for migrating an existing app to?

I've recently come on board with a PHP application. There has not been much design put into the app - there is a front controller, however, view, model and controller code is usually mixed together.
I would like to slowly start refactoring the code beginning with moving all the SQL queries into appropriate models. Having looked at a few frameworks, it seems that most frameworks are setup with the assumption that an app will be developed from scratch using that framework.
Is there a good framework that I can just kind of plug-in so that I can use the model libraries and then perhaps later on, integrate more of the app into the framework? Would Doctrine be a good tool for something like this? Or should I just setup my own models without relying on third-party libraries?
If you have an existing php application, then there is no point to migrate it to some framework. Frameworks help you to develop project faster - you already have one. At this point adding framework on top of what you have will only make your application more complex and, most likely, slower.
Instead of trying to find some magical framework, you should invest in refactoring (apply some OOP principles, like SOLID) and documenting the existing code. Maybe start incrementally add some unit-tests.
P.S. Doctrine is an ORM ( 1.x implements activerectord , 2.x - something like a datamapper ). ORMs are for people who are extremely lazy, misguided or do not understand SQL. By moving your existing SQL queries to ORMs code you will make it all only slower. Additionally, you will encounter problems when migrating complicated queries. Just dont do it.
I've just started rewriting a site in Kohana, and I'm quite happy with it. It seems flexible and powerful. It's very similar to CodeIgniter, but a little more modern (more of the latest PHP features are used).
If you want only MVC (not HMVC or more difficult) frameworks for simple adoptation with existing application you should touch CodeIgniter. ActiveRecords is very easy for refactoring from existing sql-queries. You even can use default or hand made functions or classes for building queries in its models.
But default, Codeigniter isn't enough flexible for difficult or multi-namespacing applications.
Im migrating a site using Zend and Doctrine2.
The site wasn't OOP in any sense but it was divided between logic view and dal. The migration is still in process (new features are coded with framework, existing feature gets migrated only when big changes are needed).
Both frameworks are non intrusive, and the most valuable thing you get for me is to standarize things.

A CMS on 2 DIFFERENT frameworks?

I'm not sure if this is possible, but let's say you want to build a CMS, but you're torn between 2 frameworks because each has some features that you like. Is it possible to create the CMS with both framewoks? Does this approach have merits or pitfalls?
Speaking strictly about the Zend Framework (ZF) I would say yes. ZF components are written to be as independent from other components as possible. I would say that it would not be very difficult (It may actually be quite common) to integrate libraries of ZF into other frameworks like Cake, Symfony, or Codeigniter.
Is it possible to create the CMS with both framewoks?
While it's possible to use components from the Zend Framework inside other Frameworks / CMSs - this may be the case with other component libraries as well, but Zend's the most modular one that I know - It's usually not a good idea to mix two full-blown Frameworks.
Many central functions like MVC structures, URL routing, the database layer, Unit testing, error management and so on are by nature unable to be served by two frameworks at once without massive friction. Also, you're likely to get problems when one of the frameworks needs to be updated.
I would recommend to pick the framework that covers most of what you need, and try and add the missing features using plug-ins or own modifications.
Your question is too abstract.
For instance Zend Framework is more to be a library of specific functionalities ready-to-be-include into Your codebase then some closed development environment like for instance Symfony framework.
Thanks to it can be ZF simply included into your codebase (and Symfony too).
Symfony Framework compared to it is closed solution depending on front server environment so you cannot use it like some other framewor's slave.
It would really depend on which things you liked about both...
Zend Frameowrk is more like a library, so you can pick and choose components from it. Symfony also has some re-usable components you can use.
Really, you can do anything... it just depends how much work you want to do, and how willing you are to modify the framework code. Note: most other PHP frameworks are not nearly as flexible as Zend Framework (next up probably being Symfony).
This sounds very messy, so I'd advise against it, unless you use it in the fashion I've described above. It's easy to pull ZF or Symfony components into other frameworks, but not the other way around.
Hope this helps.
The composability of most frameworks is such that that is most likely to give you all the disadvantages of both, while simultaneously eliminating most of the individual advantages of both.
It seems to me like one framework will for serve as the core - bootstrapping, MVC stack, routing - while the other will be used to pull in specific functionality - like classes for forms or filtering or interacting with web services, etc.
As much as I prefer Zend Framework for the core - and most everything else - its use-at-will architecture argues for making the other framework the core and pulling in ZF components where you need them.
As #Adrian notes, it's easy to pull in ZF components into a project built primarily on another framework, since ZF is designed with that flexibility in mind. Other frameworks are less accommodating in this regard.
You can do it. Most modern frameworks (Zend, symfony, flow) is capable to use parts of other frameworks. Symfony 2 uses Zend Logger, flow3 uses sfYaml... It is possible tu interchange some components.
But, imho, you should stick to one framework as a core, and use second only to relatively isolated subsystems. Adapter and Facade design patterns can help you to mix them together - some components / clases demands some wrapping before use in non-native environment.
For further reading: http://www.symfony-project.org/book/1_2/17-Extending-Symfony#chapter_17_integrating_with_other_framework_s_components
Of course it is possible and I don't see something wrong with it. For example I used CakePHP and Zend on a relatively large Project which was kind of a cms. CakePHP for the core (Routing, MVC) and Zend for some "Modules". Mainly for PDF, E-Mail (smtp), FTP and a few others that CakePHP was not that good at. With Cake it was fairly easy to use ZF components and didn't feel hacky at all.
In fact, ZF was written to be as independent as possible, so that you can use any component at any time anywhere. Yet, it would not work the other way round (Using ZF as core, and Cake components). Surely it is possible, but a real pain with no benefits. So ZF could be used propably inside of pretty much any other framework and nothing would be wrong with it, imho.

how to convert zend framework php code to cakephp

i want to convert zend php to cake php but not finding correct book and guiding to do that????
Just download Cake, install and configure it and then gradually migrate your existing code into it. There is no standard recipe how to do that. You have to do that manually, class by class, line by line. Cake's API is quite different from ZF's API so this will take a while, depending on how much coupling you got. Also, ZF does not have any ActiveRecord, while Cake is built around that, so the database part will probably take longest.
Migrating from framework to framework is a sure thing to introduce bugs into the code. If you don't have a solid unit-test base already, it's a good opportunity to add a test before migrating a class.
On a sidenote: why do you want to to do that anyway? Cake is compatible with PHP4 and has a rather messy and slow performing codebase. Migrating your application from ZF to Cake is likely a downgrade. And as others pointed out, you could have Cake and ZF coexist.
I suggest you learn how to use both frameworks and then port the code manually. There are no tools that will do this for you; there simply is no way to do this automatically, especially given then highly flexible nature of ZF.
Learn both, use your understanding to migrate the code.

Which PHP framework is most like Ruby on Rails?

Which PHP framework should I choose if I want to be able to develop in both PHP and Ruby and Rails without having to make too much of a mental jump when I move from one to the other? It does not have to be an exact copy, but should have most of the basic features of Rails.
That is, it should include similar routing (either /controller/action/id or RESTful); similar model method names (find, findBy); similar helper methods (linkTo etc..); similar validations and similar conventions with regards table names.
CakePHP is essentially a port of ROR to PHP.
Akelos may be what you are looking for.
I would say CakePHP is more Rails-ish in its approach. CodeIgniter is another wonderful PHP framework, but not quite so Rails-ish.
There is also CodeIgniter. Tried it a few years back and I thought it was pretty nice. The documentation is great.
I would say Cakephp, if u have to write an app and coming from Rails, it'll be a lot easier to adjust your development compared to other php frameworks.
Currently, the PHP framework that mimics Rails best must be Maintainable Framework. It is essentially a directly ported version of Rails and features a lot of the goodness from Rails (ActiveRecord, Migrations, generators, routing, view helpers etc.) using the same directory structure, so you should feel familiar. Don't think it is so widely used, though.

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.

Categories