I have app with old code - plain php and new code - Symfony. And when in old code call class symfony autoloader, maybe, intercepts class, how told Symfony to call exctly needed class
I have app/old/core/classes/Locale.php from old code, without name space and
app/src/AppBundle/Entity/Locale.php from new code, this is entity with name space
and in old code I call static function Locale from old code, but Symfony call entity, of course entity LOcale dont have this static function and I have error
class Page
{
function replacePageTags($replace_arr)
{
// set brases for keys
$braced_arr = Array();
foreach($replace_arr as $key => $value) {
$braced_arr["{".$key."}"] = $value;
}
//this I have error
$this->content = Locale::replaceTags($this->content, $braced_arr);
}
}
error message:
Attempted to call an undefined method named "replaceTags" of class "Locale".
whe I add include Locale to class Page
include('Locale.php');
class Page
{
have error
Error: Cannot declare class Locale, because the name is already in use
But when I add to entity static function replaceTags($text, $replace_arr) still have error, maybe Symfony call another Locale, but I need call Locale from old functionality, how can I do this ?
maybe this because in composer in autoload I have
"autoload": {
"psr-4": {
"": "src/"
}
but old code not in src or I dont know
In another developer have not this problem, I have php version 7.0.14, they have 7.0.8, maybe I need low some ph destriction, I don't know ( How to call exectly needed class in old code or fix this problem?
Attempted to call an undefined method named "replaceTags" of class "Locale".because symfony call another calss with name Locale, I thinkphp -m | grep intlreturns nothing?intlI have intl