forked from GNUsocial/gnu-social
[TOOLS] Add support for updating autocode in modules
This commit is contained in:
parent
cc758f6a8e
commit
6a2a0d4e66
@ -22,10 +22,9 @@ const types = [
|
|||||||
'phone_number' => 'PhoneNumber',
|
'phone_number' => 'PhoneNumber',
|
||||||
];
|
];
|
||||||
|
|
||||||
$path = Yaml::parseFile(ROOT . '/config/services.yaml')['services']['app.core.schemadef_driver']['arguments'][0];
|
$files = array_merge(glob(ROOT . '/src/Entity/*.php'),
|
||||||
$path = str_replace('%kernel.project_dir%', ROOT, $path);
|
array_merge(glob(ROOT . '/components/*/Entity/*.php'),
|
||||||
|
glob(ROOT . '/plugins/*/Entity/*.php')));
|
||||||
$files = glob($path . '/*.php');
|
|
||||||
|
|
||||||
$classes = [];
|
$classes = [];
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ foreach ($files as $file) {
|
|||||||
|
|
||||||
$declared = get_declared_classes();
|
$declared = get_declared_classes();
|
||||||
foreach ($declared as $dc) {
|
foreach ($declared as $dc) {
|
||||||
if (preg_match('/App\\\\Entity/', $dc) && !in_array($dc, $classes)) {
|
if (preg_match('/(App|(Component|Plugin)\\\\[^\\\\]+)\\\\Entity/', $dc) && !in_array($dc, $classes)) {
|
||||||
$class = $dc;
|
$class = $dc;
|
||||||
$classes[] = $class;
|
$classes[] = $class;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user