Frameworks

Hi,

Up till now I’ve been very resistant to using frameworks, mainly because I enjoy the challenge of figuring out how a particular project is going to be coded. In some way, using a framework to me feels as though I’ve cheated - handing over control and having to code a specific way, not the way I’d like to. I’ve tried building a framework myself, but time has always been an issue. I like giving the designers complete access to everything displayed in the form of template files, rather than hiding HTML text and structures in the programming or mixing the HTML with inline PHP code, which makes it harder for them to edit in my opinion.

As much as I don’t like the idea, its becoming obvious that my development time is becoming more and more limited, so the pressure needs to be relieved. Frameworks are probably the answer, but I’m uncomfortable with having to drastically change the way I code to fit the framework. I also don’t want to lose the freedom to write my own functions (uploaders, validators, etc), which is something I enjoy.

With all this in mind, what sort of frameworks or approaches would anyone suggest? And is my view of frameworks crazy?

Thanks in advance

Yes.

Zend Framework.

To be a little more elaborative - e.g. ZF let’s you code things the way you like.
If you don’t like a particular implementation - override it.
If your missing something - write it.

I’m pretty sure every major framework handles it this way, otherwise they wouldn’t be popular.

I thing that zend is huge and so more difficult to learn all this api.
You may look at some other frameworks with more ease to learn as Yii and [URL=“cakephp.org”]cakephp.
My opinion is that you have to learn also OOP,design paterns and generally good code practise also with a framework like these, it will help you to write “good” code.

I’ve been coding OOP route for a couple of years now; feel comfortable with that approach.

Having a look at zend framework. Took me ages to figure out how to install it (granted, it was 2am and I was watching super bowl at the time). Still few things I need to look at with that.

I’ll have a look at Yii and cakePHP as well. What are your views on codeigniter?

Given your apparent level, stay away from CI, Kohana et al.

Best bet, IMHO, Symfony & ZF.

I worked with CI and I do not like it.
It is simple and it has good docs but the frameworks mentioned here are better.
Symfony is good but as I thing more complicated from Yii and cakephp.

I’ll have a look at Yii and cakePHP as well. What are your views on codeigniter?

In terms of OOP best practices and design patterns, etc…

Zend and Symphony are superior to CakePHP and CodeIgnitor, etc.

Cheers,
Alex

Had a look at CI and didn’t get along with it. As a package its well documented, but coding felt more restrictive.

Been busy last few nights, so will give Zend another go in next few days. Will have a look at Symfony as well.

Question: Our server runs numerous websites, so would I need to install Zend then create project every time a website is created? or is the install only needed once then project files extracted from batch are copied for each new build?

Granted, I still have more to read up on Zend, but I’d appreciate any ideas on what others do when dealing with multiple websites on a server.

Thanks for all the replies so far, they’ve been extremely helpful.

Depends on your web-servers’ configuration, really. In normal “shared hosting” it isn’t possible to use files across multiple instances of that hosting, and I always configure my server that way, as I don’t want customer 1 to be able to read the configuration files of customer 2. In this set-up, there are two options: create a directory somewhere that has reading permissions for all webhostings, so that you can reuse the same installation of the library over and over, or install the library separately on each account.

Then, you’ll have to take the versions of the framework into account just as well: it’s not uncommon to have different applications utilising different versions of the framework, as you normally won’t update all applications at the same time.

I’d create a directory called /www/frameworks/ or something like it, and every time I’d use such a framework from there, I would probably create a symlink to it from the webhosting account. Eg. ~/lib/ -> /www/frameworks/zend/1.10/. When the time comes to update, you can just change the symlink and be done with it (if they haven’t broken backwards compatibility again).

Sorry, I should’ve been more specific. We owner a dedicated LAMP server with root access via a control panel.

The library of framework installs sounds a really good idea webaddictz, thanks. I do that with third-party plugins (Jquery, mootools, etc), storing them by version number on a single domain, then reference it on applicable sites. I guess the theory copies across to frameworks?