public function deploy()
 {
     foreach ($this->destinations as $destination) {
         // set new swap_id
         $swap_id = NConf_HTML::set_swap_id('swap_deploy');
         // reset informations
         NConf_HTML::set_info('', 'reset');
         // add informations if status is FALSE
         // if there are host informations, add them
         if (!empty($destination["host"])) {
             NConf_HTML::set_info(NConf_HTML::table_row_check('Host:', '', $destination["host"]), 'add');
         }
         // call the command and get its status back
         // also catch direct output (of errors etc.) which are not intercepted in the submodule
         ob_start();
         $status = $this->command($destination);
         if (ob_get_contents()) {
             NConf_DEBUG::set(ob_get_contents(), 'ERROR', $this->name);
             NConf_HTML::set_info(NConf_HTML::table_row_check('Error/Info:', 'ERROR', 'Please have a look at the NConf error message at the bottom of the page'), 'add');
         }
         ob_end_clean();
         // Table output
         echo NConf_HTML::table_row_check(NConf_HTML::swap_opener($swap_id, $destination["title"], TRUE), $status);
         $content = NConf_HTML::table_begin('class="table_content ui-widget-content"', array(102, 50, ''));
         $content .= NConf_HTML::get_info();
         $content .= NConf_HTML::table_end();
         // create row with detailed feedback
         echo NConf_HTML::table_row_text($content, '', 'colspan=3', TRUE);
         // add status to history log
         NConf_Deployment::history($destination["title"], $status);
     }
 }
示例#2
0
    });

</script>


<?php 
echo NConf_HTML::ui_box_header("Configuration Deployment");
echo NConf_HTML::ui_box_content();
echo '<div style="height: 20px;">
            <div id="loading">
                <img src="img/working_small.gif"> in progress...
            </div>
          </div>';
// Load deployment class and create object
require_once "class.deployment.php";
require_once "class.deployment.modules.php";
// Load the NConf Deployment class
// It loads all the modules and handles the deployment basic stuff
$deployment = new NConf_Deployment();
// Loads the configuration of the user
// nconf/conf/deployment.ini
$deployment->import_config();
if (NConf_DEBUG::status('ERROR')) {
    // Show error if set
    echo NConf_HTML::limit_space(NConf_HTML::show_error());
} else {
    // Start deploying the files
    $deployment->run_deployment();
}
echo '</div>';