Developer Documentation¶
Working on the project¶
develop branch contains the most current working code of the
Project and should be considered beta.master branch is the most current stable release of
LibreBooking.master
(hardreset) and develop (rebase) branches for you. Please commit
bugfixes / features to a new branch prefixed bugfix-, feature-
so they can be looked over, and pull requested to the develop
branch and will eventually end up in a release on master.Design philosophy¶
[page].php should
- define ROOT_DIR
- include /Pages/[page]Page.php
- construct [page]Page and call PageLoad()
Each page should have at least one corresponding template in
/tplEach page should have a corresponding class in
/PagesEach Page class should have a corresponding presenter class in
/Presenters
API¶
LibreBooking has a REST-API API-Documentation
User interface¶
/tpl and, by default, are cached to
/tpl_c/Web/img/<icon-name>.pngTools¶
Run composer install-tools in the root of the project to install
Phive-managed tools into the /tools directory.
Run composer install to install Composer-managed tools into
/vendor/bin (for example php-cs-fixer).
Phing¶
composer build Builds / Packages a distributable relase inside
/build configured via /build.xml.
PHPUnit¶
All classes should have good unit test coverage. The level of coverage is up to the developer and should be done when the code is sufficiently complex. Tests must all succeed for a final release.
PHPDocumentor¶
Generates automatic documentation based on code comments. You can
customize the output by copying /phpdoc.dist.xml to /phpdoc.xml
which now takes precedence and isn’t tracked with git. The documentation
will be generated in /.phpdoc/build.
PHP-CS-Fixer¶
composer phpcsfixer:lint and composer phpcsfixer:fixApplication Structure¶
/config Application configuration
/Controls All reusable page control objects
/database_schema Base and upgrade sql scripts
/Domain Domain specific entities, repositories, services, etc
/Access Domain repository objects (db abstraction layer)
/Events Domain events
/Values Value objects
/Jobs All tasks that run on a schedule (cron tasks, for example)
/lang Translations
/lib All application supporting objects
/Application Most of the subdirectories are self-explanatory
/Admin Application administration logic
/Attributes Custom attributes
/Authentication Authentication (login)
/Authorization Authorization (access)
/Reporting Logic for generating and running reports
/Reservation
/Notification Post-reservation logic
/Persistence Creating, updating, deleting reservation information
/Validation Pre-reservation logic
/Schedule Schedule population
/User
/Common Non-specific shared objects (localization, dates, smarty, etc)
/Config Configuration read/write
/Database Database access and abstractions
/Email Email abstractions and services
/external Third party libraries
/FileSystem Filesystem, I/O object
/Graphics Creating and manipulating images
/Server Web server abstractions (sessions, cookies, etc)
/WebService Objects for creating and invoking web services (the API)
/Pages Page binding and work flow logic
/phing-tasks Custom build tasks that hook into phing
/plugins Contains subdirectories for each type of plugin
/Presenters Application logic, page population
/tests All unit tests
/tpl All Smarty page and control templates
/tpl_c Default Smarty template cache directory
/uploads Default file upload directory
/Web All user facing pages
/scripts All application related javascript files
/WebServices The LibreBooking API
Database¶
you can open
/doc/LibreBooking.mbw
with MySQL Workbench to
edit/update this ERD