[ Index ]
 

Code source de PHPonTrax 2.6.6-svn

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/data/script/ -> console.php (source)

   1  #! /usr/local/bin/php -q
   2  <?php
   3  /**
   4   *  (PHP 5)
   5   *
   6   *  @package PHPonTrax
   7   *  @version $Id: generate.php 199 2006-05-05 01:52:43Z haas $
   8   *  @copyright (c) 2005 John Peterson
   9   *
  10   *  Permission is hereby granted, free of charge, to any person obtaining
  11   *  a copy of this software and associated documentation files (the
  12   *  "Software"), to deal in the Software without restriction, including
  13   *  without limitation the rights to use, copy, modify, merge, publish,
  14   *  distribute, sublicense, and/or sell copies of the Software, and to
  15   *  permit persons to whom the Software is furnished to do so, subject to
  16   *  the following conditions:
  17   *
  18   *  The above copyright notice and this permission notice shall be
  19   *  included in all copies or substantial portions of the Software.
  20   *
  21   *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22   *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23   *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24   *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25   *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26   *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27   *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28   *
  29   *
  30   * The console gives you access to your Trax Environments|Environment 
  31   * where you can interact with the domain model. Here you¡¦ll have all 
  32   * parts of the application configured, just like it is when the application 
  33   * is running. You can inspect domain models, change values, and save to 
  34   * the database.
  35   * 
  36   * 
  37   */
  38  
  39  // If command line arguments exist, parse them
  40  if(array_key_exists('argv', $_SERVER)) {
  41      if(array_key_exists(1, $_SERVER['argv'])) {
  42          $environment = strtolower($_SERVER["argv"][1]);
  43      }
  44  }
  45  
  46  // Set the environment to load
  47  $_SERVER['TRAX_ENV'] = !is_null($environment) ? $environment : 'development';
  48  
  49  /**
  50   *  Load definitions of the Trax environment from {@link environment.php}
  51   */
  52  require_once(dirname(dirname(__FILE__)) . "/config/environment.php");
  53  
  54  // Make sure the TRAX_ENV index is set
  55  ActiveRecord::$active_connections[TRAX_ENV] = null;
  56  
  57  echo "Loading Trax ".TRAX_ENV." environment.\n";
  58  include("php_shell.php");
  59  
  60  ?>


Généré le : Sun Feb 25 20:04:38 2007 par Balluche grâce à PHPXref 0.7