-
Notifications
You must be signed in to change notification settings - Fork 445
Code Functional Reference
Sometimes you just need a 10,000 foot "birds eye view" of what's going on inside the code. Here's the place.
Beginning in 2.4.0, we began converting global variables to static classes. This gives us more flexibility and clarity when referring to these necessary variables.
If you find yourself tempted to add to the legacy Include/Functions.php
file, please evaluate whether the function would be better placed in a static class.
-
SystemURLs
- Document Root - The physical path of ChurchCRM on the server. i.e. /var/www/html/ChurchCRM
- Root Path - The path of ChurchCRM relative to the current domain. i.e. http://www.domain.com**/churchCRM**
-
SystemConfig
- Read / Write access to all of the system configuration options found in System Settings | General Settings
- We use PropelORM to provide a PHP object model for database entities
- These classes are automatically generated at build time, and are located at
src/ChurchCRM/model/*
- As of 2.4.0, there is still a lot of legacy code that relies on direct calls to SQL. These should all be replaced by ORM calls
schema.xml is used to automatically generate the base model like this:
/propel/schema.xml ---> (/propel/propel.php) ----|---> /src/ChurchCRM/model/ChurchCRM/Base
|---> /src/ChurchCRM/model/ChurchCRM/Map
To debug the ORM queries, you can use syntax similar to the following:
$rawSql = (new BookQuery)::create()->filterById(25)->toString();
Source: Propel: Get Raw SQL from Query object?
Any change to the database schema must increment the minor revision number by one. (i.e: 2.x.0.).
Schema changes must be applied to:
- The UI pages that reference the changes
- The
Schema.xml
document used to generate the ORM - The
Install.sql
file used for initial installation - The
Upgrade.sql
file to be used during the upgrade of existing installations - The
ChurchCRM-Database.sql
file in the demo directory for TravisCI tests to pass
There is a lot of legacy code that obscures the line between logic and page rendering. Wherever possible, program / business logic should be separate from page rendering.
We have a window.CRM object: window.CRM.root
represents the $sRootPath
path as defined in Include/Config.php