Skip to content
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

Composer error. #627

Open
alebak opened this issue Nov 24, 2016 · 3 comments
Open

Composer error. #627

alebak opened this issue Nov 24, 2016 · 3 comments

Comments

@alebak
Copy link

alebak commented Nov 24, 2016

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?

@neilime
Copy link

neilime commented Nov 25, 2016

You have to require the composer autoloader instead of include the file "lessc.inc.php" :

require __DIR__ . '/vendor/autoload.php';

@alebak
Copy link
Author

alebak commented Nov 25, 2016

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

@neilime
Copy link

neilime commented Nov 27, 2016

You should try to require the last version : 0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants