Set a single entry point

The first significant change we make in Alixar (based on a copy of Dolibarr 10 ERP) is to create a single entry point.

Alixar, unlike Dolibarr, will have only one entry point, which will be the index.php file in the main folder. In Dolibarr, the different options of the application run directly executing the corresponding file.

The way Dolibarr does it means at least 2 serious problems:

  • It can be easier to hack, having to control many entry points
  • Every time you need to access a common file, you have to keep in mind that the application runs from different folders, so when you don’t know the entry point, we need to know the path from the executable file.

The main problem is that it involves a very important change in the way the application works, and therefore it is difficult to do without breaking the code.

The code will be broken for a few days until the process is completed, and still, there will be no guarantees that everyone is fixed.

How do you get a single entry point?

To obtain a single point of entry, the original routes of Dolibarr are renamed as follows:

It would be as follows.

It could be the case that there were more levels of nesting, for example compta/bank/card. PHP would happen to be ?controller=compta/bank&method=card.

As you can see, this change involves changing all the links in all the pages and menus to the new format.

You can review the evolution of the code in the official repository:

Leave a comment

Your email address will not be published. Required fields are marked *