Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

save time taken and generated size (closes #3)

  • Loading branch information...
commit 0070e4b61a83c62ee31e58bc3ccfdacb4f93c5d6 1 parent 62edf49
@juzna authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 app/presenters/GeneratorPresenter.php
View
7 app/presenters/GeneratorPresenter.php
@@ -106,12 +106,17 @@ protected function make($item) {
}
// Generate API
+ $timeStarted = microtime(true);
$rootDir = APP_DIR . '/../';
$sourceDir = "$repoDir/$item->subdir";
$docDir = DOC_PROCESSING_DIR . "/$item->dir";
$docFinalDir = DOC_FINAL_DIR . "/$item->dir";
$generatedWell = $this->exec("php -dmemory_limit=1024M $rootDir/apigen/apigen.php -s " . escapeshellarg($sourceDir) . " -d " . escapeshellarg($docDir) . " --charset=auto --download --debug --colors=no --progressbar=no --title=" . escapeshellarg($item->name), $result);
- if($result) $this->db->table('repo')->where('id', $item->id)->update(array('apigenResultId' => $result->id));
+ $this->db->table('repo')->where('id', $item->id)->update(array(
+ 'apigenResultId' => $result->id,
+ 'apigenTime' => microtime(true) - $timeStarted,
+ 'sizeDoc' => (int) exec("du -sb " . escapeshellarg($docDir)),
+ ));
// check
if(!file_exists("$docDir/index.html") || !$generatedWell) {
Please sign in to comment.
Something went wrong with that request. Please try again.