What PHP structure to choose for an older project

Iโ€™m working on my senior project, and the topic that we agreed on was CMS, which, like Drupal, will simplify the work by providing reliable administration capabilities. Some of them include: Content type and creating a data field (CCK) Creating views Integrated user management (tasks and roles) the ability to add third-party modules later - intercepts templating capabilitites

Now the point is that I would have to demonstrate sufficient knowledge and understanding of the software architecture and development process. Of course, I will not start from scratch, but I can not demonstrate Drupal in my documentation either

I would like to use a framework on which to create skills, not too complicated, and one that will still force me to write code - a senior project concerns my work and not the work of the php community

I started with Kohana, but I really didn't like it. His poor documentation and frequent changes to the codebase made me stop.

I think of something very small and sweet that does not appear at every step and says: โ€œHey, you know that I can do it better than you.โ€ Something like CakePHP, maybe.

I know that more or less all the code I need is available there. However, the case here is a bit more academic.

Any suggestions?

+4
source share
5 answers

I fully enjoy CodeIgniter . It does not have CakePHP / Rails' magic features, but it automatically comes with a good MVC setup and a good base library for forms, an ActiveRecord implementation for sanitizing POST data, and other nice things that I just don't prefer for every project.

Their introductory video on creating a blog is all I needed to get hooked. Good syntax, good practice ... I can not recommend it enough for your project size / style.

EDIT

As commentators note, I will align the pluses in the form of markers:

  • Small file size (upload - 2.1 MB, but actual files to use ~ 1.5 MB)

  • Libraries and helpers called on demand โ†’ minimize memory usage

  • Great docs . Not a big fan of the drop-from-top effect, but they are written in readable English with good examples.

  • Extensibility - a large number of libraries written by the community

  • Supports MVC architecture

  • Good built-in security features

+5
source

You must make Cohan your choice. I do not understand your reasons to avoid this.

There are two versions of Kohana per minute, versions 2 and 3.

Version

The current release for line 2. *: 2.3.4 and 2.4 should be released when the documentation is complete and cleaned out. 2.4 - release that changes the API.

The current release for line 3. * is 3.0.3, and the API is frozen until the next major release (for many months).

Documentation

People complain about the Kohana documentation, which I think is unfounded. Some time ago this might have been true, but a lot has changed quite a lot. Kohana 3 has fantastic documentation that can be found here and has an extensive third-party wiki at kerkness.ca .

The documentation for line 2. * may not be as good, but it is certainly enough to get you started at least. When 2.4 is released, it will be as good as Kohana 3s

CodeIgniter Notes

Once you come across using CodeIgniter, you should be aware of some of the idiotic design mistakes they made.

  • They initially decided to disable the use of $ _GET by running $_GET = array() in one of their main files. Then they decided to include this in the $allow_get configuration parameter. I donโ€™t understand this at all.
  • Remaining with PHP4, they reimplemented several methods not found in PHP4. I'm sorry they wonโ€™t cross, damn it; even their users started writing plugins and libraries in PHP5.
  • Session support is absolute shit. People still have problems with this daily. Want to have different session drivers? (native, database or cookie) No, you have only one choice.

Some of the points from Alex Mcp are also invalid.

Small file size (upload - 2.1 MB, but actual files to use ~ 1.5 MB).

Kohana is also a couple of MBs, but this should never be the basis for choosing a framework.

Libraries and helpers called on demand โ†’ minimize memory usage

This is where CodeIgniter sucks. In PHP5, you must create a static method and call it like this: Class :: method () ;.

I hated the way CodeIgniter $this->load->helper('form') etc.

Ask yourself, who's stopping right now?

Great documents. Not a big fan of the drop-from-top effect personally, but they are written in readable English with good examples.

See above.

Extensibility - a large number of libraries written by the community

Kohana also has hundreds of extensions, http://dev.kohanaphp.com/projects/ and <a3>

CodeIgniter allows you to extend classes using the special prefix "My_" for your classes. Kohana does this using a cascading file system, so a file named "form.php" in your application will automatically override "form.php" in the system directory.

If you really want something that will not bother you and help you, and not bother you, then Kohana is the way to go.

Only my 2cents on this.

+10
source

Ok, I personally tried Symphony, Zend Framework and Kohana. Of these three, the Zend Framework made the best first as well as the best second impression on me. I have been using it for more than a year (almost two years, I think), and I have encoded several custom content management systems for my clients (each of them depends on the needs of my client).

Further, I am currently working on my bachelor project, which is also developing a type content management system, and I am using the Zend Framework for it.

The symphony was great, but I had two problems.

  • On Windows, running Symphony commands (for example, to create a new project with the default directory structure) took too much time (it always took, like 10 seconds before the command started). I believe that this was a known problem, but for a long time it remained without attention.
  • The documentation (at least at the time I tried Symphony) was inconsistent, and there were examples of untrusted code and other errors, and that could be quite annoying.

The Zend Framework has very good documentation, so I really managed to convince me of this, plus there is a very useful community here in StackOverflow that helped me solve many problems.

I also like that it does not develop at such a fast speed as Kohana or Symphony. I'm kinda like a guy who likes to get used to a certain way of doing something, and I don't like to change my habits every three months.

+2
source

Buy from CodeIgniter: Enables you to implement a clean MVC architecture without requiring a book of instructions. The community is also great, so you will not be alone.

+1
source

In addition to the options suggested above (CakePHP, ZendFramework), I also suggest you take a look at Symfony

0
source

Source: https://habr.com/ru/post/1301131/


All Articles