Answer the question
In order to leave comments, you need to log in
DIY CMS
Are there manas or books for writing cms or is it just for true ninjas?
If someone had such a problem and he has literature, then can share it?
I really want to be enlightened. I’ll google it myself over time, but while I’m looking for something worthwhile, it will take a lot of time that I could spend reading and browsing.
Thanks to all.
Answer the question
In order to leave comments, you need to log in
The author, and what to google. There are at least 3 ways: pick a simple Open-Source CMS (problem: find a CMS with good architecture and neat code), get a job in a company that has its own CMS (and almost every studio has it), and finally write it yourself correctly.
Mana is needed not for writing a CMS, but for the products and technologies used.
First you need to decide on the task. Install and use several CMS just to see how they work. (if you can't do that, you need to learn the basics of installing and configuring apache/mysql/whatever, not writing a CMS. Leave to practice these skills). Also, there is a good site where demos of dozens of CMS are installed and you can see them without installing them.
Write down what you want to get, sketch out the pages. Decide on the requirements for your CMS. What modules will be in it, how can they be managed.
CMS usually consists of 2 parts - the so-called. "admin panel" (password-protected section where the site configuration changes, materials are added) and the public part of the site that users see.
If you haven't given up yet, let's move on to the next step. Architecture design and CMS writing. To write a complex CMS well, you need experience and understanding of how to write complex programs in general. Deep knowledge of HTTP/HTML/CSS/JS/SQL is required. Namely:
- the system must be modular, so that, having written the basis, it would be possible, without rewriting it, to slowly add modules and expand the functionality
- the system should be written using a competent architecture and neat code, since maintaining and rewriting bad code will take too much effort from you. And then no one will be able to understand it at all.
What else do you need to know. First, you need to have an idea what MVC or 3-tier architecture means.
M in MVC is Model. CMS will most likely store data in the database - you need to know what DBAL is and how it is written (google: PDO), placeholders in queries, perhaps Table Gateway, get acquainted with what ORM is, and why PHP ORMs are so slow. If you make models, do not store field values in public properties - this is inconvenient and breaks encapsulation. Store them in a private $attributes array.
V is for View. You need to know what template engines are (read the Smarty, Django Templates, HAML and XSLT manual for a general idea of what they are). For PHP, good options are to use pure PHP or XSLT if you can. Smarty is outdated brake junk, Twig also has flaws. And you should not put a template engine, just to write {$a} instead of [?= $a =].
Do not mix logic (complex calculations, database access) and templates. Better make 2 files: one with the code, the other with the template. Ideally, the template engine receives the values of variables from the controller and, apart from helpers, does not call any other code.
C - controllers. But this is the simplest part, the controller is just a class with methods like viewAction(), editAction() and a router that looks at the URL and calls the desired controller. See how Zend_Controller and Zend_Front_Controller work and do the same, but simpler. throwing out 90% of the functionality - you won't need it.
It is necessary to somehow make the system component without strong ties: so that the kernel can work without modules, and adding a module does not require adding code to the kernel. Read about Dependency Injection, as well as Observer (observer is when we make the addEventListener () function).
Don't use hooks like in Drupal. This is a bad and vicious way, apparently taken from ancient times and C programming.
What else. Having mastered all these concepts, in principle, it will not be difficult for you to write a CMS, but read also my tips on how to write correct code in Spanish. OOP: habrahabr.ru/qa/17158/#answer_70869
Writing your own bicycles is, in general, useful and helps to expand the horizons of the developer, makes him study different approaches to writing code.
What else. If (which I highly doubt) thanks to my humble advice you can still go through this difficult path and become a successful developer, you can pay me money. I'm not against.
Most likely your bike will be with square wheels, no seat and so on. But almost every php programmer wants to write this in the first couple. Mana on writing cms met repeatedly, but it's better not to read them. Get better acquainted with programming patterns, read 37signals so you don't drive a bulldozer for bread. Be sure to understand what MVC is, otherwise you will have mess in the code. Try to understand the code of frameworks or ready-made tsms. And even better, give up on this idea, and if all the same you are so drawn to cms building, then find a ready-made cms, understand it and help improve it, write plugins and so on.
Make several sites on different popular CMS: Joomla, MODX, Drupal,… Write for them by module/component.
In order not to do extra work, you can take projects on freelance, plus there will be at least a symbolic payment.
As for working on a CMS, I would advise you to take some kind of framework as a basis. Now, I would take Zend as it is written academically correct, but at the same time it is quite difficult for beginners to understand. From a simpler, it seems, Yii is now in vogue.
And then, hang on the framework all the best that you have seen in every CMS or even come up with a new solution to a specific problem. Somehow I did it.
In general, writing a CMS is for “true” cyclists. Let's face it, you probably won't get anything of value, but it will help you understand the finer points of designing a modular system, the CMS domain, hopefully OOP, the MVC pattern, and templating engines, and give you invaluable experience developing a huge and complex project.
In general, after writing such a bike, my personal level has soared in a year from something I can write from scratch, before I can do everything and calmly without experience even with Zend and reading manuals, I write in Magenta, which just recently seemed like a Chinese letter.
it is more useful to download a couple of ready-made open source and figure out why they are written that way.
www.bhv.ru/books/book.php?id=8541
Here in this book, as a final example, it describes step by step how a CMS and a forum are made. Everything is clear and detailed. According to the principle "from simple to complex". For a start, I think that's what you need.
Writing a CMS is a huge job. There is nothing wrong with trying to write a CMS yourself for educational purposes, this is the best way to learn design in practice and gain experience that will help you understand ready-made CMSs and write normal code on them. Before writing a CMS, you need to write a Framework for it. You can start by looking at ready-made solutions, such as Symfony2. Before practice, it is necessary to study the theory, design patterns, optimization methods, etc. You should not risk using your CMS on combat sites and servers, because it will almost certainly contain vulnerabilities and architectural errors that will create a lot of problems for you or your colleagues in the future.
To begin with, you can take some light engines that have minimal functionality, see how it is implemented, then take another one, tweak it, and eventually you will begin to understand the structure itself (this, by the way, is a very important point). In fact, books are not needed, it will be more difficult with them, when I was finishing the engine, I did not read anything other than descriptions of functions. Yes, I was sitting on one function for 2 hours, but now I understand perfectly how it works and it will take me no more than 10 minutes to implement it. The main desire is to complete what has been started)
Everything is simple.
1. Learn a thread like Symfony 2 (more difficult) or Kohana (easier).
2. Learn more about Nested Sets for operating with tree structures (articles in categories, comments).
3. Make a CMS.
Read books on information systems architecture. Any.
Start with Martin Fowler.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question