-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smarty_Internal_CompileBase missing from Composer autoload in PHP 7.4 & Smarty ~3.1 #611
Comments
@Sonorpearl I can't reproduce. Do you have a sample with test.php and composer.json files that triggers the error? |
@wisskid I do have the very same issue with PHP 8.1 and Smarty 4.2 running in a PHP-FPM Docker container using composer:
My composer.json file looks as follows: Test PHP file: $smarty = new Smarty(); Test template file: I found nearly all smarty classes in the composer classmap file, but |
I'll have a look! Thank you for the detailed report. |
I'm afraid I cannot reproduce: #!/bin/bash
php -v
composer require "smarty/smarty 4.2"
composer install
echo 'Hello {$name}, welcome to Smarty!' > test.tpl
echo '<?php
require "vendor/autoload.php";
$smarty = new Smarty();
$smarty->assign("name", "John");
$smarty->display("test.tpl");' > test.php
php test.php
|
The |
I'm quite curious what might be causing this error. $ grep -r "class Smarty_Internal_CompileBase"
vendor/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php:abstract class Smarty_Internal_CompileBase and Smarty's
|
Thank you @wisskid for having a quick look an this issue. You're right, this is NO Smarty bug!
I tried it on an other plattform and all Smarty classes were listed correctly. |
$ composer require smarty/smarty:v3.1.48
./composer.json has been updated
Running composer update smarty/smarty
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Upgrading smarty/smarty (v3.1.36 => v3.1.48)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downloading smarty/smarty (v3.1.48)
- Upgrading smarty/smarty (v3.1.36 => v3.1.48): Extracting archive
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found
Fatal error: Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in /www/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_function_plugin.php ,
autoload_classmap.php:
'Smarty_Internal_CompileBase' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php',
autoload_static.php:
'Smarty_Internal_CompileBase' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php',
Error /www/ # composer -V
Composer version 2.5.7 2023-05-24 15:00:39
/www/ # php -v
PHP 7.4.33 (cli) (built: Nov 12 2022 09:21:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
/www/ # uname -a
Linux 99dfd383a39e 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 Linux Success # cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) |
See post before, this is no Smarty/PHP Bug: |
Hello everyone,
it seems like the
Smarty_Internal_CompileBase
class is missing when requiring or updating the Composer with smarty/smart~3.1
. The following lines are missing:autoload_classmap.php:
'Smarty_Internal_CompileBase' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php',
autoload_static.php:
'Smarty_Internal_CompileBase' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_internal_compilebase.php',
Otherwise I'm getting the following error with the Composer autoloader & include:
<br /> <b>Fatal error</b>: Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in .../lib/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php:17 Stack trace: #0 .../lib/composer/ClassLoader.php(444): include() #1 .../lib/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/...') #2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Smarty_Internal...') #3 [internal function]: spl_autoload_call('Smarty_Internal...') #4 .../lib/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(789): class_exists('Smarty_Internal...') #5 .../lib/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php(435): Smarty_Internal_TemplateCompilerBase->getTagCompiler('private_php') #6 .../lib/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php(359): Smarty_Internal_Templatelexer->yy_r1_16() #7 /var/www in <b>.../lib/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_php.php</b> on line <b>17</b><br />
The text was updated successfully, but these errors were encountered: