I'm trying to find a project that incorporates the "best practices" that are discussed and debated on a daily basis for almost all languages but I'm trying to focus on php5.
Is there a php5 open source project that I can comb through to see working examples of project that exemplifies Units Tests, Dependency Injection and other best practices
I'm basically researching for a new large project and wanted to see a shining example project in all it's glory instead of the snippets of code that are endlessly debated. Since this project will not inherit a whole bunch of legacy code I'm really trying to get things right from the start.
It seems like you are looking for something like Zend Framework!
Check out Kohana Framework too. In fact, most of the popular frameworks have great PHP code. I can not say the same for Wordpress, osCommerce, etc. Magento seems to be OK, maybe a little over engineered.
Here are the list of few libraries which are having good php standards
Laravel - PHP Framework with tons of goodies
Guzzle - CURL library
PHPUnit - PHP Testing Framework
Carbon - DateTime handling library
Faker - For generating fake data
Many more are there, the following link will help you more
https://github.com/uhub/awesome-php
Related
I'm looking for a "good" PHP framework to suit my needs:
well-documented, preferably with a handful of beginner tutorials (majorly, majorly important.. I looked at Kohana and felt like I wouldn't be able to jump in with both feet and learn it)
fairly solid community (either here on Stack Overflow, or on a forum) for questions, etc
stable and time-tested
greatly reduces amount of code/coding (e.g. what jQuery does for JavaScript)
I'm pretty solid at PHP, I'm just looking for something that will help speed up the development process, handle cleansing input from users, simplify database queries, that sort of thing. MVC and OO is nice, but not exactly a requirement for me.
Have you take a look at symfony?
Symfony (version 1 or 2 - doesn't matter) has a great documentation (with a book to guide you building a web, a book showing you how the framework works, and the usual API documentation). Check here for the full documentation of symfony1 and symfony2.
Symfony2 is rather new, so while I can say it's stable (I'm using it and quite sure it is), time-tested-ness (is that a word? :p) is not so good. But if you want a stable and time-tested, you could try symfony1, because it's still supported until 2013.
The symfony community is also great, both the user community and the developers. Stackoverflow also has many good symfony users, and you can check their mailing list and other resources here.
As for reducing amount of code, symfony comes with a lot of standard library, ORM, and many code-generation tool (usually called from command line). So yeah, it save so many code. In symfony1, you can even generate a CRUD application without a single line of code written by you. I know you also can do this in symfony2, but I haven't tried it yet. You can be sure that you will more focused on coding your business logic well than fighting the framework.
Hope this helps.
I am a newbie in PHP Frameworks and would like to share/discuss some experience with you guys. Getting straight to the point, what I understand till now (from a newby stand of point is this):
CodeIgniter + Doctrine + Twigg = Symfony:
Zend + Doctrine + Twigg = Symfony
Symfony 2, uses php5.3 (I realy like namespace stuff remind me .Net)
but it lucks of tutorials right now (only partial jobeet translation to ver2)
I enjoy CI community and noumerous tutorials, plus using Doctrine + Twigg I could achive the same with Symfony.
Zend is more enterprise with lots of tutorials, but more difficult to grasp than CI.
So the question is should I start with CI + Doctrine or learn directly Symfony2?
Am I correct with the above assumptions?
Start with CodeIgniter if you are new to frameworks. Both Symfony and ZF have a greater learning curve and if you're not familiar with some concepts you might get fustrated in the beginning with the more complex frameworks .
I would suggest you to go with Symfony 2 since it has got lots of good stuff built around it. Take a look at this article http://www.phparch.com/2010/02/symfony-2-benchmarks/.
Hope this link is very useful on learning Symfony 2. It's a tutorials based on days (21) teaching you how to create a calendar website. Good luck.
http://symfony.com/blog/do-you-know-jobeet
More:
http://symfony2easy.blogspot.com/
http://www.dobervich.com/2011/03/03/symfony2-blog-application-tutorial-part-i-project-setup/, http://www.dobervich.com/2011/03/05/symfony2-blog-application-tutorial-part-ii-the-data-model/, http://www.dobervich.com/2011/03/09/symfony2-blog-application-tutorial-part-iii-routing-controllers-and-templates/
it really adds up to what your requirements are.
Symfony is great, though my only bash on it is that it requires PHP 5.3, which is great, but make sure your host has 5.3 support. Also the issue of using CLI bugs me.
CodeIgniter 2 on the other hand requires 5.1.6, which is good for me as my host is still on 5.2; I also like how small CI was compared to Zend or Symfony. Now like you i like some of symfony's components and i use 2 of them (swift mailer & twig) on my CI install. doesnt mean you should just junk ci and go symfony. CI is built to be a stepping stone framework that you can build on. Symfony to me is a full-fledged framework with everything and the kitchen sink.
having said all that, not all frameworks are created equal. I use CI for one project and Kohana for another. Kohana offered me something i liked that CI didnt do and thats fine.
I think you should look at the different frameworks out there, some are full featured, some are bare-bones and allow you to grow with your needs.
You may quick start with Cygnite PHP Framework. Simple yet powerful tool to build your next project. It gives you exceptional performance. Check benchmark results:
Performance benchmark results
I was looking for a fresh forum software (threaded) or bulletin board (flat/partitioned). And I'm wondering if there's an implementation based on one of the big PHP frameworks (CodeIgniter, Kohana, Yii, CakePHP, ZF, Seagull, Fusebox, Symfony, eZ, Prado, or whatever...).
Reason: A framework based implementation would be inherently more secure, because of ORM and validation and abstracted processing logic. And also would be good showcase of the framework itself.
Tutorials and example implementations of e.g. blogs are frequent for each PHP framework. But I didn't find much in the area of forums/boards. There was only a single implementation "sfSimpleForumPlugin" for Symfony, in alpha stage and seemingly abandoned, too bare-bones for practical use anyway.
However I'm surely not looking for a feature-bloated forum script. Just the common functionality, and ;) an excellent sample application for the particular PHP framework.
It's surprisingly hard to google. Is there something? Framework homepages not helpful. (And they all use phpBB or something.)
The new version 2 release of Vanilla Forums has just been recoded from scratch as an application that runs on a new PHP MVC framework called Garden. While most have probably not heard of Garden, I think the fact that it powers such a popular forum package ("382,287 sites use Vanilla Forums") stands as somewhat of a testament. If you view Vanilla's application code on GitHub, you can see that the folder structure looks similar to what you would find in other MVC frameworks. Although there doesn't seem to be an official website for the framework yet, the author has released a series of blog posts that give some insight into why the framework was developed and what features it contains.
There are many:
CupCake forum on CakePHP
Web3CMS on Yii
Also interesting for you: Comparison of Internet forum software (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.
I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal.
What would be the best PHP framework
to use to build this quickly,
efficiently and with the smallest
learning curve?
I have narrowed down to CodeIgniter as the major contender for this project - but having looked through the docs I couldn't find a library or class that I can use with paypal - is the same for all frameworks- surley not?
Zend framework - I considered this but although its documentation is very good, hardly any video tutorials - other frameworks seem to have lots of these especially with normal developers creating screencasts - where is the Zend community!
CakePHP - Having read the stackoverflow threads, I gathered this is a slow framework, giving developers little control as it seems to be a CMS backbone rather than a framework - agree? It was also said cakePHP and Zend have a steeper learning curve than CodeIgnitor.
I have start my short-listing again and I would appreciate any help with this.
Thanks all
You'll very likely find CodeIgniter to have the lowest learning curve. Regardless of the framework you choose, you'll have to pick up where the framework leaves off, and that is going to mean a significant amount of work on your part (if you truly want to implement all the features of ebay). There seems to be a PayPal lib in the CodeIgniter Wiki. Looks like it would be a great place to start.
Cake is not a CMS backbone, it's a framework like the others. It's just more opinionated, i.e. geared towards CRUD operations (create, read, update, delete, what you typically do in a CMS). If your application is focused on CRUD, Cake will give your development a kickstart; you can get a complete admin interface for your database tables up in, literally, minutes.
Thanks to that it may be a little slower, especially compared to "loose" frameworks like Zend, but in the end it won't matter much. You can do anything with any of these frameworks and any of these frameworks can be optimized to run as fast as possible. Try to get a simple prototype app up and running in all of them and choose the one that seems most comfortable to you.
I'd really recommend Codeigniter for speed. I've made a few things with it and it was great.
If you need some help learning Codeigniter Nettuts has been doing some really good screencasts
In the end, it won't matter. Your code for database and presentation will trump any 'problems' your framework has. The frameworks you listed are awefully similar. You'll be more or less stuck with which you pick, so pick one and learn all you can.
If you're going with codeigniter (note, maybe take a look at Kohana too, the php5 fork of CI), you can always use libs out of Zend if theres something that fits your needs.