Skip to content

Commit

Permalink
build v3.0.0-beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed Jan 28, 2016
1 parent e197a3c commit 6c50da5
Show file tree
Hide file tree
Showing 2,942 changed files with 147,226 additions and 16,130 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ archives/
css/

composer.phar
vendor/
/vendor/
.phpstorm_helpers
coverage

# vim
.phpstorm_helpers
.phpcomplete_extended
.phpcomplete_extended
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function(grunt) {
build: {
files: [ {
expand: true,
src: [ 'js/*.js', 'css/*', 'appinfo/*', 'ajax/*', 'img/**', 'templates/*', 'sound/*', 'settings.php', 'LICENSE' ],
src: [ 'js/*.js', 'css/*', 'appinfo/*', 'ajax/*', 'img/**', 'templates/*', 'sound/*', 'vendor/**', 'settings.php', 'LICENSE' ],
dest: 'build/'
}, {
expand: true,
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>ojsxc</id>
<name>JavaScript XMPP Chat</name>
<description>XMPP Chat with OTR</description>
<version>2.1.5</version>
<version>3.0.0-beta1</version>
<licence>MIT</licence>
<author>Klaus Herberth</author>
<require>5</require>
Expand Down
2 changes: 1 addition & 1 deletion appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.5
3.0.0-beta1
14 changes: 12 additions & 2 deletions build/ajax/getsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ function validateBoolean($val) {

$data = array ();
$data ['xmpp'] = array ();
$data ['serverType'] = OCP\Config::getAppValue ( 'ojsxc', 'serverType' );
$data ['loginForm'] ['startMinimized'] = validateBoolean(OCP\Config::getAppValue ( 'ojsxc', 'xmppStartMinimized' ));

if ($data ['serverType'] === 'internal') {
OCP\JSON::encodedPrint ( array (
'result' => 'success',
'data' => $data
) );

exit;
}

$data ['xmpp'] ['url'] = OCP\Config::getAppValue ( 'ojsxc', 'boshUrl' );
$data ['xmpp'] ['domain'] = OCP\Config::getAppValue ( 'ojsxc', 'xmppDomain' );
$data ['xmpp'] ['resource'] = OCP\Config::getAppValue ( 'ojsxc', 'xmppResource' );
Expand All @@ -42,8 +54,6 @@ function validateBoolean($val) {
}
}

$data ['loginForm'] ['startMinimized'] = validateBoolean(OCP\Config::getAppValue ( 'ojsxc', 'xmppStartMinimized' ));

OCP\JSON::encodedPrint ( array (
'result' => 'success',
'data' => $data
Expand Down
1 change: 1 addition & 0 deletions build/ajax/setsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
OCP\User::checkAdminUser ();
OCP\JSON::callCheck ();

OCP\Config::setAppValue ( 'ojsxc', 'serverType', $_POST ['serverType'] );
OCP\Config::setAppValue ( 'ojsxc', 'boshUrl', $_POST ['boshUrl'] );
OCP\Config::setAppValue ( 'ojsxc', 'xmppDomain', $_POST ['xmppDomain'] );
OCP\Config::setAppValue ( 'ojsxc', 'xmppResource', $_POST ['xmppResource'] );
Expand Down
6 changes: 3 additions & 3 deletions build/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand All @@ -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' );
Expand All @@ -29,4 +27,6 @@
if($version[0] <= 6)
OCP\Util::addStyle ( 'ojsxc', 'jsxc.oc.lte6' );

require_once __DIR__ ."/../vendor/autoload.php";

?>
121 changes: 121 additions & 0 deletions build/appinfo/application.php
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')
);

}

}
37 changes: 37 additions & 0 deletions build/appinfo/database.xml
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>
2 changes: 1 addition & 1 deletion build/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>ojsxc</id>
<name>JavaScript XMPP Chat</name>
<description>XMPP Chat with OTR</description>
<version>2.1.5</version>
<version>3.0.0-beta1</version>
<licence>MIT</licence>
<author>Klaus Herberth</author>
<require>5</require>
Expand Down
9 changes: 9 additions & 0 deletions build/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*
* @author Klaus Herberth
*/

use \OCA\OJSXC\AppInfo\Application;

$this->create('ojsxc_ajax_getsettings', 'ajax/getsettings.php')
->actionInclude('ojsxc/ajax/getsettings.php');

Expand All @@ -22,4 +25,10 @@
$this->create('ojsxc_ajax_getUsers', 'ajax/getUsers.php')
->actionInclude('ojsxc/ajax/getUsers.php');

$application = new Application();
$application->registerRoutes($this, array(
'routes' => array(
array('name' => 'http_bind#index', 'url' => '/http-bind', 'verb' => array('GET', 'POST')),
)
));
?>
2 changes: 1 addition & 1 deletion build/appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.5
3.0.0-beta1
2 changes: 1 addition & 1 deletion build/css/jquery-ui.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 6c50da5

Please sign in to comment.