Applied fixes from StyleCI
This commit is contained in:
parent
ec775de695
commit
68a91159e6
@ -75,6 +75,6 @@ if (php_sapi_name() === 'cli-server') {
|
||||
$_SERVER['SCRIPT_NAME'] = '/index.php';
|
||||
}
|
||||
|
||||
require_once(__DIR__ . '/libs/bootstrap.php');
|
||||
require_once __DIR__ . '/libs/bootstrap.php';
|
||||
|
||||
\Todaymade\Daux\Server\Server::serve();
|
||||
|
@ -58,27 +58,33 @@ class Config extends ArrayObject
|
||||
$this['current_page'] = $entry;
|
||||
}
|
||||
|
||||
public function getDocumentationDirectory() {
|
||||
public function getDocumentationDirectory()
|
||||
{
|
||||
return $this['docs_directory'];
|
||||
}
|
||||
|
||||
public function setDocumentationDirectory($documentationPath) {
|
||||
public function setDocumentationDirectory($documentationPath)
|
||||
{
|
||||
$this['docs_directory'] = $documentationPath;
|
||||
}
|
||||
|
||||
public function getThemesDirectory() {
|
||||
public function getThemesDirectory()
|
||||
{
|
||||
return $this['themes_directory'];
|
||||
}
|
||||
|
||||
public function setFormat($format) {
|
||||
public function setFormat($format)
|
||||
{
|
||||
$this['format'] = $format;
|
||||
}
|
||||
|
||||
public function getFormat() {
|
||||
public function getFormat()
|
||||
{
|
||||
return $this['format'];
|
||||
}
|
||||
|
||||
public function isMultilanguage() {
|
||||
public function isMultilanguage()
|
||||
{
|
||||
return array_key_exists('languages', $this) && !empty($this['languages']);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?php namespace Todaymade\Daux\Console;
|
||||
|
||||
use Symfony\Component\Console\Command\Command as SymfonyCommand;
|
||||
use Symfony\Component\Console\Exception\InvalidOptionException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@ -34,8 +33,7 @@ class Generate extends SymfonyCommand
|
||||
|
||||
// HTML Format only
|
||||
->addOption('destination', 'd', InputOption::VALUE_REQUIRED, $description, 'static')
|
||||
->addOption('search', null, InputOption::VALUE_NONE, 'Generate full text search')
|
||||
;
|
||||
->addOption('search', null, InputOption::VALUE_NONE, 'Generate full text search');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
@ -44,6 +42,7 @@ class Generate extends SymfonyCommand
|
||||
|
||||
if ($input->getOption('serve')) {
|
||||
$this->serve($daux, $input);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,8 @@ class Daux
|
||||
}
|
||||
}
|
||||
|
||||
public function normalizeThemePath($path) {
|
||||
public function normalizeThemePath($path)
|
||||
{
|
||||
if (is_dir($path)) {
|
||||
return $path;
|
||||
}
|
||||
|
@ -66,10 +66,11 @@ class Server
|
||||
echo $page->getContent();
|
||||
}
|
||||
|
||||
public static function runServer(Config $config, $host, $port) {
|
||||
public static function runServer(Config $config, $host, $port)
|
||||
{
|
||||
chdir(__DIR__ . '/../../');
|
||||
|
||||
putenv("DAUX_SOURCE=" . $config->getDocumentationDirectory());
|
||||
putenv('DAUX_SOURCE=' . $config->getDocumentationDirectory());
|
||||
|
||||
$base = ProcessUtils::escapeArgument(__DIR__ . '/../../');
|
||||
$binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
|
||||
|
@ -2,18 +2,19 @@
|
||||
|
||||
// Loaded in the project itself
|
||||
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
|
||||
return require_once(__DIR__ . '/../vendor/autoload.php');
|
||||
return require_once __DIR__ . '/../vendor/autoload.php';
|
||||
}
|
||||
|
||||
// Loaded as a dependency
|
||||
if (file_exists(__DIR__ . '/../../../../autoload.php')) {
|
||||
return require_once(__DIR__ . '/../../../../autoload.php');
|
||||
return require_once __DIR__ . '/../../../../autoload.php';
|
||||
}
|
||||
|
||||
// Loaded in the project itself, when vendor isn't installed
|
||||
if (file_exists(__DIR__ . '/../daux.phar')) {
|
||||
define('PHAR_DIR', __DIR__ . '/..');
|
||||
return require_once("phar://" . __DIR__ . "/../daux.phar/vendor/autoload.php");
|
||||
|
||||
return require_once 'phar://' . __DIR__ . '/../daux.phar/vendor/autoload.php';
|
||||
}
|
||||
|
||||
throw new Exception("Impossible to load Daux, missing vendor/ or daux.phar");
|
||||
throw new Exception('Impossible to load Daux, missing vendor/ or daux.phar');
|
||||
|
Loading…
Reference in New Issue
Block a user