Example #1
0
 public function initialization()
 {
     $this->registerDi();
     $this->container->get('logger')->info("Logger initialization", []);
     $this->container->get('logger')->info("Request Url", [$_SERVER['REQUEST_URI']]);
     $this->container->get('logger')->info("Request Method", [$_SERVER['REQUEST_METHOD']]);
     $this->container->dispatcher->addListener('module.modules.beforeAllInitialization', function () {
         $arModules = $this->container->modules->keys();
         foreach ($arModules as $name) {
             $this->container->dispatcher->addListener('module.' . $name . '.beforeInitialization', function ($event) use($name) {
                 $event->getLogger()->info("action beforeInitialization", [$name]);
                 //$event->getParam()->getName()
             });
             $this->container->dispatcher->addListener('module.' . $name . '.afterInitialization', function ($event) use($name) {
                 $event->getLogger()->info("action afterInitialization", [$name]);
             });
         }
     });
     $this->container->dispatcher->addListener('app.afterRun', function ($event) {
         $workTime = round(microtime(true) - $GLOBALS['startTime'], 3);
         $logger = $event->getLogger();
         $logger->stat("work time: ", [$workTime . 's']);
         $logger->stat("memory usage: ", [memoryFormat(memory_get_usage())]);
         $logger->stat("max memory usage: ", [memoryFormat(memory_get_peak_usage())]);
         $logger->stat("Stop Application", []);
     });
 }
        ?>
	
	<h3><?php 
        echo __("Table Information");
        ?>
</h3>
	<dl class="information">
	<?php 
        $engine = array_key_exists("Type", $infoRow) ? $infoRow['Type'] : $infoRow['Engine'];
        echo '<dt>' . __("Storage engine") . ':</dt><dd>' . $engine . '</dd>';
        if (array_key_exists('Collation', $infoRow) && isset($collationList)) {
            echo '<dt>' . "Charset" . ':</dt><dd>' . $collationList[$infoRow['Collation']] . '</dd>';
        }
        echo '<dt>' . __("Rows") . ':</dt><dd>' . number_format($infoRow['Rows']) . '</dd>';
        echo '<dt>' . __("Size") . ':</dt><dd>' . memoryFormat($infoRow['Data_length']) . '</dd>';
        echo '<dt>' . __("Overhead") . ':</dt><dd>' . memoryFormat($infoRow['Data_free']) . '</dd>';
        echo '<dt>' . __("Auto Increment") . ':</dt><dd>' . number_format($infoRow['Auto_increment']) . '</dd>';
        ?>
	</dl>
	<div class="clearer"></div>
	
	<?php 
    }
    ?>
	
	<script type="text/javascript" authkey="<?php 
    echo $requestKey;
    ?>
">
	setTimeout("startGrid()", 1);
	</script>
