I'm working on a CMS for some of our projects, but would like to ease the work a bit by using a framework. This is what I need from a framework:
A framework that implements basic things like session management for me. Is there one?
A framework that supports REST. Is there one?
A framework that doesn't cause my CMS to break when the framework is upgraded. Is this something that I have to implement myself or can the framework help me.
A framework that's very object oriented. Am I right assuming this is a good thing?
The Zend Framework is allways a good choice.
http://framework.zend.com/
Or you could go with CakePHP if you want it a bit more Rails like (do it the framework wants you to do it and you have to configure/write less to achive the same)
Symfony is a nice framework that works well, in my experience, for custom CMS work. It's well integrated with the Doctrine ORM library, and the combo simplifies solutions to a lot of CMS problems. It also provides a nice set of feature for building REST interfaces.
Personally, I don't like how opinionated Symfony can be, so I use it sparingly (but often, for CMSy things where ActiveRecord doesn't seem to be an obstacle). For more complex problem domains, I prefer the Zend Framework, which sod recommends in his answer. It's very solid, provides a lot of great functionality, and it's easy to use as much or as little as you like. It provides no "model" layer, by design. That's a Good Thing if you're not buildng yet-another-cms/blog/etc
Look at symfony. For REST thing there are even generators: http://www.symfony-project.org/plugins/sfDoctrineRestGeneratorPlugin and http://www.symfony-project.org/plugins/ckWebServicePlugin/1_5_0
Related
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.
I'm embarking on a very big exercise to build a CMS in php. It's actually my attempt to learn PHP in a fun (and hardcore) way coming from a Java background. Java is all object oriented so oop is in my blood, but I'm finding that OOP hasn't made it yet to PHP. Most PHP is still being written today the old way without the new concepts.
I'm trying to find an example PHP CMS that's written as object oriented. I hear Xoops is. Any others you know of? or any OOP libraries in general that you know of that could help me in a CMS project.
I would suggest symfony framework as it is well documented and functional framework that helped building many web applications.
http://www.symfony-project.org/
PHP5 is pretty OOP. Look for CMSes and frameworks that only work on PHP5. For example, Kohana
Concrete5 is a pretty complex OOP based CMS. Might be a harsh start but I've learned a lot by working with it.
again, +1 for symfony, but this is a large project and getting to know symfony will consume most of your time, yet if you want to dive in, its documentation is really great.
since you are trying to build your own CMS, get started with easy to grasp frameworks and build upon them. Don't waste your time on everything that has been already done. I recommend you Codeigniter MVC Framework http://codeigniter.com and for CMS, PyroCMS http://pyrocms.com which is built upon codeigniter is cool. Codeigniter is really easy to get along, and documentation is very neat and clean.
Further, if you like to start with a simple php framework, here's what Tyrehall has done, http://github.com/tylerhall/simple-php-framework . This project can act as a base for your CMS
No one seems to have mentioned Kohana the PHP 5 only framework.
Kohana has a pretty active and very helpful community to back it up (#kohana on freenode in particular).
edit: Upon closer inspection I see someone has already mentioned Kohana.
what you will notice is that what is more important to most cms (and framework) developers is MVC pattern implementation. Most MVC implementations in php do in fact use oop practices (some stricter than others)
+1 for symfony, and another I'd like to recommend is Kohana (built on CodeIgniter)
Also have a look at their forums, as both already have a cms or 10 built using these frameworks.
Using these frameworks brings you about 60% there, as a lot of the rudimentary tasks are taken care of.
edit
also remebered this one: fatfree framework it's quite lightweight: http://fatfree.sourceforge.net/
Have a look at Phundament 3.
Phundament 3 is an application foundation built upon a set if independent Yii modules and extensions such as user, rights, yiiext, gtc, ckeditor, jquery-file-upload, p3widgets and p3media.
The combination of p3widgets and p3media provides basic content management system (CMS) features, like dynamic widget creation and file management.
Combined in ckeditor, p3media acts as a ckfinder plugin which gives you the full power of HTML and media files for content creation via p3widgets.
It comes with a very minimalistic setup which integrates perfectly into an Yii web application skeletion and installs with one single command.
as some folks suggested here, you should start with Codeigniter because it's really easy to dive in. Its documentation is very well structured and easy to read. But I think Codeigniter seems to be very old now.
What I really recommend to you is Laravel. There's another Framework you should look into, that's FuelPHP. But for me, Laravel has absolutely changed to way I'm writing my PHP code. It is the best framework I've ever seen in my life. It's so elegant that you will instantly fall in love with.
If Laravel suits you, I recommend you to follow this online course by Jeffrey Way # Tutsplus.com. You will love it!
Good luck :)
Have you seen CakePHP?
http://cakephp.org/
Its a MVC framework for PHP. Its pretty robust and can be used in a fully object oriented manner.
I have been tasked with building a simple web based system for managing a list of vehicles.
I am interested to know whether there are any robust, clean PHP 5 frameworks / libraries that are specialized in doing this quickly.
They should be able to quickly build a skeleton web back-end to an arbitrary data structure with the basic functions:
Customizable list view
Customizable edit form
create/update/delete operations
Nice to haves:
Multi-user interface
ACL based rights system
Localization
Image / File upload built in
Wet dreams:
A skeleton CRUD API to manage items programmatically
A skeleton RSS feed to inform about new items
I am aware most big frameworks provide tools and helpers for this, but would prefer a standalone, light-weight solution that is easy to get into.
Alternatively, is there a great PHP application that you would recommend looking into to modify to suit my needs?
As far as building skeleton apps goes, nothing comes close to the Yii framework.
From the site:
MVC, DAO/ActiveRecord, I18N/L10N,
caching, jQuery-based AJAX support,
authentication and role-based access
control, scaffolding, input
validation, widgets, events, theming,
Web services, and so on. Written in
strict OOP, Yii is easy to use and is
extremely flexible and extensible.
It also includes CRUD code generation. Headed by the guy who did Prado.
If you don't want a big framework, you could check out phpactiverecord
I would recommend CakePHP
I've seen awesome demos of the instant blog in Rails and Django and Symfony.
Looking at Zend, Cake, Symfony, Symfony seems the most like Rails/Django. Check out the 10 minute (yeah, super sped up!) demo. It's pretty sweet:
http://www.symfony-project.org/screencast/cart
My experience tells me that there's no framework, lightweight or otherwise that you can easily do what you want quickly if you don't know it. So that's where the tutorials come in. You really need a nice ORM to avoid all that mess with the DB and or reinventing that with a CMS. So the best bet is to choose the one with the best docs, the best tutorial + screencast, in the language you know that gets you closest to your requirements by just changing the names of the variables. I know Django can do all that you're asking with Django 1.2, but with PHP 5 being the requirement, Symfony and it's ORM is my first suggestion.
Yii looks like something I'll be taking a look at right now! Yii-Haaw!
Here's Yii's screencast of blog making: http://www.yiiframework.com/screencast/blog/
Not bad so far! But it's quite a learning curve to get the blog working. Very similar to Rails.
The best i have seen around in years http://www.grocerycrud.com/ its for codeigniter
Sapphire has a lot of promise. I have used the CMS built on it - SilverStripe - for a few projects and it's very nice. But I haven't dug into the back-end too much.
From the website:
Our Object-Relational Mapper takes
care of your data. Define your data
model using our simple PHP5 syntax
and our ORM does the rest.
Tell
Sapphire about your data model, and
you get 3 interfaces for free. A
RESTful API, a SOAP API, and an admin
editing interface.
It's not exactly lightweight, but its core is ~1.3 MB but meets a lot of your "nice to haves"
There are several PHP frameworks that meet your requirements (basic requirements). You should use a framework that you are most familiar. If you do not familiar with any framework, I suggest you to use the CodeIgniter.
I've been looking for a drop-in admin panel like this too, so far I've 2:
AjaxCrud - http://ajaxcrud.com/
Peek from Code Canyon - http://bit.ly/toKKrB
Love to hear any other suggestions!
For class, I would like a to use PHP MVC framework very similar to ASP.NET MVC with NHibernate. I am very comfortable with ASP.NET MVC. I need to use PHP and MySQL. I would not like to be concerned with the SQL to save me time. I would like to just design my PHP model classes and controllers without all of that data-access logic behind it that I would have to write.
Any suggestions? Thanks.
Also, I'm very limited on what I can install on the server. For instance, I can't upgrade PHP or run other installers. I want something I can drop in.
I prefer Zend Framework MVC components combined with Doctrine if really want great power. but for something simple try CaKePHP as it has its own simple ORM implementation, and the framework is built to be the php version of Ruby on Rails.
My personnal preference for "MVC Framework" would probably be Zend Framework -- though it's not the only possible choice (I'm thinking about symfony too, for instance).
About the "not writing SQL" part, I would use Doctrine, which is a great ORM Framework.
It's actually the default ORM Framework of symfony, and can be used with Zend Framework quite easily.
I suggest Symfony. It uses Doctrine (which is inspired partly by Hibernate) too, but it is integrated deeper with Symfony than Zend Framework. Symfony provides a number of helper classes which really help automate things with Doctrine (my favorite is sfDoctrinePager). Zend Framework is a good choice, but I recommend looking at Symfony first. I would avoid the other PHP MVC frameworks as they tend to be less flexible, and if you're coming from another language you may have your own preferences on how to attack a certain problem - Symfony and ZF will both give you leeway in this sense.
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.