-
Notifications
You must be signed in to change notification settings - Fork 1
/
development-guide.txt
91 lines (76 loc) · 4 KB
/
development-guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
A) Project:
- GIT Repository - https://git.code.sf.net/p/phpscheduleit/source
- To contribute and submit your code please contact Nick Korbel <[email protected]>
- Programming paradigm: toward 100% object oriented PHP5
- Please include the GPL header on every new source file with your name and year. If you are altering an existing file, just add your name and year.
B) Requirements:
- Web server (Apache/IIS)
- PHP 5.3 or greater
- MySQL 5.5 or greater
C) Getting the development branch running:
1) Set configuration values
Update config/config.php with your local settings
2) If you have phing and are on Windows
Run /build.bat setup.db
2) If you do not have phing
Create the database and user
run /database_schema/create-db.sql
run /database_schema/create-user.sql
Open http://localhost/booked/Web/install
D) Development branch technical information:
1) Application 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 Booked API
2) Design philosophy
The Model-View-Presenter (MVP) pattern is used to keep a clear separation between application logic and presentation logic. Page objects act as thin abstraction to the template engine and typically have no other logic. Presenter objects orchestrate interactions between underlying application logic objects and the page. This typically includes fetching and transforming data and minimal application logic.
[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 /tpl
Each page should have a corresponding class in /Pages
Each Page class should have a corresponding presenter class in /Presenters
Logically related code should be grouped in a directory with a "namespace.php" file, which requires all files in that directory. This simply makes it easier to include necessary file dependencies.
All classes should have good unit test coverage. The level of coverage is up to the developer, but I'd encourage TDD and .
3) User interface
Smarty template engine (www.smarty.net) is used for all UI presentation. Page templates are located in /tpl and, by default, are cached to /tpl_c