Commit Graph

40 Commits

Author SHA1 Message Date
Roeland Jago Douma 484f52bb4d
Also unset the other possible unused paramters
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-12-16 20:31:30 +01:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Roeland Jago Douma 72a9c35be3
Remove some IRouter methods
This is not the end. IRouter needs to burn.
But it is a start.

🎵 we didn't start the fire 🎵

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-17 14:08:20 +01:00
Roeland Jago Douma e25a7137cc
Cleanup route registration logic
This was a bunch of cylic things being called.
This is an attempt to clean this all up. If an app provides an array of
routes. We just parse them and hand them back.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-03 09:39:49 +01:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +02:00
Morris Jobke 387cac4c5f
Properly inject IRouter into URLGenerator to properly encapsulate tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-19 22:00:47 +02:00
Morris Jobke 053ee7b386
Only load routes of the app which is requested
* Add fallback to load all routes if needed
* Move partial loaded routes test to proper place

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-19 21:58:20 +02:00
Joas Schilling ea8f68bea6 Hand in the route and the parameters of the request
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2020-08-05 12:52:16 +00:00
Roeland Jago Douma b57019bcaa
Log the route not found exception on a lower level
This should be logged but it is not that critical to wanner level 3

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-24 15:39:53 +02:00
Roeland Jago Douma edc1c77dd9
Do not create a RouteActionHandler object for each route
This is not required and doesn't allow us to be properly lazy. On top of
it this doesnt allow us to cache the routes (since closures/objects
can't be cached).

This is the first small step into cleaning up the routing we have

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-07 12:33:22 +02:00
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Joas Schilling aad16c8508
Fix creation of legacy routes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-18 11:21:28 +02:00
Joas Schilling 3f8168b6e5
Allow some apps to have root URLs in their own routing file
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-18 11:21:28 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
John Molakvoæ 13960b69da
Merge pull request #17509 from nextcloud/fix/application-singleton
Fix Application instances created multiple times
2019-11-04 18:18:32 +01:00
Robin Appelman 219905b9c8
Dont cache empty url for not found routes
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-10-18 18:20:25 +02:00
Christoph Wurst f6a79338d4
Make sure we create an app's Application class just once
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-10-11 08:21:24 +02:00
Christoph Wurst de6940352a Move settings to an app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2019-09-28 09:39:28 +00:00
Joas Schilling 0c77cd21f9
Make sure maintenance mode is always casted to bool
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-22 08:25:41 +01:00
Morris Jobke c1e4f9f305
Use type casting instead of *val() method
It should be up to 6x faster

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 11:35:42 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Morris Jobke 5aa25fcdd5 Fix require once for actionInclude
* regression from #5791

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-09 23:51:49 +02:00
Roeland Jago Douma 459ae6d94a
User proper anonymous function
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-09 15:51:12 +02:00
Roeland Jago Douma 7753b93aa6
PrivateData to app
* PrivateData is an app now: https://github.com/nextcloud/privatedata
* No need to load the OCS routes.php (as there is none!)

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-07-21 08:51:14 +02:00
Joas Schilling 72c1b24844
Check whether the $_SERVER['REQUEST_*'] vars exist before using them
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-15 14:33:27 +02:00
Felix Epp 1614b310ef Add system config htaccess.IgnoreFrontController for prettyURLs w/o mod_env
Added the system config which sets all conditions to true that query the
FrontControllerActive mod_env variable.

Signed-off-by: Felix A. Epp <work@felixepp.de>
2016-11-16 22:28:49 +01:00
Roeland Jago Douma 575875e8d0
Allow OCS routes in Core and Settings 2016-08-09 20:56:31 +02:00
Roeland Jago Douma 63f6d2d558
Allow ocs/v2.php/cloud/... routes
One of the possibilities of the old OCS API is that you can define the
url yourself.

This PR makes this possible again by adding an optional root elemenet to
the route. Routes are thus:

.../ocs/v2.php/<root>/<url>

By default <root> = apps/<app>

This will allow for example the provisioning API etc to be in
../ovs/v2/php/cloud/users
2016-08-08 15:01:26 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Roeland Jago Douma 94cd83ca00
Make the router handle OCS AppFramework Routes 2016-07-18 11:09:04 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Lukas Reschke f81b57bc45
Read only once
This can lead to race conditions otherwise. Also depracted hasKey
2016-05-02 11:31:57 +02:00
Roeland Jago Douma bb1e2f9d9d
Move \OC\Route to PSR-4 2016-04-25 21:49:07 +02:00