Cette révision appartient à :
Stéphane Goetz 2015-05-21 18:04:57 +02:00 révisé par Stéphane Goetz
Parent 1445bf7c0f
révision fa798ff1e4
2 fichiers modifiés avec 18 ajouts et 8 suppressions

Voir le fichier

@ -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);
$config_file = $this->local_base . DS . $config_file;
if (!file_exists($config_file)) {
throw new Exception('The local config file is missing. Check path : ' . $config_file);
}
if (is_file($config_file)) {
// Read documentation overrides
$config_file = $this->docs_path . DS . 'config.json';
if (file_exists($config_file)) {
$config = json_decode(file_get_contents($config_file), true);
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);
}

Voir le fichier

@ -62,9 +62,11 @@ class Generator
if (!array_key_exists('id', $published)) {
if (array_key_exists('page', $entry)) {
echo "Creating: " . $entry['file']->getUrl() . "\n";
$published['version'] = 1;
$published['id'] = $this->client->createPage($parent_id, $entry['title'], "The content will come very soon !");
} else {
echo "Creating Placeholder page: " . $entry['title'] . "\n";
$published['version'] = 1;
$published['id'] = $this->client->createPage($parent_id, $entry['title'], "");
}
}