-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,942 changed files
with
147,226 additions
and
16,130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.1.5 | ||
3.0.0-beta1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
* | ||
* Copyright (c) 2014-2015 Klaus Herberth <[email protected]> <br> | ||
* Released under the MIT license | ||
* | ||
* @author Klaus Herberth <[email protected]> | ||
*/ | ||
OCP\App::registerAdmin ( 'ojsxc', 'settings' ); | ||
|
@@ -16,8 +15,7 @@ | |
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'lib/jquery.fullscreen' ); | ||
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'lib/jsxc.dep' ); | ||
OCP\Util::addScript ( 'ojsxc', $jsxc_root.'jsxc' ); | ||
|
||
OCP\Util::addScript ( 'ojsxc', 'ojsxc' ); | ||
OCP\Util::addScript('ojsxc', 'ojsxc'); | ||
|
||
// ############# CSS ############# | ||
OCP\Util::addStyle ( 'ojsxc', 'jquery.mCustomScrollbar' ); | ||
|
@@ -29,4 +27,6 @@ | |
if($version[0] <= 6) | ||
OCP\Util::addStyle ( 'ojsxc', 'jsxc.oc.lte6' ); | ||
|
||
require_once __DIR__ ."/../vendor/autoload.php"; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?php | ||
|
||
namespace OCA\OJSXC\AppInfo; | ||
|
||
use OCA\OJSXC\Controller\HttpBindController; | ||
use OCA\OJSXC\Db\MessageMapper; | ||
use OCA\OJSXC\Db\StanzaMapper; | ||
use OCA\OJSXC\StanzaHandlers\IQ; | ||
use OCA\OJSXC\StanzaHandlers\Message; | ||
use OCP\AppFramework\App; | ||
use OCA\OJSXC\ILock; | ||
use OCA\OJSXC\DbLock; | ||
use OCA\OJSXC\MemLock; | ||
use OCP\ICache; | ||
|
||
class Application extends App { | ||
|
||
private static $config = []; | ||
|
||
public function __construct(array $urlParams=array()){ | ||
parent::__construct('ojsxc', $urlParams); | ||
$container = $this->getContainer(); | ||
|
||
/** @var $config \OCP\IConfig */ | ||
$configManager = $container->query('OCP\IConfig'); | ||
self::$config['polling'] = $configManager->getSystemValue('ojsxc.polling', | ||
['sleep_time' => 1, 'max_cycles' => 10]); | ||
self::$config['use_memcache'] = $configManager->getSystemValue('ojsxc.use_memcache', | ||
['locking' => false]); | ||
|
||
$container->registerService('HttpBindController', function($c){ | ||
return new HttpBindController( | ||
$c->query('AppName'), | ||
$c->query('Request'), | ||
$c->query('UserId'), | ||
$c->query('OCP\ISession'), | ||
$c->query('StanzaMapper'), | ||
$c->query('IQHandler'), | ||
$c->query('MessageHandler'), | ||
$c->query('Host'), | ||
$this->getLock(), | ||
file_get_contents("php://input"), | ||
self::$config['polling']['sleep_time'], | ||
self::$config['polling']['max_cycles'] | ||
); | ||
}); | ||
|
||
/** | ||
* Database Layer | ||
*/ | ||
$container->registerService('MessageMapper', function($c) { | ||
return new MessageMapper( | ||
$c->query('ServerContainer')->getDb(), | ||
$c->query('Host') | ||
); | ||
}); | ||
|
||
$container->registerService('StanzaMapper', function($c) { | ||
return new StanzaMapper( | ||
$c->query('ServerContainer')->getDb(), | ||
$c->query('Host') | ||
); | ||
}); | ||
|
||
/** | ||
* XMPP Stanza Handlers | ||
*/ | ||
$container->registerService('IQHandler', function($c) { | ||
return new IQ( | ||
$c->query('UserId'), | ||
$c->query('Host'), | ||
$c->query('OCP\IUserManager') | ||
); | ||
}); | ||
|
||
$container->registerService('MessageHandler', function($c) { | ||
return new Message( | ||
$c->query('UserId'), | ||
$c->query('Host'), | ||
$c->query('MessageMapper') | ||
); | ||
}); | ||
|
||
/** | ||
* Config values | ||
*/ | ||
$container->registerService('Host', function($c){ | ||
return $c->query('Request')->getServerHost(); | ||
}); | ||
|
||
} | ||
|
||
/** | ||
* @return ILock | ||
*/ | ||
private function getLock() { | ||
$c = $this->getContainer(); | ||
if (self::$config['use_memcache']['locking'] === true) { | ||
$cache = $c->getServer()->getMemCacheFactory(); | ||
|
||
if ($cache->isAvailable()) { | ||
$memcache = $cache->create('ojsxc'); | ||
return new MemLock( | ||
$c->query('UserId'), | ||
$memcache | ||
); | ||
} else { | ||
$c->getServer()->getLogger()->warning('OJSXC is configured to use memcache as backend for locking, but no memcache is available.'); | ||
} | ||
} | ||
|
||
// default | ||
return new DbLock( | ||
$c->query('UserId'), | ||
$c->query('OCP\IDb'), | ||
$c->query('OCP\IConfig') | ||
); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1" ?> | ||
<database> | ||
<name>*dbname*</name> | ||
<create>true</create> | ||
<overwrite>false</overwrite> | ||
<charset>utf8</charset> | ||
<table> | ||
<name>*dbprefix*ojsxc_stanzas</name> | ||
<declaration> | ||
<field> | ||
<name>id</name> | ||
<type>integer</type> | ||
<notnull>true</notnull> | ||
<autoincrement>1</autoincrement> | ||
<length>4</length> | ||
</field> | ||
<field> | ||
<name>from</name> | ||
<type>text</type> | ||
<notnull>true</notnull> | ||
<length>64</length> | ||
</field> | ||
<field> | ||
<name>to</name> | ||
<type>text</type> | ||
<notnull>true</notnull> | ||
<length>64</length> | ||
</field> | ||
<field> | ||
<name>stanza</name> | ||
<type>text</type> | ||
<notnull>true</notnull> | ||
<length>200000</length> | ||
</field> | ||
</declaration> | ||
</table> | ||
</database> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.1.5 | ||
3.0.0-beta1 |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.