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

Support __DIR__ etc. #16

Closed
franzliedke opened this issue Mar 12, 2014 · 4 comments
Closed

Support __DIR__ etc. #16

franzliedke opened this issue Mar 12, 2014 · 4 comments
Labels

Comments

@franzliedke
Copy link

The Laravel documentation makes me think that having constants like __DIR__ in a serialized closure will break things.

Do you think that we could build some magic around this?

@jeremeamia
Copy link
Owner

I can't speak for the Laravel documentation, but SuperClosure should handle magic constants just fine. One of the features on the README says, "Replaces magic constants with their expected values so that the closure behaves as expected after unserialization". The two visitor classes help make this possible.

Now, if you've tried it, and it is not working, then I would consider it a bug. Have you tried it, or are you just going off what the Laravel docs say?

Prior to about September last year, Laravel did not use the SuperClosure package (it was using an older, vendored version of SuperClosure). At that point in time, that piece of documentation was probably true. If __DIR__ is working for you, then you should raise an issue with the Laravel docs to have that updated.

@franzliedke
Copy link
Author

Thanks for the feedback, I'll contact Laravel's developer and will report back to you.

@franzliedke
Copy link
Author

Looks like it was just an oversight. Thank you, great library by the way!

@franzliedke
Copy link
Author

Works beautifully, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants