Beispiel #1
0
 * 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']);
        }
        //--- switch to stable