Skip to content

Commit

Permalink
Deprecate stream variables (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Mar 25, 2024
1 parent 7255b4d commit 578c03e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/api/variables/streams.md
Expand Up @@ -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)
3 changes: 3 additions & 0 deletions src/Template.php
Expand Up @@ -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) {
Expand Down

0 comments on commit 578c03e

Please sign in to comment.