Small refactoring and documentation fix
This commit is contained in:
parent
def4b5ed98
commit
837fca6886
@ -6,7 +6,7 @@
|
||||
[](https://travis-ci.org/dauxio/daux.io)
|
||||
[](https://scrutinizer-ci.com/g/dauxio/daux.io/code-structure)
|
||||
[](https://scrutinizer-ci.com/g/dauxio/daux.io)
|
||||
[](https://packagist.org/packages/dauxio/daux.io)
|
||||
[](https://packagist.org/packages/daux/daux.io)
|
||||
|
||||
|
||||
**Daux.io** is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.
|
||||
|
@ -72,7 +72,7 @@ class Daux
|
||||
|
||||
// Read command line overrides
|
||||
$override_file = $this->getConfigurationOverride($override_file);
|
||||
if ($override_file != null) {
|
||||
if ($override_file !== null) {
|
||||
$params->setConfigurationOverrideFile($override_file);
|
||||
$this->loadConfiguration($override_file);
|
||||
}
|
||||
|
@ -469,11 +469,19 @@ class DauxHelper
|
||||
return '' !== $parts['root'];
|
||||
}
|
||||
|
||||
public static function getAbsolutePath($path) {
|
||||
if (DauxHelper::isAbsolutePath($path)) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
return getcwd() . '/' . $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @param $basedir
|
||||
* @param $var
|
||||
* @param $type
|
||||
* @param string|null $path
|
||||
* @param string $basedir
|
||||
* @param string $var The constant name to check
|
||||
* @param "dir"|"file" $type
|
||||
* @return false|null|string
|
||||
*/
|
||||
public static function findLocation($path, $basedir, $var, $type) {
|
||||
@ -483,18 +491,17 @@ class DauxHelper
|
||||
return $env;
|
||||
}
|
||||
|
||||
// If Path is explicitly null, it's useless to go further
|
||||
if ($path == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if it's relative to the current directory or an absolute path
|
||||
if (DauxHelper::is($path, $type)) {
|
||||
if (DauxHelper::isAbsolutePath($path)) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
return getcwd() . '/' . $path;
|
||||
return DauxHelper::getAbsolutePath($path);
|
||||
}
|
||||
|
||||
// Check if it exists relative to Daux's root
|
||||
$newPath = $basedir . DIRECTORY_SEPARATOR . $path;
|
||||
if (DauxHelper::is($newPath, $type)) {
|
||||
return $newPath;
|
||||
|
Loading…
x
Reference in New Issue
Block a user