allow better standard config

master
Guillermo Dev 7 years ago
parent 34acb97743
commit 84c310e8d9

1
.gitignore vendored

@ -1,4 +1,3 @@
.idea
logs/
*configuration.local.php
*~

@ -60,17 +60,18 @@ class Configuration {
// by default, set the session save path to the default value;
$this->values['session']['save_path'] = session_save_path();
if(file_exists($this->custom_config)) {
/** @noinspection PhpIncludeInspection */
require_once($this->custom_config);
if(!file_exists($this->custom_config)) {
throw new \Exception\UsageException('No configuration.local.php file was found. Create it with the proper config.');
}
$configuration = include_once $this->custom_config;
if(! isset($configuration) || ! is_array($configuration)) {
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)
{

@ -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,
);;
Loading…
Cancel
Save