mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-07-16 22:46:49 +00:00
Make owncloud 8.1 as the minimum default + cleanups
This commit is contained in:
parent
4fc1a91a39
commit
729b48a846
@ -6,10 +6,10 @@
|
||||
<licence>AGPL</licence>
|
||||
<author>Loic Blot</author>
|
||||
<version>1.6.4</version>
|
||||
<requiremin>8</requiremin>
|
||||
<requiremax>9.1</requiremax>
|
||||
<requiremin>8.1</requiremin>
|
||||
<requiremax>9.2</requiremax>
|
||||
<dependencies>
|
||||
<owncloud min-version="8.0" max-version="9.1" />
|
||||
<owncloud min-version="8.1" max-version="9.2" />
|
||||
</dependencies>
|
||||
|
||||
<ocsid>167289</ocsid>
|
||||
|
@ -37,43 +37,36 @@ class OcSmsApp extends App {
|
||||
$this->c = $container;
|
||||
$app = $this;
|
||||
|
||||
/**
|
||||
* Core
|
||||
*/
|
||||
$container->registerService('UserId', function($c) {
|
||||
return \OCP\User::getUser();
|
||||
});
|
||||
|
||||
/**
|
||||
* Database Layer
|
||||
*/
|
||||
$container->registerService('ConfigMapper', function ($c) use ($app) {
|
||||
return new ConfigMapper(
|
||||
$c->query('ServerContainer')->getDb(),
|
||||
$c->query('UserId'),
|
||||
$c->query('ServerContainer')->getCrypto()
|
||||
);
|
||||
});
|
||||
$container->registerService('ConfigMapper', function (IContainer $c) use ($app) {
|
||||
return new ConfigMapper(
|
||||
$c->query('ServerContainer')->getDb(),
|
||||
$c->query('CurrentUID'),
|
||||
$c->query('ServerContainer')->getCrypto()
|
||||
);
|
||||
});
|
||||
|
||||
$container->registerService('Sms', function($c) {
|
||||
return new Sms($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
$container->registerService('Sms', function(IContainer $c) {
|
||||
return new Sms($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
|
||||
$container->registerService('SmsMapper', function($c) {
|
||||
return new SmsMapper($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
$container->registerService('SmsMapper', function(IContainer $c) {
|
||||
return new SmsMapper($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
|
||||
/**
|
||||
* Managers
|
||||
*/
|
||||
$container->registerService('ContactsManager', function($c) {
|
||||
$container->registerService('ContactsManager', function(IContainer $c) {
|
||||
return $c->getServer()->getContactsManager();
|
||||
});
|
||||
|
||||
/**
|
||||
* Controllers
|
||||
*/
|
||||
$container->registerService('SettingsController', function($c) use($app) {
|
||||
$container->registerService('SettingsController', function(IContainer $c) use($app) {
|
||||
return new SettingsController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
@ -82,24 +75,25 @@ class OcSmsApp extends App {
|
||||
);
|
||||
});
|
||||
|
||||
$container->registerService('SmsController', function($c) use($app) {
|
||||
$container->registerService('SmsController', function(IContainer $c) use($app) {
|
||||
$server = $c->query('ServerContainer');
|
||||
return new SmsController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId'),
|
||||
$c->query('CurrentUID'),
|
||||
$c->query('SmsMapper'),
|
||||
$c->query('ConfigMapper'),
|
||||
$c->query('ContactsManager'),
|
||||
$c->query('ServerContainer')->getURLGenerator(),
|
||||
$server->getContactsManager(),
|
||||
$server->getURLGenerator(),
|
||||
$app
|
||||
);
|
||||
});
|
||||
|
||||
$container->registerService('ApiController', function($c) use($app) {
|
||||
$container->registerService('ApiController', function(IContainer $c) use($app) {
|
||||
return new ApiController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId'),
|
||||
$c->query('CurrentUID'),
|
||||
$c->query('SmsMapper'),
|
||||
$app
|
||||
);
|
||||
|
@ -13,6 +13,7 @@ namespace OCA\OcSms\Controller;
|
||||
|
||||
|
||||
use \OCP\IRequest;
|
||||
use \OCP\Contacts\IManager as IContactsManager;
|
||||
use \OCP\AppFramework\Http\TemplateResponse;
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
@ -35,7 +36,8 @@ class SmsController extends Controller {
|
||||
private $urlGenerator;
|
||||
private $contactCache;
|
||||
|
||||
public function __construct ($appName, IRequest $request, $userId, SmsMapper $mapper, ConfigMapper $cfgMapper, $contactsManager, $urlGenerator, OcSmsApp $app){
|
||||
public function __construct ($appName, IRequest $request, $userId, SmsMapper $mapper, ConfigMapper $cfgMapper,
|
||||
IContactsManager $contactsManager, $urlGenerator, OcSmsApp $app) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->app = $app;
|
||||
$this->userId = $userId;
|
||||
|
@ -29,8 +29,8 @@ class ConfigMapper extends Mapper {
|
||||
*/
|
||||
private $crypto;
|
||||
|
||||
public function __construct (IDb $api, $user, $crypto){
|
||||
parent::__construct($api, 'ocsms_config');
|
||||
public function __construct (IDb $db, $user, $crypto){
|
||||
parent::__construct($db, 'ocsms_config');
|
||||
$this->user = $user;
|
||||
$this->crypto = $crypto;
|
||||
}
|
||||
|
@ -12,7 +12,9 @@
|
||||
|
||||
namespace OCA\OcSms\Lib;
|
||||
|
||||
use \OCP\Util;
|
||||
use \OCP\Contacts\IManager as IContactsManager;
|
||||
|
||||
use \OCA\OcSms\Db\ConfigMapper;
|
||||
|
||||
class ContactCache {
|
||||
/**
|
||||
@ -25,11 +27,11 @@ class ContactCache {
|
||||
private $cfgMapper;
|
||||
private $contactsManager;
|
||||
|
||||
public function __construct ($cfgMapper, $contactsManager) {
|
||||
$contacts = array();
|
||||
$contactPhotos = array();
|
||||
$contactsInverted = array();
|
||||
|
||||
public function __construct (ConfigMapper $cfgMapper, IContactsManager $contactsManager) {
|
||||
$this->contacts = array();
|
||||
$this->contactPhotos = array();
|
||||
$this->contactsInverted = array();
|
||||
|
||||
$this->cfgMapper = $cfgMapper;
|
||||
$this->contactsManager = $contactsManager;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user