I have an update / folder with PHP files, like this:
Thesearemysqlupdatefiles,whenitisupdatedshortlyaftertheservershutsdown.WhentheclientdoesnotaccesstheAdmin,thefilestaysthere,whenwereleaseanotherupdate,thenitaddsthefileofthepreviousversionandthelatestversionandsoonuntilitaccessestheAdmintorunthisupdate.
Myproblem:
Notrunninginascendingorder.Ineedtomakeitalwaysopenfromthesmallesttothelargest,asthisistheorderoftheupdate.
Code:
<?php$path=$_SERVER["DOCUMENT_ROOT"]."/update/";
$diretorio = dir($path); $i = 0;
while($i <= 3){
$arquivo = $diretorio -> read();
$file = explode("_v", $arquivo);
if ($file[0] == 'updateSQL'){
?>
<script type="text/javascript">$(function() {$('#myModal').modal('show');})</script>
<script type="text/javascript">$('#myModal').modal({backdrop: 'static',keyboard: false})</script>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Espere... Não feche até acabar.</h4>
</div>
<div class="modal-body">
<iframe src="../update/<?php echo $arquivo?>" frameborder="0" height="300px" width="100%" onload="resizeIframe(this);"></iframe>
</div>
</div>
</div>
</div>
<?php
}$i++;
}
$diretorio -> close();
?>