Changeset 151 for trunk/bin


Ignore:
Timestamp:
Jun 6, 2006 3:19:17 AM (18 years ago)
Author:
scdev
Message:

Q - Changed one more SessionCache? -> Cache, small bug fixt to Prefs, added operation help to modulemaker scripts.

Location:
trunk/bin/module_maker
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/_config.inc.php

    r136 r151  
    33 * code by strangecode :: www.strangecode.com :: this document contains copyrighted information. */
    44
    5 // Determine common site directory.
    6 $common_base = realpath($_SERVER['argv'][1]);
    7 
    85// Test argument.
    9 if ($_SERVER['argc'] > 1 && '' != $common_base && is_dir($common_base)) {
     6if ($_SERVER['argc'] > 1 && isset($_SERVER['argv'][1]) && '' != $_SERVER['argv'][1] && is_dir($_SERVER['argv'][1])) {
     7    // Determine common site directory.
     8    $common_base = realpath($_SERVER['argv'][1]);
     9   
    1010    // First arg is path to current site. Realpath removes trailing /s
    1111    define('COMMON_BASE', $common_base);
  • trunk/bin/module_maker/list_template.cli.php

    r136 r151  
    1616    $db_tbl = $_SERVER['argv'][2];
    1717} else {
    18     die(sprintf("Usage: %s site_directory db_table [operation]\n", basename($_SERVER['argv'][0])));
     18    die(sprintf("Usage: %s site_directory db_table [operation]\nValid operations include: %s", basename($_SERVER['argv'][0]), join(', ', $valid_ops)));
    1919}
    2020
  • trunk/bin/module_maker/module.cli.php

    r143 r151  
    1818    die(basename($_SERVER['argv'][0]) . " Error: invalid arguments. Try like this:
    1919
    20     " . basename($_SERVER['argv'][0]) . " site_directory name_singular name_plural [clean]
     20    " . basename($_SERVER['argv'][0]) . " site_directory name_singular name_plural [operation]
     21   
     22Valid operations include: " . join(', ', $valid_ops) . "
    2123
    2224The following files will be generated by this script:
  • trunk/bin/module_maker/skel/admin.php

    r143 r151  
    3333$fv = new FormValidator();
    3434
    35 $cache =& SessionCache::getInstance();
     35$cache =& Cache::getInstance();
    3636
    3737%SORT_ORDER%
     
    250250    global $lock;
    251251    $db =& DB::getInstance();
    252     $cache =& SessionCache::getInstance();
     252    $cache =& Cache::getInstance();
    253253   
    254254    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     
    285285    global $auth;
    286286    $db =& DB::getInstance();
    287     $cache =& SessionCache::getInstance();
     287    $cache =& Cache::getInstance();
    288288   
    289289    // Break the cache because we are changing the list data.
     
    306306    global $auth, $lock;
    307307    $app =& App::getInstance();
    308     $cache =& SessionCache::getInstance();
     308    $cache =& Cache::getInstance();
    309309   
    310310    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']);
     
    334334    $db =& DB::getInstance();
    335335    $prefs =& Prefs::getInstance();
    336     $cache =& SessionCache::getInstance();
     336    $cache =& Cache::getInstance();
    337337   
    338338    $where_clause = '';
     
    411411{
    412412    $db =& DB::getInstance();
    413     $cache =& SessionCache::getInstance();
     413    $cache =& Cache::getInstance();
    414414   
    415415    if (!is_array($ranks)) {
  • trunk/bin/module_maker/sql.cli.php

    r147 r151  
    1616    $db_tbl = $_SERVER['argv'][2];
    1717} else {
    18     die(sprintf("Usage: %s site_directory db_table [operation]\n", basename($_SERVER['argv'][0])));
     18    die(sprintf("Usage: %s site_directory db_table [operation]\nValid operations include: %s", basename($_SERVER['argv'][0]), join(', ', $valid_ops)));
    1919}
    2020
  • trunk/bin/module_maker/validation.cli.php

    r145 r151  
    187187        }
    188188        if ($max_length > 0 && $len_type == 'string') {
    189             $o[] = "\$fv->stringLength('$field', 0, $max_length, sprintf(_(\"%s must be %f-to-%f characters in length.\"), _(\"$title\"), 0, $max_length));";
     189            $o[] = "\$fv->stringLength('$field', 0, $max_length, sprintf(_(\"%s must be %d-to-%d characters in length.\"), _(\"$title\"), 0, $max_length));";
    190190        }
    191191        if ($len_type == 'num') {
    192             $o[] = "\$fv->numericRange('$field', $min, $max, sprintf(_(\"%s must be a number between %f and %f.\"), _(\"$title\"), $min, $max));";
     192            $o[] = "\$fv->numericRange('$field', $min, $max, sprintf(_(\"%s must be a number between %d and %d.\"), _(\"$title\"), $min, $max));";
    193193        }
    194194
Note: See TracChangeset for help on using the changeset viewer.