System files structure
Windu CMS is built on 3 main catalogs which are:
- app - all the system files and whole PHP engine of our CMS
- data - this one intrests us more, all the user data, graphic templates and widgets.
- cache - here system saves cache files
In the data folder we have subfolders and its structure looks like this:
- backups - all the backups are saved here, available in the PRO package
- database -all database files are here
- files - here you can find all the files, images and any other files uploaded to the system. This folder is strictly connected to files and images server engine that's why its not worth to look into it
- functions - additional smarty functions, everything that we want to add to smarty while creating our own function
- languages - folder with language files for both admin and front. Subfolders with a given language are created automatically when we add a new language
- log - in here Windu saves help files for requestLog and firewall system
- themes -all the templates which were added or installed to Windu
- widgets -storage for a widgets files.
app - applications folder
In this folder we have the core of the system and collection of plugins responsible for functions in Windu.
- controller - folder with controllers, which are php files called out based on the entered path, in the controller we have basic actions displaying contents or performing "do" operations
- core - consists of basic php files executing base system action, this folder contains whole "logic" required for Windu to work
- includes - starting configuration files of Windu
- model - this folder contains files supporting model, which is our database, every table has its file
- plugins - contains all the plugins. A plugin is a separate part of code using both model and core to operate, the plugin has independent configs and routers which overwrite Windus operations. For example the administrators panel or images server or files are a separate plugin.
- admin - this plugin holds Windus whole administrators panel! Every plugin has its own folder with configuration and controller files and also templates, plugin can also have its own folder containing files supporting database tables.
- database - contains basic extensions for tables and databases. It has files which enrich functions of a given table by extending it.
- file - manages files added to Windu excluding images
- front - responsible for displaying website
- html - responsible for displaying html contents, contains smarty and forms engines
- image - manages images
- mail - responsible for sending out mails
- pdf - generates pdfs from chosen contents
- rss - responsible for rss feed managment
- update - repsonsible for system updates
- widget - responsible for support of widgets on our website
- wp - our example plugin, in this case webprojector.org which is actually seperate plugin of Windu!
- resources - folder with image, css and jss files resources
- templates - folder with default views, like error404
Windus engine operates according to the following logic:
- index.php - Http query is directed to the folder with our CMS where its then directed with the use of .htaccess file to index.php. In this file paths and basic system variables are set. Then configDB.php is called out.
- configDB.php - here databse configuration is being loaded and also another part of start configuration is attached.
- config.php - another part of starting constants is being attached. In config.php file there are basic parameters such as defined structure of files and folders in windu and defined which plugins are supposed to be loaded up.
- init.php - is a key file for system to work, the whole logic is called out inside, this file contains whole autoloads which load up classes for Windu and also calls out the correct controller based on the router.
- pluginManager::loadMainConfigs() - call out inside of init.php loads up starting data from plugins. On this stage we completely loaded up config of the system. System is ready for first operations.
- router::instance()->callController($request) - call out of a controlled based on a path. System downloads routing tables,which the router uses to knows to which controller it has to refer to. By default the index action is called out, however in routing the variable #action can be defined, which tells us which action from the controller to call out.