So I'm about to start a big Property Management System for the cloud. This Hotel system already exists in VB.net technologies, and now we are porting the whole system to web.
We are trying to decide between ASP.net or PHP, we are thinking on PHP because ASP.net would cost too much on licensing and servers. So there is Laravel, Symphony, CodeIgniter, Zend, etc..
The thing is, this project is suppose to live for years to come. But we feel like getting constraint ed by using a PHP framework, because every time the framework gets updated then we need to update our whole system. For example.. now Laravel got updated from version 4 to 5. And the whole folder structure changed. I can't imagine having our big system needing to be updated and keep up to every Laravel version update. How do you keep up with this ?
Also, what would happened if Laravel disappears, its the trendy fashion now. But we see PHP frameworks come and go.
Would it be wiser not to use any php framework and building everything from scratch to have more control over it ?
You should first note that using a framework is primarily meant to solve two issues;
Force coding into a certain 'format'. Collaboratively working on code can generate 'hacked' solutions, or unmaintainable code. A framework can be the force which helps keep these things in check.
A framework comes with a certain core-code which handles for example database abstraction, routing, etc. which can save you a lot of time to develop yourself.
An extra thing to mention; when implementing new features, there is the possibility someone has built it before and maybe even better than you would have anticipated.
Keeping up with the framework should not be too hard, as long as you abide by the coding guidelines of the framework. With the bigger frameworks, new releases have (or after sometime generate) tutorials on how to port your previous version into the new version format.
Choosing which framework to use, is a question which is opinion-based and not suited to discuss here, but keep in mind that you choose your framework according to your needs. Also check how big the community is and how much 3rd party plugins/code exists (the more, the longer the framework will last).
Good luck!
You could see a framework as a base to start from. Remember that you get all the code! Look at the code. Do you like it? Does it fit your requirements? Using a framework gives you a huge advantage over making everything yourself from scratch.
But do you need to update? Would you update your own code constantly? Perhaps it's not always needed. Sure, if there is a security issue you should do something about it, but seeing every update to a framework as essential is just plain nonsense.
I build projects aimed at specific versions of frameworks and libraries. I try to build in flexibility so I can swap out frameworks and libraries, and versions, but I often find that I stick with what's working.
Some people might not like this, and argue you should always be on the latest version, but I find that completely impractical.
Related
Here's the thing. I love Ruby and I've been using it for the past couple of years. I love everything about the language and the community.
But I have this soon-to-be-large WordPress site, where I have to implement a lot of additional functinality. The problem is, I really hate customizing WordPress beyond simple theme design.
Examples of things I need to do:
add some additional information to profiles, like karma/points/reputation system
offer users to create their own page after they're allowed to do it
pulling data from some external API and displaying it on the user's profile
I got really used to the whole agile BDD workflow, where I go from Cucumber features to RSpec to implementing the stuff, and the whole WordPress architecture looks to me like ok I'm just gonna have to pray this works.
I'm not sure if it's even wise to try to write some part of the app in Ruby and try to make it work together with WordPress, or if I should just take WordPress as the only thing I've got and make the most of it's strenghts and weaknesses.
The main issue for me is that everything I'm going to write in PHP will take about 5 times as long than if I do it in Ruby, and it will probably also be more secure and robust, since I don't have as much experience with complex PHP stuff. I mean I've done a lot of PHP in the past, but I always felt like the whole thing is going to fall apart at one point.
I know there is probably no definite answer on how to approach this, but any suggestions are welcome.
We've integrated a Rails app into a TYPO3 installation. It worked out pretty well. The key point is to use Rails' support for adapting models to tables of a legacy app. An important point is to handle authentication which we handle by passing the TYPO3 session key to the Rails app in a hidden way (using PHP as the web-client and passing appropriate headers) and looking it up in the session table (respecting the session timeouts). The Rails app itself is mapped into a sub directory using passenger. Performance is very good, it's even amazing compared to our previous implementation trying to use Extbase.
So, in conclusion: If you do it right and the interfaces between the two apps are well planned such an approach can offer great benefits and the best of two worlds. If not done right or you don't understand some implications of Wordpress (like security) you will create a big mess prone to security breaches.
BTW: We reached feature parity with the Extbase (MVC framework in TYPO3) solution after 4 days of using Rails. The Extbase solution took 6 weeeks and caused a lot of headache and trouble. So your time factor may be even better than 5:1.
Why not learn how to to Behavior Driven Development in PHP for WordPress? In fact, this is one of the great opportunities for developers in 2017. We now how full blown BDD frameworks in WP-Codeception, so that you can even automate Gherkin feature files, just like in Cucumber. Check out WordPress-BDD.com for some usefull info.
The "Framework" question has been asked a bunch of times here but having read everything I can find, I can't find the answer to this question.
I'm creating everything from games, to CMS's, social applications, etc. I've used Zend and CodeUgnighter briefly, but when I deliver it, its going to have a bunch of unnecessary folders and it requires anyone who wants to modify my program to know the framework, and they've got a mountain to move if they want to update it to the latest version of the framework.
It just seems to me that frameworks were designed mostly for super large projects where its being designed for one customer, not a released program. It seems like all the big packaged php products out there make their own frameworks (vbulletin, etc).
its going to have a bunch of unnecessary folders
These uncessary folders are stored in one folder and are needed for the framework to work, is that the 10, 20, 200 Mb which is problem? Storage is cheap nowadays, why cares?
it requires anyone who wants to modify
my program to know the framework
You got it! It is an advantage, not an inconvenient. If it doesn't, the guy which will read your code will need to understand your habits, your convention, and they probably are not so common.
If you are able to write consistent code, following any conventions, why not.
But it can also gives your customer a real plus value since he knows that anyone could take back your work if you have to leave for any reasons.
they've got a mountain to move if they want to update it to the latest version of the framework.
In any case upgrading a framework, an application to a new version is most of the time a moutain since in a production environment, you need to test, and test again, to be sure your application is stable.
Most of the framework give releases notes which should let you know about backward compatibility.
It just seems to me that frameworks
were designed mostly for super large
projects.
Zend or Code Igniter fit well for medium sized project, with time you developed framework extensions and you'll be able to save time and bugs on smaller project.
It seems like all the big packaged php
products out there make their own
frameworks (vbulletin, etc).
PHP framework are youngs, most of them are 3/4 years old (Zend, Symfony). A lot of application like Vbulletin are older.
There a lot application based on common framework, but they don't target the same people.
Joomla, Drupal, Wordpress have their own framework (procedural, or object) but they target more the end-user.
However a solution like Magento, which uses Zend Framework, is designed to be extended and very customizable with extensions.
There are many light-weight PHP MVC frameworks, each with varying degrees of features and flexibility. The majority of these are going to be lacking advanced features, but will get the job done.
One that comes to mind is: http://www.kissmvc.com.
Hope that helps :)
You're right that most frameworks are tailored towards 'one size fits it all', meaning they have a lot of stuff that you won't necessarily need on every project. Which sometimes makes them a bit heavyweight. More 'modern' frameworks DO have a strong focus on modularization, but when it comes to the core there are often a lot of inter-dependencies.
One solution: Roll your own framework, dissect code from other frameworks and use parts you like/need. If you can, lean more towards using libraries that focus on specific tasks that you need. E.g. ORM for databases, you might as well use doctrine since it's area of expertise is very focused. Just as an example.
Either way, if you do it right it's a lot of work upfront trying to figure out what you even need. Start with the basics, how do your controllers work, do you need the full implementation of MVC with front controllers, action controllers, maybe page controllers for a CMS? Where can you cut corners, where not? It really depends a lot on what YOU need for your specific product (or product palette).
The other solution, like Serge mentioned, is getting a lightweight framework which really just focuses on the basics. And fill all the holes yourself, or by using 3rd party libraries where they are available.
I personally use a heavily modified version of FLOW3 (currently in alpha development) which uses a lot of cool stuff, but lacks a bit when it comes to using legacy databases (they have their own domain model implementation). Which is what I changed mostly for my version.
I recently started working for a web firm as a freelancer, taking my hobby of coding in PHP to a career level, and since then I have been overwhelmed by the amount of work that needs to be done within short time frames.
The problem isn’t being able to do what is asked, but being able to do it all as quickly as is needed of me. I never used any PHP frameworks, but if I started using one, would that speed up the entire development process? If so, how drastically?
Also which framework would be best for my purpose?
If it matters, what I do is mostly build back end CMSs and tie that in with front end functionality for small business client sites.
Once you know a Framework well (i.e. don't have to spend time learning how to use it), yes, it helps speed up both :
The development process
The maintenance process
Why ? Well, probably, at least, because :
It provides guidelines
No need to think (too much) about what goes where, or how to do X or Y
Those guidelines are known by everyone who knows the framework -- which means you can hire a guy that knows the framework, and he'll need less time to be efficient on your project
It provides a lot of useful libraries
which means less time spent re-inventing the wheel
and components that are already integrated in/with the framework ; which makes it easier to use them from your application than some random external component
Now, for the "which framework should I use" part... it's mostly a matter of personnal preferences, and there are many existing questions about that on SO.
To only give you a few links, you can start taking a look at questions+answers such as :
PHP Framework Decision - Analysis paralysis!
What PHP framework would you choose for a new application and why?
To use a PHP framework or not?
PHP - MVC framework?
Which PHP Framework is right for this project?
Best PHP framework for an experienced PHP developer?
And there are many others -- you can use the search box, in the upper-right corner of the site, to find more ;-)
They certainly do.
Something to be aware of is there are variable learning curves depending on the framework that you decide upon. So you might experience slower development initially while getting comfortable in a new environment.
I have seen the zend framework recommended may times.
firstly if you go to phpframeworks you can view exactly what kind of framework would fit your work load.
next, frameworks initially take time to implement corectly, but once everything is done, it speeds up considerably your development time for your projects. However what's nice about this is that if your framework is done correctly you can apply it to all your projects. Where I work currently we have a framework that is implemented and it applies to all the sites that are being developed. if you want each project to have the same type of look and feel and functionality then a framework is your best bet
however if it's just for one project it might be a little too much.
We have been going back and forth a lot around our office lately about abandoning a proprietary framework that was developed here a couple of years ago and move to something that is larger and community supported.
Our current solution was built to include only the things we need and is very flexible, by flexible i mean that it is loose and the developers that have built sites with it over the years have take liberty in that, so a lot of sites we manage and have built and not to any standard at all. Here at the office I use the framework somewhat but prefer to use other tools. Over the years I have used a lot of PHP frameworks ranging from Code Igniter to CakePHP and have been a big fan of Zend Framework for all my personal projects so I am heavily biased and that is why i am asking here for advice from people who may be able to give me a more objective opinion. In the office a lot of work has been done on our framework so I can understand why some people might be hesitant to abandon it but the way i see it is this:
We don't currently spend a lot of time keeping our framework current and checking it over and over for bugs, we fix them as we find them. Which we should be doing
Any work done to improve our framework is directly put into our overhead column
We have a application built on top of our framework that is subscription based and closed source that we sell and I feel could be better if built to a better standard using a popular, community driven, framework that would require or encourage these things.
I searched and found this thread, Why do I need to use a popular framework?, that was similar to what I am asking but not quite. What i am asking for are opinions on as to why you would do one thing or the other, i don't really want to start a conversation about which framework is better, that will be the next step for us if we chose to switch.
Here are some of the reasons i see switching to a supported, open source framework as helping us in the long run:
As PHP puts out new versions the core of the framework will be updated to take advantage of those things without us having to do the work.
Security concerns with the libraries will be found by the community and patched without our involvement other than updating our code base with the current version.
Lots of information on the internet and exisitng code that can be used as reference
Ability to hire outside programmers that know the framework already, instead of hiring people and expecting them to have to learn how to use our proprietary one.
Ability to give back to the community through patches, plugins, helpers, and support.
Here are the negatives that I have come up with:
We will have to port all the existing code we have in our custom application to the new system
Our employees will have to be allowed a certain amount of time to learn a new framework and it's ins and outs
Our current framework is very flexible and loose which allows us to build things how ever we want and this keep our developers from having to follow and obey and conventions, which some developers seem to hate. I personally like conventions
Again it is probably obvious that I am biased and this is the reason I am asking here, I am open minded to what anyone might have to say.
Your question is really devilishly biased, because all pro's are long-term and all con's short-term development pains. :) But if the situation is even half as much as you describe, switching is the right thing and will save a lot of money in the long run.
My company is in the same sort of situation. We have a custom developed framework in Perl that never seems to get quite as much attention paid to developing new features and fixing bugs as the open source frameworks do. I and most other developers would love to switch to something open source for the benefits you mention, but nobody has the budget to spend the time porting code over. Our current plan is to use an open source framework if we have any small, new projects come up, and if that's successful consider moving older apps over.
I've mostly worked with Perl and Ruby, but a trend I'm seeing more of these days is frameworks allowing you to mix and match framework core components. For example, we're considering integrating parts of our custom framework into Catalyst. That way we can still use some of our custom developed code components (our own DBI class and some Mason templates) and porting our applications won't be as difficult. Ruby on Rails is also moving in the direction of being more modular.
Perhaps there's a PHP framework that might allow you to use some of your code, or at least make it easier to shoehorn some of your code into the framework instead of starting from scratch. Googling I see most of the PHP frameworks claim to be modular, but some appear to just allow you to develop add-ons, not swap out core components.
Sounds like you're doing some good analysis and I wish you luck in your search.
I think the most important points you highlighted here. The decision now, should be based, on numbers. Technically your analysis is perfect. What i would ask now is: How much it would cost for your company,to:
* keep your app to take advantage of new php improvements without break your old code (it means: architecture analysis, development and test, test, test).
* Do you have any developer/analyst focused in security development? (it means: security development life cycle, test, test, test).
* Do you have a development methodology? Normally those frameworks are kept under a good distributed development methodology.
I had the same question than you sometime ago, and my company decided to choose a framework, migrate our code, allocate 2 developers 1 day per week to work on the framework. To put our team to work with the framework development team was good, because we learned more about the framework, we helped the community (demagogy :-)) and we could add some business requirements in the framework features road map ;-)
I and my team are nearing completion of porting an existing application across to run on Zend Framework and it's gone quite well.
The old application had a lot of issues that were going to be big problems to fix and we decided to take the plunge and rebuilt it in ZF.
It has however taken a long time to port, I would estimate for our application it's taken us a good 4-5 months of dev to port everything across (we have taken the opportunity to rejigg the database and other areas of the system).
If you do go for it then be prepared to explain to your bosses why you need to spend a good chunk of time porting rather than working on income generating work. We were lucky to be able to use a new project as the impetus to carrying out all this work.
I see a couple of cons of switching over.
First, of course, there's:
We will have to port all the existing
code we have in our custom application
to the new system
Followed by:
We will have to port all the existing
code we have in our custom application
to the new system
and, last, but, not least:
We will have to port all the existing
code we have in our custom application
to the new system
You were talking about "money in the overhead column", and rewriting working tested code in to new working tested code doesn't add a whole lot of value.
If you're talking about introducing a new framework for a brand new, unrelated project, or one that uses little of the existing code base, then, sure, knock yourself out. That's a fine opportunity to switch frameworks, platforms, languages, etc.
But an existing, shipping, mature code base with existing knowledgeable folks working on it?
That's a hard pill to swallow, personally.
If you want folks to follow standards and conventions, then ... follow standards and conventions. Since you have a system that allows folks the "freedom to what they want", make "following standards and conventions" something they want to do.
It's always better to transition a system incrementally that throw the whole baby, bathwater, soap, basin and towels out the window just to go back and redo the exact same thing again.
Everyone wants to rewrite code, I want to do it. Our framework needs a "do over" here. But then we go "yea, but..." and what do we get in the end? N Months of effort to get back to where we are now. That doesn't do much in a world where time to market matters.
I am deciding on a framework to try out for PHP. I have narrowed it down to CakePHP and CodeIgniter. I have a couple of questions for any of you who have used or are familiar with both:
I like the fact that CakePHP keeps most of the code outside of the webroot by default. Especially since I may end up using a single framework install for multiple apps. I see CodeIgniter will do that too, but you have to configure it and move some stuff around. Is that workaround secure and reliable, or is it an afterthought hack?
Which (if not both) is easier to upgrade, and maintain over the long term? As new versions of the framework (and PHP itself) come out. I don't want to find my stuff either breaking, or becoming outdated.
Edit:
This is a very old post, but I thought I would update it with what I finally ended up doing, which was to use Kohana.
You should try both frameworks for a week or so, building something trivial (like a blog or wiki) in both, and see which you prefer using. Whatever makes the most sense to you will probably sustain you the longest through upgrades an deprecations.
CakePHP is in a bit of a volatile state right now, still unearthing bugs while pushing to release version 1.2 (which is not backward compatible). I wouldn't suggest building a critical application with it if you need something rock solid right now. If you can wait a month or two for things to settle, then it's probably a moot point.
To address your concerns:
1) Cake and CI do it the same way (iirc). They are equally secure, reliable, and hackish on this front.
2) Everything changes. If you need concrete, perpetual assurance of stability and backward compatibility, roll your own framework. There's not that much to it, and you're guaranteed that nothing changes unless you want it to.
I have deployed multiple applications on CakePHP and it's been a very, very, nice experience. You can't go wrong either way, as both are solid.
is a non-issue.
CodeIgniter has a sponsor behind it, so it's definately the one to choose for the long term. Also, it's faster.
This is a non issue. The app has a couple of lines which says where the core and your application code lies. You just need to change those lines.
You can never anticipate this one.
The state of PHP is a wildcard here. One app (CI) is built to be compatible with PHP4 the other requires PHP5. If you need to deal with the possibilty of a web host only supporting older versions of PHP then you need to go with CO.
Another issue is unit testing. If you require your framework to ship with tests, then CI is not the way to go.
Personally, I feel comfortable with CI because of the corporate backing. The company behind CI is making real profit from their efforts. Though CI is free, their paid product (ExpressionEngine) will eventually live on CI. The same could be said of the Zend Framework and even the birth of Rails (originally built for Basecamp.)
A minor correction to an above comment: both are compatible with PHP4, not just CI. Also, I don't think that having a sponsor makes CI and more or less upgradable or maintainable. Money doesn't solve those problems in the least.
I use CakePHP for a variety of applications and I've been happy with it thus far. 1.2 is a huge improvement over 1.1, and while the library source may change from RC3 to Final, I don't think any code you write will become obsolete. My only niggle is that the Manual isn't as comprehensive as it should be (in my opinion), and I end up in the API quite a bit. The trade-off there is that I now understand the code behind the scenes very well. In any case, I highly recommend it.
On the other hand, I've never played around with CI, so I can't recommend CakePHP over CI. I would take each for a spin and see which one grabs you. Whichever one you choose, study the hell out of its conventions and capabilities. When I started with Cake, I unwittingly wrote a bunch of code to do something Cake did "automagically" by having me set one variable in the controller.
CodeIgniter is very flexible as you would see once you try it. So how your application would be maintainable would fall you your hands.
I have also deployed multiple applications using the same installation. I usually create 2 applications for CMS projects (one for admin, one for the front-end).
To address both of your questions from a CodeIgniter perspective (I don't use Cake):
1) CodeIgniter doesn't keep itself outside the webroot by default, but it can do so with some very simple changes. The first part of my CI tutorial series explains how to do so, along with a walk through of the setup of a new CI instance. Once finished the only part of CI that needs to be in the webroot is a small index.php bootstrap file.
2) I've got an application which I originally developed in CI 1.4.x and I've sucessfully migrated to 1.5.x then 1.6.x. With each new release the CI dev's make available detailed upgrade instructions laying out what needs to be replaced so upgrades are fairly easy.
Jim.