mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
View: Ignore setting short_open_tag
Adjusting class `Zend_View_Stream` according to https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.stream-wrappers didn't work. (*syntax error, unexpected end of file* after every last php statement in phtml files) So.. since `<?= ?>` instructions are permanently available since PHP 5.4 (https://www.php.net/manual/en/language.basic-syntax.phptags.php) we'll just omit using a custom stream wrapper now.
This commit is contained in:
parent
7bc1893a24
commit
0442c4f0ab
@ -59,13 +59,6 @@ class View extends Zend_View_Abstract
|
|||||||
*/
|
*/
|
||||||
const CHARSET = 'UTF-8';
|
const CHARSET = 'UTF-8';
|
||||||
|
|
||||||
/**
|
|
||||||
* Flag to register stream wrapper
|
|
||||||
*
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $useViewStream = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registered helper functions
|
* Registered helper functions
|
||||||
*/
|
*/
|
||||||
@ -86,13 +79,6 @@ class View extends Zend_View_Abstract
|
|||||||
*/
|
*/
|
||||||
public function __construct($config = array())
|
public function __construct($config = array())
|
||||||
{
|
{
|
||||||
$this->useViewStream = (bool) ini_get('short_open_tag') ? false : true;
|
|
||||||
if ($this->useViewStream) {
|
|
||||||
if (!in_array('zend.view', stream_get_wrappers())) {
|
|
||||||
stream_wrapper_register('zend.view', '\Icinga\Web\ViewStream');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$config['helperPath']['Icinga\\Web\\View\\Helper\\'] = Icinga::app()->getLibraryDir('Icinga/Web/View/Helper');
|
$config['helperPath']['Icinga\\Web\\View\\Helper\\'] = Icinga::app()->getLibraryDir('Icinga/Web/View/Helper');
|
||||||
|
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
@ -258,11 +244,8 @@ class View extends Zend_View_Abstract
|
|||||||
// Exporting global variables to view scripts:
|
// Exporting global variables to view scripts:
|
||||||
$$k = $v;
|
$$k = $v;
|
||||||
}
|
}
|
||||||
if ($this->useViewStream) {
|
|
||||||
include 'zend.view://' . func_get_arg(0);
|
include func_get_arg(0);
|
||||||
} else {
|
|
||||||
include func_get_arg(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Icinga Web 2 | (c) 2013 Icinga Development Team | GPLv2+ */
|
|
||||||
|
|
||||||
namespace Icinga\Web;
|
|
||||||
|
|
||||||
use Zend_View_Stream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is used in Icinga\Web\View to imitate PHP's short_open_tag
|
|
||||||
*/
|
|
||||||
class ViewStream extends Zend_View_Stream
|
|
||||||
{
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user