lessphp
lessphp copied to clipboard
Composer error.
Hello, I have this problem using lessphp with composer. This is my composer.json:
{
"name": "ximware/xim_sbadmin2",
"description": "Template for Joomla based on the SB Admin 2 Theme created and maintained by David Miller.",
"type": "project",
"license": "MIT",
"authors": [
{
"name": "Ximware S.A.S",
"email": "[email protected]"
}
],
"config": {
"vendor-dir": "src/lib/vendor"
},
"require": {
"leafo/lessphp": "0.4.0"
},
"autoload": {
"psr-4": {
"Leafo\\Lessphp\\": "src/"
}
}
}
And this it the error:
Warning: include(C:\xampp\home\joomla\public_html\templates\xim_sbadmin2\lib\vendor\composer/../leafo/lessphp/lessc.inc.php): failed to open stream: No such file or directory in C:\xampp\home\joomla\public_html\libraries\vendor\composer\ClassLoader.php on line 412
How to fix?
You have to require the composer autoloader instead of include the file "lessc.inc.php" :
require __DIR__ . '/vendor/autoload.php';
@neilime Thanks for response. I have this code:
$composerAutoload = dirname(__DIR__) . '/lib/vendor/autoload.php';
if (!file_exists($composerAutoload))
{
return;
}
require_once $composerAutoload;
The error is with composer autoload.php. The ClassLoader.php on line 412 is this function:
function includeFile($file)
{
include $file;
}
You should try to require the last version : 0.5.0