Changeset 237 for trunk/docs


Ignore:
Timestamp:
Mar 8, 2007 4:02:29 AM (17 years ago)
Author:
quinn
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/codebase_v1-to-v2_upgrade_checklist.txt

    r236 r237  
    2222    require_once 'codebase/lib/Utilities.inc.php';
    2323   
     24   
    24253. $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:
    2526
     
    3233(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".)
    3334
     35
    34364. $CFG->site_url is not needed when referencing URLs. Change this:
    3537
     
    4143   
    4244(In otherwords, the URL should be a not-fully-qualified URL starting with a slash.)
    43    
     45
     46
     475. 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
     49Searching for "$CFG->ssl_domain = 'www.example.com';":
     50
     51    $CFG->(\w+)\s*=\s*['"](\w+)['"];
     52
     53Replace:
     54
     55    $app->setParam(array(
     56        '\1' => '\2'
     57    ));
     58   
     59   
     606. 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   
     64at the top of the function.
    4465
    4566   
     
    262283
    263284
    264 =====================================================================
    265 HINTS
    266 =====================================================================
    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 
    288285
    289286?>
Note: See TracChangeset for help on using the changeset viewer.