-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.php
77 lines (64 loc) · 2.54 KB
/
Application.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/*
START LICENSE AND COPYRIGHT
This file is part of ZfExtended library
Copyright (c) 2013 - 2021 Marc Mittag; MittagQI - Quality Informatics; All rights reserved.
Contact: http://www.MittagQI.com/ / service (ATT) MittagQI.com
This file may be used under the terms of the GNU LESSER GENERAL PUBLIC LICENSE version 3
as published by the Free Software Foundation and appearing in the file lgpl3-license.txt
included in the packaging of this file. Please review the following information
to ensure the GNU LESSER GENERAL PUBLIC LICENSE version 3.0 requirements will be met:
https://www.gnu.org/licenses/lgpl-3.0.txt
@copyright Marc Mittag, MittagQI - Quality Informatics
@author MittagQI - Quality Informatics
@license GNU LESSER GENERAL PUBLIC LICENSE version 3
https://www.gnu.org/licenses/lgpl-3.0.txt
END LICENSE AND COPYRIGHT
*/
/**#@+
* @author Marc Mittag
* @package portal
* @version 2.0
*
*/
require_once 'Zend/Application.php';
/**
* Standard Inhalt der index.php gekapselt
*/
class ZfExtended_Application extends Zend_Application
{
/**
* Creates an URL with the configured protocol & domain
* @throws Zend_Exception
*/
public static function createUrl(string $path = null): string
{
$config = Zend_Registry::get('config');
$url = $config->runtimeOptions->server->protocol . $config->runtimeOptions->server->name;
return ($path === null) ? $url : $url . '/' . ltrim($path, '/');
}
/**
* Creates an URL to use for workers
* @throws Zend_Exception
*/
public static function createWorkerUrl(string $path = null): string
{
$config = Zend_Registry::get('config');
$url = empty($config->runtimeOptions->worker->server) ? $config->runtimeOptions->server->protocol . $config->runtimeOptions->server->name : $config->runtimeOptions->worker->server;
return ($path === null) ? $url : $url . '/' . ltrim($path, '/');
}
public function setPhpSettings(array $settings, $prefix = '')
{
//remove phpSettings.iconv.internal_encoding = "UTF-8" since this is deprecated in PHP >= 5.6.0
$is560 = version_compare(PHP_VERSION, '5.6.0', '>=');
if ($is560 && isset($settings['iconv']) && isset($settings['iconv']['internal_encoding'])) {
unset($settings['iconv']['internal_encoding']);
}
return parent::setPhpSettings($settings, $prefix);
}
public function run()
{
define('APPLICATION_VERSION', ZfExtended_Utils::getAppVersion());
parent::run();
}
}