From 578c03efa5f202f2ed84d0f48f82d5dfbd730fc4 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 25 Mar 2024 13:45:04 +0100 Subject: [PATCH] Deprecate stream variables (#933) --- docs/api/variables/streams.md | 3 +++ src/Template.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/api/variables/streams.md b/docs/api/variables/streams.md index 93d5c15e1..c872cf8bb 100644 --- a/docs/api/variables/streams.md +++ b/docs/api/variables/streams.md @@ -10,4 +10,7 @@ template. {$foo:bar} ``` +NB. Support for using streams to call variables is deprecated since Smarty v5.1 and will be removed +in a future version. + See also [`Template Resources`](../resources.md) diff --git a/src/Template.php b/src/Template.php index 0d66ff6e6..8bb5370f1 100644 --- a/src/Template.php +++ b/src/Template.php @@ -555,6 +555,9 @@ public function setRightDelimiter($right_delimiter) */ public function getStreamVariable($variable) { + + trigger_error("Using stream variables (\`\{\$foo:bar\}\`)is deprecated.", E_USER_DEPRECATED); + $_result = ''; $fp = fopen($variable, 'r+'); if ($fp) {