In this section, we will work on the mymodcarrier
module.
Directory listing is enabled on a lot of web servers, and sometimes you can't disable it (it depends on your hosting provider). In our case, if someone wants to see the content of our module, he just has to write the path of the module in his browser.
In my case, the URL will be http://localhost/prestashop/modules/mymodcarrier/
. If I enter this URL, the browser will display the following screen:

To avoid this behavior, just add an index.php
file in all the directories. In our case, it will be in:
/modules/mymodcarrier/
/modules/mymodcarrier/classes/
/modules/mymodcarrier/controllers/
/modules/mymodcarrier/controllers/front/
/modules/mymodcarrier/controllers/hook/
/modules/mymodcarrier/install/
/modules/mymodcarrier/views/
/modules/mymodcarrier/views/img/
/modules/mymodcarrier/views/js/
/modules/mymodcarrier/views/templates/
/modules/mymodcarrier/views/templates...