-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add model:prune console command #1263
base: develop
Are you sure you want to change the base?
Conversation
$models[] = static::findCoreModels(); | ||
$models[] = static::findActivePluginsModels(); | ||
|
||
return collect($models)->flatten()->all(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we doing any sort of checking to make sure the classes are actual model classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LukeTowers But I do search only under /models/
folders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we doing any sort of checking to make sure the classes are actual model classes?
Any suggestions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjauvin if the intention is to find out if it's a model without loading it, you'll have to use something like PHP Parser to statically analyze the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bennothommo I think searching for all class files under models
is good enough for the purpose, more logic can be added by the code using the ModelFinder helper once it gets the list of class files as this is more efficient.
@jaxwilko random thought: This could be related to our work on the extension management refactoring where we could make it so that the extension managers could have an API for searching for specific types of classes / files under them (i.e. model classes, components, CLI commands, etc) to make these sorts of use cases easier to implement. |
No description provided.