Object oriented php CMS or framework - php

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.

Related

Rearchitecting procedural PHP

I need to re-architect a PHP application that is entirely procedural. Pretty much every WTF-ism you can ever think of is in this which means that it's likely to be more of a rewrite than anything else.
I want to stagger this and would like to do it with MVC.
Can anyone recommend a PHP framework that is going to help me?
The current database (MySQL) is OK - but the code isn't.
Some updates:
* I consider myself to be very skilled in web programming but I do very little in PHP
* A lot of experience in MVC
* No issues with Design Patterns
* The project is an ecommerce platform
* I am coming from a mainly .NET background
You should take a look at CodeIgniter. It's fast, stable and easy to learn.
I use Codeigniter pretty much all time. It's quite easy to use and it has a light footstep (it loads only classes you use).
CakePHP 2.0 beta has pretty much everything you'd want in a framework. It's fast and it's really good once you've picked it up.
If you have previous experience in Ruby on Rails => Yii
Else if you have previous experience in Django/Spring => Symfony2
Else if you have no experience in any framework & fast way learnig => CodeIgniter
CodeIgniter is probably the simplest answer. It's easy to learn and well documented. However, I prefer Zend Framework because of the templating system, the extensive library, and the new ZF tool. However I found the learning curve on ZF to be a tad steep. I recommend getting a CURRENT book to learn ZF. "Easy PHP Web Sites with Zend Framework" is very good.
http://www.wjgilmore.com/books/read/easy_php_websites_with_the_zend_framework
if you want other decision it's symfony(herder) or Yii(very easy to learn).
Simple project are creating by using(CI), if you project is harder use symphony or Yii.
If you want became ninja FrameworkDev learn Zend

Web app: code from the ground up or use 3rd party framework?

I'm about to develop a web app (PHP/MySQL). I prefer to use the MVC style when developing apps, but I've always struggled writing my own MVC framework in the past so I've started playing with CodeIgniter. After a couple of tutorials I better understand how to properly develop with a MVC framework and I'm totally comfortable using CodeIgniter to write my app.
The thing is I'm now wondering if its better to write my own MVC framework for this app or use CodeIgniter? My worries are due to the fact that I'm just getting this app written to serve as a prototype and will hand it off to more experienced developers down the road. I'm worried CodeIgniter has limitations that I'm unaware of yet and could hinder further development for me or the next developer(s). I'd imagine its easier to get around issues/limitations of a custom framework than it is of a 3rd party/ready made/stock framework.
Any insight?
There aren't any real limitations to CodeIgniter as most of the core can be extended. I have been using it for years and not found anything I couldn't use it for.
Kohana is a little more fun if you're into PHP5/OOP stuff but the lack of documentation will make learning it quickly rather difficult, especially if you are being paid to produce this.
Use CI, it will speed you up plenty.
I'd would go with CodeIgniter if you're familiar with it (and not writing your own framework from scratch), the app is a prototype, and it's getting handed off to more experienced developers down the line.
CodeIgniter isn't an obscure framework, it's pretty widely used and well documented. If your developers kick up a fuss, then they're probably aren't as experienced as they would like to think they are.
For a prototype I would say definitely use whatever you're familiar with, instead of making the project much bigger than it needs to be. Writing your own framework is a huge challenge, but it's also a really good learning experience. I've written my own suited to my own needs just so that I could learn the language "in the deep end" (and I keep adding to it whenever I use it... maybe someday, when I decide it's "fully featured", I'll release it into the wider world). But you should only do that if you've got the time, and plenty of room for everything to go wrong.
Well, the question is: can you do better than every other MVC PHP framework out there? Reinventing the wheel only costs more time and the focus off your application changes, because you have 2 seperate things to maintain.
I would stick with a proper MVC framework. We use Symfony exclusively for that use. It's a great framework with a lot of features borrowed from other frameworks and other programming languages. However, the list is endlessly for PHP framework. I recommend reading a bit about other frameworks and pick the one which is the most suitable for your needs. It saves you time in the end.
As a developer, I had to go through the same road.
Personally, I chose CodeIgniter as primary tool of my development, mainly because of community support and straightforward MVC. However, CodeIgniter was built by EllisLab, and they are not community driven. If you are looking for something that has more dynamic, community driven, open source MVC framework, I would suggest using Kohana.
Kohana has a good community, and they have some notable contributors. Check it out here
If you are thinking of choosing from different types of frameworks, I would suggest make a list of things you want out of a framework, and do your search based on that.

PHP rapid skeleton generator for basic CRUD?

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!

Fastest / Easiest method to develop a multi-user gaming engine in PHP/MySQL?

