Exemplo n.º 1
0
 public static function exec_cos()
 {
     $Root = "../";
     $r = glob("../app/schemas/*.php");
     $r2 = array();
     $r2 = array();
     foreach ($r as $value) {
         $temp1 = explode("schemas/", $value);
         $temp2 = explode("_", $temp1[1]);
         $temp3 = explode(".", $temp2[1]);
         $ex = $temp3[0];
         //
         if ($ex == $_POST['exec_cos_migrate_select']) {
             $r2[] = $ex;
             $r3[] = $temp2[0];
         }
     }
     $v = "";
     $full_name = "";
     //
     if (count($r2) > 1) {
         for ($i = 1; $i < count($r2); $i++) {
             error_log($r3[$i] . '*/*' . $r3[$i - 1]);
             if ($r3[$i] >= $r3[$i - 1]) {
                 $v = "../app/schemas/" . $r3[$i] . "_" . $r2[$i] . ".php";
                 $full_name = $r3[$i] . "_" . $r2[$i];
             }
         }
     } else {
         $v = "../app/schemas/" . $r3[0] . "_" . $r2[0] . ".php";
         $full_name = $r3[0] . "_" . $r2[0];
     }
     try {
         include_once $v;
         if (up()) {
             Migration::updateRegister($full_name, "exec", $Root);
             echo "Schéma executé";
         } else {
             echo Database::execErr();
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
Exemplo n.º 2
0
				</div>
				<div class="MD_unit MD_unit_cyan" style="height: 145px;">
					<div class="MD_unit_title unit_title_cyan">Personnaliser l'exécution</div>
				
					<form id="exec_cos_migrate" method="post" name="exec_cos_migrate">
					<div class="control_row">
					<?php 
        Migration::getAll('exec_cos_migrate_select');
        ?>
						<input type="submit" value="Exécuter" class="btn unit_btn unit_btn_cyan no_margins MD_submit_btn">
					</form>
					</div>
					<div class="control_row">
					<form id="rollback_cos_migrate" method="post" name="rolback_cos_migrate">
					<?php 
        Migration::getAll('ggg');
        ?>
						<input type="submit" value="Annuler" class="btn unit_btn unit_btn_cyan no_margins MD_submit_btn">
					</form>
					</div>
				</div>
			</div>
			<div class="col-md-6" >
				<div class="MD_unit">
					<table class="table table-hover">
						<tr class="info">
						  <th class="tr_table_files">Nom de object</th>
						  <th class="tr_table_files">Date de creation</th>
						</tr>

						  <?php