mirror of
				https://github.com/nerzhul/ocsms.git
				synced 2025-10-31 02:17:38 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| /**
 | |
|  * ownCloud - ocsms
 | |
|  *
 | |
|  * This file is licensed under the Affero General Public License version 3 or
 | |
|  * later. See the COPYING file.
 | |
|  *
 | |
|  * @author Loic Blot <loic.blot@unix-experience.fr>
 | |
|  * @copyright Loic Blot 2014
 | |
|  */
 | |
| 
 | |
| namespace OCA\OcSms\AppInfo;
 | |
| 
 | |
| 
 | |
| use \OCP\AppFramework\App;
 | |
| 
 | |
| use \OCA\OcSms\Controller\SmsController;
 | |
| 
 | |
| use \OCA\OcSms\Db\Sms;
 | |
| use \OCA\OcSms\Db\SmsMapper;
 | |
| 
 | |
| 
 | |
| class Application extends App {
 | |
| 
 | |
| 	public function __construct (array $urlParams=array()) {
 | |
| 		parent::__construct('ocsms', $urlParams);
 | |
| 
 | |
| 		$container = $this->getContainer();
 | |
| 
 | |
| 		/**
 | |
| 		 * Controllers
 | |
| 		 */
 | |
| 
 | |
| 		$container->registerService('SmsController', function($c) {
 | |
| 			return new SmsController(
 | |
| 				$c->query('AppName'),
 | |
| 				$c->query('Request'),
 | |
| 				$c->query('UserId'),
 | |
| 				$c->query('SmsMapper')
 | |
| 			);
 | |
| 		});
 | |
| 
 | |
| 		/**
 | |
|          * Database Layer
 | |
|          */
 | |
|         $container->registerService('Sms', function($c) {
 | |
|             return new Sms($c->query('ServerContainer')->getDb());
 | |
|         });
 | |
| 
 | |
|         $container->registerService('SmsMapper', function($c) {
 | |
|             return new SmsMapper($c->query('ServerContainer')->getDb());
 | |
|         });
 | |
| 
 | |
| 		/**
 | |
| 		 * Core
 | |
| 		 */
 | |
| 		$container->registerService('UserId', function($c) {
 | |
| 			return \OCP\User::getUser();
 | |
| 		});
 | |
| 
 | |
| 	}
 | |
| }
 |