Fixes
This commit is contained in:
parent
0715914ac4
commit
15a0c5cadb
@ -12,10 +12,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
|
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
|
||||||
web:
|
web:
|
||||||
|
environment:
|
||||||
|
- APP_ENV=dev
|
||||||
volumes:
|
volumes:
|
||||||
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
|
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
|
||||||
php-fpm:
|
php-fpm:
|
||||||
|
environment:
|
||||||
|
- APP_ENV=dev
|
||||||
volumes:
|
volumes:
|
||||||
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
|
- ${APP_CODE_PATH_HOST?}:${APP_CODE_PATH_CONTAINER?}
|
||||||
environment:
|
|
||||||
- APP_ENV=test
|
|
||||||
|
|||||||
Binary file not shown.
@ -1500,7 +1500,7 @@ CREATE TABLE `credit_system` (
|
|||||||
|
|
||||||
LOCK TABLES `credit_system` WRITE;
|
LOCK TABLES `credit_system` WRITE;
|
||||||
/*!40000 ALTER TABLE `credit_system` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `credit_system` DISABLE KEYS */;
|
||||||
INSERT INTO `credit_system` VALUES (1,1,1,'2015-03-18 11:30:30','2015-03-18 14:33:45','Sonderaktion - Neueröffnung unseres Shops',100,NULL,'2015-03-01','2015-05-31',0,5.45,0,'0','','0',1,1,1,1,1),(2,3,NULL,'2023-10-11 14:41:44','2024-05-31 17:32:44','100euro',1,1,'2023-10-11','2024-10-11',0,100,1,NULL,'hddecal-1',NULL,1,1,1,0,0),(4,3,NULL,'2024-03-26 10:24:14','2024-04-02 09:42:16','earlybird24',1,1,'2024-02-26','2024-04-26',1,10,1,NULL,'earlybird24',NULL,1,0,0,1,1),(5,3,NULL,'2024-05-31 17:14:03','2024-05-31 17:14:03','Neuer Gutschein',1,1,'2024-05-27','2024-06-26',1,100,1,NULL,'dashboard_quick_press_last_post_id',NULL,1,1,1,1,1),(6,3,NULL,'2024-05-31 18:07:08','2024-05-31 18:07:24','Göhre 15% Backup',1,1,'2024-05-31','2024-08-31',1,15,1,NULL,'goehre15-2',NULL,1,0,0,0,0);
|
INSERT INTO `credit_system` VALUES (1,1,1,'2015-03-18 11:30:30','2015-03-18 14:33:45','Sonderaktion - Neueröffnung unseres Shops',100,NULL,'2015-03-01','2015-05-31',0,5.45,0,'0','','0',1,1,1,1,1,0),(2,3,NULL,'2023-10-11 14:41:44','2024-05-31 17:32:44','100euro',1,1,'2023-10-11','2024-10-11',0,100,1,NULL,'hddecal-1',NULL,1,1,1,0,0,0),(4,3,NULL,'2024-03-26 10:24:14','2024-04-02 09:42:16','earlybird24',1,1,'2024-02-26','2024-04-26',1,10,1,NULL,'earlybird24',NULL,1,0,0,1,1,0),(5,3,NULL,'2024-05-31 17:14:03','2024-05-31 17:14:03','Neuer Gutschein',1,1,'2024-05-27','2024-06-26',1,100,1,NULL,'dashboard_quick_press_last_post_id',NULL,1,1,1,1,1,0),(6,3,NULL,'2024-05-31 18:07:08','2024-05-31 18:07:24','Göhre 15% Backup',1,1,'2024-05-31','2024-08-31',1,15,1,NULL,'goehre15-2',NULL,1,0,0,0,0,0);
|
||||||
/*!40000 ALTER TABLE `credit_system` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `credit_system` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $shop_id = 0;
|
protected $shop_id = 0;
|
||||||
|
|
||||||
protected Shop $shop;
|
protected Shop $shop;
|
||||||
@ -21,12 +21,13 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$autoloader->registerNamespace('EasyBib_');
|
$autoloader->registerNamespace('EasyBib_');
|
||||||
include_once 'Doctrine.php';
|
include_once 'Doctrine.php';
|
||||||
$autoloader->pushAutoloader(
|
$autoloader->pushAutoloader(
|
||||||
array (
|
array(
|
||||||
'Doctrine',
|
'Doctrine',
|
||||||
'autoload'), 'Doctrine'
|
'autoload'),
|
||||||
|
'Doctrine'
|
||||||
);
|
);
|
||||||
$autoloaderModule = new Zend_Application_Module_Autoloader(
|
$autoloaderModule = new Zend_Application_Module_Autoloader(
|
||||||
array (
|
array(
|
||||||
'namespace' => 'Admin',
|
'namespace' => 'Admin',
|
||||||
'basePath' => APPLICATION_PATH . '/modules/admin')
|
'basePath' => APPLICATION_PATH . '/modules/admin')
|
||||||
);
|
);
|
||||||
@ -38,13 +39,12 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
protected function _initDb()
|
protected function _initDb()
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/database.ini', APPLICATION_ENV);
|
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/database.ini', APPLICATION_ENV);
|
||||||
/**
|
/**
|
||||||
* @see Zend_Db
|
* @see Zend_Db
|
||||||
*/
|
*/
|
||||||
$servers = array (
|
$servers = array(
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'port' => 11211,
|
'port' => 11211,
|
||||||
'persistent' => true);
|
'persistent' => true);
|
||||||
@ -54,12 +54,22 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
)
|
)
|
||||||
);*/
|
);*/
|
||||||
$cacheDriver = new Doctrine_Cache_Array();
|
$cacheDriver = new Doctrine_Cache_Array();
|
||||||
|
if (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] == 'test') {
|
||||||
|
$dsn = 'mysql:dbname=psc_test;host=mysql';
|
||||||
|
$user = 'psc';
|
||||||
|
$password = 'psc';
|
||||||
|
} elseif (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] == 'dev') {
|
||||||
|
$dsn = 'mysql:dbname=psc;host=mysql';
|
||||||
|
$user = 'psc';
|
||||||
|
$password = 'psc';
|
||||||
|
} else {
|
||||||
$dsn = 'mysql:dbname=psc;host=mysql';
|
$dsn = 'mysql:dbname=psc;host=mysql';
|
||||||
$user = 'root';
|
$user = 'root';
|
||||||
$password = 'Wichtig1';
|
$password = 'Wichtig1';
|
||||||
|
}
|
||||||
|
|
||||||
if ((isset($_REQUEST['ARTID']) || isset($_REQUEST['artid']) || isset($_POST['ARTID'])) && (strpos($_SERVER['REQUEST_URI'], 'upload') !== false || strpos($_SERVER['REQUEST_URI'], 'template') !== false || strpos($_SERVER['REQUEST_URI'], 'basket') !== false || strpos($_SERVER['REQUEST_URI'], 'article') !== false) ) {
|
if ((isset($_REQUEST['ARTID']) || isset($_REQUEST['artid']) || isset($_POST['ARTID'])) && (strpos($_SERVER['REQUEST_URI'], 'upload') !== false || strpos($_SERVER['REQUEST_URI'], 'template') !== false || strpos($_SERVER['REQUEST_URI'], 'basket') !== false || strpos($_SERVER['REQUEST_URI'], 'article') !== false)) {
|
||||||
if(strlen($_REQUEST['ARTID']) > 100) {
|
if (strlen($_REQUEST['ARTID']) > 100) {
|
||||||
$values = TP_Crypt::decrypt($_REQUEST['ARTID']);
|
$values = TP_Crypt::decrypt($_REQUEST['ARTID']);
|
||||||
$_SERVER["SERVER_NAME"] = str_replace(array("http://", "https://"), array("", ""), $values['SERVER']);
|
$_SERVER["SERVER_NAME"] = str_replace(array("http://", "https://"), array("", ""), $values['SERVER']);
|
||||||
|
|
||||||
@ -80,16 +90,15 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
* Configure Doctrine
|
* Configure Doctrine
|
||||||
*/
|
*/
|
||||||
Zend_Registry::set(
|
Zend_Registry::set(
|
||||||
'doctrine_config', array (
|
'doctrine_config',
|
||||||
|
array(
|
||||||
'data_fixtures_path' => dirname(__FILE__) . '/doctrine/data/fixtures',
|
'data_fixtures_path' => dirname(__FILE__) . '/doctrine/data/fixtures',
|
||||||
'models_path' => dirname(__FILE__) . '/models',
|
'models_path' => dirname(__FILE__) . '/models',
|
||||||
'migrations_path' => dirname(__FILE__) . '/doctrine/migrations',
|
'migrations_path' => dirname(__FILE__) . '/doctrine/migrations',
|
||||||
'sql_path' => dirname(__FILE__) . '/doctrine/data/sql',
|
'sql_path' => dirname(__FILE__) . '/doctrine/data/sql',
|
||||||
'yaml_schema_path' => dirname(__FILE__) . '/doctrine/schema')
|
'yaml_schema_path' => dirname(__FILE__) . '/doctrine/schema')
|
||||||
);
|
);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch ( Exception $e )
|
|
||||||
{
|
|
||||||
die($e->getMessage());
|
die($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,25 +110,20 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$logger->addPriority('TABLE', 8);
|
$logger->addPriority('TABLE', 8);
|
||||||
Zend_Registry::set('log', $logger);
|
Zend_Registry::set('log', $logger);
|
||||||
ini_set('error_log', APPLICATION_PATH . '/../logs/php.error.log');
|
ini_set('error_log', APPLICATION_PATH . '/../logs/php.error.log');
|
||||||
if ((isset($_REQUEST['ARTID']) || isset($_REQUEST['artid']) || isset($_POST['ARTID'])) && (strpos($_SERVER['REQUEST_URI'], 'upload') !== false || strpos($_SERVER['REQUEST_URI'], 'template') !== false || strpos($_SERVER['REQUEST_URI'], 'basket') !== false || strpos($_SERVER['REQUEST_URI'], 'overview') !== false || strpos($_SERVER['REQUEST_URI'], 'steplayouter') !== false || strpos($_SERVER['REQUEST_URI'], 'article') !== false) ) {
|
if ((isset($_REQUEST['ARTID']) || isset($_REQUEST['artid']) || isset($_POST['ARTID'])) && (strpos($_SERVER['REQUEST_URI'], 'upload') !== false || strpos($_SERVER['REQUEST_URI'], 'template') !== false || strpos($_SERVER['REQUEST_URI'], 'basket') !== false || strpos($_SERVER['REQUEST_URI'], 'overview') !== false || strpos($_SERVER['REQUEST_URI'], 'steplayouter') !== false || strpos($_SERVER['REQUEST_URI'], 'article') !== false)) {
|
||||||
if(strlen($_REQUEST['ARTID']) > 100) {
|
if (strlen($_REQUEST['ARTID']) > 100) {
|
||||||
$values = TP_Crypt::decrypt($_REQUEST['ARTID']);
|
$values = TP_Crypt::decrypt($_REQUEST['ARTID']);
|
||||||
Zend_Session::setId($values['ARTID']);
|
Zend_Session::setId($values['ARTID']);
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
if (isset($_POST['ARTID']) ) {
|
if (isset($_POST['ARTID'])) {
|
||||||
Zend_Registry::get('log')->debug($_POST['ARTID']);
|
Zend_Registry::get('log')->debug($_POST['ARTID']);
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Zend_Session::setId($_POST['ARTID']);
|
Zend_Session::setId($_POST['ARTID']);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch ( Exception $e )
|
|
||||||
{
|
|
||||||
Zend_Registry::get('log')->debug($e->getMessage());
|
Zend_Registry::get('log')->debug($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Zend_Session::setId($_REQUEST['ARTID']);
|
Zend_Session::setId($_REQUEST['ARTID']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,23 +137,22 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
}
|
}
|
||||||
protected function _initCli()
|
protected function _initCli()
|
||||||
{
|
{
|
||||||
if (strrpos(strtolower(PHP_SAPI), 'cli') !== false && APPLICATION_ENV != 'testing' ) {
|
if (strrpos(strtolower(PHP_SAPI), 'cli') !== false && APPLICATION_ENV != 'testing') {
|
||||||
$this->bootstrap('frontController');
|
$this->bootstrap('frontController');
|
||||||
$this->frontController->setRouter(new TP_Controller_Router_Cli())->setRequest(new TP_Controller_Request_Cli())->setResponse(new TP_Controller_Response_Cli());
|
$this->frontController->setRouter(new TP_Controller_Router_Cli())->setRequest(new TP_Controller_Request_Cli())->setResponse(new TP_Controller_Response_Cli());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected function _initLayout()
|
protected function _initLayout()
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
if ($_SERVER["SERVER_NAME"] == "" && isset($_SERVER["HTTP_HOST"]) && $_SERVER["HTTP_HOST"] != "") {
|
||||||
if($_SERVER["SERVER_NAME"] == "" && isset($_SERVER["HTTP_HOST"]) && $_SERVER["HTTP_HOST"] != "") {
|
|
||||||
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
|
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
|
||||||
}
|
}
|
||||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/layout.ini', APPLICATION_ENV, true);
|
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/layout.ini', APPLICATION_ENV, true);
|
||||||
$row = Doctrine_Query::create()->from('Domain m')->where('m.name = ?', $_SERVER["SERVER_NAME"])->fetchOne();
|
$row = Doctrine_Query::create()->from('Domain m')->where('m.name = ?', $_SERVER["SERVER_NAME"])->fetchOne();
|
||||||
if ($row === false ) {
|
if ($row === false) {
|
||||||
$shop = Doctrine_Query::create()->from('Shop s')->fetchOne();
|
$shop = Doctrine_Query::create()->from('Shop s')->fetchOne();
|
||||||
}else{
|
} else {
|
||||||
$shop = $row->Shop;
|
$shop = $row->Shop;
|
||||||
}
|
}
|
||||||
$this->shop = $shop;
|
$this->shop = $shop;
|
||||||
@ -159,7 +162,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($shop->deleted == true) {
|
if ($shop->deleted == true) {
|
||||||
die(
|
die(
|
||||||
'<html>
|
'<html>
|
||||||
<head><title>' . $shop->name . ' ist geschlossen</title></head>
|
<head><title>' . $shop->name . ' ist geschlossen</title></head>
|
||||||
@ -176,22 +179,23 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$config->shopPath = APPLICATION_PATH . '/' . str_replace('%SHOPID%', $shop->uid, $config->shopPath);
|
$config->shopPath = APPLICATION_PATH . '/' . str_replace('%SHOPID%', $shop->uid, $config->shopPath);
|
||||||
|
|
||||||
$this->shop_id = $shop->uid;
|
$this->shop_id = $shop->uid;
|
||||||
if ($shop->customtemplates == 1 ) {
|
if ($shop->customtemplates == 1) {
|
||||||
$config->layoutPath = APPLICATION_PATH . '/design/vorlagen/' . $shop->layout;
|
$config->layoutPath = APPLICATION_PATH . '/design/vorlagen/' . $shop->layout;
|
||||||
}elseif($shop->template_switch && Zend_Auth::getInstance()->hasIdentity()) {
|
} elseif ($shop->template_switch && Zend_Auth::getInstance()->hasIdentity()) {
|
||||||
$user = Zend_Auth::getInstance()->getIdentity();
|
$user = Zend_Auth::getInstance()->getIdentity();
|
||||||
$accountPath = $this->getAccountTemplatePath($user['account_id']);
|
$accountPath = $this->getAccountTemplatePath($user['account_id']);
|
||||||
if($accountPath != "") {
|
if ($accountPath != "") {
|
||||||
$config->layoutPath = APPLICATION_PATH . '/' . str_replace('%LAYOUT%', $accountPath, $config->layoutPath);
|
$config->layoutPath = APPLICATION_PATH . '/' . str_replace('%LAYOUT%', $accountPath, $config->layoutPath);
|
||||||
}else{
|
} else {
|
||||||
$config->layoutPath = APPLICATION_PATH . '/' . str_replace('%LAYOUT%', $shop->layout, $config->layoutPath);
|
$config->layoutPath = APPLICATION_PATH . '/' . str_replace('%LAYOUT%', $shop->layout, $config->layoutPath);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!file_exists(APPLICATION_PATH . str_replace('%LAYOUT%', "", $config->layoutPath))) { mkdir(APPLICATION_PATH . str_replace('%LAYOUT%', "", $config->layoutPath));
|
if (!file_exists(APPLICATION_PATH . str_replace('%LAYOUT%', "", $config->layoutPath))) {
|
||||||
|
mkdir(APPLICATION_PATH . str_replace('%LAYOUT%', "", $config->layoutPath));
|
||||||
}
|
}
|
||||||
if(strpos('_'.$shop->layout, "/")) {
|
if (strpos('_'.$shop->layout, "/")) {
|
||||||
$config->layoutPath = APPLICATION_PATH . str_replace('%LAYOUT%', "", $config->layoutPath) . $shop->layout;
|
$config->layoutPath = APPLICATION_PATH . str_replace('%LAYOUT%', "", $config->layoutPath) . $shop->layout;
|
||||||
}else{
|
} else {
|
||||||
$config->layoutPath = APPLICATION_PATH . '/' . str_replace('%LAYOUT%', $shop->layout, $config->layoutPath);
|
$config->layoutPath = APPLICATION_PATH . '/' . str_replace('%LAYOUT%', $shop->layout, $config->layoutPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,57 +209,52 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
include_once 'Zend/Layout.php';
|
include_once 'Zend/Layout.php';
|
||||||
Zend_Layout::startMvc($config);
|
Zend_Layout::startMvc($config);
|
||||||
|
|
||||||
if (isset($_GET['no_cache']) ) {
|
if (isset($_GET['no_cache'])) {
|
||||||
TP_Util::clearCache(TP_Util::CLEAR_ALL);
|
TP_Util::clearCache(TP_Util::CLEAR_ALL);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch ( Exception $e )
|
|
||||||
{
|
|
||||||
var_dump($e->getTraceAsString());
|
var_dump($e->getTraceAsString());
|
||||||
die(var_dump($e));
|
die(var_dump($e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected function _initLanguage()
|
protected function _initLanguage()
|
||||||
{
|
{
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/printshopcreator.ini', APPLICATION_ENV, true);
|
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/printshopcreator.ini', APPLICATION_ENV, true);
|
||||||
Zend_Registry::set('marketid', $config->marketid);
|
Zend_Registry::set('marketid', $config->marketid);
|
||||||
if (isset($_REQUEST['ticketid']) && strpos($_SERVER['REQUEST_URI'], 'service/upload') !== false ) {
|
if (isset($_REQUEST['ticketid']) && strpos($_SERVER['REQUEST_URI'], 'service/upload') !== false) {
|
||||||
Zend_Session::setId($_REQUEST['ticketid']);
|
Zend_Session::setId($_REQUEST['ticketid']);
|
||||||
}
|
}
|
||||||
if (isset($_REQUEST['chunkid']) && strpos($_SERVER['REQUEST_URI'], 'service/upload') !== false ) {
|
if (isset($_REQUEST['chunkid']) && strpos($_SERVER['REQUEST_URI'], 'service/upload') !== false) {
|
||||||
Zend_Session::setId($_REQUEST['chunkid']);
|
Zend_Session::setId($_REQUEST['chunkid']);
|
||||||
}
|
}
|
||||||
include_once 'Zend/Locale.php';
|
include_once 'Zend/Locale.php';
|
||||||
if (isset($_REQUEST['speak']) ) {
|
if (isset($_REQUEST['speak'])) {
|
||||||
$langsess = new Zend_Session_Namespace('lang');
|
$langsess = new Zend_Session_Namespace('lang');
|
||||||
$langsess->code = $_REQUEST['speak'];
|
$langsess->code = $_REQUEST['speak'];
|
||||||
}
|
}
|
||||||
if (Zend_Auth::getInstance()->hasIdentity() && ! Zend_Session::namespaceIsset('lang') ) {
|
if (Zend_Auth::getInstance()->hasIdentity() && ! Zend_Session::namespaceIsset('lang')) {
|
||||||
$user = Zend_Auth::getInstance()->getIdentity();
|
$user = Zend_Auth::getInstance()->getIdentity();
|
||||||
if($user['language']) {
|
if ($user['language']) {
|
||||||
$locale = new Zend_Locale($user['language']);
|
$locale = new Zend_Locale($user['language']);
|
||||||
}else{
|
} else {
|
||||||
$locale = new Zend_Locale('de_DE');
|
$locale = new Zend_Locale('de_DE');
|
||||||
}
|
}
|
||||||
}
|
} elseif (Zend_Session::namespaceIsset('lang')) {
|
||||||
elseif (Zend_Session::namespaceIsset('lang') ) {
|
|
||||||
$lang = new Zend_Session_Namespace('lang');
|
$lang = new Zend_Session_Namespace('lang');
|
||||||
$locale = new Zend_Locale($lang->code);
|
$locale = new Zend_Locale($lang->code);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$locale = new Zend_Locale($this->shop->getDefaultLocale());
|
$locale = new Zend_Locale($this->shop->getDefaultLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!file_exists(APPLICATION_PATH . '/../cache/'.$this->shop_id.'/')) { mkdir(APPLICATION_PATH . '/../cache/'.$this->shop_id.'/');
|
if (!file_exists(APPLICATION_PATH . '/../cache/'.$this->shop_id.'/')) {
|
||||||
|
mkdir(APPLICATION_PATH . '/../cache/'.$this->shop_id.'/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$frontendOptions = array (
|
$frontendOptions = array(
|
||||||
'lifetime' => 14000, // Lebensdauer des Caches 2 Stunden
|
'lifetime' => 14000, // Lebensdauer des Caches 2 Stunden
|
||||||
'automatic_serialization' => true);
|
'automatic_serialization' => true);
|
||||||
$backendOptions = array (
|
$backendOptions = array(
|
||||||
'cache_dir' => APPLICATION_PATH . '/../cache/'.$this->shop_id.'/')// Verzeichnis, in welches die Cache Dateien kommen
|
'cache_dir' => APPLICATION_PATH . '/../cache/'.$this->shop_id.'/')// Verzeichnis, in welches die Cache Dateien kommen
|
||||||
;
|
;
|
||||||
/*$backendOptions = array('host' => 'localhost',
|
/*$backendOptions = array('host' => 'localhost',
|
||||||
@ -267,14 +266,17 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
'status' => true,
|
'status' => true,
|
||||||
'failure_callback' => '');*/
|
'failure_callback' => '');*/
|
||||||
|
|
||||||
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, array ());
|
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, array());
|
||||||
$fcache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
|
$fcache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
|
||||||
$locale->setCache($cache);
|
$locale->setCache($cache);
|
||||||
Zend_Registry::set('locale', $locale);
|
Zend_Registry::set('locale', $locale);
|
||||||
Zend_Translate::setCache($fcache);
|
Zend_Translate::setCache($fcache);
|
||||||
|
|
||||||
$translate = new Zend_Translate(
|
$translate = new Zend_Translate(
|
||||||
'TP_Translate_Adapter_Frontend_Db', APPLICATION_PATH . '/locale', $locale, array (
|
'TP_Translate_Adapter_Frontend_Db',
|
||||||
|
APPLICATION_PATH . '/locale',
|
||||||
|
$locale,
|
||||||
|
array(
|
||||||
'scan' => Zend_Translate::LOCALE_DIRECTORY)
|
'scan' => Zend_Translate::LOCALE_DIRECTORY)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -287,18 +289,15 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
Zend_Registry::set('cache', $cache);
|
Zend_Registry::set('cache', $cache);
|
||||||
Zend_Registry::set('filecache', $fcache);
|
Zend_Registry::set('filecache', $fcache);
|
||||||
Zend_Form::setDefaultTranslator($translate);
|
Zend_Form::setDefaultTranslator($translate);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch ( Exception $e )
|
|
||||||
{
|
|
||||||
die($e->getMessage());
|
die($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected function _initArticleQueues()
|
protected function _initArticleQueues()
|
||||||
{
|
{
|
||||||
$articles = array ();
|
$articles = array();
|
||||||
foreach ( new DirectoryIterator(APPLICATION_PATH . '/articles') as $file )
|
foreach (new DirectoryIterator(APPLICATION_PATH . '/articles') as $file) {
|
||||||
{
|
if ($file == '.' || $file == '..' || $file == '.svn' || $file == '.DS_Store') {
|
||||||
if ($file == '.' || $file == '..' || $file == '.svn' || $file == '.DS_Store' ) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
include_once APPLICATION_PATH . '/articles/' . $file->getFilename() . '/Article.php';
|
include_once APPLICATION_PATH . '/articles/' . $file->getFilename() . '/Article.php';
|
||||||
@ -306,10 +305,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$articles[$article->id] = $file->getFilename() . '_Article';
|
$articles[$article->id] = $file->getFilename() . '_Article';
|
||||||
}
|
}
|
||||||
Zend_Registry::set('articles', $articles);
|
Zend_Registry::set('articles', $articles);
|
||||||
$queues = array ();
|
$queues = array();
|
||||||
foreach ( new DirectoryIterator(APPLICATION_PATH . '/queues') as $file )
|
foreach (new DirectoryIterator(APPLICATION_PATH . '/queues') as $file) {
|
||||||
{
|
if ($file == '.' || $file == '..' || $file == '.svn' || $file == '.DS_Store') {
|
||||||
if ($file == '.' || $file == '..' || $file == '.svn' || $file == '.DS_Store' ) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
include_once APPLICATION_PATH . '/queues/' . $file->getFilename() . '/Queues.php';
|
include_once APPLICATION_PATH . '/queues/' . $file->getFilename() . '/Queues.php';
|
||||||
@ -325,7 +323,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$front = $this->getResource('FrontController');
|
$front = $this->getResource('FrontController');
|
||||||
$auth = Zend_Auth::getInstance();
|
$auth = Zend_Auth::getInstance();
|
||||||
$cache = Zend_Registry::get('cache');
|
$cache = Zend_Registry::get('cache');
|
||||||
if (! ($acl = $cache->load('acl')) ) {
|
if (! ($acl = $cache->load('acl'))) {
|
||||||
$acl = new TP_Plugin_Acl($auth);
|
$acl = new TP_Plugin_Acl($auth);
|
||||||
$cache->save($acl);
|
$cache->save($acl);
|
||||||
}
|
}
|
||||||
@ -333,7 +331,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$cache->save($acl);
|
$cache->save($acl);
|
||||||
$front->registerPlugin(
|
$front->registerPlugin(
|
||||||
new Zend_Controller_Plugin_ErrorHandler(
|
new Zend_Controller_Plugin_ErrorHandler(
|
||||||
array (
|
array(
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'error',
|
'controller' => 'error',
|
||||||
'action' => 'error')
|
'action' => 'error')
|
||||||
@ -346,10 +344,10 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
protected function getAccountTemplatePath($account_id)
|
protected function getAccountTemplatePath($account_id)
|
||||||
{
|
{
|
||||||
$account = Doctrine_Query::create()->from('Account c')->where('c.id = ?', array($account_id))->fetchOne();
|
$account = Doctrine_Query::create()->from('Account c')->where('c.id = ?', array($account_id))->fetchOne();
|
||||||
if($account['template_switch'] != "") {
|
if ($account['template_switch'] != "") {
|
||||||
return $account['template_switch'];
|
return $account['template_switch'];
|
||||||
}
|
}
|
||||||
if($account['filiale_id'] != "" && $account['filiale_id'] != 0) {
|
if ($account['filiale_id'] != "" && $account['filiale_id'] != 0) {
|
||||||
return $this->getAccountTemplatePath($account['filiale_id']);
|
return $this->getAccountTemplatePath($account['filiale_id']);
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
@ -365,9 +363,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$dbMongo = TP_Mongo::getInstance();
|
$dbMongo = TP_Mongo::getInstance();
|
||||||
$objs = $dbMongo->Route->find(array('shop' => (string)$shop['uid']));
|
$objs = $dbMongo->Route->find(array('shop' => (string)$shop['uid']));
|
||||||
|
|
||||||
foreach($objs as $obj) {
|
foreach ($objs as $obj) {
|
||||||
|
|
||||||
if($obj->controller == 2) {
|
if ($obj->controller == 2) {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->url,
|
$obj->url,
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -382,7 +380,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($obj->controller == 1) {
|
if ($obj->controller == 1) {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->url,
|
$obj->url,
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -397,7 +395,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($obj->controller == 3) {
|
if ($obj->controller == 3) {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->url,
|
$obj->url,
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -412,8 +410,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($obj->controller == 4) {
|
if ($obj->controller == 4) {
|
||||||
if(strpos($obj->url, 'basket') !== false) {
|
if (strpos($obj->url, 'basket') !== false) {
|
||||||
|
|
||||||
$basketUrl = explode("/", $obj->url);
|
$basketUrl = explode("/", $obj->url);
|
||||||
|
|
||||||
@ -423,12 +421,12 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
[
|
[
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'basket',
|
'controller' => 'basket',
|
||||||
'action' => $basketUrl[2]?$basketUrl[2]:'index',
|
'action' => $basketUrl[2] ? $basketUrl[2] : 'index',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}elseif(strpos($obj->url, 'user') !== false) {
|
} elseif (strpos($obj->url, 'user') !== false) {
|
||||||
$basketUrl = explode("/", $obj->url);
|
$basketUrl = explode("/", $obj->url);
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->parameter->getArrayCopy()['target'],
|
$obj->parameter->getArrayCopy()['target'],
|
||||||
@ -436,7 +434,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
[
|
[
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'user',
|
'controller' => 'user',
|
||||||
'action' => $basketUrl[2]?$basketUrl[2]:'index',
|
'action' => $basketUrl[2] ? $basketUrl[2] : 'index',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -453,7 +451,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$router->addRoute((string)$obj->_id.'_route', $route);
|
$router->addRoute((string)$obj->_id.'_route', $route);
|
||||||
}elseif(strpos($obj->url, 'impress') !== false) {
|
} elseif (strpos($obj->url, 'impress') !== false) {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->parameter->getArrayCopy()['target'],
|
$obj->parameter->getArrayCopy()['target'],
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -465,7 +463,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}elseif(strpos($obj->url, 'privacy') !== false) {
|
} elseif (strpos($obj->url, 'privacy') !== false) {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->parameter->getArrayCopy()['target'],
|
$obj->parameter->getArrayCopy()['target'],
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -477,7 +475,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}elseif(strpos($obj->url, 'agb') !== false) {
|
} elseif (strpos($obj->url, 'agb') !== false) {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->parameter->getArrayCopy()['target'],
|
$obj->parameter->getArrayCopy()['target'],
|
||||||
array_merge(
|
array_merge(
|
||||||
@ -489,7 +487,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$router->addRoute((string)$obj->_id, $route);
|
$router->addRoute((string)$obj->_id, $route);
|
||||||
}else{
|
} else {
|
||||||
$route = new Zend_Controller_Router_Route(
|
$route = new Zend_Controller_Router_Route(
|
||||||
$obj->url,
|
$obj->url,
|
||||||
array_merge(
|
array_merge(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user