yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.23k stars 6.91k forks source link

Runtime folder error with HTMLpurifier #18056

Closed lluisclava closed 5 months ago

lluisclava commented 4 years ago

Runtime folder not found error. vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php on line 235.

What steps will reproduce the problem?

Move the runtime folder. I recently moved some folders in the app-advanced-template to fit my project needs. So the new folder structure is: base
core
-common --config/
--models/
--tests/
-console --config/
--controllers/
--migrations/
--models/
-backend --assets/
--config/
--controllers/
--models/
--tests/
--views/
docs/
environments/
modules/
runtime/ universal
-gii-custom-templates/
-helpers/
-mail/
-templates/
-widgets/
vagrant/
vendor/
web/

I changed the runtime folder alias in the config/bootstrap.php.

What is the expected result?

Use the runtime folder defined in aliases with @runtime in bootstrap.php.

What do you get instead?

Error because the HTMLPurifier dont find the runtime folder. It expects backend/runtime. All other things in the application works fine. HTMLPurifier it's using it's own runtime path, not the alias defined.

Additional info

Q A
Yii version 2.0.35?
PHP version 7.2.26
Operating system Linux
lluisclava commented 4 years ago

I found the solution, just set the runtimePath in the config/main.php. But, I thing these runtime paths whoud be unified and set only in one place.