pug-php / pug-symfony

Pug (Jade) template engine for Symfony

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facing autoload.php issue when installing on Symfony 2.8.26

ramit-mitra opened this issue · comments

Hi,
I started with a fresh symfony 2.8 setup and tried installing pug-symfony. I executed composer require pug-php/pug-symfony, and all the dependencies got installed. However, in the last section of installation, am getting this error, when autoload.php files are being generated,

[ErrorException]
include_once(C:\xampp\htdocs\demoSymfony\autoload.php): failed to
open stream: No such file or directory

Also, i tried composer dump-autoload -o and it provided me with the same error.

I also tried creating a blank autoload.php in the project root, and then tried composer update, and got this output,

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Package found added to be installed with npm: coffee-script@""
Package found added to be installed with npm: less@"
"
Package found added to be installed with npm: clean-css@""
Package found added to be installed with npm: babel-cli@"^6.10.1"
Package found added to be installed with npm: babel-plugin-transform-r
eact-jsx@"^6.8.0"
Package found added to be installed with npm: babel-preset-es2015@"^6.
8.0"
Package found added to be installed with npm: babel-preset-react@"^6.1
1.1"
Package found added to be installed with npm: stylus@"
"
Package found added to be installed with npm: uglify-js@""
Package found added to be installed with npm: clean-css@"
"
Package found added to be installed with npm: pug-cli@"^1.0.0-alpha6"
Packages installed.

[ErrorException]
call_user_func() expects parameter 1 to be a valid callback, clas
s 'Pug\PugSymfonyEngine' not found

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev
] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [
--no-progress] [--no-suggest] [--with-dependencies] [-v|vv|vvv|--verbo
se] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-a
utoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest
] [-i|--interactive] [--root-reqs] [--] []...

Can you please look into this and provide me a solution ?

Reference,
https://stackoverflow.com/questions/45582104/facing-issue-installing-pug-php-pug-symfony-on-symfony-2-8-26?sgp=2

commented

Hi, autoload.php should be in the vendor directory:

include_once(C:\xampp\htdocs\demoSymfony\vendor\autoload.php):

You should follow the symfony "getting started" documentation then install the pug-symfony package when ready.

commented

Here is a link for 2.8 setup http://symfony.com/doc/2.8/setup.html
I also recommand you to consider using the version 3

Hi,
I did follow the symfony "getting started" documentation to setup the project. Also, my vendor/ directory does have the autoload.php file as well.

image

The issue am facing occurs when am trying to run composer update or, composer require pug-php/pug-symfony .
In the last step of the installation, after autoload files are generated and npm packages are added, suddenly installation fails, because someone is looking for an autoload.php in the project root.
PS, have a look at the screenshot below,

image

However, if I remove pug dependency from composer.json, remove the vendor directory and execute composer update, everything works fine !

image
image
image

Next, I again removed the vendor folder and executed composer require pug-php/pug-symfony, and the issue of autoload.php being looked for in the project root is back.

image
image
image
image

PS, I tried composer dumpautoload -o and the same error occurs.

For further reference, I am posting my composer.json here,
(PS: Since github doesn't allow .json files to be attached to comments, I am renaming it as .txt, please change the extension to .json)
composer.txt

I love working with pug and this issue is really bugging me. Please help.

commented

Thanks, it seems we have a post-install-script in one of our package that miss find the vendor directory. I will fix it. Maybe it is the automated script. Can you try to install the previous version?

composer require pug-php/pug-symfony 2.2.5

I tried composer require pug-php/pug-symfony 2.2.5, and it works.
Here are some sample screenshots.
Thanks for looking into the issue, please update the community when you fix this on version 2.3.

image
image
image
image

commented

Hi, I worked hard on it and find the problem in the pug/installer. I could install it on Windows with pug-symfony 2.8. So just have to check all is right with unit tests and as soon as I will release the new version tag you will be able to update to the last version or directly create new projects with symfony 2.8 and used the automated install.

commented

The new version is release and has a bigger range of compatibility:

  • PHP >= 5.4
  • Symfony >= 2.7

Feel free to re-open if something wrong occurs.

Thankyou so much for looking into this !