Upgrading to v8
Permalink
I'm currently attempting to upgrade to v8 from 5.7.5.13
I have a custom helper that extends the date helper, but currently receiving the following error message
This is the line from the app.php
Path and namespace details from the ContextualDate file
Can anyone see the issue?
I have a custom helper that extends the date helper, but currently receiving the following error message
Class 'Application\Src\Localization\Service\ContextualDate' not found
This is the line from the app.php
Core::bind('helper/date', function() { return new \Application\Src\Localization\Service\ContextualDate(); });
Path and namespace details from the ContextualDate file
//Path /application/src/Localization/Service/ContextualDate.php namespace Application\Src\Localization\Service; class ContextualDate extends Date {...}
Can anyone see the issue?
Interesting, thanks for the link. I'll investigate
So there are two options for resolving this the first is the quickest.
add the following line to the array in application/config/app.php
The other is to refactor the extension to suit the new autoload version
The class would also need its namespace amended (but not the path)
add the following line to the array in application/config/app.php
'enable_legacy_src_namespace' => true
The other is to refactor the extension to suit the new autoload version
$classLoader = new \Symfony\Component\ClassLoader\Psr4ClassLoader(); $classLoader->addPrefix('Application\\Localization\\Service', DIR_APPLICATION . '/' . DIRNAME_CLASSES . '/Localization/Service'); $classLoader->register();
The class would also need its namespace amended (but not the path)
namespace Application\Localization\Service;
'enable_legacy_src_namespace' => true
update this now appears to break newer functionality in the latest 8.4 version.
I've managed to run into the same issue again this time trying to autoload a file from a package, whilst attempting to add a new framework.
It suggests something is up with the autoloader of the site but I'm stumped :shrug:
update this now appears to break newer functionality in the latest 8.4 version.
I've managed to run into the same issue again this time trying to autoload a file from a package, whilst attempting to add a new framework.
It suggests something is up with the autoloader of the site but I'm stumped :shrug:
Did your "refactoring" solution work for you in 8.4?
https://documentation.concrete5.org/developers/extending-concrete5-w...