-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add input option to convert documents to PDF.
- Loading branch information
1 parent
4ba1a38
commit 8836e17
Showing
7 changed files
with
126 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Changelog | ||
|
||
## v1.0.0 (05/08/2020) | ||
*No changelog for this release.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace Core; | ||
|
||
use Module\Application\FileSystem\FileInterface; | ||
use Symfony\Component\Console\Command\Command as ConsoleCommand; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class Command extends ConsoleCommand | ||
{ | ||
/** | ||
* @var string|float | ||
*/ | ||
protected $startTime; | ||
|
||
/** | ||
* @var string|float | ||
*/ | ||
protected $endTime; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function __construct($name = null) | ||
{ | ||
parent::__construct($name = null); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function run(InputInterface $input, OutputInterface $output) | ||
{ | ||
$this->startTime = microtime(true); | ||
$result = parent::run($input, $output); | ||
|
||
return $result; | ||
} | ||
|
||
/** | ||
* Calculate commmand execution time in seconds | ||
* | ||
* @return float | ||
*/ | ||
protected function getExecutionTime() | ||
{ | ||
$this->endTime = microtime(true); | ||
return number_format($this->endTime - $this->startTime, 5); | ||
} | ||
|
||
/** | ||
* Write a file summary to the output | ||
* | ||
* @param mixed $output | ||
* @param mixed $file | ||
* @return void | ||
*/ | ||
public function writeSummary(OutputInterface $output, FileInterface $file) | ||
{ | ||
$output->writeln(''); | ||
$output->writeln(sprintf('<info>File name:</info> %s', $file->getName())); | ||
$output->writeln(sprintf('<info>Directory:</info> %s', $file->getDir())); | ||
$output->writeln(sprintf('<info>Preview:</info> %s', $file->getPath())); | ||
$output->writeln(''); | ||
$output->writeln(sprintf('<fg=yellow;options=bold>Execution time: %s sec</>', $this->getExecutionTime())); | ||
$output->writeln(''); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters