Commit Graph

22 Commits

Author SHA1 Message Date
Bernhard Posselt f195123765 Intelligent container
* resolves dependencies by type hint or variable name
* simpler route.php
* implementation of https://github.com/owncloud/core/issues/12829

Generates and injects parameters automatically. You can now build full classes like

    $c->query('MyClassName')

without having to register it as a service. The resolved object's instance will be saved by using registerService. If a constructor parameter is not type hinted, the parameter name will be taken.

Therefore the following two implementations are identical:

    class Class1 { function __construct(MyClassName $class)
    class Class1 { function __construct($MyClassName)

This makes it possible to also inject primitive values such as strings, arrays etc.

In addition if the query could not be resolved, a `QueryException` is now thrown

Routes can now be returned as an array from `routes.php` and an `appinfo/application.php` is optional

Old commit messages:

make it possible to return the routes instead of having to intialize the application
try to get the controller by convention
add first implementation of automatic resolve
add another test just to be sure
store the resolved object
more tests
add phpdoc to public app.php method
use the same variable for the public app.php method
deprecate old methods and add services for public interfaces
deprecated getServer method
disallow private api injection for apps other than core or settings (settings should be an app goddamnit :D)
register userid because its such an often used variable
fix indention and leading slash
use test namespace
add deprecation reasons, remove private api usage checks and remove deprecation from getServer()
add additional public interfaces
add public interface for rootfolder
fix syntax error
remove deprecation from methods where no alternative is there yet
remove deprecated from method which has no alternative
add timezone public service for #12881
add another deprecation hint
move deprecation into separate branch
remove dead comment
first try to get the namespace from the info.xml, if it does not exist, just uppercase the first letter
also trim the namespace name
add an interface for timefactory
move timefactory to public and add icontrollermethodreflector
keep core interface
fix copyright date in headers
2014-12-23 09:50:42 +01:00
Morris Jobke d40bdfb35e drop unneeded var_dump - fixes #9997 2014-11-18 22:36:42 +01:00
Robin Appelman 9fd234f63f Log some additional events 2014-10-20 13:38:38 +02:00
Robin Appelman 1e69f5e7ac Log some basic events 2014-10-20 13:38:38 +02:00
Joas Schilling 71bec60b92 Also match routes without trailing slash
Fix #11209
2014-09-22 11:22:33 +02:00
Jörn Friedrich Dreyer 5a588333b2 introduce and use getCurrentConnection() 2014-07-01 16:45:00 +02:00
Vincent Petry 799205488c Prevent loadApps on upgrade
Moved OC::needUpgrade() to OCP\Util::needUpgrade() to make it accessible
form the router.
Moved maintenance + upgrade check to the router.
2014-06-18 11:10:07 +02:00
Lukas Reschke ac7fb1b23e Remove legacy routing code
The getfile routing code was absolutely legacy and not needed anymore. Additionally \OC::$REQUESTEDAPP was never set to the actually accessed application.

This commit removes the legacy routing code and ensures that $REQUESTEDAPP is always set so that other applications (e.g. the firewall or a two-factor authentication) can intercept the currently accessed app.

Testplan:
[x] Installation works
[x] Login with DB works
[x] Logout works
[x] Login with alternate backend works (tested with user_webdavauth)
[x] Other apps are accessible
[x] Redirect on login works (e.g. index.php?redirect_url=%2Fcore%2Findex.php%2Fsettings%2Fapps%3Finstalled)
[x] Personal settings are accessible
[x] Admin settings are accessible
[x] Sharing files works
[x] DAV works
[x] OC::$REQUESTEDAPP contains the requested application and can be intercepted by other applications
2014-06-05 11:45:45 +02:00
Robin McCorkell 87b548ed91 Fix all PHPDoc types and variable names, in /lib 2014-05-13 19:08:14 +01:00
Thomas Müller 33987eea83 remove legacy aka deprecated code: OC_Cache 2014-05-12 16:23:33 +02:00
Bart Visscher a4b7f5155f Fix PHPdoc in lib/private
using scrutinizer patch
2014-04-15 22:55:20 +02:00
Thomas Müller ecd74d3630 Merge pull request #8138 from owncloud/allow-app-in-routes.php
To isolate the variable scope used inside the $file it is required in it...
2014-04-10 16:09:23 +02:00
Thomas Müller 98a5f121fd To isolate the variable scope used inside the $file it is required in it's own method 2014-04-09 22:45:34 +02:00
Robin Appelman db95f49b7e Load all routes when matching an ocs route 2014-04-03 13:01:20 +02:00
Robin Appelman 9b2bb7c6ab fix undefined index warning in router 2014-03-26 13:02:11 +01:00
Robin Appelman d75c3d5f9a Fix routes getting lost when loading app routes twice 2014-03-25 14:28:30 +01:00
Robin Appelman e1d3d0e948 fix incorect array 2014-03-25 14:04:18 +01:00
Robin Appelman c17f415356 Only load core routes for ocs and settings 2014-03-25 13:42:47 +01:00
Robin Appelman 9e89ad07c6 Only load core routes when matching a core route 2014-03-24 16:38:01 +01:00
Robin Appelman f17674fef2 Only load routes from the apps we need 2014-03-24 15:41:46 +01:00
Robin Appelman 0d0aac6fff Load the routes when matching or generating a route instead of when creating the router 2014-03-24 14:55:03 +01:00
Robin Appelman 8ab7d18a6a Move the router classes to a namespace and expose it with a public interface 2014-03-10 14:04:58 +01:00