Allow Docs directory to be specified via absolute or relative path. Fix insignificant bug in Static Gen
This commit is contained in:
parent
37226d4b66
commit
c34ff07ed0
@ -65,7 +65,7 @@ software, even if advised of the possibility of such damage.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
if (isset($argv[1])) $Daux = new \Todaymade\Daux\Daux($argv[1]);
|
if (isset($argv[1])) $Daux = new \Todaymade\Daux\Daux($argv[1]);
|
||||||
else $Daux = new \Todaymade\Daux\Daux($argv[1]);
|
else $Daux = new \Todaymade\Daux\Daux();
|
||||||
$Daux->initialize();
|
$Daux->initialize();
|
||||||
if (isset($argv[2])) $Daux->generate_static($argv[2]);
|
if (isset($argv[2])) $Daux->generate_static($argv[2]);
|
||||||
else $Daux->generate_static();
|
else $Daux->generate_static();
|
||||||
|
@ -87,23 +87,27 @@
|
|||||||
'The Global Config file is missing. Requested File : ' . $global_config_file, ErrorPage::FATAL_ERROR_TYPE);
|
'The Global Config file is missing. Requested File : ' . $global_config_file, ErrorPage::FATAL_ERROR_TYPE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$global_config = json_decode(file_get_contents($global_config_file), true);
|
$global_config = json_decode(file_get_contents($global_config_file), true);
|
||||||
if (!isset($global_config)) {
|
if (!isset($global_config)) {
|
||||||
$this->generate_error_page('Corrupt Global Config File',
|
$this->generate_error_page('Corrupt Global Config File',
|
||||||
'The Global Config file is corrupt. Check that the JSON encoding is correct', ErrorPage::FATAL_ERROR_TYPE);
|
'The Global Config file is corrupt. Check that the JSON encoding is correct', ErrorPage::FATAL_ERROR_TYPE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($global_config['docs_directory'])) {
|
if (!isset($global_config['docs_directory'])) {
|
||||||
$this->generate_error_page('Docs Directory not set', 'The Global Config file does not have the docs directory set.',
|
$this->generate_error_page('Docs Directory not set', 'The Global Config file does not have the docs directory set.',
|
||||||
ErrorPage::FATAL_ERROR_TYPE);
|
ErrorPage::FATAL_ERROR_TYPE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->docs_path = $this->local_base . DIRECTORY_SEPARATOR . $global_config['docs_directory'];
|
|
||||||
if (!is_dir($this->docs_path)) {
|
$this->docs_path = $global_config['docs_directory'];
|
||||||
|
if (!is_dir($this->docs_path) && !is_dir($this->docs_path = $this->local_base . DIRECTORY_SEPARATOR . $this->docs_path)) {
|
||||||
$this->generate_error_page('Docs Directory not found',
|
$this->generate_error_page('Docs Directory not found',
|
||||||
'The Docs directory does not exist. Check the path again : ' . $this->docs_path, ErrorPage::FATAL_ERROR_TYPE);
|
'The Docs directory does not exist. Check the path again : ' . $this->docs_path, ErrorPage::FATAL_ERROR_TYPE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($global_config['valid_markdown_extensions'])) static::$VALID_MARKDOWN_EXTENSIONS = array('md', 'markdown');
|
if (!isset($global_config['valid_markdown_extensions'])) static::$VALID_MARKDOWN_EXTENSIONS = array('md', 'markdown');
|
||||||
else static::$VALID_MARKDOWN_EXTENSIONS = $global_config['valid_markdown_extensions'];
|
else static::$VALID_MARKDOWN_EXTENSIONS = $global_config['valid_markdown_extensions'];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user