assetic icon indicating copy to clipboard operation
assetic copied to clipboard

Fatal error: Cannot redeclare assetic_init()

Open combatx007 opened this issue 10 years ago • 4 comments

I use assetic with symfony2, but when i install symfony, then spring up this error:

Fatal error: Cannot redeclare assetic_init() (previously declared in D:\site\gsc.local\vendor\kriswallsmith\assetic\src\functions.php:24) in D:\site\service.ru\vendor\kriswallsmith\assetic\src\functions.php on line 30

Please help me. I use windows 7 and apache. What could be the problem?

combatx007 avatar Aug 19 '15 07:08 combatx007

Aren't you including /vendor/autoload.php from both Global and Local Composer installations? Maybe both have Assetic installed.

aik099 avatar Aug 19 '15 08:08 aik099

Yea, i including this file in php.ini auto_prepend_file directive. It's necessary for vardumper. Whether it is possible do so, that autoload.php was included and worked assetic?

combatx007 avatar Aug 19 '15 09:08 combatx007

@combatx007 loading the autoloading for global packages will break if you have some packages defining functions. I suggest you to use an install with only var_dumper in it for the auto_prepend_file instead of a setup with many packages.

stof avatar Aug 19 '15 09:08 stof

Seems like you ran into the same bug assetic has, that i ran into: https://github.com/kriswallsmith/assetic/pull/770

Multiple inclusion of assetic is bogus atm due to an errourness usage of function_exists.

tgloeggl avatar Jan 20 '16 11:01 tgloeggl