1 | -------------------------------------------------------------------------------- |
---|
2 | Strangecodebase branch 2.0 dev |
---|
3 | -------------------------------------------------------------------------------- |
---|
4 | |
---|
5 | Codebase self contained. runs without reference to external files or info. |
---|
6 | - can be located in /usr/local/php/lib/php for server-wide access |
---|
7 | - does not include any files outside codebase |
---|
8 | - does not write to files outside codebase |
---|
9 | - does not try to determine it's location or site parameters. this will minimize it's failure to glean this info. |
---|
10 | - will still run if info missing: db creds, log dir, session info. |
---|
11 | - can be located in /usr/local/lib/php if necessary, so accessible by all sites. |
---|
12 | |
---|
13 | remove interdependencies: |
---|
14 | - App() is the only dependency for other classes. It includes Utilities.inc.php silently. |
---|
15 | - admin_id vs. user_id |
---|
16 | - libs requiring external files, such as html templates and email templates, make classes self-contained. |
---|
17 | |
---|
18 | App object: |
---|
19 | - object belongs to a realm, keeping messages and session data within specific site/app. |
---|
20 | - uses the singleton pattern so only one instance of App exists for each app. |
---|
21 | - app object can be accessed globally without reference to object name by calling methods statically, e.g. App:logMsg() |
---|
22 | - seperate application and codebase parameters from site configuration variables. |
---|
23 | Use $app->getParam('var') or App::getParam('var') to get app params and for site configurations do whatever you want |
---|
24 | I'm using $cfg['node']['features'] format for configurations |
---|
25 | |
---|
26 | Application configuration vars |
---|
27 | - defaults part of the app class |
---|
28 | - do not need to be set in any specific order |
---|
29 | |
---|
30 | One application will always have distinct: |
---|
31 | - Configurations: |
---|
32 | - log dir |
---|
33 | - log config |
---|
34 | - debugging |
---|
35 | - charset |
---|
36 | - maybe sessions |
---|
37 | - Objects: |
---|
38 | - auth object |
---|
39 | - security roster |
---|
40 | - Environment: |
---|
41 | - even seperate codebase installs if necessary |
---|
42 | - include path |
---|
43 | - site/doc/web root |
---|
44 | - lang |
---|
45 | - $dbh database handler |
---|
46 | |
---|
47 | DB object: |
---|
48 | - Self contained class for DB functions. db::query is the only necessary function. Maintains connections and state independent of App. |
---|
49 | |
---|
50 | Things with modified interfaces: |
---|
51 | - App |
---|
52 | - Auth_SQL |
---|
53 | - DB |
---|
54 | - DBSessionHandler.inc.php |
---|
55 | - RecordLock |
---|
56 | - RecordVersion |
---|
57 | - SessionCache.inc.php |
---|
58 | |
---|
59 | Full test suite for all codebase libraries. Run from the command line: "codebase/tests/run_tests.sh;" |
---|
60 | |
---|
61 | Classes that access database tables have a function initDB() that will setup the basic schema necessary to run. This includes Auth_SQL, RecordVersion, RecordLock, and DBSessionHandler. |
---|
62 | |
---|
63 | -------------------------------------------------------------------------------- |
---|
64 | Strangecodebase branch 1.0 release |
---|
65 | -------------------------------------------------------------------------------- |
---|
66 | |
---|
67 | This is the primary stable release used before we started using Subversion. It was maintained erratically by one erratic person. No revision info documented, sorry. |
---|
68 | |
---|
69 | |
---|