feat: allow starting session from extenders
This commit is contained in:
@@ -1,45 +0,0 @@
|
|||||||
<?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,
|
|
||||||
),
|
|
||||||
'renderer' => array('class' => '\Bsr\Webservice\MockRenderer'),
|
|
||||||
'log' => array(
|
|
||||||
'file' => realpath(dirname(__FILE__) . '/..') . '/log/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,
|
|
||||||
);;
|
|
||||||
@@ -69,6 +69,12 @@ abstract class WebService
|
|||||||
$renderer->render($this->status, $data);
|
$renderer->render($this->status, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function startSession()
|
||||||
|
{
|
||||||
|
session_save_path(Configuration::get('session.save_path'));
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines which method to call based on GET or POST parameters and
|
* Determines which method to call based on GET or POST parameters and
|
||||||
* call it before returning the result.
|
* call it before returning the result.
|
||||||
@@ -80,8 +86,7 @@ abstract class WebService
|
|||||||
private function call($sendSession = true)
|
private function call($sendSession = true)
|
||||||
{
|
{
|
||||||
if ($sendSession) {
|
if ($sendSession) {
|
||||||
session_save_path(Configuration::get('session.save_path'));
|
$this->startSession();
|
||||||
session_start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$params = empty($_GET) ? $_POST : $_GET;
|
$params = empty($_GET) ? $_POST : $_GET;
|
||||||
|
|||||||
Reference in New Issue
Block a user