// Load configuration require 'build_config.php'; // Folder definitions define('BUILDBASE', __DIR__ . '/'); // Don't stop script exectuion on 404... function show_404($page = '', $log_error = TRUE) { } // Make sure we have access to CI() object. ob_start(); require BUILDBASE . '../index.php'; ob_end_clean(); //-------------------------------------------------------------------- // Determine the build script to run //-------------------------------------------------------------------- $release = CLI::segment(1); if (empty($release)) { $release = CLI::prompt("Which script", array_keys($config['builds'])); } if (!array_key_exists($release, $config['builds'])) { CLI::error('Invalid build specified: ' . $release); exit(1); } //-------------------------------------------------------------------- // Instantiate the class and run it //-------------------------------------------------------------------- $class_name = $config['builds'][$release]; if (!file_exists(BUILDBASE . "scripts/{$class_name}.php")) { CLI::error('Unable to find build script: ' . $class_name . '.php'); exit(1); }