nc-vue-register/appinfo/application.php

50 lines
879 B
PHP

<?php
/**
* ownCloud - registration
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Pellaeon Lin <pellaeon@hs.ntnu.edu.tw>
* @copyright Pellaeon Lin 2014
*/
namespace OCA\Registration\AppInfo;
use \OCP\AppFramework\App;
use \OCA\Registration\Controller\PageController;
class Application extends App {
public function __construct (array $urlParams=array()) {
parent::__construct('registration', $urlParams);
$container = $this->getContainer();
/**
* Controllers
*/
$container->registerService('PageController', function($c) {
return new PageController(
$c->query('AppName'),
$c->query('Request'),
$c->query('UserId')
);
});
/**
* Core
*/
$container->registerService('UserId', function($c) {
return \OCP\User::getUser();
});
}
}