Example #3
0
     }
     echo '"><dt><input type="checkbox" class="check' . $m . '" onclick="rowClicked(' . $m++ . ')" querybuilder="' . $tableRow[0] . '" /></dt></dl>';
 }
 echo '</div>';
 $tableSql = $conn->listTables();
 echo '<div class="gridscroll withchecks" style="overflow-x: hidden; max-height: 400px">';
 $m = 0;
 while ($tableRow = $conn->fetchArray($tableSql)) {
     $rowCount = $conn->tableRowCount($tableRow[0]);
     if ($conn->getAdapter() == "mysql") {
         $infoSql = $conn->query("SHOW TABLE STATUS LIKE '" . $tableRow[0] . "'");
         $infoRow = $conn->fetchAssoc($infoSql);
         $overhead = $infoRow["Data_free"];
         $formattedOverhead = "";
         if ($overhead > 0) {
             $formattedOverhead = memoryFormat($overhead);
         }
     }
     echo '<div class="row' . $m . ' browse';
     if ($m % 2 == 1) {
         echo ' alternator';
     } else {
         echo ' alternator2';
     }
     echo '">';
     echo '<table cellpadding="0" cellspacing="0">';
     echo '<tr>';
     echo '<td><div class="item column1"><div style="float: left; overflow: hidden; width: 185px">' . $tableRow[0] . '</div><img src="images/goto.png" class="goto" onclick="subTabLoad(\'' . $db . '\', \'' . $tableRow[0] . '\')" /></div></td>';
     echo '<td><div class="item column2">' . number_format($rowCount) . '</div></td>';
     if (isset($collationList) && array_key_exists("Collation", $infoRow) && array_key_exists($infoRow['Collation'], $collationList)) {
         echo '<td><div class="item column3">' . $collationList[$infoRow['Collation']] . '</div></td>';
Example #4
0
"><?php 
    echo $id;
    ?>
</a></td>
          <td><a href="<?php 
    echo __siteurl;
    ?>
/?r=store/remote/server&id=<?php 
    echo $id;
    ?>
"><?php 
    echo $server['name'];
    ?>
</a></td>
          <td><?php 
    echo memoryFormat($server['size']);
    ?>
</td>
          <td><?php 
    echo $server['filesCount'];
    ?>
</td>
          <td><?php 
    echo date('d.m.Y h:i', $server['time']);
    ?>
</td>
          <td></td>        
        </tr>
        <?php 
}
?>
    echo (int) $_GET['id'];
    ?>
"><?php 
    echo $task['title'];
    ?>
</a></td>
          <td><?php 
    echo date('d.m.Y h:i', $task['lastExec']);
    ?>
</td>
          <td><?php 
    echo date('d.m.Y h:i', nextExecDateTime($task));
    ?>
</td>
          <td><?php 
    echo memoryFormat($task['memoryUsage']);
    ?>
</td>
          <td><?php 
    echo $task['type'];
    ?>
</td>
          <td><span class="tag_<?php 
    echo strtolower($taskStatuses[$task['status']]);
    ?>
"><?php 
    echo $taskStatuses[$task['status']];
    ?>
<span></td>
          <td class="align-right">
            <form method="post">
Example #6
0
</td>
          <td><a href="<?php 
    echo __siteurl;
    ?>
/?r=store/download&fileName=<?php 
    echo $file['name'];
    ?>
&folder=local&taskId=<?php 
    echo $taskId;
    ?>
" target="_blank"><?php 
    echo $file['name'];
    ?>
</a></td>
          <td><?php 
    echo memoryFormat($file['size']);
    ?>
</td>
          <td><?php 
    echo date('d.m.Y h:i', $file['time']);
    ?>
</td>
          <td class="align-right">
            <form method="post">
              <input type="hidden" name="action" value="store/deleteFile">
              <input type="hidden" name="taskId" value="<?php 
    echo $taskId;
    ?>
">
              <input type="hidden" name="fileName" value="<?php 
    echo $file['name'];
Example #7
0
    ?>
        <tr>
          <td><?php 
    echo genServerTitle($server);
    ?>
</td>
          <td><?php 
    echo $server['address'];
    ?>
</td>
          <td><?php 
    echo getServerStatus($server['status']);
    ?>
</td>
          <td><?php 
    echo memoryFormat($server['freeSpace']);
    ?>
</td>
          <td><?php 
    echo $server['tasksCount'];
    ?>
</td>
          <td class="align-right"><a href="<?php 
    echo __siteurl;
    ?>
/?r=servers/server_edit&id=<?php 
    echo $server['id'];
    ?>
" class="btn btn-xs btn-info"><?php 
    echo $_LANG['servers']['connection'];
    ?>
Example #8
0
"><?php 
    echo $id;
    ?>
</a></td>
          <td><a href="<?php 
    echo __siteurl;
    ?>
/?r=store/local/folder&id=<?php 
    echo $id;
    ?>
"><?php 
    echo $folder['name'];
    ?>
</a></td>
          <td><?php 
    echo memoryFormat($folder['size']);
    ?>
</td>
          <td><?php 
    echo $folder['filesCount'];
    ?>
</td>
          <td><?php 
    echo date('d.m.Y h:i', $folder['time']);
    ?>
</td>
          <td></td>        
        </tr>
        <?php 
}
?>
Example #9
0
function getMemoryUsage($task)
{
    if (!is_dir(__archiveDIR . 'local/' . $task['id'])) {
        return 0;
    }
    return memoryFormat(dirSize(__archiveDIR . 'local/' . $task['id']));
}
Example #10
0
    return round($val / $maxVal * 100);
}
$count = 0;
foreach ($backUpsUsage as $key => $val) {
    $count++;
    if ($count > 30) {
        break;
    }
    ?>
      <div class="graphRow">
        <div class="graphIndicator" style="width: <?php 
    echo calcPercent($maxUsage, $val['value']);
    ?>
%;"></div>
        <div class="graphIndicatorValue"><?php 
    echo memoryFormat($val['value']);
    ?>
</div>
        <div class="graphLabel"><?php 
    echo $val['label'];
    ?>
</div>
        <div class="graphLabel"><?php 
    echo $val['label'];
    ?>
</div>
        <div class="graphLabel"><?php 
    echo $val['label'];
    ?>
</div>
      </div>