- Timestamp:
- Dec 11, 2013 12:34:37 AM (10 years ago)
- Location:
- branches/eli_branch
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch/bin/file_importer.php
r412 r443 123 123 // } 124 124 // 125 // ?> -
branches/eli_branch/bin/module_maker/form_template.cli.php
r412 r443 249 249 250 250 echo join("\n", $output); 251 252 ?> -
branches/eli_branch/bin/module_maker/list_template.cli.php
r412 r443 213 213 214 214 E_O_F; 215 216 ?> -
branches/eli_branch/bin/module_maker/module.cli.php
r413 r443 596 596 } 597 597 } 598 599 ?> -
branches/eli_branch/bin/module_maker/skel/admin.php
r408 r443 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 236 236 $db =& DB::getInstance(); 237 237 $app =& App::getInstance(); 238 238 239 239 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); 240 240 if ($lock->isLocked() && !$lock->isMine()) { … … 278 278 $db =& DB::getInstance(); 279 279 $app =& App::getInstance(); 280 280 281 281 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id); 282 282 if ($lock->isLocked() && !$lock->isMine()) { … … 314 314 $db =& DB::getInstance(); 315 315 $app =& App::getInstance(); 316 316 317 317 // Remove any stale cached list data. 318 318 $cache->delete('list'); … … 337 337 $db =& DB::getInstance(); 338 338 $app =& App::getInstance(); 339 339 340 340 $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']); 341 341 if ($lock->isLocked() && !$lock->isMine()) { … … 364 364 global $tmp_prefs; 365 365 global $cache; 366 $db =& DB::getInstance(); 367 $app =& App::getInstance(); 368 366 $db =& DB::getInstance(); 367 $app =& App::getInstance(); 368 369 369 $where_clause = ''; 370 370 … … 425 425 return $list; 426 426 } 427 427 428 428 // The list was not cached, so issue the real query. 429 429 $qid = $db->query($sql); … … 445 445 $db =& DB::getInstance(); 446 446 $app =& App::getInstance(); 447 447 448 448 if (!is_array($ranks)) { 449 449 $app->logMsg('Saving rank failed, data posted is not an array: ' . $ranks, LOG_ERR, __FILE__, __LINE__); … … 476 476 } 477 477 } 478 479 ?> -
branches/eli_branch/bin/module_maker/sql.cli.php
r412 r443 218 218 219 219 echo isset($op) ? '' : "\n\n\n"; 220 ?> -
branches/eli_branch/docs/codebase_v1-to-v2_upgrade_checklist.txt
r334 r443 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.