Changeset 468 for trunk/docs/codebase_v1-to-v2_upgrade_checklist.txt
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/docs/codebase_v1-to-v2_upgrade_checklist.txt
r334 r468 1 <?php2 3 1 ===================================================================== 4 2 In General … … 8 6 9 7 include SITE_BASE . '/_templates/header.ihtml'; 10 8 11 9 do this: 12 10 13 11 include 'header.ihtml'; 14 12 15 13 16 14 2. CODE_BASE is a defunct constant. The location of the codebase is no longer important as long as it can be found in the currently configured include_path. This will usually include the local site directory (where the codebase normally would be found) as well as the server-wide /usr/lib/php directory where the codebase might be included for the whole server. So now, instead of this: 17 15 18 16 require_once CODE_BASE . '/lib/Utilities.inc.php'; 19 17 20 18 do this: 21 19 22 20 require_once 'codebase/lib/Utilities.inc.php'; 23 24 21 22 25 23 3. $CFG-> variables are gone. Most of these should be converted into their $app and $auth equivalents. 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: 26 24 27 25 $CFG->gallery_images_url = '/gallery_images'; 28 26 29 27 should become: 30 28 31 29 $cfg['gallery_images_url'] = '/gallery_images'; 32 30 33 31 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: 34 32 35 "{$cfg['gallery_images_url']}/my/path". 36 37 If the value used is now to be retrieved from a $object->getParam(...) method call, you'll need to do this: 33 "{$cfg['gallery_images_url']}/my/path". 34 35 If the value used is now to be retrieved from a $object->getParam(...) method call, you'll need to do this: 38 36 39 37 $object->getParam('gallery_images_url') . '/my/path' … … 43 41 44 42 <a href="<?php echo ohref("$CFG->site_url/my/file.php"); ?>"> 45 43 46 44 to this: 47 45 48 46 <a href="<?php echo $app->ohref("/my/file.php"); ?>"> 49 47 50 48 (In other words, the URL should be a not-fully-qualified URL starting with a slash.) 51 49 … … 62 60 '\1' => '\2' 63 61 )); 64 65 62 63 66 64 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: 67 65 68 66 global $cache; 69 67 70 68 at the top of the function. 71 69 72 70 73 71 74 72 ===================================================================== … … 80 78 --------------------------------------------------------------------- 81 79 $CFG global variables are converted to object properties specific to their usage. 82 80 83 81 For example: 84 82 … … 98 96 Convert functions to methods. 99 97 100 raiseMsg(...) $app->raiseMsg(...) 101 logMsg(...) $app->logMsg(...) 98 raiseMsg(...) $app->raiseMsg(...) 99 logMsg(...) $app->logMsg(...) 102 100 include 'message_header.ihtml'; $app->printRaisedMessages(); 103 101 $carry_queries = array(... , ...); $app->carryQuery(...); //call for each value in array 104 ohref(...) $app->ohref(...) 105 printHiddenSession(...); $app->printHiddenSession(...); 106 dieURL(...); $app->dieURL(...); 107 dieBoomerangURL(...); $app->dieBoomerangURL(...); 108 setBoomerangURL(...); $app->setBoomerangURL(...); 109 getBoomerangURL(...); $app->getBoomerangURL(...); 110 validBoomerangURL(...); $app->validBoomerangURL(...); 111 deleteBoomerangURL(...); $app->deleteBoomerangURL(...); 102 ohref(...) $app->ohref(...) 103 printHiddenSession(...); $app->printHiddenSession(...); 104 dieURL(...); $app->dieURL(...); 105 dieBoomerangURL(...); $app->dieBoomerangURL(...); 106 setBoomerangURL(...); $app->setBoomerangURL(...); 107 getBoomerangURL(...); $app->getBoomerangURL(...); 108 validBoomerangURL(...); $app->validBoomerangURL(...); 109 deleteBoomerangURL(...); $app->deleteBoomerangURL(...); 112 110 sslOn(); $app->sslOn(); 113 111 sslOff(); $app->sslOff(); … … 121 119 ===================================================================== 122 120 DB 123 ===================================================================== 121 ===================================================================== 124 122 125 123 dbQuery(...) $db->query(...) … … 209 207 210 208 $lock = new RecordLock($GLOBALS['_admin']); 211 209 212 210 to: 213 211 … … 215 213 global $auth; 216 214 $lock =& Lock::getInstance($auth); 217 215 218 216 And instantiate the original global $lock object in _config.inc.php as follows: 219 217 … … 236 234 237 235 $version = new RecordVersion(); 238 236 239 237 to: 240 238 … … 250 248 Changed all method calls to now require object calls rather than static calls. In other words, change this: 251 249 252 if (SessionCache::isCached('mydata')) { 250 if (SessionCache::isCached('mydata')) { 253 251 $list = SessionCache::getCache('mydata'); 254 252 } … … 304 302 305 303 include_once 'form_error_header.ihtml'; $fv->printErrorMessages(); 306 307 308 ?>
Note: See TracChangeset
for help on using the changeset viewer.