fix issue with murph version constant and autoloader

This commit is contained in:
Simon Vieille 2022-03-14 10:38:13 +01:00
parent 6401b46de8
commit aaacc4a23d
4 changed files with 23 additions and 10 deletions

View file

@ -64,9 +64,6 @@
"autoload": {
"psr-4": {
"App\\Core\\": "src/core/"
},
"files": [
"src/core/autoload.php"
]
}
}
}

View file

@ -2,6 +2,7 @@
namespace App\Core\Controller\Admin;
use App\Core\Murph;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@ -29,7 +30,7 @@ abstract class AdminController extends AbstractController
'section' => $this->getSection(),
'site_name' => $params['name'],
'site_logo' => $params['logo'],
'murph_version' => MURPH_VERSION,
'murph_version' => Murph::version(),
]
);

20
src/core/Murph.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace App\Core;
if (!defined('MURPH_VERSION')) {
define('MURPH_VERSION', 'v1.9.1');
}
/**
* class Murph.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class Murph
{
public static function version(): string
{
return MURPH_VERSION;
}
}

View file

@ -1,5 +0,0 @@
<?php
namespace App\Core;
define('MURPH_VERSION', 'v1.9.1');