Skip to content
Snippets Groups Projects

[RTKO] default volatile on setupOpac

Merged Sebastien ANDRE requested to merge fix_default_volatile_on_setup into master
Compare and Show latest version
2 files
+ 23
22
Preferences
Compare changes
Files
2
+ 22
21
@@ -44,11 +44,9 @@ class Bokeh_Engine
$_php_command,
$_instance;
protected
$_cache_seed,
$_config,
$_front_controller;
protected ?Zend_Config_Ini $_config = null;
protected ?string $_cache_seed = null;
protected ?Zend_Controller_Front $_front_controller = null;
protected bool $_for_test = false;
public static function getInstance()
@@ -79,7 +77,7 @@ class Bokeh_Engine
}
public function getFrontController()
public function getFrontController(): ?Zend_Controller_Front
{
return $this->_front_controller;
}
@@ -99,7 +97,7 @@ class Bokeh_Engine
{
require_once('Class/Url.php');
defineConstant('BASE_URL', Class_Url::baseUrl());
defineConstant('BASE_URL', Class_Url::baseUrl());
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
@@ -108,6 +106,7 @@ class Bokeh_Engine
$this->setupConstants();
require_once('requires.php');
return $this;
}
@@ -178,9 +177,9 @@ class Bokeh_Engine
defineConstant('JQUERYUI', URL_ADMIN_JS . 'jquery-ui-1.12.1/jquery-ui.min.js');
defineConstant('JQUERYUI_CSS', URL_ADMIN_JS . 'jquery-ui-1.12.1/jquery-ui.min.css');
defineConstant("URL_JS", BASE_URL . "/public/opac/js/");
defineConstant("URL_EPUB", BASE_URL . "/temp/epub/");
defineConstant("URL_SHARED_IMG", BASE_URL . "/public/opac/images/");
defineConstant('URL_JS', BASE_URL . '/public/opac/js/');
defineConstant('URL_EPUB', BASE_URL . '/temp/epub/');
defineConstant('URL_SHARED_IMG', BASE_URL . '/public/opac/images/');
// il y a des autre define URL dans ZendAfi_Controller_Plugin_DefineURLs
// par exemple URL_IMG, URL_CSS, URL_HTML et URL_JS va chercher dans 'URL_SKIN . 'nom de le module' . /html' etc.
@@ -214,10 +213,9 @@ class Bokeh_Engine
bool $allowModifications = false): self
{
// load configuration (local ou production)
if (array_isset('REMOTE_ADDR', $_SERVER) && $_SERVER['REMOTE_ADDR'] == '127.0.0.1')
$serveur = 'local';
else
$serveur = 'production';
$serveur = (array_isset('REMOTE_ADDR', $_SERVER) && $_SERVER['REMOTE_ADDR'] == '127.0.0.1')
? 'local'
: 'production';
$this->_config = new Zend_Config_Ini($config_init_file_path, $serveur, $allowModifications);
Zend_Registry::set('cfg', $this->_config);
@@ -285,13 +283,13 @@ class Bokeh_Engine
}
public function getCacheSeed()
public function getCacheSeed(): ?string
{
return $this->_cache_seed;;
return $this->_cache_seed;
}
public function setCacheSeed($seed): self
public function setCacheSeed(string $seed): self
{
$this->_cache_seed = $seed;
@@ -324,7 +322,7 @@ class Bokeh_Engine
}
protected function _timeoutReload()
protected function _timeoutReload(): self
{
$this->_getPhpCommand()->header('HTTP/1.1 503 Service Unavailable');
$this->_getPhpCommand()->echoHtml('<html>'
@@ -337,6 +335,8 @@ class Bokeh_Engine
. '</body>'
.'</html>');
$this->_getPhpCommand()->exitDispatch();
return $this;
}
@@ -550,7 +550,7 @@ class Bokeh_Engine
}
function setupRoutes($front_controller, $cfg): self
function setupRoutes(Zend_Controller_Front $front_controller, $cfg): self
{
if ('1' == $cfg->get('enable_rewriting'))
{
@@ -629,6 +629,8 @@ class Bokeh_Engine
if ($this->_for_test)
Storm_Model_Loader::defaultToVolatile();
$this->_for_test = false;
return $this;
}
}
@@ -666,8 +668,7 @@ class Bokeh_Session
/* for test */
protected static $_cookie_jar;
public function get($session_id)
public function get(string $session_id): Zend_Session_Namespace
{
$this->_getCookieJar()->session_set_cookie_params(['httponly' => true,
'secure' => Class_Url::isSecure()]);