I'm an advanced designer, but also starting out a career in development: I'm a PHP intermediate user. I (unfortunately) learnt procedural development, and not OOP.
My current project is a multi-user game web-app and I was developing procedurally only for my Boss to insist that it has to be OOP, so I needed to start learning OOP (I believe I am a relatively fast learner). A friend advised me to just learn a lightweight PHP framework and move on from there, since the project must be launched in less than three weeks (I have roughly 2 weeks left now)!
After viewing a lot of articles comparing them, I ended up with CodeIgniter, Kohana, and Yii based on the efficiency and the lightweight-edness. I am not quite used to command-line instructions like it's done in Yii, so I had to drop it off to save my time :(. Kohana looks very interesting, but I am new to the PHP5 and OOP it uses and there's VERY LITTLE help on Kohana, I even tried to buy books but there are none. CodeIgniter has a lot of helpful material, but it has no official Authentication module with Access Control, and the three open-source modules I have tested did not integrate well with other modules I am using.
Please can anyone recommend another OOP PHP framework with a quick learning curve, or provide some pointers to resolve the problems I had with those 3 frameworks tested, or should I just develop the entire application out of the box after studying OOP extensively? Thanks for your time.
There are frameworks, that provide an authentication natively but there is no way, that you can learn those in two weeks AND finish your project.
CodeIgniter was the first framework I learned and it was the perfect choice for me: The documentation is really good: reading the documentation enabled me to fully understand the MVC pattern. If I was in your position I would definitely use codeigniter and integrate one of the many free authentication plugins discussed here.
After you finished your project, you can go on and start learning symfony and Zend Framework, depending on your preferences.

php CMS system built with a framework - php framework AND php CMS

I have to develop a CMS for a friend of mine, nothing commercial...
I'd like to take this opportunity to learn a php framework, to see if it would be suitable for future (and more complex) developments, or at least to steal some nice ideas...
SO I'd like to easily implement a content management system and at the same time have a look at a modern php framework (one of the rails inspired ones, or at least implementing MVC, which I think covers them all...)
I've heard of http://www.digitaluscms.com/, built with zend framework, and http://radiantcms.org/, but that is ruby on rails (I'd prefer php for ease of deployment and hosting...)
If you want a CMS built with a real Framework, I've heard (just today, actually) of Diem, which is built upon symfony (and uses some components of Zend Framework).
Maybe Sympal, also based on symfony, could interest you too.
If you want to learn, and work with symfony, one of those two might be the perfect match for you.
Still, as those two are not as popular as Drupal (or Joomla, or whatever other well-known CMS you can think about), I would probably not use them for any "real" site -- at least, not before studying them for a while.
For a framework, I would recommend Code Igniter wholeheartedly. It's MVC based, super-lightweight and it reminds you of Rails a lot. You can check out a screencast of a hello world application here: http://codeigniter.com/tutorials/
In regards to a CMS that could be http://expressionengine.com/, it's a popular CMS built on top of Code Igniter. I don't really like it as a CMS, but you were asking about a good platform to build on, so that would probably be a great bet.
The most common PHP frameworks are Symfony and CakePHP - I don't know CakePHP so much, but personally Symfony is too big and bloated for my taste, although very powerful.
The most common used CMSes are of course: WordPress, Joomla and Drupal. There are endless other systems available, but most of them don't really have a great platform to build on.
Good luck!
Others have mentioned various pre-built CMS applications. If you want to build your own in an existing PHP framework, check out CakePHP or symfony.
http://cakephp.org/
http://www.symfony-project.org/
But really, you should just learn Django, because it's so awesome.
A free CMS built on CodeIgniter is PyroCMS. The demo is currently down but installer is so freaking simply you could have it running in a few minutes.
Modular, multi-lang, UTF-8 throughought and pretty easy to skin.
Unlike other CMS' I have seen built on frameworks, PyroCMS doesn't touch the core framework at all, which means future upgrades of CodeIgniter will be easy.
you should take a look at silverstripe - besides the fact hat you really should read about what a framework nowadays can deliver, so some basic knowledge about Rails and Django is absolutely essential to put yourself in a position of beeing able to decide yourself what is good for you and what is not.
One most important thing ignored is RESTful-ness - many CMS or Frameworks still not support it or at least do it very complicated. Yuo need to read about REST to understand, why you want a framework or / and CMS that suppirts REST.
Talking about Joomla here is, of course, a joke.
Use Joomla. It probably won't teach you much but you will get a very nice system. Professional level even. Joomla has a MVC framework but most of what you do will be configuration. But really who wants to do a cms any more anyway? So many of them out there.
All kidding aside, Joomla is written in php, scales nicely and has a nice admin interface for the client/end user. It is also used all over the place.
If you really want to learn a usable framework try to write the cms in zend or codeigniter. those are beautiful frameworks.
If you really want to experiment a popular PHP framework while developing a simple CMS, look for a real CMF.
The only one I know at this time is Symfony2 CMF. It's a set of Symfony bundles providing popular CMS features like the Node concept, blocks, menus, dynamic routing (for routing to newly created nodes), etc.
Using a CMF instead of a CMS prevents you to configure your application only using a big administrative back-end and make you to understand the framework behaviors. As a consequence, you will be able to use the framework (Symfony in my example) even for a non CMS related project !
Using a CMS like Wordpress or Drupal (which is built on top of Symfony) will hide you the framework.
P.S: Actually, Symfony CMF is only compatible with Symfony 2. But beta versions of the bundles are already available for Symfony 3. Anyway, there is a LTS version of Symfony 2 whose bug fixes support ends in 2018 and security support in 2019 !

Categories