コード例 #1
0
 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);
     }
 }