N98\Magento\Command\Developer\Log\SizeCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : void
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return void
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->detectMagento($output);
        if (!$this->initMagento()) {
            return;
        }
        $fileName = $input->getArgument('log_filename');
        if ($fileName === null) {
            $path = $this->askLogFile($output);
        } else {
            $path = $this->getLogDir() . DIRECTORY_SEPARATOR . $fileName;
        }
        if ($this->logfileExists(basename($path))) {
            $size = @filesize($path);
            if ($size === false) {
                throw new RuntimeException('Couldn\\t detect filesize.');
            }
        } else {
            $size = 0;
        }
        if ($input->getOption('human')) {
            $output->writeln(\N98\Util\Filesystem::humanFileSize($size));
        } else {
            $output->writeln("{$size}");
        }
    }