Changeset 237
- Timestamp:
- Mar 8, 2007 4:02:29 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/codebase_v1-to-v2_upgrade_checklist.txt
r236 r237 22 22 require_once 'codebase/lib/Utilities.inc.php'; 23 23 24 24 25 3. $CFG-> variables are gone. Most of these should be converted into their $app and $auth equivelents. If a $CFG variable is NOT something used by the codebase but is still needed by the website application, I suggest converting these values to a $cfg array. For example, this: 25 26 … … 32 33 (And of course change the code where they are used to support the array instead of object-properties. If the array is inside of double-quotes it should be written like "{$cfg['gallery_images_url']}/my/path".) 33 34 35 34 36 4. $CFG->site_url is not needed when referencing URLs. Change this: 35 37 … … 41 43 42 44 (In otherwords, the URL should be a not-fully-qualified URL starting with a slash.) 43 45 46 47 5. Expect formatting incosistencies! When doing global search-replace expect whitespace to be erratic, variable names to change, and lines to be otherwise inconsistent. Here's a good example of a safe way to match a line: 48 49 Searching for "$CFG->ssl_domain = 'www.example.com';": 50 51 $CFG->(\w+)\s*=\s*['"](\w+)['"]; 52 53 Replace: 54 55 $app->setParam(array( 56 '\1' => '\2' 57 )); 58 59 60 6. Many classes now require object-method calls, and the object must be globally scoped. For example, to call the $cache->exists() method inside a function, be sure to add: 61 62 global $cache; 63 64 at the top of the function. 44 65 45 66 … … 262 283 263 284 264 =====================================================================265 HINTS266 =====================================================================267 268 1. Expect formatting incosistencies! When doing global search-replace expect whitespace to be erratic, variable names to change, and lines to be otherwise inconsistent. Here's a good example of a safe way to match a line:269 270 Searching for "$CFG->ssl_domain = 'www.example.com';":271 272 $CFG->(\w+)\s*=\s*['"](\w+)['"];273 274 Replace:275 276 $app->setParam(array(277 '\1' => '\2'278 ));279 280 2. Many classes now require object-method calls, and the object must be globally scoped. For example, to call the $cache->exists() method inside a function, be sure to add:281 282 global $cache;283 284 at the top of the function.285 286 3.287 288 285 289 286 ?>
Note: See TracChangeset
for help on using the changeset viewer.