Skip to content
This repository was archived by the owner on Apr 5, 2020. It is now read-only.

Commit 0690282

Browse files
committed
Update XMPP library
1 parent fe96975 commit 0690282

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1666
-267
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
plugin=Jabber
12
all:
23
@ echo "Build archive for plugin ${plugin} version=${version}"
34
@ git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip

Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getPluginAuthor()
4242

4343
public function getPluginVersion()
4444
{
45-
return '1.0.7';
45+
return '1.0.8';
4646
}
4747

4848
public function getPluginHomepage()

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ Go to **Settings > Integrations > Jabber** and fill the form:
6060
Changes
6161
-------
6262

63+
### Version 1.0.8
64+
65+
- Update XMPP library
66+
- Update Documentation links
67+
6368
### Version 1.0.7
6469

6570
- Fix bug concerning task overdue events

Template/config/integration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<?= $this->form->label(t('Jabber nickname for Kanboard'), 'jabber_nickname') ?>
1717
<?= $this->form->text('jabber_nickname', $values, array()) ?>
1818

19-
<p class="form-help"><a href="https://kanboard.net/plugin/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
19+
<p class="form-help"><a href="https://github.com/kanboard/plugin-jabber#configuration" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
2020

2121
<div class="form-actions">
2222
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>

Template/project/integration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<?= $this->form->label(t('Multi-user chat room'), 'jabber_room') ?>
44
<?= $this->form->text('jabber_room', $values, array(), array('placeholder="myroom@conference.example.com"')) ?>
55

6-
<p class="form-help"><a href="https://kanboard.net/plugin/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
6+
<p class="form-help"><a href="https://github.com/kanboard/plugin-jabber#configuration" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
77

88
<div class="form-actions">
99
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>

Template/user/integration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<?= $this->form->label(t('Jabber Id'), 'jabber_jid') ?>
44
<?= $this->form->text('jabber_jid', $values) ?>
55

6-
<p class="form-help"><a href="https://kanboard.net/plugin/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
6+
<p class="form-help"><a href="https://github.com/kanboard/plugin-jabber#configuration" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
77

88
<div class="form-actions">
99
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"discard-changes": true
1515
},
1616
"require" : {
17-
"php" : ">=5.3",
18-
"fabiang/xmpp" : "0.6.1"
17+
"fabiang/xmpp" : "0.7.0"
1918
}
2019
}

composer.lock

Lines changed: 32 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
// autoload.php @generated by Composer
44

5-
require_once __DIR__ . '/composer' . '/autoload_real.php';
5+
require_once __DIR__ . '/composer/autoload_real.php';
66

77
return ComposerAutoloaderInit0974ba0e8d42c8958de6db3414ec99de::getLoader();

vendor/composer/ClassLoader.php

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
namespace Composer\Autoload;
1414

1515
/**
16-
* ClassLoader implements a PSR-0 class loader
17-
*
18-
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
16+
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
1917
*
2018
* $loader = new \Composer\Autoload\ClassLoader();
2119
*
@@ -39,6 +37,8 @@
3937
*
4038
* @author Fabien Potencier <fabien@symfony.com>
4139
* @author Jordi Boggiano <j.boggiano@seld.be>
40+
* @see http://www.php-fig.org/psr/psr-0/
41+
* @see http://www.php-fig.org/psr/psr-4/
4242
*/
4343
class ClassLoader
4444
{
@@ -53,8 +53,9 @@ class ClassLoader
5353

5454
private $useIncludePath = false;
5555
private $classMap = array();
56-
5756
private $classMapAuthoritative = false;
57+
private $missingClasses = array();
58+
private $apcuPrefix;
5859

5960
public function getPrefixes()
6061
{
@@ -147,7 +148,7 @@ public function add($prefix, $paths, $prepend = false)
147148
* appending or prepending to the ones previously set for this namespace.
148149
*
149150
* @param string $prefix The prefix/namespace, with trailing '\\'
150-
* @param array|string $paths The PSR-0 base directories
151+
* @param array|string $paths The PSR-4 base directories
151152
* @param bool $prepend Whether to prepend the directories
152153
*
153154
* @throws \InvalidArgumentException
@@ -271,6 +272,26 @@ public function isClassMapAuthoritative()
271272
return $this->classMapAuthoritative;
272273
}
273274

275+
/**
276+
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277+
*
278+
* @param string|null $apcuPrefix
279+
*/
280+
public function setApcuPrefix($apcuPrefix)
281+
{
282+
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283+
}
284+
285+
/**
286+
* The APCu prefix in use, or null if APCu caching is not enabled.
287+
*
288+
* @return string|null
289+
*/
290+
public function getApcuPrefix()
291+
{
292+
return $this->apcuPrefix;
293+
}
294+
274295
/**
275296
* Registers this instance as an autoloader.
276297
*
@@ -313,29 +334,34 @@ public function loadClass($class)
313334
*/
314335
public function findFile($class)
315336
{
316-
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317-
if ('\\' == $class[0]) {
318-
$class = substr($class, 1);
319-
}
320-
321337
// class map lookup
322338
if (isset($this->classMap[$class])) {
323339
return $this->classMap[$class];
324340
}
325-
if ($this->classMapAuthoritative) {
341+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
326342
return false;
327343
}
344+
if (null !== $this->apcuPrefix) {
345+
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
346+
if ($hit) {
347+
return $file;
348+
}
349+
}
328350

329351
$file = $this->findFileWithExtension($class, '.php');
330352

331353
// Search for Hack files if we are running on HHVM
332-
if ($file === null && defined('HHVM_VERSION')) {
354+
if (false === $file && defined('HHVM_VERSION')) {
333355
$file = $this->findFileWithExtension($class, '.hh');
334356
}
335357

336-
if ($file === null) {
358+
if (null !== $this->apcuPrefix) {
359+
apcu_add($this->apcuPrefix.$class, $file);
360+
}
361+
362+
if (false === $file) {
337363
// Remember that this class does not exist.
338-
return $this->classMap[$class] = false;
364+
$this->missingClasses[$class] = true;
339365
}
340366

341367
return $file;
@@ -348,9 +374,13 @@ private function findFileWithExtension($class, $ext)
348374

349375
$first = $class[0];
350376
if (isset($this->prefixLengthsPsr4[$first])) {
351-
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352-
if (0 === strpos($class, $prefix)) {
353-
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
377+
$subPath = $class;
378+
while (false !== $lastPos = strrpos($subPath, '\\')) {
379+
$subPath = substr($subPath, 0, $lastPos);
380+
$search = $subPath.'\\';
381+
if (isset($this->prefixDirsPsr4[$search])) {
382+
foreach ($this->prefixDirsPsr4[$search] as $dir) {
383+
$length = $this->prefixLengthsPsr4[$first][$search];
354384
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355385
return $file;
356386
}
@@ -399,6 +429,8 @@ private function findFileWithExtension($class, $ext)
399429
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400430
return $file;
401431
}
432+
433+
return false;
402434
}
403435
}
404436

0 commit comments

Comments
 (0)