Changeset 476 for trunk/docs


Ignore:
Timestamp:
Apr 26, 2014 5:06:03 AM (10 years ago)
Author:
anonymous
Message:

Disabled header output when _CLI is defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/examples/example.cli.php

    r468 r476  
    55 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    66 * Copyright 2001-2012 Strangecode, LLC
    7  * 
     7 *
    88 * This file is part of The Strangecode Codebase.
    99 *
     
    1212 * Free Software Foundation, either version 3 of the License, or (at your option)
    1313 * any later version.
    14  * 
     14 *
    1515 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1616 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1717 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1818 * details.
    19  * 
     19 *
    2020 * You should have received a copy of the GNU General Public License along with
    2121 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    2424/*
    2525* example.cli.php - An example of a command-line interface script using the Strangecode Codebase.
    26 * 
     26*
    2727*
    2828* @author   Quinn Comendant <quinn@strangecode.com>
     
    3939
    4040// First things first. Define the globally used directory paths.
    41 // The parent directory of all application DocRoots, such as /home/user/www.example.com/
    42 define('COMMON_BASE', realpath('../..'));
     41// The parent directory of all application DocRoots.
     42define('COMMON_BASE', realpath(dirname(__FILE__) . '/../'));
    4343
    4444// Set include path for all templates and libraries.
     
    5151* CONFIG
    5252********************************************************************/
     53
     54// This will disable sessions and things not needed by a cli script.
     55define('_CLI', true);
    5356
    5457// Include core libraries.
     
    9699if (!$options) {
    97100    printf("%s: Syntax or usage error. Try '-h' if you are lost.\n", $this_script);
    98     die(1);   
     101    die(1);
    99102}
    100103
     
    134137
    135138OPTIONS:
    136    
     139
    137140    -a  Blah blah blah
    138141    -b  Blah blah blah
Note: See TracChangeset for help on using the changeset viewer.