Rewriting php application in CakePHP

So, I really think about rewriting my application using the flash framework, as I think this will facilitate the interaction of people and also improve the design of the application.

CakePHP looks like the best of PHP web frameworks. Does anyone have any experience? What are the caveats I should consider when moving from PHP with manual coding to using a framework?

+6
php cakephp
source share
7 answers

Depending on the structure you have chosen, the first thing you need to know is the following:

  • You will need some time to find out.
  • you will do things at this time ^^
  • therefore, note that it will take some time before you are fully functional :-)

I think these points are the most underestimated points: using the framework takes little time ... Using this well and taking full advantage of it takes ... Well, a couple of months, maybe .. This means that when you are at the end of your project, you will say: "I have to rewrite this with all the things that I learned when re-recording for the first time": -D

What does this mean: to find out what the infrastructure can do, to learn how to use it, and to use it for some time on small applications before starting to rewrite your big one!


Then, probably, there are no "best frameworks": one framework can be very well suited for one project, and the other may be better for a second, different project.

I have never worked with CakePHP; I really like the Zend Framework . But this is a personal opinion, and O knows people who really love symfony ; they are not mistaken: symfony is great - and I'm not mistaken either ^ ^
However, we sometimes agree on some things; as the fact that Doctrine (by default the symfony ORM level) is really great stuff, and we tend to use both symfony and ZF-based projects ...


If you are motivated, you can take a look at many posts about SO, about structures ... Here are a few of them:

  • What structure of PHP would you choose for a new application and why?
  • Is Symfony a good place to learn?
  • What do you think is the best PHP MVC framework?
  • Is Symfony a better choice than Zend for the web development store (10+) because it is a complete stack structure?
  • Best PHP platform for an experienced PHP developer?

Good luck with these ^^
("What structure" is a rather passive-subjective question ^^)

+8
source share

CakePHP has good details, but no “better” structure. Here is a thread with some tips on what's good in most popular PHP frameworks.

If you've never used MVC frameworks before (and Cake is an MVC framework), I think you should first become familiar with MVC architecture .

+2
source share

"CakePHP looks like the best of PHP web frameworks."

This is subjective. You should compare the pros and cons of other PHP frameworks that will suit your needs.

These messages may help you:

https://stackoverflow.com/questions/2648/what-php-framework-would-you-choose-for-a-new-application-and-why

Why do I need a popular framework?

https://stackoverflow.com/questions/249984/php-framework-decision-analysis-paralysis

+1
source share

FWIW, I used it for a while when I was developing php. I found it easy to use, and the quick development aspect was great, and I would suggest that it has just improved over the last 3 years. There is subtle help on the irc channel , and the documentation is good. I have not stood in PHP long enough to become an expert. However, I was just starting out as a programmer and then came across Larry Masters (creator, aka phpnut), and he was just a good person to talk about design principles and a good guy. Again, you don’t have to be a super-good guy to write a good web framework (I look at you DHH).

+1
source share

Most frameworks “connect” you with them, which means that you need to do something in your own way. If you want to do something that is not intended for them, you usually need to hack it. For example, how many PHP frames does Facebook Connect currently support?

Personally, I prefer the "framework" that you can use only those parts that you want. Zend is like this, Doctrine and Propel are ORMs that are designed to be used with other code. For example, the Symfony framework may also use.

Finally, I did not find the popular PHP framework that scales well.

0
source share

I used cakephp for several projects. From the moment I found out about this, I have never written php without it (unless it's fun code in which I want to try something new or learn other design ideas from MVC). As already mentioned, studying this will take some time. How much time it really depends on your background. If you used a different MVC environment for the web scripting language, you will learn it very quickly; RoR developers will pick it up within hours / days. If you do not have experience with MVC frameworks, this may take you a bit, but it will really save your time later on the road (including in the project you are starting from).

Until today, I am still learning new things about CakePHP every time I start a new project, although I copy its source code in many ways (you definitely don't need to do this, the documentation and help tips are more than enough).

I definitely recommend you study it. This will save you a lot of time and think differently (if you are not using MVC).

Good luck.

0
source share

CakePHP configuration agreement has several advantages if you recognize them:

  • it helps you organize and understand the code
  • simplifies the interaction of several developers with the same application
  • allows developers to understand other developers' applications

You have two main options when rewriting an outdated application in CakePHP:

  • change the database schema to reflect conventions - resulting in less code
  • encode your models to interact with an outdated database - this book goes into all the details.

In any case, once you have done this, it’s pretty easy swimming and good training.

0
source share

All Articles