コード例 #1
0
ファイル: index.php プロジェクト: vicstr/CodePax
 * It is also available through the world-wide-web at this URL:
 * http://www.codepax.com/license.html
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@codepax.com so we can send you a copy immediately.
 * */
/**
 * The main page of the app
 *
 * @category CodePax
 * @copyright Copyright (c) 2012 Zitec COM srl, Romania
 * @license New BSD http://www.codepax.com/license.html
 */
require '../application/bootstrap.php';
// initialize view object
$view = new CodePax_View();
$view->setViewsPath(VIEWS_PATH);
$view->setCurrentView('index');
try {
    $repo_wrapper = CodePax_Scm_Factory::Factory(VERSIONING);
    //--- execute some action: update, switch, etc
    if (!empty($_GET)) {
        $response_string = null;
        //--- switch to branch
        if (isset($_GET['branch']) && strlen($_GET['branch']) > 1 && defined('SWITCH_TO_BRANCH') && SWITCH_TO_BRANCH === true) {
            $response_string = $repo_wrapper->switchToBranch($_GET['branch']);
        }
        //--- switch to tag
        if (isset($_GET['tag']) && strlen($_GET['tag']) > 1 && defined('SWITCH_TO_TAG') && SWITCH_TO_TAG === true) {
            $response_string = $repo_wrapper->switchToTag($_GET['tag']);
        }
コード例 #2
0
ファイル: change_log.php プロジェクト: vicstr/CodePax
 *
 * LICENSE
 *
 * This source file is subject to the New BSD license that is bundled
 * with this package in the file LICENSE
 * It is also available through the world-wide-web at this URL:
 * http://www.codepax.com/license.html
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@codepax.com so we can send you a copy immediately.
 * */
/**
 * Simple page to show the change log for each version
 *
 * @category CodePax
 * @copyright Copyright (c) 2012 Zitec COM srl, Romania
 * @license New BSD http://www.codepax.com/license.html
 */
require '../application/bootstrap.php';
// initialize view object
$view = new CodePax_View();
$view->setViewsPath(VIEWS_PATH);
$view->setCurrentView('change_log');
$view->project_name = PROJECT_NAME;
$view->environment = strtoupper(APPLICATION_ENVIRONMENT);
try {
    $view->render();
} catch (View_Exception $e) {
    echo $e->getMessage();
    exit;
}
コード例 #3
0
ファイル: run_db_scripts.php プロジェクト: vicstr/CodePax
 * It is also available through the world-wide-web at this URL:
 * http://www.codepax.com/license.html
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@codepax.com so we can send you a copy immediately.
 * */
/**
 * Called via AJAX to run the DB scripts
 *
 * @category CodePax
 * @copyright Copyright (c) 2012 Zitec COM srl, Romania
 * @license New BSD http://www.codepax.com/license.html
 */
require '../application/bootstrap.php';
// initialize view object
$view = new CodePax_View();
$view->setViewsPath(VIEWS_PATH);
$view->setCurrentView('run_db_scripts');
try {
    $db_versioning_handler = CodePax_DbVersioning_Environments_Factory::factory(APPLICATION_ENVIRONMENT);
    $generate_test_data = false;
    // generate test data
    if (APPLICATION_ENVIRONMENT == 'dev' && isset($_POST['preserve_test_data']) && $_POST['preserve_test_data'] == 1) {
        $generate_test_data = true;
    }
    // run the change scripts
    $db_scripts_result = $db_versioning_handler->runScripts($generate_test_data);
    // unset some keys that are redundant on DEV
    unset($db_scripts_result['run_change_scripts'], $db_scripts_result['run_data_change_scripts']);
    $view->db_scripts = $db_scripts_result;
} catch (CodePax_DbVersioning_Exception $dbv_e) {
コード例 #4
0
ファイル: run_hooks.php プロジェクト: vicstr/CodePax
 * http://www.codepax.com/license.html
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@codepax.com so we can send you a copy immediately.
 * */
/**
 * Script called on AJAX used to run every
 * class found under hooks directory
 *
 * @category CodePax
 * @copyright Copyright (c) 2012 Zitec COM srl, Romania
 * @license New BSD http://www.codepax.com/license.html
 */
require '../application/bootstrap.php';
// initialize view object
$view = new CodePax_View();
$view->setViewsPath(VIEWS_PATH);
$view->setCurrentView('run_hooks');
$hooks_hanlder = new CodePax_Hooks_Handler();
// get all the registered hooks
$available_hooks = $hooks_hanlder->getList();
// run only the hooks chose by the user
$hooks_to_run = array_intersect_key($available_hooks, $_POST);
if (!empty($hooks_to_run)) {
    $hooks_hanlder->run($hooks_to_run);
    $hook_results = $hooks_hanlder->getResults();
    $view->hook_results = $hook_results;
} else {
    $view->no_hooks_selected = true;
}
try {