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:
Johannes Meyer 2019-12-04 09:35:24 +01:00
parent 7bc1893a24
commit 0442c4f0ab
2 changed files with 2 additions and 32 deletions

View File

@ -59,13 +59,6 @@ class View extends Zend_View_Abstract
*/
const CHARSET = 'UTF-8';
/**
* Flag to register stream wrapper
*
* @var bool
*/
private $useViewStream = false;
/**
* Registered helper functions
*/
@ -86,13 +79,6 @@ class View extends Zend_View_Abstract
*/
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');
parent::__construct($config);
@ -258,11 +244,8 @@ class View extends Zend_View_Abstract
// Exporting global variables to view scripts:
$$k = $v;
}
if ($this->useViewStream) {
include 'zend.view://' . func_get_arg(0);
} else {
include func_get_arg(0);
}
include func_get_arg(0);
}
/**

View File

@ -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
{
}