Skip to content
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

Use ClassInfo::classes_for_file(); to collect classes #59

Closed
axyr opened this issue Apr 15, 2016 · 6 comments
Closed

Use ClassInfo::classes_for_file(); to collect classes #59

axyr opened this issue Apr 15, 2016 · 6 comments

Comments

@axyr
Copy link
Contributor

axyr commented Apr 15, 2016

This means :

  • we can have modules without Dataojects to annotate (now only works with the task)
  • hook into requireDefaultRecords only once to trigger the generation process..
@Firesphere
Copy link
Member

If hooking into requireDefaultRecords only once... I'd suggest we switch to flushable, and implement flush() method.
That would mean it's only called at flush. We could check if it's an "all" or "1" option, and only start generation if it's "all".
That would be the cleanest way, and fix the fact that requireDefaultRecords is actually not the cleanest implementation.

@axyr
Copy link
Contributor Author

axyr commented Apr 15, 2016

hm.. I understand what you mean.

But. only on dev/build the database fields are generated and the extensions are coupled..

So triggering on flush would require or a second action or require to always use dev/build?flush=all/1

Or am I wrong about what flush is doing?

@axyr
Copy link
Contributor Author

axyr commented Apr 15, 2016

So in fact we need a MyObject implements DevBuildable ;)

@Firesphere
Copy link
Member

flush is running on flush=all indeed. So there would be an extra check for if it's in the build process. Still, I'd think it's cleaner.

And yes.. I raised an issue about that on the framework ;)

@Firesphere
Copy link
Member

There's requireDefaultRecords, Flushable, but not an option to hook into the actual build :'(

@axyr
Copy link
Contributor Author

axyr commented Apr 18, 2016

Note2Self:

just hook into dev/build once and traverse the enabled modules:

https://github.com/silverstripe/silverstripe-framework/blob/3/dev/DevBuildController.php

here we can also get the cached orm before the tagging starts for #58

@axyr axyr closed this as completed in e842f56 Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants