diff --git a/composer.json b/composer.json index 28cff9d..7d6aa25 100644 --- a/composer.json +++ b/composer.json @@ -2,13 +2,15 @@ "name": "upschooling/upschooling", "description": "UPschooling Support Platform", "type": "project", - "license": "AGPL", + "license": "AGPL-3.0-or-later", "authors": [ { "name": "UPschooling" } ], - "require": {}, + "require": { + "aryess/php-matrix-sdk": "dev-master" + }, "require-dev": { "phpunit/phpunit": "^8.5", "nextcloud/coding-standard": "^0.5.0" @@ -25,4 +27,4 @@ "cs:check": "php-cs-fixer fix --dry-run --diff", "cs:fix": "php-cs-fixer fix" } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index aa2a786..62e3f6a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,659 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4018f4cd299ffa09ba7399e8d16ae95c", - "packages": [], + "content-hash": "7b53e42ce616e0920d8d108689ba93f2", + "packages": [ + { + "name": "aryess/php-matrix-sdk", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Aryess/matrix-php-sdk.git", + "reference": "70f6273e0eff08b0896866b867334f95714384ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Aryess/matrix-php-sdk/zipball/70f6273e0eff08b0896866b867334f95714384ed", + "reference": "70f6273e0eff08b0896866b867334f95714384ed", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/guzzle": "^6.3", + "php": "~7.2", + "rappasoft/laravel-helpers": "^1.0" + }, + "replace": { + "aryess/phpmatrixsdk": "self.version" + }, + "require-dev": { + "phpunit/phpunit": ">=5.4.3" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Aryess\\PhpMatrixSdk\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Yoann Celton", + "email": "aryess@github.com", + "homepage": "https://github.com/aryess", + "role": "Developer" + } + ], + "description": "Later", + "homepage": "https://github.com/Aryess/PhpMatrixSdk", + "keywords": [ + "PhpMatrixSdk" + ], + "support": { + "issues": "https://github.com/Aryess/matrix-php-sdk/issues", + "source": "https://github.com/Aryess/matrix-php-sdk/tree/master" + }, + "time": "2021-06-24T17:07:32+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "6.5.5", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.17.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/6.5" + }, + "time": "2020-06-16T21:01:06+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.4.1" + }, + "time": "2021-03-07T09:25:29+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.8.2" + }, + "time": "2021-04-26T09:17:50+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "rappasoft/laravel-helpers", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/rappasoft/laravel-helpers.git", + "reference": "c8dfa1e979437528262725ebe99c2e6383b24c16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rappasoft/laravel-helpers/zipball/c8dfa1e979437528262725ebe99c2e6383b24c16", + "reference": "c8dfa1e979437528262725ebe99c2e6383b24c16", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Rappa", + "email": "rappa819@gmail.com" + } + ], + "description": "Laravel Helpers for Non-Laravel Projects", + "keywords": [ + "helpers", + "laravel" + ], + "support": { + "issues": "https://github.com/rappasoft/laravel-helpers/issues", + "source": "https://github.com/rappasoft/laravel-helpers/tree/1.0.2" + }, + "time": "2019-04-03T13:15:59+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:27:20+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + } + ], "packages-dev": [ { "name": "composer/semver", @@ -858,16 +1509,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", "shasum": "" }, "require": { @@ -875,7 +1526,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -901,39 +1553,39 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-09-17T15:28:14+00:00" }, { "name": "phpspec/prophecy", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -968,9 +1620,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, - "time": "2021-03-17T13:42:18+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1271,16 +1923,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.19", + "version": "8.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "496281b64ec781856ed0a583483b5923b4033722" + "reference": "9deefba183198398a09b927a6ac6bc1feb0b7b70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/496281b64ec781856ed0a583483b5923b4033722", - "reference": "496281b64ec781856ed0a583483b5923b4033722", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9deefba183198398a09b927a6ac6bc1feb0b7b70", + "reference": "9deefba183198398a09b927a6ac6bc1feb0b7b70", "shasum": "" }, "require": { @@ -1352,7 +2004,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.20" }, "funding": [ { @@ -1364,7 +2016,7 @@ "type": "github" } ], - "time": "2021-07-31T15:15:06+00:00" + "time": "2021-08-31T06:44:38+00:00" }, { "name": "psr/cache", @@ -2244,16 +2896,16 @@ }, { "name": "symfony/console", - "version": "v4.4.29", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b" + "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b", - "reference": "8baf0bbcfddfde7d7225ae8e04705cfd1081cd7b", + "url": "https://api.github.com/repos/symfony/console/zipball/a3f7189a0665ee33b50e9e228c46f50f5acbed22", + "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22", "shasum": "" }, "require": { @@ -2314,7 +2966,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.29" + "source": "https://github.com/symfony/console/tree/v4.4.30" }, "funding": [ { @@ -2330,20 +2982,20 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:04:53+00:00" + "time": "2021-08-25T19:27:26+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.27", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "958a128b184fcf0ba45ec90c0e88554c9327c2e9" + "reference": "2fe81680070043c4c80e7cedceb797e34f377bac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/958a128b184fcf0ba45ec90c0e88554c9327c2e9", - "reference": "958a128b184fcf0ba45ec90c0e88554c9327c2e9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2fe81680070043c4c80e7cedceb797e34f377bac", + "reference": "2fe81680070043c4c80e7cedceb797e34f377bac", "shasum": "" }, "require": { @@ -2398,7 +3050,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.27" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.30" }, "funding": [ { @@ -2414,7 +3066,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:41:52+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2560,16 +3212,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.27", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "42414d7ac96fc2880a783b872185789dea0d4262" + "reference": "70362f1e112280d75b30087c7598b837c1b468b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/42414d7ac96fc2880a783b872185789dea0d4262", - "reference": "42414d7ac96fc2880a783b872185789dea0d4262", + "url": "https://api.github.com/repos/symfony/finder/zipball/70362f1e112280d75b30087c7598b837c1b468b6", + "reference": "70362f1e112280d75b30087c7598b837c1b468b6", "shasum": "" }, "require": { @@ -2602,7 +3254,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.27" + "source": "https://github.com/symfony/finder/tree/v4.4.30" }, "funding": [ { @@ -2618,20 +3270,20 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:41:52+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.4.27", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "66a3346190f9ddb8bcb160649ee452af3529a990" + "reference": "fa0b12a3a47ed25749d47d6b4f61412fd5ca1554" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/66a3346190f9ddb8bcb160649ee452af3529a990", - "reference": "66a3346190f9ddb8bcb160649ee452af3529a990", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/fa0b12a3a47ed25749d47d6b4f61412fd5ca1554", + "reference": "fa0b12a3a47ed25749d47d6b4f61412fd5ca1554", "shasum": "" }, "require": { @@ -2669,7 +3321,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v4.4.27" + "source": "https://github.com/symfony/options-resolver/tree/v4.4.30" }, "funding": [ { @@ -2685,7 +3337,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:41:52+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2914,82 +3566,6 @@ ], "time": "2020-10-23T14:02:19+00:00" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T09:17:38+00:00" - }, { "name": "symfony/polyfill-php73", "version": "v1.23.0", @@ -3154,16 +3730,16 @@ }, { "name": "symfony/process", - "version": "v4.4.27", + "version": "v4.4.30", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "0b7dc5599ac4aa6d7b936c8f7d10abae64f6cf7f" + "reference": "13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0b7dc5599ac4aa6d7b936c8f7d10abae64f6cf7f", - "reference": "0b7dc5599ac4aa6d7b936c8f7d10abae64f6cf7f", + "url": "https://api.github.com/repos/symfony/process/zipball/13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d", + "reference": "13d3161ef63a8ec21eeccaaf9a4d7f784a87a97d", "shasum": "" }, "require": { @@ -3196,7 +3772,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.27" + "source": "https://github.com/symfony/process/tree/v4.4.30" }, "funding": [ { @@ -3212,7 +3788,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:41:52+00:00" + "time": "2021-08-04T20:31:23+00:00" }, { "name": "symfony/service-contracts", @@ -3466,7 +4042,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "aryess/php-matrix-sdk": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": [], diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 86080dc..7644a05 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -3,11 +3,25 @@ namespace OCA\UPschooling\AppInfo; use OCP\AppFramework\App; +use OCP\AppFramework\Bootstrap\IBootContext; +use OCP\AppFramework\Bootstrap\IBootstrap; +use OCP\AppFramework\Bootstrap\IRegistrationContext; -class Application extends App { +class Application extends App implements IBootstrap { public const APP_ID = 'upschooling'; public function __construct() { parent::__construct(self::APP_ID); } + + public function register(IRegistrationContext $context): void + { + // Register the composer autoloader for packages shipped by this app, if applicable + include_once __DIR__ . '/../../vendor/autoload.php'; + } + + public function boot(IBootContext $context): void + { + // nothing to boot? + } } diff --git a/lib/Controller/TicketController.php b/lib/Controller/TicketController.php index 2b3b55f..96b391e 100644 --- a/lib/Controller/TicketController.php +++ b/lib/Controller/TicketController.php @@ -3,15 +3,20 @@ namespace OCA\UPschooling\Controller; use OCA\UPschooling\AppInfo\Application; +use OCA\UPschooling\Service\MatrixService; use OCA\UPschooling\Service\TicketService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; use OCP\IRequest; class TicketController extends Controller { + /** @var TicketService */ private $service; + /** @var MatrixService */ + private $matrix; + /** @var string */ private $userId; @@ -19,9 +24,11 @@ class TicketController extends Controller { public function __construct(IRequest $request, TicketService $service, + MatrixService $matrix, $userId) { parent::__construct(Application::APP_ID, $request); $this->service = $service; + $this->matrix = $matrix; $this->userId = $userId; } diff --git a/lib/Service/MatrixService.php b/lib/Service/MatrixService.php new file mode 100644 index 0000000..66aea08 --- /dev/null +++ b/lib/Service/MatrixService.php @@ -0,0 +1,65 @@ +logger = $logger; + $this->channel = "#issue:synapse"; + $this->client = new MatrixClient("http://synapse:8008"); + $this->token = $this->client->login("upschooling", "secret"); + try { + $this->room = $this->client->createRoom($this->channel, false, array()); + } catch (MatrixException $e) { + $this->logger->error("Could not create room ".$this->channel, array('exception' => $e)); + } + } + + /** + * Sets a property on a channel. + * + * @param string $eventType a unique property identifier with reverse domain notation, e.g. com.example.property. + * @param array $content the contents as a JSON serializable array. + * @throws MatrixException + */ + public function setProperty(string $eventType, array $content) + { + $this->room->sendStateEvent($eventType, $content); + } + + /** + * @param string $eventType a unique property identifier with reverse domain notation, e.g. com.example.property. + * @return array the contents of the room state. + * @throws MatrixException|MatrixRequestException + */ + public function getProperty(string $eventType): array + { + // first parameter should be $this->room->roomId + return $this->client->api()->getStateEvent($this->channel, $eventType); + } + +} diff --git a/podman-run.sh b/podman-run.sh index e00aaf1..316c054 100755 --- a/podman-run.sh +++ b/podman-run.sh @@ -5,10 +5,67 @@ IFS=$'\n\t' DIR="${0%/*}" -podman run -d --name=nextcloud --replace=true -p 8080:80 -v "$DIR:/var/www/html/custom_apps/upschooling" docker.io/nextcloud +# replace containers +podman rm -if synapse +podman rm -if nextcloud + +podman run -d --name=nextcloud -p 8080:80 -v "$DIR:/var/www/html/custom_apps/upschooling" docker.io/nextcloud podman exec nextcloud chown -R 33 /var/www/html/custom_apps "$DIR/podman-reown.sh" podman exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make composer' podman exec --user 33 nextcloud php occ maintenance:install --database sqlite --admin-user admin --admin-pass admin podman exec --user 33 nextcloud php occ config:system:set --value=true --type=boolean debug podman exec --user 33 nextcloud php occ app:enable --force upschooling + +if podman volume exists synapse-data; then + echo "Found existing synapse-data volume" +else + podman run --rm \ + --name=synapse \ + --hostname synapse \ + "--mount=type=volume,src=synapse-data,dst=/data" \ + -e SYNAPSE_SERVER_NAME=synapse \ + -e SYNAPSE_REPORT_STATS=no \ + docker.io/matrixdotorg/synapse \ + generate + echo "Generated fresh synapse-data volume" +fi + +podman run -d \ + --name=synapse \ + "--mount=type=volume,src=synapse-data,dst=/data" \ + "--network=container:$(podman inspect --format "{{.Id}}" nextcloud)" \ + --hostname synapse \ + docker.io/matrixdotorg/synapse + +# wait for synapse to start +MAX_TRIES=15 +for ((i = 0 ; i < $MAX_TRIES ; i++)); do + if podman logs synapse 2>&1 | grep -q "Synapse now listening on TCP port 8008"; then + echo -e "Synapse has started. \e[1;38;5;2mOK\033[0m" + break + fi + sleep 1 +done + +if [[ $i -ge $MAX_TRIES ]]; then + echo "Synapse did not start in time! Use \`podman logs synapse\` to investigate" + exit 1 +fi + +set +e +REGISTER_USER_OUTPUT="$(podman exec synapse register_new_matrix_user -u upschooling -p secret -a -c /data/homeserver.yaml http://localhost:8008)" +REGISTER_USER_SUCCESS=$? +set -e + +if [[ "$REGISTER_USER_SUCCESS" != "0" ]]; then + if echo $REGISTER_USER_OUTPUT | grep -q "User ID already taken."; then + echo -e "User @upschooling:synapse already exists. \e[1;38;5;2mOK\033[0m" + else + echo "Could not create user @upschooling:synapse" + echo $REGISTER_USER_OUTPUT + exit 1 + fi +else + echo -e "Matrix user @upschooling:synapse created. \e[1;38;5;2mOK\033[0m" +fi