Bugfixes
This commit is contained in:
parent
1445bf7c0f
commit
fa798ff1e4
@ -67,19 +67,27 @@ class Daux
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadConfigOverrides($config_file)
|
private function loadConfigOverrides($override_file)
|
||||||
{
|
{
|
||||||
|
// Read main configuration
|
||||||
$this->options = json_decode(file_get_contents($this->local_base . DS . 'default.json'), true);
|
$this->options = json_decode(file_get_contents($this->local_base . DS . 'default.json'), true);
|
||||||
|
|
||||||
$config_file = $this->local_base . DS . $config_file;
|
// Read documentation overrides
|
||||||
if (!file_exists($config_file)) {
|
$config_file = $this->docs_path . DS . 'config.json';
|
||||||
throw new Exception('The local config file is missing. Check path : ' . $config_file);
|
if (file_exists($config_file)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (is_file($config_file)) {
|
|
||||||
$config = json_decode(file_get_contents($config_file), true);
|
$config = json_decode(file_get_contents($config_file), true);
|
||||||
if (!isset($config)) {
|
if (!isset($config)) {
|
||||||
throw new Exception('There was an error parsing the Config file. Please review');
|
throw new Exception('The local config file is missing. Check path : ' . $config_file);
|
||||||
|
}
|
||||||
|
$this->options = array_merge($this->options, $config);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read command line overrides
|
||||||
|
$config_file = $this->local_base . DS . $override_file;
|
||||||
|
if (file_exists($config_file)) {
|
||||||
|
$config = json_decode(file_get_contents($config_file), true);
|
||||||
|
if (!isset($config)) {
|
||||||
|
throw new Exception('The local config file is missing. Check path : ' . $config_file);
|
||||||
}
|
}
|
||||||
$this->options = array_merge($this->options, $config);
|
$this->options = array_merge($this->options, $config);
|
||||||
}
|
}
|
||||||
|
@ -62,9 +62,11 @@ class Generator
|
|||||||
if (!array_key_exists('id', $published)) {
|
if (!array_key_exists('id', $published)) {
|
||||||
if (array_key_exists('page', $entry)) {
|
if (array_key_exists('page', $entry)) {
|
||||||
echo "Creating: " . $entry['file']->getUrl() . "\n";
|
echo "Creating: " . $entry['file']->getUrl() . "\n";
|
||||||
|
$published['version'] = 1;
|
||||||
$published['id'] = $this->client->createPage($parent_id, $entry['title'], "The content will come very soon !");
|
$published['id'] = $this->client->createPage($parent_id, $entry['title'], "The content will come very soon !");
|
||||||
} else {
|
} else {
|
||||||
echo "Creating Placeholder page: " . $entry['title'] . "\n";
|
echo "Creating Placeholder page: " . $entry['title'] . "\n";
|
||||||
|
$published['version'] = 1;
|
||||||
$published['id'] = $this->client->createPage($parent_id, $entry['title'], "");
|
$published['id'] = $this->client->createPage($parent_id, $entry['title'], "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user