allow better standard config
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
.idea
|
.idea
|
||||||
logs/
|
logs/
|
||||||
*configuration.local.php
|
|
||||||
*~
|
*~
|
||||||
|
|||||||
@@ -60,16 +60,17 @@ class Configuration {
|
|||||||
// by default, set the session save path to the default value;
|
// by default, set the session save path to the default value;
|
||||||
$this->values['session']['save_path'] = session_save_path();
|
$this->values['session']['save_path'] = session_save_path();
|
||||||
|
|
||||||
if(file_exists($this->custom_config)) {
|
if(!file_exists($this->custom_config)) {
|
||||||
/** @noinspection PhpIncludeInspection */
|
throw new \Exception\UsageException('No configuration.local.php file was found. Create it with the proper config.');
|
||||||
require_once($this->custom_config);
|
|
||||||
|
|
||||||
if(! isset($configuration) || ! is_array($configuration)) {
|
|
||||||
throw new \RuntimeException("You custom configuration in '{$this->custom_config}' must be in a variable named '\$configuration' and be an array.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->values = array_replace_recursive($this->values, $configuration);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$configuration = include_once $this->custom_config;
|
||||||
|
|
||||||
|
if(!is_array($configuration)) {
|
||||||
|
throw new \RuntimeException("You custom configuration in '{$this->custom_config}' must be in a variable named '\$configuration' and be an array.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->values = array_replace_recursive($this->values, $configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function dotNotationAccess($data, $key, $default=null)
|
private function dotNotationAccess($data, $key, $default=null)
|
||||||
|
|||||||
44
configuration.local.php
Normal file
44
configuration.local.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 'odbc:Driver=FreeTDS;
|
||||||
|
* Server=192.168.0.8;
|
||||||
|
* Port=1218;
|
||||||
|
* Database=netbiblio;
|
||||||
|
* TDS_Version=7.4;
|
||||||
|
* ClientCharset=UTF-8'* 'alcoda', 'alcodaonly'
|
||||||
|
*/
|
||||||
|
return array(
|
||||||
|
'db' => array(
|
||||||
|
'driver' => 'FreeTDS',
|
||||||
|
'server' => '192.168.0.8',
|
||||||
|
'port' => '1218',
|
||||||
|
'username' => 'alcoda',
|
||||||
|
'password' => 'alcodaonly',
|
||||||
|
'name' => 'netbiblio',
|
||||||
|
),
|
||||||
|
'solr' => array(
|
||||||
|
'server' => '212.147.56.162',
|
||||||
|
'port' => '8983',
|
||||||
|
'username' => '',
|
||||||
|
'password' => '',
|
||||||
|
'path' => 'solr/',
|
||||||
|
'result_count' => 10,
|
||||||
|
),
|
||||||
|
'log' => array(
|
||||||
|
'file' => '/var/www/webservice/logs/log.txt',
|
||||||
|
'format' => '%ip% - [%date%] - %status% %error% - %time% - %func%',
|
||||||
|
// The greater the verbosity, the more is displayed
|
||||||
|
// 0 : no log at all
|
||||||
|
// 1 : log summary
|
||||||
|
// 2 : log response
|
||||||
|
'verbosity' => 1,
|
||||||
|
),
|
||||||
|
'session' => array(
|
||||||
|
'save_path' => ''
|
||||||
|
),
|
||||||
|
'checkfile_url' => 'http://medias.bibliothequesonore.ch/checkfile.php?',
|
||||||
|
'checkfile_url_old' => 'http://fichiers.bibliothequesonore.ch/checkfile.php?',
|
||||||
|
'netbiblio_worker_id' => 45,
|
||||||
|
'www_employee_id' => 45,
|
||||||
|
'www_library_id' => 2,
|
||||||
|
);;
|
||||||
Reference in New Issue
Block a user