Skip to content

Conversation

@saeideng
Copy link
Contributor

@saeideng saeideng commented Jun 8, 2019

Refs : #101

throw MissingRouteException when url is incomplete

@dereuromark
Copy link
Owner

Should this only be done in debug mode? This seems to cost Performance.

@saeideng
Copy link
Contributor Author

saeideng commented Jun 9, 2019

Should this only be done in debug mode?

no
we have to throw exception when a needed route elements {var} is missing
I removed unnecessary if/else because code handles by Router::url()

@dereuromark
Copy link
Owner

Why is this needed? The result is still the same.
We dont care here for other cases either. Mainly as this is expensive for many checks on one page.
Only in debug mode it could be useful to know you made a mistake.

@saeideng
Copy link
Contributor Author

saeideng commented Jun 9, 2019

Mainly as this is expensive for many checks on one page.

which part ? Router::url($url); ?

@dereuromark
Copy link
Owner

Yes, especially when called often.

@saeideng
Copy link
Contributor Author

saeideng commented Jun 9, 2019

if you think no different between post/view/1 and post/view
you can ignore this PR :)

@dereuromark
Copy link
Owner

dereuromark commented Jun 10, 2019

Those both return false if invalid or without access, right?

@saeideng
Copy link
Contributor Author

when you connect post/view/{id} in routes, and you want check access to post/view(with applying _name)
1)with this PR, throws a exception
2)without this PR, returns true

@dereuromark dereuromark merged commit 82f9b7a into dereuromark:master Jun 10, 2019
@saeideng saeideng deleted the named branch June 10, 2019 17:41
@saeideng
Copy link
Contributor Author

@dereuromark could we cache the result or it is not possible ?

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

Successfully merging this pull request may close these issues.

2 participants