Ignore:
Timestamp:
May 2, 2019 10:17:26 PM (5 years ago)
Author:
anonymous
Message:

Add user.cli.php and supporting changes

File:
1 edited

Legend:

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

    r572 r674  
    3939define('CODEBASE_PATH', realpath(dirname(__FILE__) . '/../'));
    4040
    41 
    4241$db_auth_file = false;
    4342if (!defined('_NODB')) {
     
    5150    }
    5251    if (!$db_auth_file) {
    53         die(sprintf("%s error: the current directory must be common site directory (i.e. the parent directory of the document root) AND a db_auth file must exist within two directory levels.\n", $cli_executed));
     52        printf("%s error: the current directory must be common site directory (i.e. the parent directory of the document root) AND a db_auth file must exist within two directory levels.\n", $cli_executed);
     53        exit(1);
    5454    }
    5555    if (fileowner($db_auth_file) != getmyuid()) {
    56         die(sprintf("%s error: you must execute this script as the owner of the web files.\n", $cli_executed));
     56        printf("%s error: you must execute this script as the owner of the web files.\n", $cli_executed);
     57        exit(1);
    5758    }
    5859}
    5960
    6061// Set include path.
    61 ini_set('include_path', get_include_path() . PATH_SEPARATOR . COMMON_BASE);
     62ini_set('include_path', join(PATH_SEPARATOR, array_unique(array(
     63    '.',
     64    COMMON_BASE,
     65    dirname($db_auth_file)
     66))));
    6267
    6368/********************************************************************
     
    6671
    6772// Include core libraries.
    68 require_once CODEBASE_PATH . '/lib/App.inc.php';
    69 require_once CODEBASE_PATH . '/lib/Utilities.inc.php';
     73(include_once 'codebase/lib/App.inc.php') || require_once CODEBASE_PATH . '/lib/App.inc.php';
    7074
    7175define('_CLI', true);
Note: See TracChangeset for help on using the changeset viewer.