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