diff --git a/.editorconfig b/.editorconfig index ef6e90b2..8565b274 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,3 @@ indent_size = 2 [*.json] indent_style = space indent_size = 2 - -[composer.json] -indent_size = 4 diff --git a/.woodpecker/.code_standards_check.yml b/.woodpecker/.code_standards_check.yml index 60a1bd2a..9d59dc08 100644 --- a/.woodpecker/.code_standards_check.yml +++ b/.woodpecker/.code_standards_check.yml @@ -1,12 +1,9 @@ skip_clone: true -steps: +pipeline: clone_friendica_base: image: alpine/git commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git config --global --add safe.directory $CI_WORKSPACE - git clone https://github.com/friendica/friendica.git . - git checkout $CI_COMMIT_BRANCH when: @@ -16,7 +13,7 @@ steps: commands: - git config --global user.email "no-reply@friendi.ca" - git config --global user.name "Friendica" - - git clone $CI_REPO_CLONE_URL addon + - git clone $CI_REPO_LINK addon - cd addon/ - git checkout $CI_COMMIT_BRANCH - git fetch origin $CI_COMMIT_REF @@ -56,10 +53,6 @@ steps: - /tmp/drone-cache:/tmp/cache when: event: pull_request - phpstan: - image: friendicaci/php8.3:php8.3.3 - commands: - - ./bin/composer.phar run phpstan; check: image: friendicaci/php-cs commands: diff --git a/.woodpecker/.continuous-deployment-allinone.yml b/.woodpecker/.continuous-deployment-allinone.yml deleted file mode 100644 index 8d608db8..00000000 --- a/.woodpecker/.continuous-deployment-allinone.yml +++ /dev/null @@ -1,115 +0,0 @@ -# This prevents executing this pipeline at other servers than ci.friendi.ca -labels: - location: friendica - type: releaser - -skip_clone: true - -steps: - clone_friendica_base: - image: alpine/git - commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git config --global --add safe.directory $CI_WORKSPACE - - git clone https://github.com/friendica/friendica.git . - - git checkout $CI_COMMIT_BRANCH - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push - clone_friendica_addon: - image: alpine/git - commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git clone $CI_REPO_CLONE_URL addon - - cd addon/ - - git checkout $CI_COMMIT_BRANCH - - git fetch origin $CI_COMMIT_REF - - git merge $CI_COMMIT_SHA - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push - restore_cache: - image: meltwater/drone-cache:dev - settings: - backend: "filesystem" - restore: true - cache_key: "{{ .Repo.Name }}_php7.4_{{ arch }}_{{ os }}" - archive_format: "gzip" - mount: - - '.composer' - volumes: - - /tmp/drone-cache:/tmp/cache - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push - composer_install: - image: friendicaci/php8.2:php8.2.28 - commands: - - export COMPOSER_HOME=.composer - - composer validate - - composer install --no-dev --optimize-autoloader - volumes: - - /etc/hosts:/etc/hosts - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push - create_artifacts: - image: debian - commands: - - apt-get update - - apt-get install bzip2 - - mkdir ./build - - export VERSION="$(cat VERSION)" - - export RELEASE="friendica-all-in-one-$VERSION" - - export ARTIFACT="$RELEASE.tar.gz" - - tar - --exclude='.tx' - --exclude='.git' - --exclude='.editorconfig' - --exclude='.gitattributes' - --exclude='.gitignore' - --exclude='.woodpecker' - --exclude='**/*/messages.po' - -cvzf ./build/$ARTIFACT / - - cd ./build - - sha256sum "$ARTIFACT" > "$ARTIFACT.sum256" - - chmod 664 ./* - - ls -lh - - cat "$ARTIFACT.sum256" - - sha256sum "$ARTIFACT" - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push - sign_artifacts: - image: plugins/gpgsign - settings: - key: - from_secret: gpg_key - passphrase: - from_secret: gpg_password - files: - - build/* - exclude: - - build/*.sum256 - detach_sign: true - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push - publish_artifacts: - image: alpine - commands: - - cp -fr build/* /tmp/friendica_files/ - volumes: - - files:/tmp/friendica_files - when: - repo: friendica/friendica-addons - branch: [ develop, '*-rc' ] - event: push diff --git a/.woodpecker/.continuous-deployment.yml b/.woodpecker/.continuous-deployment.yml index d6d8a22a..ab6e07e9 100644 --- a/.woodpecker/.continuous-deployment.yml +++ b/.woodpecker/.continuous-deployment.yml @@ -5,13 +5,10 @@ labels: skip_clone: true -steps: +pipeline: clone_friendica_base: image: alpine/git commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git config --global --add safe.directory $CI_WORKSPACE - git clone https://github.com/friendica/friendica.git . - git checkout $CI_COMMIT_BRANCH when: @@ -23,7 +20,7 @@ steps: commands: - git config --global user.email "no-reply@friendi.ca" - git config --global user.name "Friendica" - - git clone $CI_REPO_CLONE_URL addon + - git clone $CI_REPO_LINK addon - cd addon/ - git checkout $CI_COMMIT_BRANCH - git fetch origin $CI_COMMIT_REF @@ -48,7 +45,7 @@ steps: branch: [ develop, '*-rc' ] event: push composer_install: - image: friendicaci/php8.2:php8.2.28 + image: friendicaci/php7.4:php7.4.33 commands: - export COMPOSER_HOME=.composer - composer validate diff --git a/.woodpecker/.messages.po_check.yml b/.woodpecker/.messages.po_check.yml index e0239dcd..f5691e00 100644 --- a/.woodpecker/.messages.po_check.yml +++ b/.woodpecker/.messages.po_check.yml @@ -1,12 +1,9 @@ skip_clone: true -steps: +pipeline: clone_friendica_base: image: alpine/git commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git config --global --add safe.directory $CI_WORKSPACE - git clone https://github.com/friendica/friendica.git . - git checkout $CI_COMMIT_BRANCH when: @@ -16,7 +13,7 @@ steps: commands: - git config --global user.email "no-reply@friendi.ca" - git config --global user.name "Friendica" - - git clone $CI_REPO_CLONE_URL addon + - git clone $CI_REPO_LINK addon - cd addon/ - git checkout $CI_COMMIT_BRANCH - git fetch origin $CI_COMMIT_REF diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml deleted file mode 100644 index b0745ad0..00000000 --- a/.woodpecker/.phpunit.yml +++ /dev/null @@ -1,120 +0,0 @@ -matrix: - include: - - PHP_MAJOR_VERSION: 7.4 - PHP_VERSION: 7.4.33 - - PHP_MAJOR_VERSION: 8.0 - PHP_VERSION: 8.0.30 - - PHP_MAJOR_VERSION: 8.1 - PHP_VERSION: 8.1.31 - - PHP_MAJOR_VERSION: 8.2 - PHP_VERSION: 8.2.28 - - PHP_MAJOR_VERSION: 8.3 - PHP_VERSION: 8.3.17 - - PHP_MAJOR_VERSION: 8.4 - PHP_VERSION: 8.4.5 - -# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...) -labels: - location: opensocial - -skip_clone: true - -steps: - clone_friendica_base: - image: alpine/git - commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git config --global --add safe.directory $CI_WORKSPACE - - git clone https://github.com/friendica/friendica.git . - - git checkout $CI_COMMIT_BRANCH - clone_friendica_addon: - image: alpine/git - commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git clone $CI_REPO_CLONE_URL addon - - cd addon/ - - git checkout $CI_COMMIT_BRANCH - - git fetch origin $CI_COMMIT_REF - - git merge $CI_COMMIT_SHA - restore_cache: - image: meltwater/drone-cache:dev - settings: - backend: "filesystem" - restore: true - cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}" - archive_format: "gzip" - mount: - - '.composer' - volumes: - - /tmp/drone-cache:/tmp/cache - composer_install: - image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION} - commands: - - export COMPOSER_HOME=.composer - - ./bin/composer.phar validate - - ./bin/composer.phar install --prefer-dist - volumes: - - /etc/hosts:/etc/hosts - rebuild_cache: - image: meltwater/drone-cache:dev - settings: - backend: "filesystem" - rebuild: true - cache_key: "{{ .Repo.Name }}_php${PHP_MAJOR_VERSION}_{{ arch }}_{{ os }}" - archive_format: "gzip" - mount: - - '.composer' - volumes: - - /tmp/drone-cache:/tmp/cache - test: - image: friendicaci/php${PHP_MAJOR_VERSION}:php${PHP_VERSION} - environment: - MYSQL_HOST: "mariadb" - MYSQL_PORT: "3306" - MYSQL_DATABASE: "test" - MYSQL_PASSWORD: "test" - MYSQL_USER: "test" - REDIS_HOST: "redis" - MEMCACHED_HOST: "memcached" - MEMCACHE_HOST: "memcached" - commands: - - cp config/local-sample.config.php config/local.config.php - - if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi - - mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql - - if [ "${PHP_MAJOR_VERSION}" = "8.2" -a "${CI_REPO}" = "friendica/friendica-addons" ]; then - phpenmod xdebug; - export XDEBUG_MODE=coverage; - phpunit --configuration tests/phpunit-addons.xml --coverage-clover clover.xml; - else - phpunit --configuration tests/phpunit-addons.xml; - fi - codecov: - image: friendicaci/codecov - when: - matrix: - PHP_MAJOR_VERSION: 8.2 - PHP_VERSION: 8.2.16 - repo: - - friendica/friendica-addons - commands: - - codecov -R '.' -Z -f 'clover.xml' - environment: - CODECOV_TOKEN: - from_secret: codecov-token - -services: - mariadb: - image: mariadb:latest - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: "true" - MYSQL_DATABASE: "test" - MYSQL_PASSWORD: "test" - MYSQL_USER: "test" - - memcached: - image: memcached - - redis: - image: redis diff --git a/.woodpecker/.releaser.yml b/.woodpecker/.releaser.yml index 7407f2bc..4a661937 100644 --- a/.woodpecker/.releaser.yml +++ b/.woodpecker/.releaser.yml @@ -5,13 +5,10 @@ labels: skip_clone: true -steps: +pipeline: clone_friendica_base: image: alpine/git commands: - - git config --global user.email "no-reply@friendi.ca" - - git config --global user.name "Friendica" - - git config --global --add safe.directory $CI_WORKSPACE - git clone https://github.com/friendica/friendica.git . - git checkout $CI_COMMIT_BRANCH when: @@ -22,7 +19,7 @@ steps: commands: - git config --global user.email "no-reply@friendi.ca" - git config --global user.name "Friendica" - - git clone $CI_REPO_CLONE_URL addon + - git clone $CI_REPO_LINK addon - cd addon/ - git checkout $CI_COMMIT_BRANCH - git fetch origin $CI_COMMIT_REF @@ -45,7 +42,7 @@ steps: repo: friendica/friendica-addons event: tag composer_install: - image: friendicaci/php8.2:php8.2.28 + image: friendicaci/php7.4:php7.4.33 commands: - export COMPOSER_HOME=.composer - composer validate diff --git a/README.md b/README.md index 82029288..6a3202bb 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,6 @@ See the [documentation](https://github.com/friendica/friendica/blob/stable/doc/A ## Translation Addons can be translated like any other part of Friendica. -Translation for addons is done at [the Transifex Friendica page](https://app.transifex.com/Friendica/friendica/dashboard/). +Translation for addons is done at [the Transifex Friendica page](https://www.transifex.com/Friendica/friendica/dashboard/). Read more about the workflow in the [Friendica translation documentation](https://github.com/friendica/friendica/blob/stable/doc/translations.md#addon). diff --git a/advancedcontentfilter/advancedcontentfilter.js b/advancedcontentfilter/advancedcontentfilter.js index a8fc1c65..fcf7b096 100644 --- a/advancedcontentfilter/advancedcontentfilter.js +++ b/advancedcontentfilter/advancedcontentfilter.js @@ -54,7 +54,7 @@ new Vue({ self.rules.push(responseJSON.rule); self.resetForm(); }, function (response) { - self.errorMessage = response.responseJSON.exception[0].message; + self.errorMessage = response.responseJSON.message; }); } }, @@ -74,7 +74,7 @@ new Vue({ self.rules[self.editedIndex] = rule; self.resetForm(); }, function (response) { - self.errorMessage = response.responseJSON.exception[0].message; + self.errorMessage = response.responseJSON.message; }); }, diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index 53cb9ebe..2254e587 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -33,13 +33,16 @@ * */ +use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Text\Markdown; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Database\DBStructure; use Friendica\DI; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Model\User; @@ -61,7 +64,7 @@ function advancedcontentfilter_install() Hook::add('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); DBStructure::performUpdate(); - DI::logger()->notice('installed advancedcontentfilter'); + Logger::notice('installed advancedcontentfilter'); } /* @@ -120,22 +123,21 @@ function advancedcontentfilter_prepare_body_content_filter(&$hook_data) $expressionLanguage = new ExpressionLanguage\ExpressionLanguage(); } - $uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId(); - if (!$uid) { + if (!DI::userSession()->getLocalUserId()) { return; } $vars = advancedcontentfilter_get_filter_fields($hook_data['item']); - $rules = DI::cache()->get('rules_' . $uid); + $rules = DI::cache()->get('rules_' . DI::userSession()->getLocalUserId()); if (!isset($rules)) { $rules = DBA::toArray(DBA::select( 'advancedcontentfilter_rules', ['name', 'expression', 'serialized'], - ['uid' => $uid, 'active' => true] + ['uid' => DI::userSession()->getLocalUserId(), 'active' => true] )); - DI::cache()->set('rules_' . $uid, $rules); + DI::cache()->set('rules_' . DI::userSession()->getLocalUserId(), $rules); } if ($rules) { @@ -188,32 +190,11 @@ function advancedcontentfilter_module() {} function advancedcontentfilter_init() { if (DI::args()->getArgc() > 1 && DI::args()->getArgv()[1] == 'api') { - $slim = \Slim\Factory\AppFactory::create(); + $slim = new \Slim\App(); - /** - * The routing middleware should be added before the ErrorMiddleware - * Otherwise exceptions thrown from it will not be handled - */ - $slim->addRoutingMiddleware(); - - $slim->addErrorMiddleware(true, true, true, DI::logger()); - - // register routes - $slim->group('/advancedcontentfilter/api', function (\Slim\Routing\RouteCollectorProxy $app) { - $app->group('/rules', function (\Slim\Routing\RouteCollectorProxy $app) { - $app->get('', 'advancedcontentfilter_get_rules'); - $app->post('', 'advancedcontentfilter_post_rules'); - - $app->get('/{id}', 'advancedcontentfilter_get_rules_id'); - $app->put('/{id}', 'advancedcontentfilter_put_rules_id'); - $app->delete('/{id}', 'advancedcontentfilter_delete_rules_id'); - }); - - $app->group('/variables', function (\Slim\Routing\RouteCollectorProxy $app) { - $app->get('/{guid}', 'advancedcontentfilter_get_variables_guid'); - }); - }); + require __DIR__ . '/src/middlewares.php'; + require __DIR__ . '/src/routes.php'; $slim->run(); exit; @@ -271,8 +252,8 @@ function advancedcontentfilter_content() 'rule_expression' => DI::l10n()->t('Rule Expression'), 'cancel' => DI::l10n()->t('Cancel'), ], - '$current_theme' => DI::appHelper()->getCurrentTheme(), - '$rules' => DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()])), + '$current_theme' => DI::app()->getCurrentTheme(), + '$rules' => advancedcontentfilter_get_rules(), '$form_security_token' => BaseModule::getFormSecurityToken() ]); } @@ -324,7 +305,7 @@ function advancedcontentfilter_build_fields($data) * API */ -function advancedcontentfilter_get_rules(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface +function advancedcontentfilter_get_rules() { if (!DI::userSession()->getLocalUserId()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); @@ -332,8 +313,7 @@ function advancedcontentfilter_get_rules(ServerRequestInterface $request, Respon $rules = DBA::toArray(DBA::select('advancedcontentfilter_rules', [], ['uid' => DI::userSession()->getLocalUserId()])); - $response->getBody()->write(json_encode($rules)); - return $response->withHeader('Content-Type', 'application/json'); + return json_encode($rules); } function advancedcontentfilter_get_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args) @@ -344,11 +324,10 @@ function advancedcontentfilter_get_rules_id(ServerRequestInterface $request, Res $rule = DBA::selectFirst('advancedcontentfilter_rules', [], ['id' => $args['id'], 'uid' => DI::userSession()->getLocalUserId()]); - $response->getBody()->write(json_encode($rule)); - return $response->withHeader('Content-Type', 'application/json'); + return json_encode($rule); } -function advancedcontentfilter_post_rules(ServerRequestInterface $request, ResponseInterface $response) +function advancedcontentfilter_post_rules(ServerRequestInterface $request) { if (!DI::userSession()->getLocalUserId()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this method')); @@ -381,8 +360,7 @@ function advancedcontentfilter_post_rules(ServerRequestInterface $request, Respo DI::cache()->delete('rules_' . DI::userSession()->getLocalUserId()); - $response->getBody()->write(json_encode(['message' => DI::l10n()->t('Rule successfully added'), 'rule' => $rule])); - return $response->withHeader('Content-Type', 'application/json'); + return json_encode(['message' => DI::l10n()->t('Rule successfully added'), 'rule' => $rule]); } function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args) @@ -413,8 +391,7 @@ function advancedcontentfilter_put_rules_id(ServerRequestInterface $request, Res DI::cache()->delete('rules_' . DI::userSession()->getLocalUserId()); - $response->getBody()->write(json_encode(['message' => DI::l10n()->t('Rule successfully updated')])); - return $response->withHeader('Content-Type', 'application/json'); + return json_encode(['message' => DI::l10n()->t('Rule successfully updated')]); } function advancedcontentfilter_delete_rules_id(ServerRequestInterface $request, ResponseInterface $response, $args) @@ -437,8 +414,7 @@ function advancedcontentfilter_delete_rules_id(ServerRequestInterface $request, DI::cache()->delete('rules_' . DI::userSession()->getLocalUserId()); - $response->getBody()->write(json_encode(['message' => DI::l10n()->t('Rule successfully deleted')])); - return $response->withHeader('Content-Type', 'application/json'); + return json_encode(['message' => DI::l10n()->t('Rule successfully deleted')]); } function advancedcontentfilter_get_variables_guid(ServerRequestInterface $request, ResponseInterface $response, $args) @@ -461,8 +437,7 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques $return = advancedcontentfilter_get_filter_fields(advancedcontentfilter_prepare_item_row($item_row)); - $response->getBody()->write(json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))])); - return $response->withHeader('Content-Type', 'application/json'); + return json_encode(['variables' => str_replace('\\\'', '\'', var_export($return, true))]); } /** @@ -480,7 +455,7 @@ function advancedcontentfilter_prepare_item_row(array $item_row): array $item_row['tags'] = $tags['tags']; $item_row['hashtags'] = $tags['hashtags']; $item_row['mentions'] = $tags['mentions']; - $item_row['attachments'] = DI::postMediaRepository()->splitAttachments($item_row['uri-id']); + $item_row['attachments'] = Post\Media::splitAttachments($item_row['uri-id']); return $item_row; } diff --git a/advancedcontentfilter/composer.json b/advancedcontentfilter/composer.json index b9ab1900..93b19cd5 100644 --- a/advancedcontentfilter/composer.json +++ b/advancedcontentfilter/composer.json @@ -1,27 +1,25 @@ { - "name": "friendica-addons/advancedcontentfilter", - "description": "Advanced Content Filter addon for Friendica", - "type": "friendica-addon", - "authors": [ - { - "name": "Hypolite Petovan", - "email": "hypolite@mrpetovan.com", - "homepage": "https://friendica.mrpetovan.com/profile/hypolite", - "role": "Developer" - } - ], - "require": { - "slim/slim": "^4", - "symfony/expression-language": "^3.4" - }, - "license": "3-clause BSD license", - "minimum-stability": "stable", - "config": { - "platform": { - "php": "7.4" - }, - "optimize-autoloader": true, - "autoloader-suffix": "AdvancedContentFilterAddon", - "preferred-install": "dist" - } + "name": "friendica-addons/advancedcontentfilter", + "description": "Advanced Content Filter addon for Friendica", + "type": "friendica-addon", + "authors": [ + { + "name": "Hypolite Petovan", + "email": "hypolite@mrpetovan.com", + "homepage": "https://friendica.mrpetovan.com/profile/hypolite", + "role": "Developer" + } + ], + "require": { + "php": ">=5.6.0", + "slim/slim": "^3.1", + "symfony/expression-language": "^3.4" + }, + "license": "3-clause BSD license", + "minimum-stability": "stable", + "config": { + "optimize-autoloader": true, + "autoloader-suffix": "AdvancedContentFilterAddon", + "preferred-install": "dist" + } } diff --git a/advancedcontentfilter/composer.lock b/advancedcontentfilter/composer.lock index 6dbd17ba..774b5ec8 100644 --- a/advancedcontentfilter/composer.lock +++ b/advancedcontentfilter/composer.lock @@ -4,8 +4,40 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a7276eb2d2108a26699f69c750d02d27", + "content-hash": "d0e3662dd9d910ffe4f71d325bc39319", "packages": [ + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", + "time": "2017-02-14T19:40:03+00:00" + }, { "name": "nikic/fast-route", "version": "v1.3.0", @@ -52,6 +84,56 @@ ], "time": "2018-02-13T20:26:39+00:00" }, + { + "name": "pimple/pimple", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", + "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Pimple, a simple Dependency Injection Container", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2018-01-21T07:42:36+00:00" + }, { "name": "psr/cache", "version": "1.0.1", @@ -100,22 +182,27 @@ }, { "name": "psr/container", - "version": "1.1.2", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=5.3.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -128,7 +215,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -140,25 +227,24 @@ "container-interop", "psr" ], - "time": "2021-11-05T16:50:12+00:00" + "time": "2017-02-14T16:28:37+00:00" }, { - "name": "psr/http-factory", - "version": "1.0.2", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0 || ^2.0" + "php": ">=5.3.0" }, "type": "library", "extra": { @@ -178,58 +264,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "time": "2023-04-10T20:10:41+00:00" - }, - { - "name": "psr/http-message", - "version": "2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -242,126 +277,20 @@ "request", "response" ], - "time": "2023-04-04T09:54:51+00:00" - }, - { - "name": "psr/http-server-handler", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "handler", - "http", - "http-interop", - "psr", - "psr-15", - "psr-7", - "request", - "response", - "server" - ], - "time": "2023-04-10T20:06:20+00:00" - }, - { - "name": "psr/http-server-middleware", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0", - "psr/http-server-handler": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP server-side middleware", - "keywords": [ - "http", - "http-interop", - "middleware", - "psr", - "psr-15", - "psr-7", - "request", - "response" - ], - "time": "2023-04-11T06:14:47+00:00" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "psr/log", - "version": "1.1.4", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -385,7 +314,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -395,55 +324,84 @@ "psr", "psr-3" ], - "time": "2021-05-03T11:20:27+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { - "name": "slim/slim", - "version": "4.13.0", + "name": "psr/simple-cache", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "038fd5713d5a41636fdff0e8dcceedecdd17fc17" + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/038fd5713d5a41636fdff0e8dcceedecdd17fc17", - "reference": "038fd5713d5a41636fdff0e8dcceedecdd17fc17", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { - "ext-json": "*", - "nikic/fast-route": "^1.3", - "php": "^7.4 || ^8.0", - "psr/container": "^1.0 || ^2.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0", - "psr/log": "^1.1 || ^2.0 || ^3.0" + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "slim/slim", + "version": "3.9.2", + "source": { + "type": "git", + "url": "https://github.com/slimphp/Slim.git", + "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/4086d0106cf5a7135c69fce4161fe355a8feb118", + "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2", + "nikic/fast-route": "^1.0", + "php": ">=5.5.0", + "pimple/pimple": "^3.0", + "psr/container": "^1.0", + "psr/http-message": "^1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "adriansuter/php-autoload-override": "^1.4", - "ext-simplexml": "*", - "guzzlehttp/psr7": "^2.6", - "httpsoft/http-message": "^1.1", - "httpsoft/http-server-request": "^1.1", - "laminas/laminas-diactoros": "^2.17 || ^3", - "nyholm/psr7": "^1.8", - "nyholm/psr7-server": "^1.1", - "phpspec/prophecy": "^1.19", - "phpspec/prophecy-phpunit": "^2.1", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6", - "slim/http": "^1.3", - "slim/psr7": "^1.6", - "squizlabs/php_codesniffer": "^3.9" - }, - "suggest": { - "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", - "ext-xml": "Needed to support XML format in BodyParsingMiddleware", - "php-di/php-di": "PHP-DI is the recommended container library to be used with Slim", - "slim/psr7": "Slim PSR-7 implementation. See https://www.slimframework.com/docs/v4/start/installation.html for more information." + "phpunit/phpunit": "^4.0", + "squizlabs/php_codesniffer": "^2.5" }, "type": "library", "autoload": { @@ -456,100 +414,77 @@ "MIT" ], "authors": [ - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - }, { "name": "Rob Allen", "email": "rob@akrabat.com", "homepage": "http://akrabat.com" }, { - "name": "Pierre Berube", - "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" + "name": "Josh Lockhart", + "email": "hello@joshlockhart.com", + "homepage": "https://joshlockhart.com" }, { "name": "Gabriel Manricks", "email": "gmanricks@me.com", "homepage": "http://gabrielmanricks.com" + }, + { + "name": "Andrew Smith", + "email": "a.smith@silentworks.co.uk", + "homepage": "http://silentworks.co.uk" } ], "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "https://www.slimframework.com", + "homepage": "https://slimframework.com", "keywords": [ "api", "framework", "micro", "router" ], - "funding": [ - { - "url": "https://opencollective.com/slimphp", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slim/slim", - "type": "tidelift" - } - ], - "time": "2024-03-03T21:25:30+00:00" + "time": "2017-11-26T19:13:09+00:00" }, { "name": "symfony/cache", - "version": "v4.4.48", + "version": "v3.4.36", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "3b98ed664887ad197b8ede3da2432787212eb915" + "reference": "3d9f46a6960fd5cd7f030f86adc5b4b63bcfa4e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/3b98ed664887ad197b8ede3da2432787212eb915", - "reference": "3b98ed664887ad197b8ede3da2432787212eb915", + "url": "https://api.github.com/repos/symfony/cache/zipball/3d9f46a6960fd5cd7f030f86adc5b4b63bcfa4e3", + "reference": "3d9f46a6960fd5cd7f030f86adc5b4b63bcfa4e3", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/cache": "^1.0|^2.0", - "psr/log": "^1|^2|^3", - "symfony/cache-contracts": "^1.1.7|^2", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.2|^5.0" + "php": "^5.5.9|>=7.0.8", + "psr/cache": "~1.0", + "psr/log": "~1.0", + "psr/simple-cache": "^1.0", + "symfony/polyfill-apcu": "~1.1" }, "conflict": { - "doctrine/dbal": "<2.7", - "symfony/dependency-injection": "<3.4", - "symfony/http-kernel": "<4.4|>=5.0", - "symfony/var-dumper": "<4.4" + "symfony/var-dumper": "<3.3" }, "provide": { - "psr/cache-implementation": "1.0|2.0", - "psr/simple-cache-implementation": "1.0|2.0", - "symfony/cache-implementation": "1.0|2.0" + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.7|^3.0", - "predis/predis": "^1.1", - "psr/simple-cache": "^1.0|^2.0", - "symfony/config": "^4.2|^5.0", - "symfony/dependency-injection": "^3.4|^4.1|^5.0", - "symfony/filesystem": "^4.4|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/var-dumper": "^4.4|^5.0" + "doctrine/cache": "~1.6", + "doctrine/dbal": "~2.4", + "predis/predis": "~1.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\Cache\\": "" @@ -572,188 +507,38 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "description": "Symfony Cache component with PSR-6, PSR-16, and tags", "homepage": "https://symfony.com", "keywords": [ "caching", "psr6" ], - "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": "2022-10-17T20:21:54+00:00" - }, - { - "name": "symfony/cache-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/cache-contracts.git", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0|^3.0" - }, - "suggest": { - "symfony/cache-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Cache\\": "" - } - }, - "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": "Generic abstractions related to caching", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "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": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.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": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "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": "2022-01-02T09:53:40+00:00" + "time": "2019-12-01T10:45:41+00:00" }, { "name": "symfony/expression-language", - "version": "v3.4.47", + "version": "v3.4.8", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "de38e66398fca1fcb9c48e80279910e6889cb28f" + "reference": "867e4d1f5d4e52435a8ffff6b24fd6a801582241" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/de38e66398fca1fcb9c48e80279910e6889cb28f", - "reference": "de38e66398fca1fcb9c48e80279910e6889cb28f", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/867e4d1f5d4e52435a8ffff6b24fd6a801582241", + "reference": "867e4d1f5d4e52435a8ffff6b24fd6a801582241", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8", - "symfony/cache": "~3.1|~4.0", - "symfony/polyfill-php70": "~1.6" + "symfony/cache": "~3.1|~4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, "autoload": { "psr-4": { "Symfony\\Component\\ExpressionLanguage\\": "" @@ -778,345 +563,37 @@ ], "description": "Symfony ExpressionLanguage Component", "homepage": "https://symfony.com", - "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": "2020-10-24T10:57:07+00:00" + "time": "2018-01-03T07:37:34+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", + "name": "symfony/polyfill-apcu", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" + "url": "https://github.com/symfony/polyfill-apcu.git", + "reference": "a8e961c841b9ec52927a87914f8820a1ad8f8116" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", + "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/a8e961c841b9ec52927a87914f8820a1ad8f8116", + "reference": "a8e961c841b9ec52927a87914f8820a1ad8f8116", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "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.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "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": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "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 backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "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": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "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": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "Symfony\\Polyfill\\Apcu\\": "" }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "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": "2022-05-30T19:17:29+00:00" - }, - { - "name": "symfony/var-exporter", - "version": "v5.4.35", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "abb0a151b62d6b07e816487e20040464af96cae7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/abb0a151b62d6b07e816487e20040464af96cae7", - "reference": "abb0a151b62d6b07e816487e20040464af96cae7", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\VarExporter\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1133,31 +610,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "description": "Symfony polyfill backporting apcu_* functions to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "serialize" + "apcu", + "compatibility", + "polyfill", + "portable", + "shim" ], - "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": "2024-01-23T13:51:25+00:00" + "time": "2019-11-27T13:56:44+00:00" } ], "packages-dev": [], @@ -1166,10 +628,8 @@ "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "platform-overrides": { - "php": "7.4" + "platform": { + "php": ">=5.6.0" }, - "plugin-api-version": "1.1.0" + "platform-dev": [] } diff --git a/advancedcontentfilter/lang/bg/messages.po b/advancedcontentfilter/lang/bg/messages.po deleted file mode 100644 index 8c65990e..00000000 --- a/advancedcontentfilter/lang/bg/messages.po +++ /dev/null @@ -1,161 +0,0 @@ -# ADDON advancedcontentfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica advancedcontentfilter addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-11 08:54-0400\n" -"PO-Revision-Date: 2018-05-24 06:41+0000\n" -"Language-Team: Bulgarian (https://app.transifex.com/Friendica/teams/12172/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: advancedcontentfilter.php:154 -#, php-format -msgid "Filtered by rule: %s" -msgstr "" - -#: advancedcontentfilter.php:170 advancedcontentfilter.php:225 -msgid "Advanced Content Filter" -msgstr "" - -#: advancedcontentfilter.php:224 -msgid "Back to Addon Settings" -msgstr "" - -#: advancedcontentfilter.php:226 -msgid "Add a Rule" -msgstr "" - -#: advancedcontentfilter.php:227 -msgid "Help" -msgstr "" - -#: advancedcontentfilter.php:228 -msgid "" -"Add and manage your personal content filter rules in this screen. Rules have" -" a name and an arbitrary expression that will be matched against post data. " -"For a complete reference of the available operations and variables, check " -"the help page." -msgstr "" - -#: advancedcontentfilter.php:229 -msgid "Your rules" -msgstr "" - -#: advancedcontentfilter.php:230 -msgid "" -"You have no rules yet! Start adding one by clicking on the button above next" -" to the title." -msgstr "" - -#: advancedcontentfilter.php:231 -msgid "Disabled" -msgstr "" - -#: advancedcontentfilter.php:232 -msgid "Enabled" -msgstr "" - -#: advancedcontentfilter.php:233 -msgid "Disable this rule" -msgstr "" - -#: advancedcontentfilter.php:234 -msgid "Enable this rule" -msgstr "" - -#: advancedcontentfilter.php:235 -msgid "Edit this rule" -msgstr "" - -#: advancedcontentfilter.php:236 -msgid "Edit the rule" -msgstr "" - -#: advancedcontentfilter.php:237 -msgid "Save this rule" -msgstr "" - -#: advancedcontentfilter.php:238 -msgid "Delete this rule" -msgstr "" - -#: advancedcontentfilter.php:239 -msgid "Rule" -msgstr "" - -#: advancedcontentfilter.php:240 -msgid "Close" -msgstr "" - -#: advancedcontentfilter.php:241 -msgid "Add new rule" -msgstr "" - -#: advancedcontentfilter.php:242 -msgid "Rule Name" -msgstr "" - -#: advancedcontentfilter.php:243 -msgid "Rule Expression" -msgstr "" - -#: advancedcontentfilter.php:244 -msgid "Cancel" -msgstr "" - -#: advancedcontentfilter.php:295 -msgid "This addon requires this node having at least one post" -msgstr "" - -#: advancedcontentfilter.php:325 advancedcontentfilter.php:336 -#: advancedcontentfilter.php:347 advancedcontentfilter.php:383 -#: advancedcontentfilter.php:414 advancedcontentfilter.php:437 -msgid "You must be logged in to use this method" -msgstr "" - -#: advancedcontentfilter.php:351 advancedcontentfilter.php:387 -#: advancedcontentfilter.php:418 -msgid "Invalid form security token, please refresh the page." -msgstr "" - -#: advancedcontentfilter.php:363 -msgid "The rule name and expression are required." -msgstr "" - -#: advancedcontentfilter.php:377 -msgid "Rule successfully added" -msgstr "" - -#: advancedcontentfilter.php:391 advancedcontentfilter.php:422 -msgid "Rule doesn't exist or doesn't belong to you." -msgstr "" - -#: advancedcontentfilter.php:408 -msgid "Rule successfully updated" -msgstr "" - -#: advancedcontentfilter.php:431 -msgid "Rule successfully deleted" -msgstr "" - -#: advancedcontentfilter.php:441 -msgid "Missing argument: guid." -msgstr "" - -#: advancedcontentfilter.php:449 -#, php-format -msgid "Unknown post with guid: %s" -msgstr "" - -#: src/middlewares.php:49 -msgid "Method not found" -msgstr "" diff --git a/advancedcontentfilter/lang/bg/strings.php b/advancedcontentfilter/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/advancedcontentfilter/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && n < 20) ? 2 : 3;\n" - -#: advancedcontentfilter.php:154 -#, php-format -msgid "Filtered by rule: %s" -msgstr "" - -#: advancedcontentfilter.php:170 advancedcontentfilter.php:225 -msgid "Advanced Content Filter" -msgstr "" - -#: advancedcontentfilter.php:224 -msgid "Back to Addon Settings" -msgstr "" - -#: advancedcontentfilter.php:226 -msgid "Add a Rule" -msgstr "" - -#: advancedcontentfilter.php:227 -msgid "Help" -msgstr "" - -#: advancedcontentfilter.php:228 -msgid "" -"Add and manage your personal content filter rules in this screen. Rules have" -" a name and an arbitrary expression that will be matched against post data. " -"For a complete reference of the available operations and variables, check " -"the help page." -msgstr "" - -#: advancedcontentfilter.php:229 -msgid "Your rules" -msgstr "" - -#: advancedcontentfilter.php:230 -msgid "" -"You have no rules yet! Start adding one by clicking on the button above next" -" to the title." -msgstr "" - -#: advancedcontentfilter.php:231 -msgid "Disabled" -msgstr "" - -#: advancedcontentfilter.php:232 -msgid "Enabled" -msgstr "" - -#: advancedcontentfilter.php:233 -msgid "Disable this rule" -msgstr "" - -#: advancedcontentfilter.php:234 -msgid "Enable this rule" -msgstr "" - -#: advancedcontentfilter.php:235 -msgid "Edit this rule" -msgstr "" - -#: advancedcontentfilter.php:236 -msgid "Edit the rule" -msgstr "" - -#: advancedcontentfilter.php:237 -msgid "Save this rule" -msgstr "" - -#: advancedcontentfilter.php:238 -msgid "Delete this rule" -msgstr "" - -#: advancedcontentfilter.php:239 -msgid "Rule" -msgstr "" - -#: advancedcontentfilter.php:240 -msgid "Close" -msgstr "" - -#: advancedcontentfilter.php:241 -msgid "Add new rule" -msgstr "" - -#: advancedcontentfilter.php:242 -msgid "Rule Name" -msgstr "" - -#: advancedcontentfilter.php:243 -msgid "Rule Expression" -msgstr "" - -#: advancedcontentfilter.php:244 -msgid "Cancel" -msgstr "" - -#: advancedcontentfilter.php:295 -msgid "This addon requires this node having at least one post" -msgstr "" - -#: advancedcontentfilter.php:325 advancedcontentfilter.php:336 -#: advancedcontentfilter.php:347 advancedcontentfilter.php:383 -#: advancedcontentfilter.php:414 advancedcontentfilter.php:437 -msgid "You must be logged in to use this method" -msgstr "" - -#: advancedcontentfilter.php:351 advancedcontentfilter.php:387 -#: advancedcontentfilter.php:418 -msgid "Invalid form security token, please refresh the page." -msgstr "" - -#: advancedcontentfilter.php:363 -msgid "The rule name and expression are required." -msgstr "" - -#: advancedcontentfilter.php:377 -msgid "Rule successfully added" -msgstr "" - -#: advancedcontentfilter.php:391 advancedcontentfilter.php:422 -msgid "Rule doesn't exist or doesn't belong to you." -msgstr "" - -#: advancedcontentfilter.php:408 -msgid "Rule successfully updated" -msgstr "" - -#: advancedcontentfilter.php:431 -msgid "Rule successfully deleted" -msgstr "" - -#: advancedcontentfilter.php:441 -msgid "Missing argument: guid." -msgstr "" - -#: advancedcontentfilter.php:449 -#, php-format -msgid "Unknown post with guid: %s" -msgstr "" - -#: src/middlewares.php:49 -msgid "Method not found" -msgstr "" diff --git a/advancedcontentfilter/lang/gd/strings.php b/advancedcontentfilter/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/advancedcontentfilter/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/advancedcontentfilter/lang/is/messages.po b/advancedcontentfilter/lang/is/messages.po deleted file mode 100644 index 4c50158d..00000000 --- a/advancedcontentfilter/lang/is/messages.po +++ /dev/null @@ -1,161 +0,0 @@ -# ADDON advancedcontentfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica advancedcontentfilter addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-11 08:54-0400\n" -"PO-Revision-Date: 2018-05-24 06:41+0000\n" -"Language-Team: Icelandic (https://app.transifex.com/Friendica/teams/12172/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: advancedcontentfilter.php:154 -#, php-format -msgid "Filtered by rule: %s" -msgstr "" - -#: advancedcontentfilter.php:170 advancedcontentfilter.php:225 -msgid "Advanced Content Filter" -msgstr "" - -#: advancedcontentfilter.php:224 -msgid "Back to Addon Settings" -msgstr "" - -#: advancedcontentfilter.php:226 -msgid "Add a Rule" -msgstr "" - -#: advancedcontentfilter.php:227 -msgid "Help" -msgstr "" - -#: advancedcontentfilter.php:228 -msgid "" -"Add and manage your personal content filter rules in this screen. Rules have" -" a name and an arbitrary expression that will be matched against post data. " -"For a complete reference of the available operations and variables, check " -"the help page." -msgstr "" - -#: advancedcontentfilter.php:229 -msgid "Your rules" -msgstr "" - -#: advancedcontentfilter.php:230 -msgid "" -"You have no rules yet! Start adding one by clicking on the button above next" -" to the title." -msgstr "" - -#: advancedcontentfilter.php:231 -msgid "Disabled" -msgstr "" - -#: advancedcontentfilter.php:232 -msgid "Enabled" -msgstr "" - -#: advancedcontentfilter.php:233 -msgid "Disable this rule" -msgstr "" - -#: advancedcontentfilter.php:234 -msgid "Enable this rule" -msgstr "" - -#: advancedcontentfilter.php:235 -msgid "Edit this rule" -msgstr "" - -#: advancedcontentfilter.php:236 -msgid "Edit the rule" -msgstr "" - -#: advancedcontentfilter.php:237 -msgid "Save this rule" -msgstr "" - -#: advancedcontentfilter.php:238 -msgid "Delete this rule" -msgstr "" - -#: advancedcontentfilter.php:239 -msgid "Rule" -msgstr "" - -#: advancedcontentfilter.php:240 -msgid "Close" -msgstr "" - -#: advancedcontentfilter.php:241 -msgid "Add new rule" -msgstr "" - -#: advancedcontentfilter.php:242 -msgid "Rule Name" -msgstr "" - -#: advancedcontentfilter.php:243 -msgid "Rule Expression" -msgstr "" - -#: advancedcontentfilter.php:244 -msgid "Cancel" -msgstr "" - -#: advancedcontentfilter.php:295 -msgid "This addon requires this node having at least one post" -msgstr "" - -#: advancedcontentfilter.php:325 advancedcontentfilter.php:336 -#: advancedcontentfilter.php:347 advancedcontentfilter.php:383 -#: advancedcontentfilter.php:414 advancedcontentfilter.php:437 -msgid "You must be logged in to use this method" -msgstr "" - -#: advancedcontentfilter.php:351 advancedcontentfilter.php:387 -#: advancedcontentfilter.php:418 -msgid "Invalid form security token, please refresh the page." -msgstr "" - -#: advancedcontentfilter.php:363 -msgid "The rule name and expression are required." -msgstr "" - -#: advancedcontentfilter.php:377 -msgid "Rule successfully added" -msgstr "" - -#: advancedcontentfilter.php:391 advancedcontentfilter.php:422 -msgid "Rule doesn't exist or doesn't belong to you." -msgstr "" - -#: advancedcontentfilter.php:408 -msgid "Rule successfully updated" -msgstr "" - -#: advancedcontentfilter.php:431 -msgid "Rule successfully deleted" -msgstr "" - -#: advancedcontentfilter.php:441 -msgid "Missing argument: guid." -msgstr "" - -#: advancedcontentfilter.php:449 -#, php-format -msgid "Unknown post with guid: %s" -msgstr "" - -#: src/middlewares.php:49 -msgid "Method not found" -msgstr "" diff --git a/advancedcontentfilter/lang/is/strings.php b/advancedcontentfilter/lang/is/strings.php deleted file mode 100644 index 975c341e..00000000 --- a/advancedcontentfilter/lang/is/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2018 -# Sylke Vicious , 2023 +# Sylke Vicious , 2021 # #, fuzzy msgid "" @@ -14,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-11 08:54-0400\n" "PO-Revision-Date: 2018-05-24 06:41+0000\n" -"Last-Translator: Sylke Vicious , 2023\n" +"Last-Translator: Sylke Vicious , 2021\n" "Language-Team: Italian (https://app.transifex.com/Friendica/teams/12172/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -125,7 +125,7 @@ msgstr "Annulla" #: advancedcontentfilter.php:295 msgid "This addon requires this node having at least one post" -msgstr "Questo addon richiede che questo nodo abbia almeno un messaggio" +msgstr "" #: advancedcontentfilter.php:325 advancedcontentfilter.php:336 #: advancedcontentfilter.php:347 advancedcontentfilter.php:383 diff --git a/advancedcontentfilter/lang/it/strings.php b/advancedcontentfilter/lang/it/strings.php index d47d7a5a..5cc01739 100644 --- a/advancedcontentfilter/lang/it/strings.php +++ b/advancedcontentfilter/lang/it/strings.php @@ -27,7 +27,6 @@ $a->strings['Add new rule'] = 'Aggiungi nuova regola'; $a->strings['Rule Name'] = 'Nome Regola'; $a->strings['Rule Expression'] = 'Espressione Regola'; $a->strings['Cancel'] = 'Annulla'; -$a->strings['This addon requires this node having at least one post'] = 'Questo addon richiede che questo nodo abbia almeno un messaggio'; $a->strings['You must be logged in to use this method'] = 'Devi essere autenticato per usare questo metodo'; $a->strings['Invalid form security token, please refresh the page.'] = 'Token di sicurezza invalido, aggiorna la pagina.'; $a->strings['The rule name and expression are required.'] = 'Il nome e l\'espressione della regola sono richiesti.'; diff --git a/advancedcontentfilter/lang/pl/messages.po b/advancedcontentfilter/lang/pl/messages.po index 9f0483c6..5fc9ca65 100644 --- a/advancedcontentfilter/lang/pl/messages.po +++ b/advancedcontentfilter/lang/pl/messages.po @@ -6,7 +6,7 @@ # Translators: # Waldemar Stoczkowski, 2018 # Joe Doe, 2021 -# Bartosz Kozień, 2025 +# Piotr Strębski , 2022 # #, fuzzy msgid "" @@ -15,8 +15,8 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-05-11 08:54-0400\n" "PO-Revision-Date: 2018-05-24 06:41+0000\n" -"Last-Translator: Bartosz Kozień, 2025\n" -"Language-Team: Polish (https://app.transifex.com/Friendica/teams/12172/pl/)\n" +"Last-Translator: Piotr Strębski , 2022\n" +"Language-Team: Polish (https://www.transifex.com/Friendica/teams/12172/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -126,7 +126,7 @@ msgstr "Anuluj" #: advancedcontentfilter.php:295 msgid "This addon requires this node having at least one post" -msgstr "Ten dodatek wymaga, aby ta instancja miała co najmniej jeden wpis" +msgstr "Ten dodatek wymaga, aby ten węzeł miał co najmniej jeden wpis" #: advancedcontentfilter.php:325 advancedcontentfilter.php:336 #: advancedcontentfilter.php:347 advancedcontentfilter.php:383 diff --git a/advancedcontentfilter/lang/pl/strings.php b/advancedcontentfilter/lang/pl/strings.php index 57215c65..625819c1 100644 --- a/advancedcontentfilter/lang/pl/strings.php +++ b/advancedcontentfilter/lang/pl/strings.php @@ -27,7 +27,7 @@ $a->strings['Add new rule'] = 'Dodaj nową regułę'; $a->strings['Rule Name'] = 'Nazwa reguły'; $a->strings['Rule Expression'] = 'Wyrażanie reguły'; $a->strings['Cancel'] = 'Anuluj'; -$a->strings['This addon requires this node having at least one post'] = 'Ten dodatek wymaga, aby ta instancja miała co najmniej jeden wpis'; +$a->strings['This addon requires this node having at least one post'] = 'Ten dodatek wymaga, aby ten węzeł miał co najmniej jeden wpis'; $a->strings['You must be logged in to use this method'] = 'Musisz być zalogowany, aby skorzystać z tej metody'; $a->strings['Invalid form security token, please refresh the page.'] = 'Nieprawidłowy token zabezpieczający formularz, odśwież stronę.'; $a->strings['The rule name and expression are required.'] = 'Nazwa reguły i wyrażenie są wymagane.'; diff --git a/advancedcontentfilter/src/middlewares.php b/advancedcontentfilter/src/middlewares.php new file mode 100644 index 00000000..dffb9363 --- /dev/null +++ b/advancedcontentfilter/src/middlewares.php @@ -0,0 +1,51 @@ +. + * + */ + +use Friendica\DI; + +$container = $slim->getContainer(); + +// Error handler based off https://stackoverflow.com/a/48135009/757392 +$container['errorHandler'] = function () { + return function(Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, Exception $exception) + { + $responseCode = 500; + + if (is_a($exception, 'Friendica\Network\HTTPException')) { + $responseCode = $exception->getCode(); + } + + $errors['message'] = $exception->getMessage(); + + $errors['responseCode'] = $responseCode; + + return $response + ->withStatus($responseCode) + ->withJson($errors); + }; +}; + +$container['notFoundHandler'] = function () { + return function () + { + throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Method not found')); + }; +}; diff --git a/monolog/static/dependencies.config.php b/advancedcontentfilter/src/routes.php similarity index 52% rename from monolog/static/dependencies.config.php rename to advancedcontentfilter/src/routes.php index f992d69c..09077bda 100644 --- a/monolog/static/dependencies.config.php +++ b/advancedcontentfilter/src/routes.php @@ -1,6 +1,6 @@ [ - 'instanceOf' => \Friendica\Addon\monolog\src\Factory\MonologFactory::class, - 'call' => null, - ], -]; +/* @var $slim Slim\App */ +$slim->group('/advancedcontentfilter/api', function () { + /* @var $this Slim\App */ + $this->group('/rules', function () { + /* @var $this Slim\App */ + $this->get('', 'advancedcontentfilter_get_rules'); + $this->post('', 'advancedcontentfilter_post_rules'); + + $this->get('/{id}', 'advancedcontentfilter_get_rules_id'); + $this->put('/{id}', 'advancedcontentfilter_put_rules_id'); + $this->delete('/{id}', 'advancedcontentfilter_delete_rules_id'); + }); + + $this->group('/variables', function () { + /* @var $this Slim\App */ + $this->get('/{guid}', 'advancedcontentfilter_get_variables_guid'); + }); +}); diff --git a/advancedcontentfilter/templates/settings.tpl b/advancedcontentfilter/templates/settings.tpl index 8b82e595..c9dfbe3a 100644 --- a/advancedcontentfilter/templates/settings.tpl +++ b/advancedcontentfilter/templates/settings.tpl @@ -3,7 +3,7 @@
+ +EOT; +} + +function blockem_item_photo_menu(array &$b) +{ + global $blockem_words; + + if (!DI::userSession()->getLocalUserId() || $b['item']['self']) { + return; + } + + $blocked = false; + $author = $b['item']['author-link']; + + if (!empty($blockem_words)) { + foreach($blockem_words as $bloke) { + if (Strings::compareLink($bloke,$author)) { + $blocked = true; + break; + } + } + } + if ($blocked) { + $b['menu'][DI::l10n()->t('Unblock Author')] = 'javascript:blockemUnblock(\'' . $author . '\');'; + } else { + $b['menu'][DI::l10n()->t('Block Author')] = 'javascript:blockemBlock(\'' . $author . '\');'; + } +} + +/** + * This is a statement rather than an actual function definition. The simple + * existence of this method is checked to figure out if the addon offers a + * module. + */ +function blockem_module() {} + +function blockem_init() +{ + if (!DI::userSession()->getLocalUserId()) { + return; + } + + $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'blockem', 'words'); + + if (array_key_exists('block', $_GET) && $_GET['block']) { + if (strlen($words)) { + $words .= ','; + } + + $words .= trim($_GET['block']); + } + + if (array_key_exists('unblock', $_GET) && $_GET['unblock']) { + $arr = explode(',',$words); + $newarr = []; + + if (count($arr)) { + foreach ($arr as $x) { + if (!Strings::compareLink(trim($x), trim($_GET['unblock']))) { + $newarr[] = $x; + } + } + } + + $words = implode(',', $newarr); + } + + DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'blockem', 'words', $words); + exit(); +} diff --git a/blockem/lang/C/messages.po b/blockem/lang/C/messages.po new file mode 100644 index 00000000..64bb3fc4 --- /dev/null +++ b/blockem/lang/C/messages.po @@ -0,0 +1,45 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "" + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "" + +#: blockem.php:45 +msgid "Blockem" +msgstr "" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "" + +#: blockem.php:185 +msgid "Block Author" +msgstr "" diff --git a/blockem/lang/ar/messages.po b/blockem/lang/ar/messages.po new file mode 100644 index 00000000..c9d6d5f9 --- /dev/null +++ b/blockem/lang/ar/messages.po @@ -0,0 +1,52 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# abidin toumi , 2021 +# Farida Khalaf , 2021 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"PO-Revision-Date: 2021-10-29 08:15+0000\n" +"Last-Translator: abidin toumi \n" +"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ar\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: blockem.php:42 blockem.php:46 +msgid "Blockem" +msgstr "احجبه
" + +#: blockem.php:50 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "إخفاء محتوى المستخدم عن طريق تصغير المشاركات. و استبدال الصورة الرمزية الخاصة بهم بصورة عامة." + +#: blockem.php:51 +msgid "Comma separated profile URLS:" +msgstr "عناوين الملفات الشخصية مفصولة بفواصل:" + +#: blockem.php:55 +msgid "Save Settings" +msgstr "احفظ الإعدادات" + +#: blockem.php:131 +#, php-format +msgid "Filtered user: %s" +msgstr "ترشيح المستخدم :1%s" + +#: blockem.php:190 +msgid "Unblock Author" +msgstr "ألغ الحجب عن المدون" + +#: blockem.php:192 +msgid "Block Author" +msgstr "احجب المدون" diff --git a/blockem/lang/ar/strings.php b/blockem/lang/ar/strings.php new file mode 100644 index 00000000..0f58fa22 --- /dev/null +++ b/blockem/lang/ar/strings.php @@ -0,0 +1,14 @@ +=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; } +}} +$a->strings['Blockem'] = 'احجبه
'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'إخفاء محتوى المستخدم عن طريق تصغير المشاركات. و استبدال الصورة الرمزية الخاصة بهم بصورة عامة.'; +$a->strings['Comma separated profile URLS:'] = 'عناوين الملفات الشخصية مفصولة بفواصل:'; +$a->strings['Save Settings'] = 'احفظ الإعدادات'; +$a->strings['Filtered user: %s'] = 'ترشيح المستخدم :1%s'; +$a->strings['Unblock Author'] = 'ألغ الحجب عن المدون'; +$a->strings['Block Author'] = 'احجب المدون'; diff --git a/blockem/lang/ca/messages.po b/blockem/lang/ca/messages.po new file mode 100644 index 00000000..6d4c3468 --- /dev/null +++ b/blockem/lang/ca/messages.po @@ -0,0 +1,59 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Joan Bar , 2019 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 10:23+0200\n" +"PO-Revision-Date: 2019-10-14 11:50+0000\n" +"Last-Translator: Joan Bar \n" +"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:54 blockem.php:58 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:62 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Amaga el contingut de l'usuari mitjançant la publicació col·lapsada. També substitueix el seu avatar per una imatge genèrica" + +#: blockem.php:63 +msgid "Comma separated profile URLS:" +msgstr "URL de perfil separats per comes:" + +#: blockem.php:67 +msgid "Save Settings" +msgstr "Desa la configuració" + +#: blockem.php:81 +msgid "BLOCKEM Settings saved." +msgstr "S'ha desat la configuració de BLOCKEM." + +#: blockem.php:143 +#, php-format +msgid "Filtered user: %s" +msgstr "Usuari filtrat:%s" + +#: blockem.php:202 +msgid "Unblock Author" +msgstr "Desbloca l'autor" + +#: blockem.php:204 +msgid "Block Author" +msgstr "Autor de bloc" + +#: blockem.php:244 +msgid "blockem settings updated" +msgstr "S'ha actualitzat la configuració de blockem" diff --git a/blockem/lang/ca/strings.php b/blockem/lang/ca/strings.php new file mode 100644 index 00000000..be4deede --- /dev/null +++ b/blockem/lang/ca/strings.php @@ -0,0 +1,16 @@ +strings['Blockem'] = 'Blockem'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Amaga el contingut de l\'usuari mitjançant la publicació col·lapsada. També substitueix el seu avatar per una imatge genèrica'; +$a->strings['Comma separated profile URLS:'] = 'URL de perfil separats per comes:'; +$a->strings['Save Settings'] = 'Desa la configuració'; +$a->strings['BLOCKEM Settings saved.'] = 'S\'ha desat la configuració de BLOCKEM.'; +$a->strings['Filtered user: %s'] = 'Usuari filtrat:%s'; +$a->strings['Unblock Author'] = 'Desbloca l\'autor'; +$a->strings['Block Author'] = 'Autor de bloc'; +$a->strings['blockem settings updated'] = 'S\'ha actualitzat la configuració de blockem'; diff --git a/blockem/lang/cs/messages.po b/blockem/lang/cs/messages.po new file mode 100644 index 00000000..fb90a2ca --- /dev/null +++ b/blockem/lang/cs/messages.po @@ -0,0 +1,60 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Aditoo, 2018 +# michal_s , 2014 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 10:23+0200\n" +"PO-Revision-Date: 2018-08-18 12:25+0000\n" +"Last-Translator: Aditoo\n" +"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: cs\n" +"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" + +#: blockem.php:54 blockem.php:58 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:62 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Skrývá uživatelský obsah zabalením příspěvků. Navíc nahrazuje avatar generickým obrázkem." + +#: blockem.php:63 +msgid "Comma separated profile URLS:" +msgstr "URL adresy profilů, oddělené čárkami:" + +#: blockem.php:67 +msgid "Save Settings" +msgstr "Uložit nastavení" + +#: blockem.php:81 +msgid "BLOCKEM Settings saved." +msgstr "Nastavení BLOCKEM uložena." + +#: blockem.php:143 +#, php-format +msgid "Filtered user: %s" +msgstr "Filtrovaný uživatel: %s" + +#: blockem.php:202 +msgid "Unblock Author" +msgstr "Odblokovat autora" + +#: blockem.php:204 +msgid "Block Author" +msgstr "Zablokovat autora" + +#: blockem.php:244 +msgid "blockem settings updated" +msgstr "nastavení blockem aktualizována" diff --git a/blockem/lang/cs/strings.php b/blockem/lang/cs/strings.php new file mode 100644 index 00000000..ac32d78f --- /dev/null +++ b/blockem/lang/cs/strings.php @@ -0,0 +1,16 @@ += 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; } +}} +$a->strings['Blockem'] = 'Blockem'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Skrývá uživatelský obsah zabalením příspěvků. Navíc nahrazuje avatar generickým obrázkem.'; +$a->strings['Comma separated profile URLS:'] = 'URL adresy profilů, oddělené čárkami:'; +$a->strings['Save Settings'] = 'Uložit nastavení'; +$a->strings['BLOCKEM Settings saved.'] = 'Nastavení BLOCKEM uložena.'; +$a->strings['Filtered user: %s'] = 'Filtrovaný uživatel: %s'; +$a->strings['Unblock Author'] = 'Odblokovat autora'; +$a->strings['Block Author'] = 'Zablokovat autora'; +$a->strings['blockem settings updated'] = 'nastavení blockem aktualizována'; diff --git a/blockem/lang/da-dk/messages.po b/blockem/lang/da-dk/messages.po new file mode 100644 index 00000000..e4a80bff --- /dev/null +++ b/blockem/lang/da-dk/messages.po @@ -0,0 +1,47 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Anton , 2022 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: 2014-06-22 11:20+0000\n" +"Last-Translator: Anton , 2022\n" +"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: da_DK\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Skjul brugers indhold ved at kollapse deres opslag. Erstatter også deres avatar med et generisk billede." + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "Kommasepareret liste over profil-URL's:" + +#: blockem.php:45 +msgid "Blockem" +msgstr "Blokdem" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "Filtreret bruger: %s" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "Fjern blokering af forfatter" + +#: blockem.php:185 +msgid "Block Author" +msgstr "Blokér forfatter" diff --git a/blockem/lang/da-dk/strings.php b/blockem/lang/da-dk/strings.php new file mode 100644 index 00000000..e99144ec --- /dev/null +++ b/blockem/lang/da-dk/strings.php @@ -0,0 +1,13 @@ +strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Skjul brugers indhold ved at kollapse deres opslag. Erstatter også deres avatar med et generisk billede.'; +$a->strings['Comma separated profile URLS:'] = 'Kommasepareret liste over profil-URL\'s:'; +$a->strings['Blockem'] = 'Blokdem'; +$a->strings['Filtered user: %s'] = 'Filtreret bruger: %s'; +$a->strings['Unblock Author'] = 'Fjern blokering af forfatter'; +$a->strings['Block Author'] = 'Blokér forfatter'; diff --git a/blockem/lang/de/messages.po b/blockem/lang/de/messages.po new file mode 100644 index 00000000..d1e2f704 --- /dev/null +++ b/blockem/lang/de/messages.po @@ -0,0 +1,50 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Andreas H., 2018 +# Tobias Diekershoff , 2014 +# Tobias Diekershoff , 2018 +# Ulf Rompe , 2019 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: 2021-12-22 15:27+0000\n" +"Last-Translator: Transifex Bot <>\n" +"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Verbirgt Inhalte von Benutzern durch Zusammenklappen der Beiträge. Des Weiteren wird das Profilbild durch einen generischen Avatar ersetzt." + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "Komma-separierte Liste von Profil-URLs" + +#: blockem.php:45 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "Gefilterte Person: %s" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "Autor freischalten" + +#: blockem.php:185 +msgid "Block Author" +msgstr "Autor blockieren" diff --git a/blockem/lang/de/strings.php b/blockem/lang/de/strings.php new file mode 100644 index 00000000..109af368 --- /dev/null +++ b/blockem/lang/de/strings.php @@ -0,0 +1,13 @@ +strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Verbirgt Inhalte von Benutzern durch Zusammenklappen der Beiträge. Des Weiteren wird das Profilbild durch einen generischen Avatar ersetzt.'; +$a->strings['Comma separated profile URLS:'] = 'Komma-separierte Liste von Profil-URLs'; +$a->strings['Blockem'] = 'Blockem'; +$a->strings['Filtered user: %s'] = 'Gefilterte Person: %s'; +$a->strings['Unblock Author'] = 'Autor freischalten'; +$a->strings['Block Author'] = 'Autor blockieren'; diff --git a/blockem/lang/en-gb/messages.po b/blockem/lang/en-gb/messages.po new file mode 100644 index 00000000..6bcc7b9b --- /dev/null +++ b/blockem/lang/en-gb/messages.po @@ -0,0 +1,59 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Andy H3 , 2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-09 13:00+0100\n" +"PO-Revision-Date: 2018-03-15 14:10+0000\n" +"Last-Translator: Andy H3 \n" +"Language-Team: English (United Kingdom) (http://www.transifex.com/Friendica/friendica/language/en_GB/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en_GB\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:51 blockem.php:55 +msgid "\"Blockem\"" +msgstr "\"Blockem\"" + +#: blockem.php:59 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Hides user's content by collapsing posts. Also replaces their avatar with generic image." + +#: blockem.php:60 +msgid "Comma separated profile URLS:" +msgstr "Comma separated profile URLs:" + +#: blockem.php:64 +msgid "Save Settings" +msgstr "Save settings" + +#: blockem.php:77 +msgid "BLOCKEM Settings saved." +msgstr "Blockem settings saved." + +#: blockem.php:140 +#, php-format +msgid "Hidden content by %s - Click to open/close" +msgstr "Hidden content by %s - Reveal/hide" + +#: blockem.php:193 +msgid "Unblock Author" +msgstr "Unblock author" + +#: blockem.php:195 +msgid "Block Author" +msgstr "Block author" + +#: blockem.php:227 +msgid "blockem settings updated" +msgstr "Blockem settings updated" diff --git a/blockem/lang/en-gb/strings.php b/blockem/lang/en-gb/strings.php new file mode 100644 index 00000000..0b9d9e4b --- /dev/null +++ b/blockem/lang/en-gb/strings.php @@ -0,0 +1,16 @@ +strings['"Blockem"'] = '"Blockem"'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'; +$a->strings['Comma separated profile URLS:'] = 'Comma separated profile URLs:'; +$a->strings['Save Settings'] = 'Save settings'; +$a->strings['BLOCKEM Settings saved.'] = 'Blockem settings saved.'; +$a->strings['Hidden content by %s - Click to open/close'] = 'Hidden content by %s - Reveal/hide'; +$a->strings['Unblock Author'] = 'Unblock author'; +$a->strings['Block Author'] = 'Block author'; +$a->strings['blockem settings updated'] = 'Blockem settings updated'; diff --git a/blockem/lang/en-us/messages.po b/blockem/lang/en-us/messages.po new file mode 100644 index 00000000..1d64620b --- /dev/null +++ b/blockem/lang/en-us/messages.po @@ -0,0 +1,61 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Adam Clark , 2018 +# Andy H3 , 2018 +# R C , 2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-01 11:11-0400\n" +"PO-Revision-Date: 2018-06-13 02:40+0000\n" +"Last-Translator: R C \n" +"Language-Team: English (United States) (http://www.transifex.com/Friendica/friendica/language/en_US/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en_US\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:52 blockem.php:56 +msgid "\"Blockem\"" +msgstr "Blockem" + +#: blockem.php:60 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Hides user's content by collapsing posts. Also replaces their avatar with generic image." + +#: blockem.php:61 +msgid "Comma separated profile URLS:" +msgstr "Comma-separated profile URLs:" + +#: blockem.php:65 +msgid "Save Settings" +msgstr "Save settings" + +#: blockem.php:78 +msgid "BLOCKEM Settings saved." +msgstr "Blockem settings saved." + +#: blockem.php:136 +#, php-format +msgid "Filtered user: %s" +msgstr "Filtered user: %s" + +#: blockem.php:189 +msgid "Unblock Author" +msgstr "Unblock author" + +#: blockem.php:191 +msgid "Block Author" +msgstr "Block author" + +#: blockem.php:223 +msgid "blockem settings updated" +msgstr "Blockem settings updated" diff --git a/blockem/lang/en-us/strings.php b/blockem/lang/en-us/strings.php new file mode 100644 index 00000000..fd76a1bc --- /dev/null +++ b/blockem/lang/en-us/strings.php @@ -0,0 +1,16 @@ +strings['"Blockem"'] = 'Blockem'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'; +$a->strings['Comma separated profile URLS:'] = 'Comma-separated profile URLs:'; +$a->strings['Save Settings'] = 'Save settings'; +$a->strings['BLOCKEM Settings saved.'] = 'Blockem settings saved.'; +$a->strings['Filtered user: %s'] = 'Filtered user: %s'; +$a->strings['Unblock Author'] = 'Unblock author'; +$a->strings['Block Author'] = 'Block author'; +$a->strings['blockem settings updated'] = 'Blockem settings updated'; diff --git a/blockem/lang/eo/strings.php b/blockem/lang/eo/strings.php new file mode 100644 index 00000000..b6116507 --- /dev/null +++ b/blockem/lang/eo/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\" Agordoj"; +$a->strings["Comma separated profile URLS to block"] = "Blokotaj URL adresoj, disigita per komo"; +$a->strings["Submit"] = "Sendi"; +$a->strings["BLOCKEM Settings saved."] = "Konservis Agordojn de BLOCKEM."; +$a->strings["Blocked %s - Click to open/close"] = "%s blokita - Klaku por malfermi/fermi"; +$a->strings["Unblock Author"] = "Malbloki Aŭtoron"; +$a->strings["Block Author"] = "Bloki Aŭtoron"; +$a->strings["blockem settings updated"] = "Ĝisdatigis la blockem agordojn"; diff --git a/blockem/lang/es/messages.po b/blockem/lang/es/messages.po new file mode 100644 index 00000000..0b59921e --- /dev/null +++ b/blockem/lang/es/messages.po @@ -0,0 +1,53 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Albert, 2018 +# Senex Petrovic , 2021 +# Tupambae.org, 2016 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"PO-Revision-Date: 2021-04-01 09:45+0000\n" +"Last-Translator: Senex Petrovic \n" +"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:42 blockem.php:46 +msgid "Blockem" +msgstr "Blockem (Bloquealos)" + +#: blockem.php:50 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Oculta el contenido del usuario al colapsar las publicaciones. También reemplaza su avatar con una imagen genérica." + +#: blockem.php:51 +msgid "Comma separated profile URLS:" +msgstr "URLs de perfil separadas por comas:" + +#: blockem.php:55 +msgid "Save Settings" +msgstr "Guardar configuración" + +#: blockem.php:131 +#, php-format +msgid "Filtered user: %s" +msgstr "Usuario filtrado: %s" + +#: blockem.php:190 +msgid "Unblock Author" +msgstr "Desbloquear autor" + +#: blockem.php:192 +msgid "Block Author" +msgstr "Bloquear autor" diff --git a/blockem/lang/es/strings.php b/blockem/lang/es/strings.php new file mode 100644 index 00000000..7d1de601 --- /dev/null +++ b/blockem/lang/es/strings.php @@ -0,0 +1,14 @@ +strings['Blockem'] = 'Blockem (Bloquealos)'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Oculta el contenido del usuario al colapsar las publicaciones. También reemplaza su avatar con una imagen genérica.'; +$a->strings['Comma separated profile URLS:'] = 'URLs de perfil separadas por comas:'; +$a->strings['Save Settings'] = 'Guardar configuración'; +$a->strings['Filtered user: %s'] = 'Usuario filtrado: %s'; +$a->strings['Unblock Author'] = 'Desbloquear autor'; +$a->strings['Block Author'] = 'Bloquear autor'; diff --git a/blockem/lang/fi-fi/messages.po b/blockem/lang/fi-fi/messages.po new file mode 100644 index 00000000..4fac9aa7 --- /dev/null +++ b/blockem/lang/fi-fi/messages.po @@ -0,0 +1,60 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Kris, 2018 +# Kris, 2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-04-01 11:11-0400\n" +"PO-Revision-Date: 2018-04-18 14:44+0000\n" +"Last-Translator: Kris\n" +"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fi_FI\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:52 blockem.php:56 +msgid "\"Blockem\"" +msgstr "\"Blockem\"" + +#: blockem.php:60 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "" + +#: blockem.php:61 +msgid "Comma separated profile URLS:" +msgstr "Profiilien URL-osoitteet pilkulla erotettuina:" + +#: blockem.php:65 +msgid "Save Settings" +msgstr "Tallenna asetukset" + +#: blockem.php:78 +msgid "BLOCKEM Settings saved." +msgstr "Blockem -asetukset tallennettu" + +#: blockem.php:136 +#, php-format +msgid "Filtered user: %s" +msgstr "Suodatettu käyttäjä: %s" + +#: blockem.php:189 +msgid "Unblock Author" +msgstr "Poista kirjoittaja estolistalta" + +#: blockem.php:191 +msgid "Block Author" +msgstr "Lisää kirjoittaja estolistalle" + +#: blockem.php:223 +msgid "blockem settings updated" +msgstr "blockem -asetukset päivitetty" diff --git a/blockem/lang/fi-fi/strings.php b/blockem/lang/fi-fi/strings.php new file mode 100644 index 00000000..d15b4a56 --- /dev/null +++ b/blockem/lang/fi-fi/strings.php @@ -0,0 +1,15 @@ +strings['"Blockem"'] = '"Blockem"'; +$a->strings['Comma separated profile URLS:'] = 'Profiilien URL-osoitteet pilkulla erotettuina:'; +$a->strings['Save Settings'] = 'Tallenna asetukset'; +$a->strings['BLOCKEM Settings saved.'] = 'Blockem -asetukset tallennettu'; +$a->strings['Filtered user: %s'] = 'Suodatettu käyttäjä: %s'; +$a->strings['Unblock Author'] = 'Poista kirjoittaja estolistalta'; +$a->strings['Block Author'] = 'Lisää kirjoittaja estolistalle'; +$a->strings['blockem settings updated'] = 'blockem -asetukset päivitetty'; diff --git a/blockem/lang/fr/messages.po b/blockem/lang/fr/messages.po new file mode 100644 index 00000000..d3617290 --- /dev/null +++ b/blockem/lang/fr/messages.po @@ -0,0 +1,50 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Hypolite Petovan , 2016 +# Marie Olive , 2018 +# StefOfficiel , 2015 +# Vladimir Núñez , 2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: 2014-06-22 11:20+0000\n" +"Last-Translator: Vladimir Núñez , 2018\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fr\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Cache le contenu de l'utilisateur en contractant les publications. Remplace aussi leur avatar par une image générique." + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "URLs de profil séparées par des virgules:" + +#: blockem.php:45 +msgid "Blockem" +msgstr "Bloquez-les" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "Utilisateur filtré:%s" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "Débloquer l'Auteur" + +#: blockem.php:185 +msgid "Block Author" +msgstr "Bloquer l'Auteur" diff --git a/blockem/lang/fr/strings.php b/blockem/lang/fr/strings.php new file mode 100644 index 00000000..26b86f24 --- /dev/null +++ b/blockem/lang/fr/strings.php @@ -0,0 +1,13 @@ +strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Cache le contenu de l\'utilisateur en contractant les publications. Remplace aussi leur avatar par une image générique.'; +$a->strings['Comma separated profile URLS:'] = 'URLs de profil séparées par des virgules:'; +$a->strings['Blockem'] = 'Bloquez-les'; +$a->strings['Filtered user: %s'] = 'Utilisateur filtré:%s'; +$a->strings['Unblock Author'] = 'Débloquer l\'Auteur'; +$a->strings['Block Author'] = 'Bloquer l\'Auteur'; diff --git a/blockem/lang/hu/messages.po b/blockem/lang/hu/messages.po new file mode 100644 index 00000000..3a29b820 --- /dev/null +++ b/blockem/lang/hu/messages.po @@ -0,0 +1,47 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Balázs Úr, 2020 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: 2014-06-22 11:20+0000\n" +"Last-Translator: Balázs Úr, 2020\n" +"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: hu\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Elrejti a felhasználók tartalmát a bejegyzések összecsukásával. Ezenkívül lecseréli a profilképeiket egy általános képre." + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "Profil URL-ek vesszővel elválasztva:" + +#: blockem.php:45 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "Kiszűrt felhasználó: %s" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "Szerző tiltásának feloldása" + +#: blockem.php:185 +msgid "Block Author" +msgstr "Szerző tiltása" diff --git a/blockem/lang/hu/strings.php b/blockem/lang/hu/strings.php new file mode 100644 index 00000000..5a3abfec --- /dev/null +++ b/blockem/lang/hu/strings.php @@ -0,0 +1,13 @@ +strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Elrejti a felhasználók tartalmát a bejegyzések összecsukásával. Ezenkívül lecseréli a profilképeiket egy általános képre.'; +$a->strings['Comma separated profile URLS:'] = 'Profil URL-ek vesszővel elválasztva:'; +$a->strings['Blockem'] = 'Blockem'; +$a->strings['Filtered user: %s'] = 'Kiszűrt felhasználó: %s'; +$a->strings['Unblock Author'] = 'Szerző tiltásának feloldása'; +$a->strings['Block Author'] = 'Szerző tiltása'; diff --git a/blockem/lang/is/strings.php b/blockem/lang/is/strings.php new file mode 100644 index 00000000..3075c457 --- /dev/null +++ b/blockem/lang/is/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "\"Blockem\" stillingar"; +$a->strings["Comma separated profile URLS to block"] = "Banna lista af forsíðum (komma á milli)"; +$a->strings["Submit"] = "Senda inn"; +$a->strings["BLOCKEM Settings saved."] = "BLOCKEM stillingar vistaðar."; +$a->strings["Blocked %s - Click to open/close"] = "%s sett í straff - Smella til að taka úr/setja á"; +$a->strings["Unblock Author"] = "Leyfa notanda"; +$a->strings["Block Author"] = "Banna notanda"; +$a->strings["blockem settings updated"] = ""; diff --git a/blockem/lang/it/messages.po b/blockem/lang/it/messages.po new file mode 100644 index 00000000..cdf74f99 --- /dev/null +++ b/blockem/lang/it/messages.po @@ -0,0 +1,59 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# fabrixxm , 2014,2018-2019 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 10:23+0200\n" +"PO-Revision-Date: 2019-03-11 14:21+0000\n" +"Last-Translator: fabrixxm \n" +"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:54 blockem.php:58 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:62 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Nascondi il contenuto degli utenti collassando i messaggi. Sostituisce anche gli avatar con un'immagine generica." + +#: blockem.php:63 +msgid "Comma separated profile URLS:" +msgstr "URL profili separati da virgola:" + +#: blockem.php:67 +msgid "Save Settings" +msgstr "Salva Impostazioni" + +#: blockem.php:81 +msgid "BLOCKEM Settings saved." +msgstr "Impostazioni BLOCKEM salvate." + +#: blockem.php:143 +#, php-format +msgid "Filtered user: %s" +msgstr "Utente filtrato: %s" + +#: blockem.php:202 +msgid "Unblock Author" +msgstr "Sblocca autore" + +#: blockem.php:204 +msgid "Block Author" +msgstr "Blocca autore" + +#: blockem.php:244 +msgid "blockem settings updated" +msgstr "Impostazioni 'blockem' aggiornate." diff --git a/blockem/lang/it/strings.php b/blockem/lang/it/strings.php new file mode 100644 index 00000000..aa73286a --- /dev/null +++ b/blockem/lang/it/strings.php @@ -0,0 +1,16 @@ +strings['Blockem'] = 'Blockem'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Nascondi il contenuto degli utenti collassando i messaggi. Sostituisce anche gli avatar con un\'immagine generica.'; +$a->strings['Comma separated profile URLS:'] = 'URL profili separati da virgola:'; +$a->strings['Save Settings'] = 'Salva Impostazioni'; +$a->strings['BLOCKEM Settings saved.'] = 'Impostazioni BLOCKEM salvate.'; +$a->strings['Filtered user: %s'] = 'Utente filtrato: %s'; +$a->strings['Unblock Author'] = 'Sblocca autore'; +$a->strings['Block Author'] = 'Blocca autore'; +$a->strings['blockem settings updated'] = 'Impostazioni \'blockem\' aggiornate.'; diff --git a/blockem/lang/nb-no/strings.php b/blockem/lang/nb-no/strings.php new file mode 100644 index 00000000..0dd6660d --- /dev/null +++ b/blockem/lang/nb-no/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = ""; +$a->strings["Comma separated profile URLS to block"] = ""; +$a->strings["Submit"] = "Lagre"; +$a->strings["BLOCKEM Settings saved."] = ""; +$a->strings["Blocked %s - Click to open/close"] = ""; +$a->strings["Unblock Author"] = ""; +$a->strings["Block Author"] = ""; +$a->strings["blockem settings updated"] = ""; diff --git a/blockem/lang/nl/messages.po b/blockem/lang/nl/messages.po new file mode 100644 index 00000000..f8bde25c --- /dev/null +++ b/blockem/lang/nl/messages.po @@ -0,0 +1,60 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# AgnesElisa , 2018 +# Jeroen De Meerleer , 2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 10:23+0200\n" +"PO-Revision-Date: 2018-08-24 13:49+0000\n" +"Last-Translator: Jeroen De Meerleer \n" +"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:54 blockem.php:58 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:62 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Verbergt de inhoud van het bericht van de gebruiker. Daarnaast vervangt het de avatar door een standaardafbeelding." + +#: blockem.php:63 +msgid "Comma separated profile URLS:" +msgstr "Profiel URLs (kommagescheiden):" + +#: blockem.php:67 +msgid "Save Settings" +msgstr "Instellingen opslaan" + +#: blockem.php:81 +msgid "BLOCKEM Settings saved." +msgstr "BLOCKEM instellingen opgeslagen." + +#: blockem.php:143 +#, php-format +msgid "Filtered user: %s" +msgstr "Gefilterde gebruiker: %s" + +#: blockem.php:202 +msgid "Unblock Author" +msgstr "Deblokkeer Auteur" + +#: blockem.php:204 +msgid "Block Author" +msgstr "Auteur blokkeren" + +#: blockem.php:244 +msgid "blockem settings updated" +msgstr "blockem instellingen opgeslagen" diff --git a/blockem/lang/nl/strings.php b/blockem/lang/nl/strings.php new file mode 100644 index 00000000..b523cdc4 --- /dev/null +++ b/blockem/lang/nl/strings.php @@ -0,0 +1,16 @@ +strings['Blockem'] = 'Blockem'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Verbergt de inhoud van het bericht van de gebruiker. Daarnaast vervangt het de avatar door een standaardafbeelding.'; +$a->strings['Comma separated profile URLS:'] = 'Profiel URLs (kommagescheiden):'; +$a->strings['Save Settings'] = 'Instellingen opslaan'; +$a->strings['BLOCKEM Settings saved.'] = 'BLOCKEM instellingen opgeslagen.'; +$a->strings['Filtered user: %s'] = 'Gefilterde gebruiker: %s'; +$a->strings['Unblock Author'] = 'Deblokkeer Auteur'; +$a->strings['Block Author'] = 'Auteur blokkeren'; +$a->strings['blockem settings updated'] = 'blockem instellingen opgeslagen'; diff --git a/blockem/lang/pl/messages.po b/blockem/lang/pl/messages.po new file mode 100644 index 00000000..8e70e0b5 --- /dev/null +++ b/blockem/lang/pl/messages.po @@ -0,0 +1,47 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Waldemar Stoczkowski, 2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: 2014-06-22 11:20+0000\n" +"Last-Translator: Waldemar Stoczkowski, 2018\n" +"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pl\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Ukrywa zawartość użytkownika, zwijając posty. Zastępuje również awatar wygenerowanym obrazem." + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "Rozdzielone przecinkami adresy URL profilu:" + +#: blockem.php:45 +msgid "Blockem" +msgstr "Zablokowanie" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "Użytkownik filtrowany: %s" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "Odblokuj autora" + +#: blockem.php:185 +msgid "Block Author" +msgstr "Zablokuj autora" diff --git a/blockem/lang/pl/strings.php b/blockem/lang/pl/strings.php new file mode 100644 index 00000000..49951a68 --- /dev/null +++ b/blockem/lang/pl/strings.php @@ -0,0 +1,13 @@ +=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; } +}} +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Ukrywa zawartość użytkownika, zwijając posty. Zastępuje również awatar wygenerowanym obrazem.'; +$a->strings['Comma separated profile URLS:'] = 'Rozdzielone przecinkami adresy URL profilu:'; +$a->strings['Blockem'] = 'Zablokowanie'; +$a->strings['Filtered user: %s'] = 'Użytkownik filtrowany: %s'; +$a->strings['Unblock Author'] = 'Odblokuj autora'; +$a->strings['Block Author'] = 'Zablokuj autora'; diff --git a/blockem/lang/pt-br/strings.php b/blockem/lang/pt-br/strings.php new file mode 100644 index 00000000..49f69cc3 --- /dev/null +++ b/blockem/lang/pt-br/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "Configurações \"Blockem\""; +$a->strings["Comma separated profile URLS to block"] = "URLS de perfis separados por vírgulas a serem bloqueados"; +$a->strings["Submit"] = "Enviar"; +$a->strings["BLOCKEM Settings saved."] = "Configurações BLOCKEM armazenadas."; +$a->strings["Blocked %s - Click to open/close"] = "Bloqueado %s - Clique para abrir/fechar"; +$a->strings["Unblock Author"] = "Desbloqueie Autor"; +$a->strings["Block Author"] = "Bloqueie Autor"; +$a->strings["blockem settings updated"] = "configurações blockem atualizadas"; diff --git a/blockem/lang/ro/messages.po b/blockem/lang/ro/messages.po new file mode 100644 index 00000000..a74e5757 --- /dev/null +++ b/blockem/lang/ro/messages.po @@ -0,0 +1,52 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-06-22 13:18+0200\n" +"PO-Revision-Date: 2014-07-08 11:43+0000\n" +"Last-Translator: Arian - Cazare Muncitori \n" +"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ro_RO\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" + +#: blockem.php:53 blockem.php:57 +msgid "\"Blockem\"" +msgstr "\"Blockem\"" + +#: blockem.php:61 +msgid "Comma separated profile URLS to block" +msgstr "Adresele URL de profil, de blocat, separate prin virgulă" + +#: blockem.php:65 +msgid "Save Settings" +msgstr "Salvare Configurări" + +#: blockem.php:78 +msgid "BLOCKEM Settings saved." +msgstr "Configurările BLOCKEM au fost salvate." + +#: blockem.php:142 +#, php-format +msgid "Blocked %s - Click to open/close" +msgstr "%s Blocate - Apăsați pentru a deschide/închide" + +#: blockem.php:197 +msgid "Unblock Author" +msgstr "Deblocare Autor" + +#: blockem.php:199 +msgid "Block Author" +msgstr "Blocare Autor" + +#: blockem.php:231 +msgid "blockem settings updated" +msgstr "Configurările blockem au fost actualizate" diff --git a/blockem/lang/ro/strings.php b/blockem/lang/ro/strings.php new file mode 100644 index 00000000..6fc8a094 --- /dev/null +++ b/blockem/lang/ro/strings.php @@ -0,0 +1,15 @@ +19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; } +}} +$a->strings['"Blockem"'] = '"Blockem"'; +$a->strings['Comma separated profile URLS to block'] = 'Adresele URL de profil, de blocat, separate prin virgulă'; +$a->strings['Save Settings'] = 'Salvare Configurări'; +$a->strings['BLOCKEM Settings saved.'] = 'Configurările BLOCKEM au fost salvate.'; +$a->strings['Blocked %s - Click to open/close'] = '%s Blocate - Apăsați pentru a deschide/închide'; +$a->strings['Unblock Author'] = 'Deblocare Autor'; +$a->strings['Block Author'] = 'Blocare Autor'; +$a->strings['blockem settings updated'] = 'Configurările blockem au fost actualizate'; diff --git a/blockem/lang/ru/messages.po b/blockem/lang/ru/messages.po new file mode 100644 index 00000000..22427327 --- /dev/null +++ b/blockem/lang/ru/messages.po @@ -0,0 +1,60 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Alexander An , 2020 +# Stanislav N. , 2017-2018 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-08-17 10:23+0200\n" +"PO-Revision-Date: 2020-04-23 14:13+0000\n" +"Last-Translator: Alexander An \n" +"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ru\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" + +#: blockem.php:54 blockem.php:58 +msgid "Blockem" +msgstr "Blockem" + +#: blockem.php:62 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Скрыть контент пользователя. Также заменяет его аватар изображением по-умолчанию." + +#: blockem.php:63 +msgid "Comma separated profile URLS:" +msgstr "URL профилей, разделенные запятыми:" + +#: blockem.php:67 +msgid "Save Settings" +msgstr "Сохранить настройки" + +#: blockem.php:81 +msgid "BLOCKEM Settings saved." +msgstr "BLOCKEM Настройки сохранены." + +#: blockem.php:143 +#, php-format +msgid "Filtered user: %s" +msgstr "Отфильтрованный пользователь: %s" + +#: blockem.php:202 +msgid "Unblock Author" +msgstr "Разблокировать автора" + +#: blockem.php:204 +msgid "Block Author" +msgstr "Блокировать автора" + +#: blockem.php:244 +msgid "blockem settings updated" +msgstr "Настройки Blockem обновлены" diff --git a/blockem/lang/ru/strings.php b/blockem/lang/ru/strings.php new file mode 100644 index 00000000..ef586740 --- /dev/null +++ b/blockem/lang/ru/strings.php @@ -0,0 +1,16 @@ +=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } +}} +$a->strings['Blockem'] = 'Blockem'; +$a->strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Скрыть контент пользователя. Также заменяет его аватар изображением по-умолчанию.'; +$a->strings['Comma separated profile URLS:'] = 'URL профилей, разделенные запятыми:'; +$a->strings['Save Settings'] = 'Сохранить настройки'; +$a->strings['BLOCKEM Settings saved.'] = 'BLOCKEM Настройки сохранены.'; +$a->strings['Filtered user: %s'] = 'Отфильтрованный пользователь: %s'; +$a->strings['Unblock Author'] = 'Разблокировать автора'; +$a->strings['Block Author'] = 'Блокировать автора'; +$a->strings['blockem settings updated'] = 'Настройки Blockem обновлены'; diff --git a/blockem/lang/sv/messages.po b/blockem/lang/sv/messages.po new file mode 100644 index 00000000..ede8ee94 --- /dev/null +++ b/blockem/lang/sv/messages.po @@ -0,0 +1,47 @@ +# ADDON blockem +# Copyright (C) +# This file is distributed under the same license as the Friendica blockem addon package. +# +# +# Translators: +# Bjoessi , 2019 +msgid "" +msgstr "" +"Project-Id-Version: friendica\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-21 19:13-0500\n" +"PO-Revision-Date: 2021-12-22 15:27+0000\n" +"Last-Translator: Transifex Bot <>\n" +"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: sv\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: blockem.php:39 +msgid "" +"Hides user's content by collapsing posts. Also replaces their avatar with " +"generic image." +msgstr "Döljer användares inlägg genom sammanslagning nedåt. Användarens profilbild ersätts med en standardbild." + +#: blockem.php:40 +msgid "Comma separated profile URLS:" +msgstr "Kommaseparerade profiladresser:" + +#: blockem.php:45 +msgid "Blockem" +msgstr "BLOCKEM" + +#: blockem.php:120 +#, php-format +msgid "Filtered user: %s" +msgstr "Filtrerat på användare:%s" + +#: blockem.php:183 +msgid "Unblock Author" +msgstr "Avblockera författare" + +#: blockem.php:185 +msgid "Block Author" +msgstr "Blockera författare" diff --git a/blockem/lang/sv/strings.php b/blockem/lang/sv/strings.php new file mode 100644 index 00000000..724e2d23 --- /dev/null +++ b/blockem/lang/sv/strings.php @@ -0,0 +1,13 @@ +strings['Hides user\'s content by collapsing posts. Also replaces their avatar with generic image.'] = 'Döljer användares inlägg genom sammanslagning nedåt. Användarens profilbild ersätts med en standardbild.'; +$a->strings['Comma separated profile URLS:'] = 'Kommaseparerade profiladresser:'; +$a->strings['Blockem'] = 'BLOCKEM'; +$a->strings['Filtered user: %s'] = 'Filtrerat på användare:%s'; +$a->strings['Unblock Author'] = 'Avblockera författare'; +$a->strings['Block Author'] = 'Blockera författare'; diff --git a/blockem/lang/zh-cn/strings.php b/blockem/lang/zh-cn/strings.php new file mode 100644 index 00000000..3a3dfaeb --- /dev/null +++ b/blockem/lang/zh-cn/strings.php @@ -0,0 +1,10 @@ +strings["\"Blockem\" Settings"] = "「Blockem」配置"; +$a->strings["Comma separated profile URLS to block"] = "逗号分简介URL为栏"; +$a->strings["Submit"] = "提交"; +$a->strings["BLOCKEM Settings saved."] = "「Blockem」配置保存了。"; +$a->strings["Blocked %s - Click to open/close"] = "%s拦了-点击为开关"; +$a->strings["Unblock Author"] = "不拦作家"; +$a->strings["Block Author"] = "拦作家"; +$a->strings["blockem settings updated"] = "blockem设置更新了"; diff --git a/blockem/templates/settings.tpl b/blockem/templates/settings.tpl new file mode 100644 index 00000000..67398400 --- /dev/null +++ b/blockem/templates/settings.tpl @@ -0,0 +1 @@ +{{include file="field_textarea.tpl" field=$words}} diff --git a/bluesky/README.md b/bluesky/README.md deleted file mode 100644 index bf900fcd..00000000 --- a/bluesky/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Bluesky Addon -============== - -This addon supports posting to and receiving posts from Bluesky. - -No setup is needed for the admins to make it work for their users. - -Bluesky itself is under development as well. It is planned to make it decentral. -The addon is prepared to support different servers. But it isn't enabled yet. \ No newline at end of file diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php deleted file mode 100644 index e1f096c7..00000000 --- a/bluesky/bluesky.php +++ /dev/null @@ -1,1209 +0,0 @@ - - * - * @todo - * Currently technical issues in the core: - * - Outgoing mentions - * - * At some point in time: - * - post videos - * - direct messages - * - Sending Quote shares https://atproto.com/lexicons/app-bsky-embed#appbskyembedrecord and https://atproto.com/lexicons/app-bsky-embed#appbskyembedrecordwithmedia - * - * Possibly not possible: - * - only fetch new posts - * - * Currently not possible, due to limitations in Friendica - * - mute contacts https://atproto.com/lexicons/app-bsky-graph#appbskygraphmuteactor - * - unmute contacts https://atproto.com/lexicons/app-bsky-graph#appbskygraphunmuteactor - * - * Possibly interesting: - * - https://atproto.com/lexicons/com-atproto-label#comatprotolabelsubscribelabels - */ - -use Friendica\Content\Text\BBCode; -use Friendica\Content\Text\Plaintext; -use Friendica\Core\Cache\Enum\Duration; -use Friendica\Core\Config\Util\ConfigFileManager; -use Friendica\Core\Hook; -use Friendica\Core\Protocol; -use Friendica\Core\Renderer; -use Friendica\Core\Worker; -use Friendica\Database\DBA; -use Friendica\DI; -use Friendica\Model\Contact; -use Friendica\Model\Conversation; -use Friendica\Model\Item; -use Friendica\Model\Photo; -use Friendica\Model\Post; -use Friendica\Model\User; -use Friendica\Object\Image; -use Friendica\Protocol\Activity; -use Friendica\Protocol\ATProtocol; -use Friendica\Protocol\Relay; -use Friendica\Util\DateTimeFormat; -use Friendica\Util\Strings; - -const BLUESKY_DEFAULT_POLL_INTERVAL = 10; // given in minutes -const BLUESKY_IMAGE_SIZE = [1000000, 500000, 100000, 50000]; - -function bluesky_install() -{ - Hook::register('load_config', __FILE__, 'bluesky_load_config'); - Hook::register('hook_fork', __FILE__, 'bluesky_hook_fork'); - Hook::register('post_local', __FILE__, 'bluesky_post_local'); - Hook::register('notifier_normal', __FILE__, 'bluesky_send'); - Hook::register('jot_networks', __FILE__, 'bluesky_jot_nets'); - Hook::register('connector_settings', __FILE__, 'bluesky_settings'); - Hook::register('connector_settings_post', __FILE__, 'bluesky_settings_post'); - Hook::register('cron', __FILE__, 'bluesky_cron'); - Hook::register('support_follow', __FILE__, 'bluesky_support_follow'); - Hook::register('follow', __FILE__, 'bluesky_follow'); - Hook::register('unfollow', __FILE__, 'bluesky_unfollow'); - Hook::register('block', __FILE__, 'bluesky_block'); - Hook::register('unblock', __FILE__, 'bluesky_unblock'); - Hook::register('check_item_notification', __FILE__, 'bluesky_check_item_notification'); - Hook::register('item_by_link', __FILE__, 'bluesky_item_by_link'); -} - -function bluesky_load_config(ConfigFileManager $loader) -{ - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('bluesky'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); -} - -function bluesky_check_item_notification(array &$notification_data) -{ - if (empty($notification_data['uid'])) { - return; - } - - $did = DI::atProtocol()->getUserDid($notification_data['uid']); - if (empty($did)) { - return; - } - - $notification_data['profiles'][] = $did; -} - -function bluesky_item_by_link(array &$hookData) -{ - // Don't overwrite an existing result - if (isset($hookData['item_id'])) { - return; - } - - if (substr($hookData['uri'], 0, 5) != 'at://') { - if (!preg_match('#^' . ATProtocol::WEB . '/profile/(.+)/post/(.+)#', $hookData['uri'], $matches)) { - return; - } - - $did = DI::atProtocol()->getDid($matches[1]); - if (empty($did)) { - return; - } - - DI::logger()->debug('Found bluesky post', ['uri' => $hookData['uri'], 'did' => $did, 'cid' => $matches[2]]); - - $uri = 'at://' . $did . '/app.bsky.feed.post/' . $matches[2]; - } else { - $uri = $hookData['uri']; - } - - $uri = DI::atpProcessor()->fetchMissingPost($uri, $hookData['uid'], Item::PR_FETCHED, 0, 0); - DI::logger()->debug('Got post', ['uri' => $uri]); - if (!empty($uri)) { - $item = Post::selectFirst(['id'], ['uri' => $uri, 'uid' => $hookData['uid']]); - if (!empty($item['id'])) { - $hookData['item_id'] = $item['id']; - } - } -} - -function bluesky_support_follow(array &$data) -{ - if ($data['protocol'] == Protocol::BLUESKY) { - $data['result'] = true; - } -} - -function bluesky_follow(array &$hook_data) -{ - $token = DI::atProtocol()->getUserToken($hook_data['uid']); - if (empty($token)) { - return; - } - - DI::logger()->debug('Check if contact is bluesky', ['data' => $hook_data]); - $contact = DBA::selectFirst('contact', [], ['network' => Protocol::BLUESKY, 'nurl' => Strings::normaliseLink($hook_data['url']), 'uid' => [0, $hook_data['uid']]]); - if (empty($contact)) { - return; - } - - $record = [ - 'subject' => $contact['url'], - 'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM), - '$type' => 'app.bsky.graph.follow' - ]; - - $post = [ - 'collection' => 'app.bsky.graph.follow', - 'repo' => DI::atProtocol()->getUserDid($hook_data['uid']), - 'record' => $record - ]; - - $activity = DI::atProtocol()->XRPCPost($hook_data['uid'], 'com.atproto.repo.createRecord', $post); - if (!empty($activity->uri)) { - $hook_data['contact'] = $contact; - DI::logger()->debug('Successfully start following', ['url' => $contact['url'], 'uri' => $activity->uri]); - } -} - -function bluesky_unfollow(array &$hook_data) -{ - $token = DI::atProtocol()->getUserToken($hook_data['uid']); - if (empty($token)) { - return; - } - - if ($hook_data['contact']['network'] != Protocol::BLUESKY) { - return; - } - - $data = DI::atProtocol()->XRPCGet('app.bsky.actor.getProfile', ['actor' => $hook_data['contact']['url']], $hook_data['uid']); - if (empty($data->viewer) || empty($data->viewer->following)) { - return; - } - - bluesky_delete_post($data->viewer->following, $hook_data['uid']); - - $hook_data['result'] = true; -} - -function bluesky_block(array &$hook_data) -{ - $token = DI::atProtocol()->getUserToken($hook_data['uid']); - if (empty($token)) { - return; - } - - if ($hook_data['contact']['network'] != Protocol::BLUESKY) { - return; - } - - $record = [ - 'subject' => $hook_data['contact']['url'], - 'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM), - '$type' => 'app.bsky.graph.block' - ]; - - $post = [ - 'collection' => 'app.bsky.graph.block', - 'repo' => DI::atProtocol()->getUserDid($hook_data['uid']), - 'record' => $record - ]; - - $activity = DI::atProtocol()->XRPCPost($hook_data['uid'], 'com.atproto.repo.createRecord', $post); - if (!empty($activity->uri)) { - $ucid = Contact::getUserContactId($hook_data['contact']['id'], $hook_data['uid']); - if ($ucid) { - Contact::remove($ucid); - } - DI::logger()->debug('Successfully blocked contact', ['url' => $hook_data['contact']['url'], 'uri' => $activity->uri]); - } -} - -function bluesky_unblock(array &$hook_data) -{ - $token = DI::atProtocol()->getUserToken($hook_data['uid']); - if (empty($token)) { - return; - } - - if ($hook_data['contact']['network'] != Protocol::BLUESKY) { - return; - } - - $data = DI::atProtocol()->XRPCGet('app.bsky.actor.getProfile', ['actor' => $hook_data['contact']['url']], $hook_data['uid']); - if (empty($data->viewer) || empty($data->viewer->blocking)) { - return; - } - - bluesky_delete_post($data->viewer->blocking, $hook_data['uid']); - - $hook_data['result'] = true; -} - -function bluesky_addon_admin(string &$o) -{ - $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/bluesky/'); - - $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$friendica_handles' => ['friendica_handles', DI::l10n()->t('Allow your users to use your hostname for their Bluesky handles'), DI::config()->get('bluesky', 'friendica_handles'), DI::l10n()->t('Before enabling this option, you have to setup a wildcard domain configuration and you have to enable wildcard requests in your webserver configuration. On Apache this is done by adding "ServerAlias *.%s" to your HTTP configuration. You don\'t need to change the HTTPS configuration.', DI::baseUrl()->getHost())], - ]); -} - -function bluesky_addon_admin_post() -{ - DI::config()->set('bluesky', 'friendica_handles', (bool)$_POST['friendica_handles']); -} - -function bluesky_settings(array &$data) -{ - if (!DI::userSession()->getLocalUserId()) { - return; - } - - $enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post') ?? false; - $def_enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default') ?? false; - $pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds'); - $handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle'); - $did = DI::atProtocol()->getUserDid(DI::userSession()->getLocalUserId()); - $token = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token'); - $import = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import') ?? false; - $import_feeds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds') ?? false; - $complete_threads = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'complete_threads') ?? false; - $custom_handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'friendica_handle') ?? false; - - if (DI::config()->get('bluesky', 'friendica_handles')) { - $self = User::getById(DI::userSession()->getLocalUserId(), ['nickname']); - $host_handle = $self['nickname'] . '.' . DI::baseUrl()->getHost(); - $friendica_handle = ['bluesky_friendica_handle', DI::l10n()->t('Allow to use %s as your Bluesky handle.', $host_handle), $custom_handle, DI::l10n()->t('When enabled, you can use %s as your Bluesky handle. After you enabled this option, please go to https://bsky.app/settings and select to change your handle. Select that you have got your own domain. Then enter %s and select "No DNS Panel". Then select "Verify Text File".', $host_handle, $host_handle)]; - if ($custom_handle) { - $handle = $host_handle; - } - } else { - $friendica_handle = []; - } - - $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/bluesky/'); - $html = Renderer::replaceMacros($t, [ - '$enable' => ['bluesky', DI::l10n()->t('Enable Bluesky Post Addon'), $enabled], - '$bydefault' => ['bluesky_bydefault', DI::l10n()->t('Post to Bluesky by default'), $def_enabled], - '$import' => ['bluesky_import', DI::l10n()->t('Import the remote timeline'), $import], - '$import_feeds' => ['bluesky_import_feeds', DI::l10n()->t('Import the pinned feeds'), $import_feeds, DI::l10n()->t('When activated, Posts will be imported from all the feeds that you pinned in Bluesky.')], - '$complete_threads' => ['bluesky_complete_threads', DI::l10n()->t('Complete the threads'), $complete_threads, DI::l10n()->t('When activated, the system fetches additional replies for the posts in the timeline. This leads to more complete threads.')], - '$custom_handle' => $friendica_handle, - '$pds' => ['bluesky_pds', DI::l10n()->t('Personal Data Server'), $pds, DI::l10n()->t('The personal data server (PDS) is the system that hosts your profile.'), '', 'readonly'], - '$handle' => ['bluesky_handle', DI::l10n()->t('Bluesky handle'), $handle, '', '', $custom_handle ? 'readonly' : ''], - '$did' => ['bluesky_did', DI::l10n()->t('Bluesky DID'), $did, DI::l10n()->t('This is the unique identifier. It will be fetched automatically, when the handle is entered.'), '', 'readonly'], - '$password' => ['bluesky_password', DI::l10n()->t('Bluesky app password'), '', DI::l10n()->t("Please don't add your real password here, but instead create a specific app password in the Bluesky settings.")], - '$status' => bluesky_get_status($handle, $did, $pds, $token), - ]); - - $data = [ - 'connector' => 'bluesky', - 'title' => DI::l10n()->t('Bluesky Import/Export'), - 'image' => 'images/bluesky.jpg', - 'enabled' => $enabled, - 'html' => $html, - ]; -} - -function bluesky_get_status(string $handle = null, string $did = null, string $pds = null, string $token = null): string -{ - if (empty($handle)) { - return DI::l10n()->t('You are not authenticated. Please enter your handle and the app password.'); - } - - $status = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'status') ?? ATProtocol::STATUS_UNKNOWN; - $message = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'status-message') ?? ''; - - // Fallback mechanism for connection that had been established before the introduction of the status - if ($status == ATProtocol::STATUS_UNKNOWN) { - if (empty($did)) { - $status = ATProtocol::STATUS_DID_FAIL; - } elseif (empty($pds)) { - $status = ATProtocol::STATUS_PDS_FAIL; - } elseif (!empty($token)) { - $status = ATProtocol::STATUS_TOKEN_OK; - } else { - $status = ATProtocol::STATUS_TOKEN_FAIL; - } - } - - switch ($status) { - case ATProtocol::STATUS_TOKEN_OK: - return DI::l10n()->t("You are authenticated to Bluesky. For security reasons the password isn't stored."); - case ATProtocol::STATUS_SUCCESS: - return DI::l10n()->t('The communication with the personal data server service (PDS) is established.'); - case ATProtocol::STATUS_API_FAIL; - return DI::l10n()->t('Communication issues with the personal data server service (PDS): %s', $message); - case ATProtocol::STATUS_DID_FAIL: - return DI::l10n()->t('The DID for the provided handle could not be detected. Please check if you entered the correct handle.'); - case ATProtocol::STATUS_PDS_FAIL: - return DI::l10n()->t('The personal data server service (PDS) could not be detected.'); - case ATProtocol::STATUS_TOKEN_FAIL: - return DI::l10n()->t('The authentication with the provided handle and password failed. Please check if you entered the correct password.'); - default: - return ''; - } -} - -function bluesky_settings_post(array &$b) -{ - if (empty($_POST['bluesky-submit'])) { - return; - } - - $old_pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds'); - $old_handle = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'handle'); - $old_did = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'did'); - - $handle = trim($_POST['bluesky_handle'], ' @'); - - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'post', intval($_POST['bluesky'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default', intval($_POST['bluesky_bydefault'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'handle', $handle); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import', intval($_POST['bluesky_import'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'import_feeds', intval($_POST['bluesky_import_feeds'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'complete_threads', intval($_POST['bluesky_complete_threads'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'friendica_handle', intval($_POST['bluesky_friendica_handle'] ?? false)); - - if (!empty($handle)) { - $did = DI::atProtocol()->getUserDid(DI::userSession()->getLocalUserId(), empty($old_did) || $old_handle != $handle); - if (!empty($did) && (empty($old_pds) || $old_handle != $handle)) { - $pds = DI::atProtocol()->getPdsOfDid($did); - if (empty($pds)) { - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'status', ATProtocol::STATUS_PDS_FAIL); - } - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'bluesky', 'pds', $pds); - } else { - $pds = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'pds'); - } - } else { - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'did'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'pds'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'password'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'access_token'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'refresh_token'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'token_created'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'bluesky', 'status'); - } - - if (!empty($did) && !empty($pds) && !empty($_POST['bluesky_password'])) { - DI::atProtocol()->createUserToken(DI::userSession()->getLocalUserId(), $_POST['bluesky_password']); - } -} - -function bluesky_jot_nets(array &$jotnets_fields) -{ - if (!DI::userSession()->getLocalUserId()) { - return; - } - - if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'bluesky_enable', - DI::l10n()->t('Post to Bluesky'), - DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default') - ] - ]; - } -} - -function bluesky_cron() -{ - $last = (int)DI::keyValue()->get('bluesky_last_poll'); - - $poll_interval = intval(DI::config()->get('bluesky', 'poll_interval')); - if (!$poll_interval) { - $poll_interval = BLUESKY_DEFAULT_POLL_INTERVAL; - } - - if ($last) { - $next = $last + ($poll_interval * 60); - if ($next > time()) { - DI::logger()->notice('poll interval not reached'); - return; - } - } - DI::logger()->notice('cron_start'); - - $abandon_days = intval(DI::config()->get('system', 'account_abandon_days')); - if ($abandon_days < 1) { - $abandon_days = 0; - } - - $abandon_limit = date(DateTimeFormat::MYSQL, time() - $abandon_days * 86400); - - $pconfigs = DBA::selectToArray('pconfig', [], ["`cat` = ? AND `k` IN (?, ?) AND `v`", 'bluesky', 'import', 'import_feeds']); - foreach ($pconfigs as $pconfig) { - if (empty(DI::atProtocol()->getUserDid($pconfig['uid']))) { - DI::logger()->debug('User has got no valid DID', ['uid' => $pconfig['uid']]); - continue; - } - - if ($abandon_days != 0) { - if (!DBA::exists('user', ["`uid` = ? AND `login_date` >= ?", $pconfig['uid'], $abandon_limit])) { - DI::logger()->notice('abandoned account: timeline from user will not be imported', ['user' => $pconfig['uid']]); - continue; - } - } - - // Refresh the token now, so that it doesn't need to be refreshed in parallel by the following workers - DI::logger()->debug('Refresh the token', ['uid' => $pconfig['uid']]); - DI::atProtocol()->getUserToken($pconfig['uid']); - - $last_sync = DI::pConfig()->get($pconfig['uid'], 'bluesky', 'last_contact_sync'); - if ($last_sync < (time() - 86400)) { - DI::atpActor()->syncContacts($pconfig['uid']); - DI::pConfig()->set($pconfig['uid'], 'bluesky', 'last_contact_sync', time()); - } - - Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_notifications.php', $pconfig['uid']); - if (DI::pConfig()->get($pconfig['uid'], 'bluesky', 'import')) { - Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_timeline.php', $pconfig['uid']); - } - if (DI::pConfig()->get($pconfig['uid'], 'bluesky', 'import_feeds')) { - DI::logger()->debug('Fetch feeds for user', ['uid' => $pconfig['uid']]); - $feeds = bluesky_get_feeds($pconfig['uid']); - foreach ($feeds as $feed) { - Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/bluesky/bluesky_feed.php', $pconfig['uid'], $feed); - } - } - DI::logger()->debug('Polling done for user', ['uid' => $pconfig['uid']]); - } - - DI::logger()->notice('Polling done for all users'); - - DI::keyValue()->set('bluesky_last_poll', time()); - - $last_clean = DI::keyValue()->get('bluesky_last_clean'); - if (empty($last_clean) || ($last_clean + 86400 < time())) { - DI::logger()->notice('Start contact cleanup'); - $contacts = DBA::select('account-user-view', ['id', 'pid'], ["`network` = ? AND `uid` != ? AND `rel` = ?", Protocol::BLUESKY, 0, Contact::NOTHING]); - while ($contact = DBA::fetch($contacts)) { - Worker::add(Worker::PRIORITY_LOW, 'MergeContact', $contact['pid'], $contact['id'], 0); - } - DBA::close($contacts); - DI::keyValue()->set('bluesky_last_clean', time()); - DI::logger()->notice('Contact cleanup done'); - } - - DI::logger()->notice('cron_end'); -} - -function bluesky_hook_fork(array &$b) -{ - if ($b['name'] != 'notifier_normal') { - return; - } - - $post = $b['data']; - - if (($post['created'] !== $post['edited']) && !$post['deleted']) { - DI::logger()->info('Editing is not supported by the addon'); - $b['execute'] = false; - return; - } - - if (DI::pConfig()->get($post['uid'], 'bluesky', 'import')) { - // Don't post if it isn't a reply to a bluesky post - if (($post['gravity'] != Item::GRAVITY_PARENT) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::BLUESKY])) { - DI::logger()->notice('No bluesky parent found', ['item' => $post['id']]); - $b['execute'] = false; - return; - } - } elseif (!strstr($post['postopts'] ?? '', 'bluesky') || ($post['gravity'] != Item::GRAVITY_PARENT) || ($post['private'] == Item::PRIVATE)) { - DI::logger()->info('Post will not be exported', ['uid' => $post['uid'], 'postopts' => $post['postopts'], 'gravity' => $post['gravity'], 'private' => $post['private']]); - $b['execute'] = false; - return; - } -} - -function bluesky_post_local(array &$b) -{ - if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) { - return; - } - - if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) { - return; - } - - $bluesky_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post')); - $bluesky_enable = (($bluesky_post && !empty($_REQUEST['bluesky_enable'])) ? intval($_REQUEST['bluesky_enable']) : 0); - - // if API is used, default to the chosen settings - if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'bluesky', 'post_by_default'))) { - $bluesky_enable = 1; - } - - if (!$bluesky_enable) { - return; - } - - if (strlen($b['postopts'])) { - $b['postopts'] .= ','; - } - - $b['postopts'] .= 'bluesky'; -} - -function bluesky_send(array &$b) -{ - if (($b['created'] !== $b['edited']) && !$b['deleted']) { - return; - } - - if (Item::isGroupPost($b['uri-id'])) { - return; - } - - if ($b['gravity'] != Item::GRAVITY_PARENT) { - DI::logger()->debug('Got comment', ['item' => $b]); - - if ($b['deleted']) { - $uri = DI::atpProcessor()->getUriClass($b['uri']); - if (empty($uri)) { - DI::logger()->debug('Not a bluesky post', ['uri' => $b['uri']]); - return; - } - bluesky_delete_post($b['uri'], $b['uid']); - return; - } - - $root = DI::atpProcessor()->getUriClass($b['parent-uri']); - $parent = DI::atpProcessor()->getUriClass($b['thr-parent']); - - if (empty($root) || empty($parent)) { - DI::logger()->debug('No bluesky post', ['parent' => $b['parent'], 'thr-parent' => $b['thr-parent']]); - return; - } - - if ($b['gravity'] == Item::GRAVITY_COMMENT) { - DI::logger()->debug('Posting comment', ['root' => $root, 'parent' => $parent]); - bluesky_create_post($b, $root, $parent); - return; - } elseif (in_array($b['verb'], [Activity::LIKE, Activity::ANNOUNCE])) { - bluesky_create_activity($b, $parent); - } - return; - } elseif (($b['private'] == Item::PRIVATE) || !strstr($b['postopts'], 'bluesky')) { - return; - } - - bluesky_create_post($b); -} - -function bluesky_create_activity(array $item, stdClass $parent = null) -{ - $uid = $item['uid']; - $token = DI::atProtocol()->getUserToken($uid); - if (empty($token)) { - return; - } - - $did = DI::atProtocol()->getUserDid($uid); - if (empty($did)) { - return; - } - - $post = []; - - if ($item['verb'] == Activity::LIKE) { - $record = [ - 'subject' => $parent, - 'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM), - '$type' => 'app.bsky.feed.like' - ]; - - $post = [ - 'collection' => 'app.bsky.feed.like', - 'repo' => $did, - 'record' => $record - ]; - } elseif ($item['verb'] == Activity::ANNOUNCE) { - $record = [ - 'subject' => $parent, - 'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM), - '$type' => 'app.bsky.feed.repost' - ]; - - $post = [ - 'collection' => 'app.bsky.feed.repost', - 'repo' => $did, - 'record' => $record - ]; - } - - $activity = DI::atProtocol()->XRPCPost($uid, 'com.atproto.repo.createRecord', $post); - if (empty($activity->uri)) { - return; - } - DI::logger()->debug('Activity done', ['return' => $activity]); - $uri = DI::atpProcessor()->getUri($activity); - Item::update(['extid' => $uri], ['guid' => $item['guid']]); - DI::logger()->debug('Set extid', ['id' => $item['id'], 'extid' => $activity]); -} - -function bluesky_create_post(array $item, stdClass $root = null, stdClass $parent = null) -{ - $uid = $item['uid']; - $token = DI::atProtocol()->getUserToken($uid); - if (empty($token)) { - return; - } - - // Try to fetch the language from the post itself - if (!empty($item['language'])) { - $language = array_key_first(json_decode($item['language'], true)); - } else { - $language = ''; - } - - $item['body'] = Post\Media::removeFromBody($item['body']); - - foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::ACTIVITY]) as $media) { - if (strpos($item['body'], $media['url']) === false) { - $item['body'] .= "\n[url]" . $media['url'] . "[/url]\n"; - } - } - - if (!empty($item['quote-uri-id'])) { - $quote = Post::selectFirstPost(['uri', 'plink'], ['uri-id' => $item['quote-uri-id']]); - if (!empty($quote)) { - if ((strpos($item['body'], $quote['plink'] ?: $quote['uri']) === false) && (strpos($item['body'], $quote['uri']) === false)) { - $item['body'] .= "\n[url]" . ($quote['plink'] ?: $quote['uri']) . "[/url]\n"; - } - } - } - - $item['body'] = bluesky_set_mentions($item['body']); - - $urls = bluesky_get_urls($item['body']); - $item['body'] = $urls['body']; - - $msg = Plaintext::getPost($item, 300, false, BBCode::BLUESKY); - foreach ($msg['parts'] as $key => $part) { - - $facets = bluesky_get_facets($part, $urls['urls']); - - $record = [ - 'text' => $facets['body'], - '$type' => 'app.bsky.feed.post', - 'createdAt' => DateTimeFormat::utcNow(DateTimeFormat::ATOM), - ]; - - if (!empty($language)) { - $record['langs'] = [$language]; - } - - if (!empty($facets['facets'])) { - $record['facets'] = $facets['facets']; - } - - if (!empty($root)) { - $record['reply'] = ['root' => $root, 'parent' => $parent]; - } - - if ($key == count($msg['parts']) - 1) { - $record = bluesky_add_embed($uid, $msg, $record); - if (empty($record)) { - if (Worker::getRetrial() < 3) { - Worker::defer(); - } - return; - } - } - - $post = [ - 'collection' => 'app.bsky.feed.post', - 'repo' => DI::atProtocol()->getUserDid($uid), - 'record' => $record - ]; - - $parent = DI::atProtocol()->XRPCPost($uid, 'com.atproto.repo.createRecord', $post); - if (empty($parent->uri)) { - if ($part == 0) { - Worker::defer(); - } - return; - } - DI::logger()->debug('Posting done', ['return' => $parent]); - if (empty($root)) { - $root = $parent; - } - if (($key == 0) && ($item['gravity'] != Item::GRAVITY_PARENT)) { - $uri = DI::atpProcessor()->getUri($parent); - Item::update(['extid' => $uri], ['guid' => $item['guid']]); - DI::logger()->debug('Set extid', ['id' => $item['id'], 'extid' => $uri]); - } - } -} - -function bluesky_set_mentions(string $body): string -{ - // Remove all url based mention links - $body = preg_replace("/([@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '$1$3', $body); - - if (!preg_match_all("/[@!]\[url\=(did:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) { - return $body; - } - - foreach ($matches as $match) { - $contact = Contact::selectFirst(['addr'], ['nurl' => $match[1]]); - if (!empty($contact['addr'])) { - $body = str_replace($match[0], '@[url=' . $match[1] . ']' . $contact['addr'] . '[/url]', $body); - } else { - $body = str_replace($match[0], '@' . $match[2], $body); - } - } - - return $body; -} - -function bluesky_get_urls(string $body): array -{ - $body = BBCode::expandVideoLinks($body); - $urls = []; - - // Search for Mentions - if (preg_match_all("/[@!]\[url\=(did:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) { - foreach ($matches as $match) { - $text = '@' . $match[2]; - $urls[strpos($body, $match[0])] = ['mention' => $match[1], 'text' => $text, 'hash' => $text]; - $body = str_replace($match[0], $text, $body); - } - } - - // Search for hash tags - if (preg_match_all("/#\[url\=(https?:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) { - foreach ($matches as $match) { - $text = '#' . $match[2]; - $urls[strpos($body, $match[0])] = ['tag' => $match[2], 'text' => $text, 'hash' => $text]; - $body = str_replace($match[0], $text, $body); - } - } - - // Search for pure links - if (preg_match_all("/\[url\](https?:.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) { - foreach ($matches as $match) { - $text = Strings::getStyledURL($match[1]); - $hash = bluesky_get_hash_for_url($match[0], mb_strlen($text)); - $urls[strpos($body, $match[0])] = ['url' => $match[1], 'text' => $text, 'hash' => $hash]; - $body = str_replace($match[0], $hash, $body); - } - } - - // Search for links with descriptions - if (preg_match_all("/\[url\=(https?:.*?)\](.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER)) { - foreach ($matches as $match) { - if ($match[1] == $match[2]) { - $text = Strings::getStyledURL($match[1]); - } else { - $text = $match[2]; - } - if (mb_strlen($text) < 100) { - $hash = bluesky_get_hash_for_url($match[0], mb_strlen($text)); - $urls[strpos($body, $match[0])] = ['url' => $match[1], 'text' => $text, 'hash' => $hash]; - $body = str_replace($match[0], $hash, $body); - } else { - $text = Strings::getStyledURL($match[1]); - $hash = bluesky_get_hash_for_url($match[0], mb_strlen($text)); - $urls[strpos($body, $match[0])] = ['url' => $match[1], 'text' => $text, 'hash' => $hash]; - $body = str_replace($match[0], $text . ' ' . $hash, $body); - } - } - } - - asort($urls); - - return ['body' => $body, 'urls' => $urls]; -} - -function bluesky_get_hash_for_url(string $text, int $linklength): string -{ - if ($linklength <= 10) { - return '|' . hash('crc32', $text) . '|'; - } - return substr('|' . hash('crc32', $text) . base64_encode($text), 0, $linklength - 2) . '|'; -} - -function bluesky_get_facets(string $body, array $urls): array -{ - $facets = []; - - foreach ($urls as $url) { - $pos = strpos($body, $url['hash']); - if ($pos === false) { - continue; - } - if ($pos > 0) { - $prefix = substr($body, 0, $pos); - } else { - $prefix = ''; - } - - $body = $prefix . $url['text'] . substr($body, $pos + strlen($url['hash'])); - - $facet = new stdClass; - $facet->index = new stdClass; - $facet->index->byteEnd = $pos + strlen($url['text']); - $facet->index->byteStart = $pos; - - $feature = new stdClass; - - $type = '$type'; - if (!empty($url['tag'])) { - $feature->tag = $url['tag']; - $feature->$type = 'app.bsky.richtext.facet#tag'; - } elseif (!empty($url['url'])) { - $feature->uri = $url['url']; - $feature->$type = 'app.bsky.richtext.facet#link'; - } elseif (!empty($url['mention'])) { - $feature->did = $url['mention']; - $feature->$type = 'app.bsky.richtext.facet#mention'; - } else { - continue; - } - - $facet->features = [$feature]; - $facets[] = $facet; - } - - return ['facets' => $facets, 'body' => $body]; -} - -function bluesky_add_embed(int $uid, array $msg, array $record): array -{ - if (($msg['type'] != 'link') && !empty($msg['images'])) { - $images = []; - foreach ($msg['images'] as $image) { - if (count($images) == 4) { - continue; - } - $photo = Photo::selectFirst([], ['id' => $image['id']]); - $blob = bluesky_upload_blob($uid, $photo); - if (empty($blob)) { - return []; - } - $images[] = [ - 'alt' => $image['description'] ?? '', - 'image' => $blob, - 'aspectRatio' => [ - 'width' => $photo['width'], - 'height' => $photo['height'], - ] - ]; - } - if (!empty($images)) { - $record['embed'] = ['$type' => 'app.bsky.embed.images', 'images' => $images]; - } - } elseif ($msg['type'] == 'link') { - $record['embed'] = [ - '$type' => 'app.bsky.embed.external', - 'external' => [ - 'uri' => $msg['url'], - 'title' => $msg['title'] ?? '', - 'description' => $msg['description'] ?? '', - ] - ]; - if (!empty($msg['image'])) { - $photo = Photo::createPhotoForExternalResource($msg['image']); - $blob = bluesky_upload_blob($uid, $photo); - if (!empty($blob)) { - $record['embed']['external']['thumb'] = $blob; - } - } - } - return $record; -} - -function bluesky_upload_blob(int $uid, array $photo): ?stdClass -{ - $retrial = Worker::getRetrial(); - $content = Photo::getImageForPhoto($photo); - - $picture = new Image($content, $photo['type'], $photo['filename']); - $height = $picture->getHeight(); - $width = $picture->getWidth(); - $size = strlen($content); - - $picture = Photo::resizeToFileSize($picture, BLUESKY_IMAGE_SIZE[$retrial]); - $new_height = $picture->getHeight(); - $new_width = $picture->getWidth(); - $content = (string)$picture->asString(); - $new_size = strlen($content); - - if (($size != 0) && ($new_size == 0) && ($retrial == 0)) { - DI::logger()->warning('Size is empty after resize, uploading original file', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]); - $content = Photo::getImageForPhoto($photo); - } else { - DI::logger()->info('Uploading', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]); - } - - $data = DI::atProtocol()->post($uid, '/xrpc/com.atproto.repo.uploadBlob', $content, ['Content-type' => $photo['type'], 'Authorization' => ['Bearer ' . DI::atProtocol()->getUserToken($uid)]]); - if (empty($data) || empty($data->blob)) { - DI::logger()->info('Uploading failed', ['uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]); - return null; - } - - Item::incrementOutbound(Protocol::BLUESKY); - DI::logger()->debug('Uploaded blob', ['return' => $data, 'uid' => $uid, 'retrial' => $retrial, 'height' => $new_height, 'width' => $new_width, 'size' => $new_size, 'orig-height' => $height, 'orig-width' => $width, 'orig-size' => $size]); - return $data->blob; -} - -function bluesky_delete_post(string $uri, int $uid) -{ - $parts = DI::atpProcessor()->getUriParts($uri); - if (empty($parts)) { - DI::logger()->debug('No uri delected', ['uri' => $uri]); - return; - } - DI::atProtocol()->XRPCPost($uid, 'com.atproto.repo.deleteRecord', $parts); - DI::logger()->debug('Deleted', ['parts' => $parts]); -} - -function bluesky_fetch_timeline(int $uid) -{ - $data = DI::atProtocol()->XRPCGet('app.bsky.feed.getTimeline', [], $uid); - if (empty($data)) { - return; - } - - if (empty($data->feed)) { - return; - } - - foreach (array_reverse($data->feed) as $entry) { - $causer = DI::atpActor()->getContactByDID($entry->post->author->did, $uid, 0, true); - if (!empty($entry->reply)) { - if (!empty($entry->reply->root)) { - bluesky_complete_post($entry->reply->root, $uid, Item::PR_COMMENT, $causer['id'], Conversation::PARCEL_CONNECTOR); - } - if (!empty($entry->reply->parent)) { - bluesky_complete_post($entry->reply->parent, $uid, Item::PR_COMMENT, $causer['id'], Conversation::PARCEL_CONNECTOR); - } - } - DI::atpProcessor()->processPost($entry->post, $uid, Item::PR_NONE, 0, 0, Conversation::PARCEL_CONNECTOR); - if (!empty($entry->reason)) { - bluesky_process_reason($entry->reason, DI::atpProcessor()->getUri($entry->post), $uid); - } - } -} - -function bluesky_complete_post(stdClass $post, int $uid, int $post_reason, int $causer, int $protocol): int -{ - $complete = DI::pConfig()->get($uid, 'bluesky', 'complete_threads'); - $existing_uri = DI::atpProcessor()->getPostUri(DI::atpProcessor()->getUri($post), $uid); - if (!empty($existing_uri)) { - $comments = Post::countPosts(['thr-parent' => $existing_uri, 'gravity' => Item::GRAVITY_COMMENT]); - if (($post->replyCount <= $comments) || !$complete) { - return DI::atpProcessor()->fetchUriId($existing_uri, $uid); - } - } - - if ($complete) { - $uri = DI::atpProcessor()->fetchMissingPost(DI::atpProcessor()->getUri($post), $uid, $post_reason, $causer, 0, '', true, $protocol); - $uri_id = DI::atpProcessor()->fetchUriId($uri, $uid); - } else { - $uri_id = DI::atpProcessor()->processPost($post, $uid, $post_reason, $causer, 0, $protocol); - } - return $uri_id; -} - -function bluesky_process_reason(stdClass $reason, string $uri, int $uid) -{ - $type = '$type'; - if ($reason->$type != 'app.bsky.feed.defs#reasonRepost') { - return; - } - - $contact = DI::atpActor()->getContactByDID($reason->by->did, $uid, 0); - - $item = [ - 'network' => Protocol::BLUESKY, - 'protocol' => Conversation::PARCEL_CONNECTOR, - 'uid' => $uid, - 'wall' => false, - 'uri' => $reason->by->did . '/app.bsky.feed.repost/' . $reason->indexedAt, - 'private' => Item::UNLISTED, - 'contact-id' => $contact['id'], - 'author-name' => $contact['name'], - 'author-link' => $contact['url'], - 'author-avatar' => $contact['avatar'], - 'verb' => Activity::ANNOUNCE, - 'body' => Activity::ANNOUNCE, - 'gravity' => Item::GRAVITY_ACTIVITY, - 'object-type' => Activity\ObjectType::NOTE, - 'thr-parent' => $uri, - ]; - - if (Post::exists(['uri' => $item['uri'], 'uid' => $uid])) { - return; - } - - if (Post::exists(['uid' => $item['uid'], 'thr-parent' => $item['thr-parent'], 'verb' => $item['verb'], 'contact-id' => $item['contact-id']])) { - return; - } - - $item['guid'] = Item::guidFromUri($item['uri'], $contact['alias']); - $item['owner-name'] = $item['author-name']; - $item['owner-link'] = $item['author-link']; - $item['owner-avatar'] = $item['author-avatar']; - if (Item::insert($item)) { - $pcid = Contact::getPublicContactId($contact['id'], $uid); - Item::update(['post-reason' => Item::PR_ANNOUNCEMENT, 'causer-id' => $pcid], ['uri' => $uri, 'uid' => $uid]); - } -} - -function bluesky_fetch_notifications(int $uid) -{ - $data = DI::atProtocol()->XRPCGet('app.bsky.notification.listNotifications', [], $uid); - if (empty($data->notifications)) { - return; - } - - foreach ($data->notifications as $notification) { - $uri = DI::atpProcessor()->getUri($notification); - if (Post::exists(['uri' => $uri, 'uid' => $uid]) || Post::exists(['extid' => $uri, 'uid' => $uid])) { - DI::logger()->debug('Notification already processed', ['uid' => $uid, 'reason' => $notification->reason, 'uri' => $uri, 'indexedAt' => $notification->indexedAt]); - continue; - } - DI::logger()->debug('Process notification', ['uid' => $uid, 'reason' => $notification->reason, 'uri' => $uri, 'indexedAt' => $notification->indexedAt]); - switch ($notification->reason) { - case 'like': - $item = DI::atpProcessor()->getHeaderFromPost($notification, $uri, $uid, Conversation::PARCEL_CONNECTOR); - $item['gravity'] = Item::GRAVITY_ACTIVITY; - $item['body'] = $item['verb'] = Activity::LIKE; - $item['thr-parent'] = DI::atpProcessor()->getUri($notification->record->subject); - $item['thr-parent'] = DI::atpProcessor()->fetchMissingPost($item['thr-parent'], $uid, Item::PR_FETCHED, $item['contact-id'], 0); - if (!empty($item['thr-parent'])) { - $data = Item::insert($item); - DI::logger()->debug('Got like', ['uid' => $uid, 'result' => $data, 'uri' => $uri]); - } else { - DI::logger()->info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]); - } - break; - - case 'repost': - $item = DI::atpProcessor()->getHeaderFromPost($notification, $uri, $uid, Conversation::PARCEL_CONNECTOR); - $item['gravity'] = Item::GRAVITY_ACTIVITY; - $item['body'] = $item['verb'] = Activity::ANNOUNCE; - $item['thr-parent'] = DI::atpProcessor()->getUri($notification->record->subject); - $item['thr-parent'] = DI::atpProcessor()->fetchMissingPost($item['thr-parent'], $uid, Item::PR_FETCHED, $item['contact-id'], 0); - if (!empty($item['thr-parent'])) { - $data = Item::insert($item); - DI::logger()->debug('Got repost', ['uid' => $uid, 'result' => $data, 'uri' => $uri]); - } else { - DI::logger()->info('Thread parent not found', ['uid' => $uid, 'parent' => $item['thr-parent'], 'uri' => $uri]); - } - break; - - case 'follow': - $contact = DI::atpActor()->getContactByDID($notification->author->did, $uid, $uid); - DI::logger()->debug('New follower', ['uid' => $uid, 'nick' => $contact['nick'], 'uri' => $uri]); - break; - - case 'mention': - $contact = DI::atpActor()->getContactByDID($notification->author->did, $uid, 0); - $result = DI::atpProcessor()->fetchMissingPost($uri, $uid, Item::PR_TO, $contact['id'], 0); - DI::logger()->debug('Got mention', ['uid' => $uid, 'nick' => $contact['nick'], 'result' => $result, 'uri' => $uri]); - break; - - case 'reply': - $contact = DI::atpActor()->getContactByDID($notification->author->did, $uid, 0); - $result = DI::atpProcessor()->fetchMissingPost($uri, $uid, Item::PR_COMMENT, $contact['id'], 0); - DI::logger()->debug('Got reply', ['uid' => $uid, 'nick' => $contact['nick'], 'result' => $result, 'uri' => $uri]); - break; - - case 'quote': - $contact = DI::atpActor()->getContactByDID($notification->author->did, $uid, 0); - $result = DI::atpProcessor()->fetchMissingPost($uri, $uid, Item::PR_PUSHED, $contact['id'], 0); - DI::logger()->debug('Got quote', ['uid' => $uid, 'nick' => $contact['nick'], 'result' => $result, 'uri' => $uri]); - break; - - default: - DI::logger()->notice('Unhandled reason', ['reason' => $notification->reason, 'uri' => $uri]); - break; - } - } -} - -function bluesky_fetch_feed(int $uid, string $feed) -{ - $data = DI::atProtocol()->XRPCGet('app.bsky.feed.getFeed', ['feed' => $feed], $uid); - if (empty($data)) { - return; - } - - if (empty($data->feed)) { - return; - } - - $feeddata = DI::atProtocol()->XRPCGet('app.bsky.feed.getFeedGenerator', ['feed' => $feed], $uid); - if (!empty($feeddata) && !empty($feeddata->view)) { - $feedurl = $feeddata->view->uri; - $feedname = $feeddata->view->displayName; - } else { - $feedurl = $feed; - $feedname = $feed; - } - - foreach (array_reverse($data->feed) as $entry) { - $contact = DI::atpActor()->getContactByDID($entry->post->author->did, $uid, 0); - $languages = $entry->post->record->langs ?? []; - - if (!Relay::isWantedLanguage($entry->post->record->text, 0, $contact['id'] ?? 0, $languages)) { - DI::logger()->debug('Unwanted language detected', ['languages' => $languages, 'text' => $entry->post->record->text]); - continue; - } - $causer = DI::atpActor()->getContactByDID($entry->post->author->did, $uid, 0); - $uri_id = bluesky_complete_post($entry->post, $uid, Item::PR_TAG, $causer['id'], Conversation::PARCEL_CONNECTOR); - if (!empty($uri_id)) { - $stored = Post\Category::storeFileByURIId($uri_id, $uid, Post\Category::SUBCRIPTION, $feedname, $feedurl); - DI::logger()->debug('Stored tag subscription for user', ['uri-id' => $uri_id, 'uid' => $uid, 'name' => $feedname, 'url' => $feedurl, 'stored' => $stored]); - } else { - DI::logger()->notice('Post not found', ['entry' => $entry]); - } - if (!empty($entry->reason)) { - bluesky_process_reason($entry->reason, DI::atpProcessor()->getUri($entry->post), $uid); - } - } -} - -function bluesky_get_feeds(int $uid): array -{ - $type = '$type'; - $preferences = bluesky_get_preferences($uid); - if (empty($preferences) || empty($preferences->preferences)) { - return []; - } - foreach ($preferences->preferences as $preference) { - if ($preference->$type == 'app.bsky.actor.defs#savedFeedsPrefV2') { - $pinned = []; - foreach ($preference->items as $item) { - if (($item->type == 'feed') && $item->pinned) { - $pinned[] = $item->value; - } - } - return $pinned; - } - } - return []; -} - -function bluesky_get_preferences(int $uid): ?stdClass -{ - $cachekey = 'bluesky:preferences:' . $uid; - $data = DI::cache()->get($cachekey); - if (!is_null($data)) { - return $data; - } - - $data = DI::atProtocol()->XRPCGet('app.bsky.actor.getPreferences', [], $uid); - if (empty($data)) { - return null; - } - - DI::cache()->set($cachekey, $data, Duration::HOUR); - return $data; -} diff --git a/bluesky/bluesky_feed.php b/bluesky/bluesky_feed.php deleted file mode 100644 index e4aa3fdc..00000000 --- a/bluesky/bluesky_feed.php +++ /dev/null @@ -1,16 +0,0 @@ -debug('Importing feed - start', ['user' => $argv[1], 'feed' => $argv[2]]); - bluesky_fetch_feed($argv[1], $argv[2]); - DI::logger()->debug('Importing feed - done', ['user' => $argv[1], 'feed' => $argv[2]]); -} diff --git a/bluesky/bluesky_notifications.php b/bluesky/bluesky_notifications.php deleted file mode 100644 index e1bf2047..00000000 --- a/bluesky/bluesky_notifications.php +++ /dev/null @@ -1,16 +0,0 @@ -notice('importing notifications - start', ['user' => $argv[1]]); - bluesky_fetch_notifications($argv[1]); - DI::logger()->notice('importing notifications - done', ['user' => $argv[1]]); -} diff --git a/bluesky/bluesky_timeline.php b/bluesky/bluesky_timeline.php deleted file mode 100644 index 37b22d99..00000000 --- a/bluesky/bluesky_timeline.php +++ /dev/null @@ -1,16 +0,0 @@ -notice('importing timeline - start', ['user' => $argv[1]]); - bluesky_fetch_timeline($argv[1]); - DI::logger()->notice('importing timeline - done', ['user' => $argv[1]]); -} diff --git a/bluesky/lang/C/messages.po b/bluesky/lang/C/messages.po deleted file mode 100644 index d573972c..00000000 --- a/bluesky/lang/C/messages.po +++ /dev/null @@ -1,133 +0,0 @@ -# ADDON bluesky -# Copyright (C) -# This file is distributed under the same license as the Friendica bluesky addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-29 18:16+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: bluesky.php:335 -msgid "Save Settings" -msgstr "" - -#: bluesky.php:336 -msgid "Allow your users to use your hostname for their Bluesky handles" -msgstr "" - -#: bluesky.php:336 -#, php-format -msgid "Before enabling this option, you have to setup a wildcard domain configuration and you have to enable wildcard requests in your webserver configuration. On Apache this is done by adding \"ServerAlias *.%s\" to your HTTP configuration. You don't need to change the HTTPS configuration." -msgstr "" - -#: bluesky.php:365 -#, php-format -msgid "Allow to use %s as your Bluesky handle." -msgstr "" - -#: bluesky.php:365 -#, php-format -msgid "When enabled, you can use %s as your Bluesky handle. After you enabled this option, please go to https://bsky.app/settings and select to change your handle. Select that you have got your own domain. Then enter %s and select \"No DNS Panel\". Then select \"Verify Text File\"." -msgstr "" - -#: bluesky.php:375 -msgid "Enable Bluesky Post Addon" -msgstr "" - -#: bluesky.php:376 -msgid "Post to Bluesky by default" -msgstr "" - -#: bluesky.php:377 -msgid "Import the remote timeline" -msgstr "" - -#: bluesky.php:378 -msgid "Import the pinned feeds" -msgstr "" - -#: bluesky.php:378 -msgid "When activated, Posts will be imported from all the feeds that you pinned in Bluesky." -msgstr "" - -#: bluesky.php:379 -msgid "Complete the threads" -msgstr "" - -#: bluesky.php:379 -msgid "When activated, the system fetches additional replies for the posts in the timeline. This leads to more complete threads." -msgstr "" - -#: bluesky.php:381 -msgid "Personal Data Server" -msgstr "" - -#: bluesky.php:381 -msgid "The personal data server (PDS) is the system that hosts your profile." -msgstr "" - -#: bluesky.php:382 -msgid "Bluesky handle" -msgstr "" - -#: bluesky.php:383 -msgid "Bluesky DID" -msgstr "" - -#: bluesky.php:383 -msgid "This is the unique identifier. It will be fetched automatically, when the handle is entered." -msgstr "" - -#: bluesky.php:384 -msgid "Bluesky app password" -msgstr "" - -#: bluesky.php:384 -msgid "Please don't add your real password here, but instead create a specific app password in the Bluesky settings." -msgstr "" - -#: bluesky.php:390 -msgid "Bluesky Import/Export" -msgstr "" - -#: bluesky.php:400 -msgid "You are not authenticated. Please enter your handle and the app password." -msgstr "" - -#: bluesky.php:420 -msgid "You are authenticated to Bluesky. For security reasons the password isn't stored." -msgstr "" - -#: bluesky.php:422 -msgid "The communication with the personal data server service (PDS) is established." -msgstr "" - -#: bluesky.php:424 -msgid "Communication issues with the personal data server service (PDS)." -msgstr "" - -#: bluesky.php:426 -msgid "The DID for the provided handle could not be detected. Please check if you entered the correct handle." -msgstr "" - -#: bluesky.php:428 -msgid "The personal data server service (PDS) could not be detected." -msgstr "" - -#: bluesky.php:430 -msgid "The authentication with the provided handle and password failed. Please check if you entered the correct password." -msgstr "" - -#: bluesky.php:492 -msgid "Post to Bluesky" -msgstr "" diff --git a/bluesky/lang/de/messages.po b/bluesky/lang/de/messages.po deleted file mode 100644 index 13ea8e96..00000000 --- a/bluesky/lang/de/messages.po +++ /dev/null @@ -1,89 +0,0 @@ -# ADDON bluesky -# Copyright (C) -# This file is distributed under the same license as the Friendica bluesky addon package. -# -# -# Translators: -# Tobias Diekershoff , 2023 -# haheute , 2023 -# Raroun, 2023 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-24 05:52+0000\n" -"PO-Revision-Date: 2023-05-24 06:02+0000\n" -"Last-Translator: Raroun, 2023\n" -"Language-Team: German (https://app.transifex.com/Friendica/teams/12172/de/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: bluesky.php:100 -msgid "" -"You are authenticated to Bluesky. For security reasons the password isn't " -"stored." -msgstr "" -"Du bist auf Bluesky authentifiziert. Aus Sicherheitsgründen wird das " -"Passwort nicht gespeichert." - -#: bluesky.php:100 -msgid "You are not authenticated. Please enter the app password." -msgstr "" -"Du bist derzeit nicht authentifiziert. Bitte gib dein App Passwort ein." - -#: bluesky.php:104 -msgid "Enable Bluesky Post Addon" -msgstr "Bluesky Post Addon aktivieren" - -#: bluesky.php:105 -msgid "Post to Bluesky by default" -msgstr "Standardmäßig auf Bluesky veröffentlichen" - -#: bluesky.php:106 -msgid "Import the remote timeline" -msgstr "Importiere die entfernte Timeline" - -#: bluesky.php:107 -msgid "Bluesky host" -msgstr "Bluesky Host" - -#: bluesky.php:108 -msgid "Bluesky handle" -msgstr "Bluesky Handle" - -#: bluesky.php:109 -msgid "Bluesky DID" -msgstr "Bluesky DID" - -#: bluesky.php:109 -msgid "" -"This is the unique identifier. It will be fetched automatically, when the " -"handle is entered." -msgstr "" -"Sobald das Handle eingegeben ist, wird diese einzigartige Kennung " -"automatisch abgerufen." - -#: bluesky.php:110 -msgid "Bluesky app password" -msgstr "Bluesky App Passwort" - -#: bluesky.php:110 -msgid "" -"Please don't add your real password here, but instead create a specific app " -"password in the Bluesky settings." -msgstr "" -"Bitte verwende hier nicht dein echtes Passwort, sondern stattdessen ein " -"speziell für diese App in den Bluesky Einstellungen festgelegtes Passwort." - -#: bluesky.php:116 -msgid "Bluesky Import/Export" -msgstr "Bluesky Import/Export" - -#: bluesky.php:167 -msgid "Post to Bluesky" -msgstr "Auf Bluesky veröffentlichen" diff --git a/bluesky/lang/de/strings.php b/bluesky/lang/de/strings.php deleted file mode 100644 index 8e3c9421..00000000 --- a/bluesky/lang/de/strings.php +++ /dev/null @@ -1,20 +0,0 @@ -strings['You are authenticated to Bluesky. For security reasons the password isn\'t stored.'] = 'Du bist auf Bluesky authentifiziert. Aus Sicherheitsgründen wird das Passwort nicht gespeichert.'; -$a->strings['You are not authenticated. Please enter the app password.'] = 'Du bist derzeit nicht authentifiziert. Bitte gib dein App Passwort ein.'; -$a->strings['Enable Bluesky Post Addon'] = 'Bluesky Post Addon aktivieren'; -$a->strings['Post to Bluesky by default'] = 'Standardmäßig auf Bluesky veröffentlichen'; -$a->strings['Import the remote timeline'] = 'Importiere die entfernte Timeline'; -$a->strings['Bluesky host'] = 'Bluesky Host'; -$a->strings['Bluesky handle'] = 'Bluesky Handle'; -$a->strings['Bluesky DID'] = 'Bluesky DID'; -$a->strings['This is the unique identifier. It will be fetched automatically, when the handle is entered.'] = 'Sobald das Handle eingegeben ist, wird diese einzigartige Kennung automatisch abgerufen.'; -$a->strings['Bluesky app password'] = 'Bluesky App Passwort'; -$a->strings['Please don\'t add your real password here, but instead create a specific app password in the Bluesky settings.'] = 'Bitte verwende hier nicht dein echtes Passwort, sondern stattdessen ein speziell für diese App in den Bluesky Einstellungen festgelegtes Passwort.'; -$a->strings['Bluesky Import/Export'] = 'Bluesky Import/Export'; -$a->strings['Post to Bluesky'] = 'Auf Bluesky veröffentlichen'; diff --git a/bluesky/lang/zh-cn/messages.po b/bluesky/lang/zh-cn/messages.po deleted file mode 100644 index 9074ce34..00000000 --- a/bluesky/lang/zh-cn/messages.po +++ /dev/null @@ -1,80 +0,0 @@ -# ADDON bluesky -# Copyright (C) -# This file is distributed under the same license as the Friendica bluesky addon package. -# -# -# Translators: -# tslmuun, 2023 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-24 05:52+0000\n" -"PO-Revision-Date: 2023-05-24 06:02+0000\n" -"Last-Translator: tslmuun, 2023\n" -"Language-Team: Chinese (China) (https://app.transifex.com/Friendica/teams/12172/zh_CN/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: bluesky.php:100 -msgid "" -"You are authenticated to Bluesky. For security reasons the password isn't " -"stored." -msgstr "您已通过 Bluesky 的身份验证。 出于安全原因,不存储密码。" - -#: bluesky.php:100 -msgid "You are not authenticated. Please enter the app password." -msgstr "您未通过身份验证。 请输入应用密码。" - -#: bluesky.php:104 -msgid "Enable Bluesky Post Addon" -msgstr "启用Bluesky插件" - -#: bluesky.php:105 -msgid "Post to Bluesky by default" -msgstr "默认发布到Bluesky" - -#: bluesky.php:106 -msgid "Import the remote timeline" -msgstr "导入远程时间线" - -#: bluesky.php:107 -msgid "Bluesky host" -msgstr "Bluesky地址" - -#: bluesky.php:108 -msgid "Bluesky handle" -msgstr "Bluesky handle" - -#: bluesky.php:109 -msgid "Bluesky DID" -msgstr "Bluesky DID" - -#: bluesky.php:109 -msgid "" -"This is the unique identifier. It will be fetched automatically, when the " -"handle is entered." -msgstr "这是唯一标识符。 输入句柄时,它将自动获取。" - -#: bluesky.php:110 -msgid "Bluesky app password" -msgstr "Bluesky 应用密码" - -#: bluesky.php:110 -msgid "" -"Please don't add your real password here, but instead create a specific app " -"password in the Bluesky settings." -msgstr "请不要在此处填写您的真实密码,而是在 Bluesky 设置中创建一个特定的应用程序密码。" - -#: bluesky.php:116 -msgid "Bluesky Import/Export" -msgstr "Bluesky 导入/导出" - -#: bluesky.php:167 -msgid "Post to Bluesky" -msgstr "发布到Bluesky" diff --git a/bluesky/lang/zh-cn/strings.php b/bluesky/lang/zh-cn/strings.php deleted file mode 100644 index 9c71d974..00000000 --- a/bluesky/lang/zh-cn/strings.php +++ /dev/null @@ -1,20 +0,0 @@ -strings['You are authenticated to Bluesky. For security reasons the password isn\'t stored.'] = '您已通过 Bluesky 的身份验证。 出于安全原因,不存储密码。'; -$a->strings['You are not authenticated. Please enter the app password.'] = '您未通过身份验证。 请输入应用密码。'; -$a->strings['Enable Bluesky Post Addon'] = '启用Bluesky插件'; -$a->strings['Post to Bluesky by default'] = '默认发布到Bluesky'; -$a->strings['Import the remote timeline'] = '导入远程时间线'; -$a->strings['Bluesky host'] = 'Bluesky地址'; -$a->strings['Bluesky handle'] = 'Bluesky handle'; -$a->strings['Bluesky DID'] = 'Bluesky DID'; -$a->strings['This is the unique identifier. It will be fetched automatically, when the handle is entered.'] = '这是唯一标识符。 输入句柄时,它将自动获取。'; -$a->strings['Bluesky app password'] = 'Bluesky 应用密码'; -$a->strings['Please don\'t add your real password here, but instead create a specific app password in the Bluesky settings.'] = '请不要在此处填写您的真实密码,而是在 Bluesky 设置中创建一个特定的应用程序密码。'; -$a->strings['Bluesky Import/Export'] = 'Bluesky 导入/导出'; -$a->strings['Post to Bluesky'] = '发布到Bluesky'; diff --git a/bluesky/templates/admin.tpl b/bluesky/templates/admin.tpl deleted file mode 100644 index 7b752a88..00000000 --- a/bluesky/templates/admin.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{{include file="field_checkbox.tpl" field=$friendica_handles}} -
diff --git a/bluesky/templates/connector_settings.tpl b/bluesky/templates/connector_settings.tpl deleted file mode 100644 index a85bcd89..00000000 --- a/bluesky/templates/connector_settings.tpl +++ /dev/null @@ -1,13 +0,0 @@ -

{{$status}}

-{{include file="field_checkbox.tpl" field=$enable}} -{{include file="field_checkbox.tpl" field=$bydefault}} -{{include file="field_checkbox.tpl" field=$import}} -{{include file="field_checkbox.tpl" field=$import_feeds}} -{{include file="field_checkbox.tpl" field=$complete_threads}} -{{if $custom_handle}} - {{include file="field_checkbox.tpl" field=$custom_handle}} -{{/if}} -{{include file="field_input.tpl" field=$pds}} -{{include file="field_input.tpl" field=$handle}} -{{include file="field_input.tpl" field=$did}} -{{include file="field_input.tpl" field=$password}} \ No newline at end of file diff --git a/buglink/buglink.php b/buglink/buglink.php index b7dd6504..78fb8bef 100644 --- a/buglink/buglink.php +++ b/buglink/buglink.php @@ -6,6 +6,7 @@ * Author: Mike Macgirvin */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; diff --git a/buglink/lang/bg/messages.po b/buglink/lang/bg/messages.po deleted file mode 100644 index d3a60344..00000000 --- a/buglink/lang/bg/messages.po +++ /dev/null @@ -1,23 +0,0 @@ -# ADDON buglink -# Copyright (C) -# This file is distributed under the same license as the Friendica buglink addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-22 11:27+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: buglink.php:20 -msgid "Report Bug" -msgstr "" diff --git a/buglink/lang/bg/strings.php b/buglink/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/buglink/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: buglink.php:20 -msgid "Report Bug" -msgstr "" diff --git a/buglink/lang/eo/strings.php b/buglink/lang/eo/strings.php index 68e8a64c..00d95a40 100644 --- a/buglink/lang/eo/strings.php +++ b/buglink/lang/eo/strings.php @@ -1,7 +1,3 @@ -strings["Report Bug"] = "Skribi cimraporton"; diff --git a/buglink/lang/et/messages.po b/buglink/lang/et/messages.po deleted file mode 100644 index db854464..00000000 --- a/buglink/lang/et/messages.po +++ /dev/null @@ -1,23 +0,0 @@ -# ADDON buglink -# Copyright (C) -# This file is distributed under the same license as the Friendica buglink addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-22 11:27+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: buglink.php:20 -msgid "Report Bug" -msgstr "" diff --git a/buglink/lang/et/strings.php b/buglink/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/buglink/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; @@ -15,7 +16,7 @@ function calc_install() { function calc_app_menu(array &$b) { - $b['app_menu'][] = ''; + $b['app_menu'][] = ''; } /** @@ -295,7 +296,7 @@ $o .= <<< EOT

Calculator



-
+
La Libravatar kromprogramo retropaŝos al Gravatar se neniu troveblis ĉe Libravatar."; +$a->strings["Submit"] = "Sendi"; +$a->strings["Default avatar image"] = "Defaŭlta avatarbildo"; +$a->strings["Select default avatar image if none was found. See README"] = "Elektu la defaŭltan avatar bildon sen neniu troveblis. Legu README."; +$a->strings["Libravatar settings updated."] = "Ĝisdatigis Libravatar agordojn."; diff --git a/libravatar/lang/et/messages.po b/libravatar/lang/et/messages.po deleted file mode 100644 index d25028a3..00000000 --- a/libravatar/lang/et/messages.po +++ /dev/null @@ -1,71 +0,0 @@ -# ADDON libravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica libravatar addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/et/strings.php b/libravatar/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/libravatar/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2022 # Hypolite Petovan , 2016 # ea1cd8241cb389ffb6f92bc6891eff5d_dc12308 <70dced5587d47e18d88f9298024d96f8_93383>, 2015 @@ -14,8 +13,8 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: cracrayol, 2025\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: Hypolite Petovan , 2022\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -63,7 +62,7 @@ msgstr "L'extension Gravatar est installée. Veuillez la désactiver.
L'exte #: libravatar.php:83 msgid "Save Settings" -msgstr "Sauvegarder les paramètres" +msgstr "Enregistrer les paramètres" #: libravatar.php:84 msgid "Default avatar image" diff --git a/libravatar/lang/fr/strings.php b/libravatar/lang/fr/strings.php index 87a3a9ab..dd3cbe2c 100644 --- a/libravatar/lang/fr/strings.php +++ b/libravatar/lang/fr/strings.php @@ -14,6 +14,6 @@ $a->strings['roboter face'] = 'Tête de robot'; $a->strings['retro adventure game character'] = 'Personnage de jeu d\'aventure rétro'; $a->strings['Information'] = 'Information'; $a->strings['Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.'] = 'L\'extension Gravatar est installée. Veuillez la désactiver.
L\'extension Libravatar se repose sur Gravatar si l\'avatar n\'a pas été trouvé sur Libravatar.'; -$a->strings['Save Settings'] = 'Sauvegarder les paramètres'; +$a->strings['Save Settings'] = 'Enregistrer les paramètres'; $a->strings['Default avatar image'] = 'Avatar par défaut'; $a->strings['Select default avatar image if none was found. See README'] = 'Sélectionnez un avatar par défaut si rien n\'a été trouvé. Voir le README'; diff --git a/libravatar/lang/gd/messages.po b/libravatar/lang/gd/messages.po deleted file mode 100644 index 95c88e99..00000000 --- a/libravatar/lang/gd/messages.po +++ /dev/null @@ -1,70 +0,0 @@ -# ADDON libravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica libravatar addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/gd/strings.php b/libravatar/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/libravatar/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/libravatar/lang/is/messages.po b/libravatar/lang/is/messages.po deleted file mode 100644 index 75746e3d..00000000 --- a/libravatar/lang/is/messages.po +++ /dev/null @@ -1,70 +0,0 @@ -# ADDON libravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica libravatar addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/is/strings.php b/libravatar/lang/is/strings.php index 975c341e..25de0e53 100644 --- a/libravatar/lang/is/strings.php +++ b/libravatar/lang/is/strings.php @@ -1,7 +1,17 @@ -strings["Could NOT install Libravatar successfully.
It requires PHP >= 5.3"] = ""; +$a->strings["generic profile image"] = ""; +$a->strings["random geometric pattern"] = ""; +$a->strings["monster face"] = ""; +$a->strings["computer generated face"] = ""; +$a->strings["retro arcade style face"] = ""; +$a->strings["Warning"] = ""; +$a->strings["Your PHP version %s is lower than the required PHP >= 5.3."] = ""; +$a->strings["This addon is not functional on your server."] = ""; +$a->strings["Information"] = ""; +$a->strings["Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = ""; +$a->strings["Submit"] = "Senda inn"; +$a->strings["Default avatar image"] = ""; +$a->strings["Select default avatar image if none was found. See README"] = ""; +$a->strings["Libravatar settings updated."] = ""; diff --git a/libravatar/lang/ru/messages.po b/libravatar/lang/ru/messages.po deleted file mode 100644 index 6723eed2..00000000 --- a/libravatar/lang/ru/messages.po +++ /dev/null @@ -1,70 +0,0 @@ -# ADDON libravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica libravatar addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "Информация" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/ru/strings.php b/libravatar/lang/ru/strings.php index 053d0249..6414c889 100644 --- a/libravatar/lang/ru/strings.php +++ b/libravatar/lang/ru/strings.php @@ -1,8 +1,17 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} -$a->strings['Information'] = 'Информация'; +strings["Could NOT install Libravatar successfully.
It requires PHP >= 5.3"] = ""; +$a->strings["generic profile image"] = ""; +$a->strings["random geometric pattern"] = ""; +$a->strings["monster face"] = ""; +$a->strings["computer generated face"] = ""; +$a->strings["retro arcade style face"] = ""; +$a->strings["Warning"] = ""; +$a->strings["Your PHP version %s is lower than the required PHP >= 5.3."] = ""; +$a->strings["This addon is not functional on your server."] = ""; +$a->strings["Information"] = ""; +$a->strings["Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = ""; +$a->strings["Submit"] = "Подтвердить"; +$a->strings["Default avatar image"] = ""; +$a->strings["Select default avatar image if none was found. See README"] = ""; +$a->strings["Libravatar settings updated."] = ""; diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index 6f47bf51..54594b88 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -6,7 +6,10 @@ * Author: Klaus Weidenbach */ +use Friendica\App; +use Friendica\Core\Addon; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Core\Config\Util\ConfigFileManager; @@ -18,12 +21,12 @@ function libravatar_install() { Hook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); Hook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); - DI::logger()->notice("registered libravatar in avatar_lookup hook"); + Logger::notice("registered libravatar in avatar_lookup hook"); } function libravatar_load_config(ConfigFileManager $loader) { - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('libravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); + DI::app()->getConfigCache()->load($loader->loadAddonConfig('libravatar'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); } /** @@ -70,9 +73,7 @@ function libravatar_addon_admin(string &$o) 'pagan' => DI::l10n()->t('retro adventure game character'), ]; - $addonHelper = DI::addonHelper(); - - if ($addonHelper->isAddonEnabled('gravatar')) { + if (Addon::isEnabled('gravatar')) { $o = '
' .DI::l10n()->t('Information') .'

' .DI::l10n()->t('Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar.') .'



'; } diff --git a/ljpost/lang/bg/messages.po b/ljpost/lang/bg/messages.po deleted file mode 100644 index 344ae537..00000000 --- a/ljpost/lang/bg/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON ljpost -# Copyright (C) -# This file is distributed under the same license as the Friendica ljpost addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:17-0500\n" -"PO-Revision-Date: 2014-06-23 09:51+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ljpost.php:43 -msgid "Post to LiveJournal" -msgstr "" - -#: ljpost.php:63 -msgid "Enable LiveJournal Post Addon" -msgstr "" - -#: ljpost.php:64 -msgid "LiveJournal username" -msgstr "" - -#: ljpost.php:65 -msgid "LiveJournal password" -msgstr "" - -#: ljpost.php:66 -msgid "Post to LiveJournal by default" -msgstr "" - -#: ljpost.php:71 -msgid "LiveJournal Export" -msgstr "" diff --git a/ljpost/lang/bg/strings.php b/ljpost/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/ljpost/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ljpost.php:43 -msgid "Post to LiveJournal" -msgstr "" - -#: ljpost.php:63 -msgid "Enable LiveJournal Post Addon" -msgstr "" - -#: ljpost.php:64 -msgid "LiveJournal username" -msgstr "" - -#: ljpost.php:65 -msgid "LiveJournal password" -msgstr "" - -#: ljpost.php:66 -msgid "Post to LiveJournal by default" -msgstr "" - -#: ljpost.php:71 -msgid "LiveJournal Export" -msgstr "" diff --git a/ljpost/lang/ca/strings.php b/ljpost/lang/ca/strings.php index d34874f6..ec370df8 100644 --- a/ljpost/lang/ca/strings.php +++ b/ljpost/lang/ca/strings.php @@ -1,7 +1,9 @@ -strings["Post to LiveJournal"] = "Missatge a Livejournal"; +$a->strings["LiveJournal Post Settings"] = "Configuració d'enviaments a Livejournal"; +$a->strings["Enable LiveJournal Post Addon"] = "Habilitat el addon d'enviaments a Livejournal"; +$a->strings["LiveJournal username"] = "Nom d'usuari a Livejournal"; +$a->strings["LiveJournal password"] = "Contrasenya a Livejournal"; +$a->strings["Post to LiveJournal by default"] = "Enviar per defecte a Livejournal"; +$a->strings["Submit"] = "Enviar"; diff --git a/ljpost/lang/eo/messages.po b/ljpost/lang/eo/messages.po deleted file mode 100644 index 3334207b..00000000 --- a/ljpost/lang/eo/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON ljpost -# Copyright (C) -# This file is distributed under the same license as the Friendica ljpost addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:17-0500\n" -"PO-Revision-Date: 2014-06-23 09:51+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ljpost.php:43 -msgid "Post to LiveJournal" -msgstr "" - -#: ljpost.php:63 -msgid "Enable LiveJournal Post Addon" -msgstr "" - -#: ljpost.php:64 -msgid "LiveJournal username" -msgstr "" - -#: ljpost.php:65 -msgid "LiveJournal password" -msgstr "" - -#: ljpost.php:66 -msgid "Post to LiveJournal by default" -msgstr "" - -#: ljpost.php:71 -msgid "LiveJournal Export" -msgstr "" diff --git a/ljpost/lang/eo/strings.php b/ljpost/lang/eo/strings.php index 68e8a64c..1bd09a6f 100644 --- a/ljpost/lang/eo/strings.php +++ b/ljpost/lang/eo/strings.php @@ -1,7 +1,9 @@ -strings["Post to LiveJournal"] = "Afiŝi ĉe LiveJournal"; +$a->strings["LiveJournal Post Settings"] = "Agordoj pri afiŝoj ĉe LiveJournal"; +$a->strings["Enable LiveJournal Post Addon"] = "Ŝalti la LiveJournal-afiŝo kromprogramon."; +$a->strings["LiveJournal username"] = "LiveJournal Salutnomo"; +$a->strings["LiveJournal password"] = "LiveJournal pasvorto"; +$a->strings["Post to LiveJournal by default"] = "Defaŭlte afiŝi al LiveJournal"; +$a->strings["Submit"] = "Sendi"; diff --git a/ljpost/lang/et/messages.po b/ljpost/lang/et/messages.po deleted file mode 100644 index e5caa42f..00000000 --- a/ljpost/lang/et/messages.po +++ /dev/null @@ -1,44 +0,0 @@ -# ADDON ljpost -# Copyright (C) -# This file is distributed under the same license as the Friendica ljpost addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:17-0500\n" -"PO-Revision-Date: 2014-06-23 09:51+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: ljpost.php:43 -msgid "Post to LiveJournal" -msgstr "" - -#: ljpost.php:63 -msgid "Enable LiveJournal Post Addon" -msgstr "" - -#: ljpost.php:64 -msgid "LiveJournal username" -msgstr "" - -#: ljpost.php:65 -msgid "LiveJournal password" -msgstr "" - -#: ljpost.php:66 -msgid "Post to LiveJournal by default" -msgstr "" - -#: ljpost.php:71 -msgid "LiveJournal Export" -msgstr "" diff --git a/ljpost/lang/et/strings.php b/ljpost/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/ljpost/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: ljpost.php:43 -msgid "Post to LiveJournal" -msgstr "" - -#: ljpost.php:63 -msgid "Enable LiveJournal Post Addon" -msgstr "" - -#: ljpost.php:64 -msgid "LiveJournal username" -msgstr "" - -#: ljpost.php:65 -msgid "LiveJournal password" -msgstr "" - -#: ljpost.php:66 -msgid "Post to LiveJournal by default" -msgstr "" - -#: ljpost.php:71 -msgid "LiveJournal Export" -msgstr "" diff --git a/ljpost/lang/gd/strings.php b/ljpost/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/ljpost/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/ljpost/lang/is/messages.po b/ljpost/lang/is/messages.po deleted file mode 100644 index 73e10103..00000000 --- a/ljpost/lang/is/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON ljpost -# Copyright (C) -# This file is distributed under the same license as the Friendica ljpost addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:17-0500\n" -"PO-Revision-Date: 2014-06-23 09:51+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: ljpost.php:43 -msgid "Post to LiveJournal" -msgstr "" - -#: ljpost.php:63 -msgid "Enable LiveJournal Post Addon" -msgstr "" - -#: ljpost.php:64 -msgid "LiveJournal username" -msgstr "" - -#: ljpost.php:65 -msgid "LiveJournal password" -msgstr "" - -#: ljpost.php:66 -msgid "Post to LiveJournal by default" -msgstr "" - -#: ljpost.php:71 -msgid "LiveJournal Export" -msgstr "" diff --git a/ljpost/lang/is/strings.php b/ljpost/lang/is/strings.php index 975c341e..164dc441 100644 --- a/ljpost/lang/is/strings.php +++ b/ljpost/lang/is/strings.php @@ -1,7 +1,9 @@ -strings["Post to LiveJournal"] = ""; +$a->strings["LiveJournal Post Settings"] = ""; +$a->strings["Enable LiveJournal Post Addon"] = ""; +$a->strings["LiveJournal username"] = ""; +$a->strings["LiveJournal password"] = ""; +$a->strings["Post to LiveJournal by default"] = ""; +$a->strings["Submit"] = "Senda inn"; diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index c865ddc3..f6f2b79a 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -8,11 +8,12 @@ * Author: Cat Gray */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; -use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\Tag; use Friendica\Model\User; @@ -34,7 +35,7 @@ function ljpost_jot_nets(array &$jotnets_fields) return; } - if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ljpost', 'post')) { + if (DI::pConfig()->get(DI::userSession()->getLocalUserId(),'ljpost','post')) { $jotnets_fields[] = [ 'type' => 'checkbox', 'field' => [ @@ -56,7 +57,7 @@ function ljpost_settings(array &$data) $ij_username = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ljpost', 'ij_username'); $def_enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ljpost', 'post_by_default'); - $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ljpost/'); + $t= Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/ljpost/'); $html = Renderer::replaceMacros($t, [ '$enabled' => ['ljpost', DI::l10n()->t('Enable LiveJournal Post Addon'), $enabled], '$username' => ['ij_username', DI::l10n()->t('LiveJournal username'), $ij_username], @@ -85,16 +86,20 @@ function ljpost_settings_post(array &$b) function ljpost_post_local(array &$b) { + // This can probably be changed to allow editing by pointing to a different API endpoint + if ($b['edit']) { + return; + } + if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) { return; } - // This can probably be changed to allow editing by pointing to a different API endpoint - if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) { + if ($b['private'] || $b['parent']) { return; } - $lj_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ljpost', 'post')); + $lj_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(),'ljpost','post')); $lj_enable = (($lj_post && !empty($_REQUEST['ljpost_enable'])) ? intval($_REQUEST['ljpost_enable']) : 0); if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ljpost', 'post_by_default'))) { @@ -113,15 +118,11 @@ function ljpost_post_local(array &$b) function ljpost_send(array &$b) { - if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) { + if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; } - if (!strstr($b['postopts'], 'ljpost')) { - return; - } - - if (Item::isGroupPost($b['uri-id'])) { + if (!strstr($b['postopts'],'ljpost')) { return; } @@ -138,13 +139,13 @@ function ljpost_send(array &$b) $user = User::getById($b['uid']); $tz = $user['timezone'] ?: 'UTC'; - $lj_username = XML::escape(DI::pConfig()->get($b['uid'], 'ljpost', 'lj_username')); - $lj_password = XML::escape(DI::pConfig()->get($b['uid'], 'ljpost', 'lj_password')); - $lj_journal = XML::escape(DI::pConfig()->get($b['uid'], 'ljpost', 'lj_journal')); - // if(! $lj_journal) - // $lj_journal = $lj_username; + $lj_username = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_username')); + $lj_password = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_password')); + $lj_journal = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_journal')); +// if(! $lj_journal) +// $lj_journal = $lj_username; - $lj_blog = XML::escape(DI::pConfig()->get($b['uid'], 'ljpost', 'lj_blog')); + $lj_blog = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_blog')); if (!strlen($lj_blog)) { $lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc'); } @@ -156,11 +157,11 @@ function ljpost_send(array &$b) $tags = Tag::getCSVByURIId($b['uri-id'], [Tag::HASHTAG]); $date = DateTimeFormat::convert($b['created'], $tz); - $year = intval(substr($date, 0, 4)); - $mon = intval(substr($date, 5, 2)); - $day = intval(substr($date, 8, 2)); - $hour = intval(substr($date, 11, 2)); - $min = intval(substr($date, 14, 2)); + $year = intval(substr($date,0,4)); + $mon = intval(substr($date,5,2)); + $day = intval(substr($date,8,2)); + $hour = intval(substr($date,11,2)); + $min = intval(substr($date,14,2)); $xml = <<< EOT @@ -203,14 +204,12 @@ function ljpost_send(array &$b) EOT; - DI::logger()->debug('ljpost: data: ' . $xml); - - $x = ''; + Logger::debug('ljpost: data: ' . $xml); if ($lj_blog !== 'test') { - $x = DI::httpClient()->post($lj_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString(); + $x = DI::httpClient()->post($lj_blog, $xml, ['Content-Type' => 'text/xml'])->getBody(); } - DI::logger()->info('posted to livejournal: ' . $x); + Logger::info('posted to livejournal: ' . ($x) ? $x : ''); } } diff --git a/mailstream/lang/bg/messages.po b/mailstream/lang/bg/messages.po deleted file mode 100644 index 8d39dfa6..00000000 --- a/mailstream/lang/bg/messages.po +++ /dev/null @@ -1,101 +0,0 @@ -# ADDON mailstream -# Copyright (C) -# This file is distributed under the same license as the Friendica mailstream addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/bg/strings.php b/mailstream/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/mailstream/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/ca/strings.php b/mailstream/lang/ca/strings.php deleted file mode 100644 index d34874f6..00000000 --- a/mailstream/lang/ca/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2022 -# Raroun, 2023 # Tobias Diekershoff , 2018 # Ulf Rompe , 2019 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: Raroun, 2023\n" -"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n" +"POT-Creation-Date: 2018-03-11 19:13+0100\n" +"PO-Revision-Date: 2019-02-18 15:05+0000\n" +"Last-Translator: Ulf Rompe \n" +"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -31,76 +29,72 @@ msgstr "Absender" msgid "Email address that stream items will appear to be from." msgstr "E-Mail-Adresse, die in hochgeladenen Artikeln erscheint." -#: mailstream.php:82 +#: mailstream.php:82 mailstream.php:380 msgid "Save Settings" msgstr "Einstellungen speichern" -#: mailstream.php:311 +#: mailstream.php:223 msgid "Re:" msgstr "Re:" -#: mailstream.php:324 mailstream.php:327 +#: mailstream.php:231 msgid "Friendica post" msgstr "Friendica-Veröffentlichung" -#: mailstream.php:330 +#: mailstream.php:234 msgid "Diaspora post" msgstr "Diaspora-Veröffentlichung" -#: mailstream.php:340 +#: mailstream.php:244 msgid "Feed item" msgstr "Artikel-Feed" -#: mailstream.php:343 +#: mailstream.php:247 msgid "Email" msgstr "E-Mail" -#: mailstream.php:345 +#: mailstream.php:249 msgid "Friendica Item" msgstr "Friendica-Artikel" -#: mailstream.php:419 +#: mailstream.php:293 msgid "Upstream" msgstr "Upstream" -#: mailstream.php:420 -msgid "URI" -msgstr "URI" - -#: mailstream.php:421 +#: mailstream.php:294 msgid "Local" msgstr "Lokal" -#: mailstream.php:499 +#: mailstream.php:362 msgid "Enabled" -msgstr "Aktiv" +msgstr "eingeschaltet" -#: mailstream.php:504 +#: mailstream.php:366 msgid "Email Address" msgstr "E-Mail-Adresse" -#: mailstream.php:506 +#: mailstream.php:368 msgid "Leave blank to use your account email address" msgstr "Leer lassen für deine Konto-E-Mail-Addresse" -#: mailstream.php:510 +#: mailstream.php:371 msgid "Exclude Likes" msgstr "Likes ignorieren" -#: mailstream.php:512 +#: mailstream.php:373 msgid "Check this to omit mailing \"Like\" notifications" msgstr "Diese Option verhindert das Versenden von \"Like\"-Benachrichtigungen per E-Mail." -#: mailstream.php:516 +#: mailstream.php:376 msgid "Attach Images" msgstr "Bilder anhängen" -#: mailstream.php:518 +#: mailstream.php:378 msgid "" "Download images in posts and attach them to the email. Useful for reading " "email while offline." msgstr "Sollen Bilder, die im Beitrag eingebettet sind, als Dateianhang in den E-Mails verschickt werden?" -#: mailstream.php:525 +#: mailstream.php:379 msgid "Mail Stream Settings" msgstr "Mail-Nachrichten-Einstellungen" diff --git a/mailstream/lang/de/strings.php b/mailstream/lang/de/strings.php index e107b7d0..80f9a7a2 100644 --- a/mailstream/lang/de/strings.php +++ b/mailstream/lang/de/strings.php @@ -15,9 +15,8 @@ $a->strings['Feed item'] = 'Artikel-Feed'; $a->strings['Email'] = 'E-Mail'; $a->strings['Friendica Item'] = 'Friendica-Artikel'; $a->strings['Upstream'] = 'Upstream'; -$a->strings['URI'] = 'URI'; $a->strings['Local'] = 'Lokal'; -$a->strings['Enabled'] = 'Aktiv'; +$a->strings['Enabled'] = 'eingeschaltet'; $a->strings['Email Address'] = 'E-Mail-Adresse'; $a->strings['Leave blank to use your account email address'] = 'Leer lassen für deine Konto-E-Mail-Addresse'; $a->strings['Exclude Likes'] = 'Likes ignorieren'; diff --git a/mailstream/lang/eo/messages.po b/mailstream/lang/eo/messages.po deleted file mode 100644 index 3898f09e..00000000 --- a/mailstream/lang/eo/messages.po +++ /dev/null @@ -1,101 +0,0 @@ -# ADDON mailstream -# Copyright (C) -# This file is distributed under the same license as the Friendica mailstream addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/eo/strings.php b/mailstream/lang/eo/strings.php deleted file mode 100644 index 68e8a64c..00000000 --- a/mailstream/lang/eo/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/et/strings.php b/mailstream/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/mailstream/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2015 # StefOfficiel , 2015 @@ -14,8 +13,8 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-21 19:15-0500\n" "PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: Florent C., 2023\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: Nicolas Derive, 2022\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -34,72 +33,68 @@ msgstr "Adresse de courriel de laquelle les éléments du flux sembleront proven msgid "Save Settings" msgstr "Sauvegarder les paramètres" -#: mailstream.php:311 +#: mailstream.php:301 msgid "Re:" msgstr "Re :" -#: mailstream.php:324 mailstream.php:327 +#: mailstream.php:314 mailstream.php:317 msgid "Friendica post" msgstr "Message Friendica" -#: mailstream.php:330 +#: mailstream.php:320 msgid "Diaspora post" msgstr "Message Diaspora" -#: mailstream.php:340 +#: mailstream.php:330 msgid "Feed item" msgstr "Élément du flux" -#: mailstream.php:343 +#: mailstream.php:333 msgid "Email" msgstr "Courriel" -#: mailstream.php:345 +#: mailstream.php:335 msgid "Friendica Item" msgstr "Élément de Friendica" -#: mailstream.php:419 +#: mailstream.php:404 msgid "Upstream" msgstr "En amont" -#: mailstream.php:420 -msgid "URI" -msgstr "URI" - -#: mailstream.php:421 +#: mailstream.php:405 msgid "Local" msgstr "Local" -#: mailstream.php:499 +#: mailstream.php:481 msgid "Enabled" msgstr "Activer" -#: mailstream.php:504 +#: mailstream.php:486 msgid "Email Address" msgstr "Adresse de courriel" -#: mailstream.php:506 +#: mailstream.php:488 msgid "Leave blank to use your account email address" msgstr "Laissez vide pour utiliser l'adresse de courriel de votre compte" -#: mailstream.php:510 +#: mailstream.php:492 msgid "Exclude Likes" msgstr "Exclure les \"j'aime\"" -#: mailstream.php:512 +#: mailstream.php:494 msgid "Check this to omit mailing \"Like\" notifications" msgstr "Cochez ceci pour éviter d'envoyer les notifications des \"J'aime\"" -#: mailstream.php:516 +#: mailstream.php:498 msgid "Attach Images" msgstr "Attacher les images" -#: mailstream.php:518 +#: mailstream.php:500 msgid "" "Download images in posts and attach them to the email. Useful for reading " "email while offline." msgstr "Télécharger les images des messages et les attacher au courriel. Utile pour les les courriels hors-ligne." -#: mailstream.php:525 +#: mailstream.php:507 msgid "Mail Stream Settings" msgstr "Paramètres de Mail Stream" diff --git a/mailstream/lang/fr/strings.php b/mailstream/lang/fr/strings.php index a21d80b8..bfaf4389 100644 --- a/mailstream/lang/fr/strings.php +++ b/mailstream/lang/fr/strings.php @@ -15,7 +15,6 @@ $a->strings['Feed item'] = 'Élément du flux'; $a->strings['Email'] = 'Courriel'; $a->strings['Friendica Item'] = 'Élément de Friendica'; $a->strings['Upstream'] = 'En amont'; -$a->strings['URI'] = 'URI'; $a->strings['Local'] = 'Local'; $a->strings['Enabled'] = 'Activer'; $a->strings['Email Address'] = 'Adresse de courriel'; diff --git a/mailstream/lang/gd/messages.po b/mailstream/lang/gd/messages.po deleted file mode 100644 index e86702a5..00000000 --- a/mailstream/lang/gd/messages.po +++ /dev/null @@ -1,101 +0,0 @@ -# ADDON mailstream -# Copyright (C) -# This file is distributed under the same license as the Friendica mailstream addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/gd/strings.php b/mailstream/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/mailstream/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/mailstream/lang/hu/messages.po b/mailstream/lang/hu/messages.po index 66d09299..3302564d 100644 --- a/mailstream/lang/hu/messages.po +++ b/mailstream/lang/hu/messages.po @@ -4,15 +4,15 @@ # # # Translators: -# Balázs Úr, 2020-2021,2023 +# Balázs Úr, 2020-2021 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-21 19:15-0500\n" "PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: Balázs Úr, 2020-2021,2023\n" -"Language-Team: Hungarian (http://app.transifex.com/Friendica/friendica/language/hu/)\n" +"Last-Translator: Balázs Úr, 2020-2021\n" +"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -31,72 +31,68 @@ msgstr "E-mail-cím, ahonnan úgy tűnik, hogy a folyam elemei származnak." msgid "Save Settings" msgstr "Beállítások mentése" -#: mailstream.php:311 +#: mailstream.php:301 msgid "Re:" msgstr "Vá:" -#: mailstream.php:324 mailstream.php:327 +#: mailstream.php:314 mailstream.php:317 msgid "Friendica post" msgstr "Friendica-bejegyzés" -#: mailstream.php:330 +#: mailstream.php:320 msgid "Diaspora post" msgstr "Diaspora-bejegyzés" -#: mailstream.php:340 +#: mailstream.php:330 msgid "Feed item" msgstr "Hírforráselem" -#: mailstream.php:343 +#: mailstream.php:333 msgid "Email" msgstr "E-mail" -#: mailstream.php:345 +#: mailstream.php:335 msgid "Friendica Item" msgstr "Friendica-elem" -#: mailstream.php:419 +#: mailstream.php:404 msgid "Upstream" msgstr "Távoli" -#: mailstream.php:420 -msgid "URI" -msgstr "URI" - -#: mailstream.php:421 +#: mailstream.php:405 msgid "Local" msgstr "Helyi" -#: mailstream.php:499 +#: mailstream.php:481 msgid "Enabled" msgstr "Engedélyezve" -#: mailstream.php:504 +#: mailstream.php:486 msgid "Email Address" msgstr "E-mail-cím" -#: mailstream.php:506 +#: mailstream.php:488 msgid "Leave blank to use your account email address" msgstr "Hagyja üresen a fiókja e-mail-címének használatához" -#: mailstream.php:510 +#: mailstream.php:492 msgid "Exclude Likes" msgstr "Kedvelések kizárása" -#: mailstream.php:512 +#: mailstream.php:494 msgid "Check this to omit mailing \"Like\" notifications" msgstr "Jelölje be ezt a „Tetszik” értesítések elküldésének kihagyásához" -#: mailstream.php:516 +#: mailstream.php:498 msgid "Attach Images" msgstr "Képek csatolása" -#: mailstream.php:518 +#: mailstream.php:500 msgid "" "Download images in posts and attach them to the email. Useful for reading " "email while offline." msgstr "Képek letöltése a bejegyzésekből és csatolás az e-mailhez. Hasznos az e-mailek kapcsolat nélküli olvasásakor." -#: mailstream.php:525 +#: mailstream.php:507 msgid "Mail Stream Settings" msgstr "Levelezőfolyam beállításai" diff --git a/mailstream/lang/hu/strings.php b/mailstream/lang/hu/strings.php index 5b1e5a51..5a7383bd 100644 --- a/mailstream/lang/hu/strings.php +++ b/mailstream/lang/hu/strings.php @@ -15,7 +15,6 @@ $a->strings['Feed item'] = 'Hírforráselem'; $a->strings['Email'] = 'E-mail'; $a->strings['Friendica Item'] = 'Friendica-elem'; $a->strings['Upstream'] = 'Távoli'; -$a->strings['URI'] = 'URI'; $a->strings['Local'] = 'Helyi'; $a->strings['Enabled'] = 'Engedélyezve'; $a->strings['Email Address'] = 'E-mail-cím'; diff --git a/mailstream/lang/is/messages.po b/mailstream/lang/is/messages.po deleted file mode 100644 index 1efd940c..00000000 --- a/mailstream/lang/is/messages.po +++ /dev/null @@ -1,101 +0,0 @@ -# ADDON mailstream -# Copyright (C) -# This file is distributed under the same license as the Friendica mailstream addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/is/strings.php b/mailstream/lang/is/strings.php deleted file mode 100644 index 975c341e..00000000 --- a/mailstream/lang/is/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -strings['Feed item'] = 'Element kanału'; $a->strings['Email'] = 'E-mail'; $a->strings['Friendica Item'] = 'Pozycja Friendica'; $a->strings['Upstream'] = 'Nadrzędny'; -$a->strings['URI'] = 'URI'; $a->strings['Local'] = 'Lokalny'; $a->strings['Enabled'] = 'Włączone'; $a->strings['Email Address'] = 'Adres e-mail'; diff --git a/mailstream/lang/ru/messages.po b/mailstream/lang/ru/messages.po deleted file mode 100644 index cabb4b45..00000000 --- a/mailstream/lang/ru/messages.po +++ /dev/null @@ -1,101 +0,0 @@ -# ADDON mailstream -# Copyright (C) -# This file is distributed under the same license as the Friendica mailstream addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:54+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: mailstream.php:77 -msgid "From Address" -msgstr "" - -#: mailstream.php:79 -msgid "Email address that stream items will appear to be from." -msgstr "" - -#: mailstream.php:82 -msgid "Save Settings" -msgstr "" - -#: mailstream.php:311 -msgid "Re:" -msgstr "" - -#: mailstream.php:324 mailstream.php:327 -msgid "Friendica post" -msgstr "" - -#: mailstream.php:330 -msgid "Diaspora post" -msgstr "" - -#: mailstream.php:340 -msgid "Feed item" -msgstr "" - -#: mailstream.php:343 -msgid "Email" -msgstr "" - -#: mailstream.php:345 -msgid "Friendica Item" -msgstr "" - -#: mailstream.php:419 -msgid "Upstream" -msgstr "" - -#: mailstream.php:420 -msgid "URI" -msgstr "" - -#: mailstream.php:421 -msgid "Local" -msgstr "" - -#: mailstream.php:499 -msgid "Enabled" -msgstr "" - -#: mailstream.php:504 -msgid "Email Address" -msgstr "" - -#: mailstream.php:506 -msgid "Leave blank to use your account email address" -msgstr "" - -#: mailstream.php:510 -msgid "Exclude Likes" -msgstr "" - -#: mailstream.php:512 -msgid "Check this to omit mailing \"Like\" notifications" -msgstr "" - -#: mailstream.php:516 -msgid "Attach Images" -msgstr "" - -#: mailstream.php:518 -msgid "" -"Download images in posts and attach them to the email. Useful for reading " -"email while offline." -msgstr "" - -#: mailstream.php:525 -msgid "Mail Stream Settings" -msgstr "" diff --git a/mailstream/lang/ru/strings.php b/mailstream/lang/ru/strings.php deleted file mode 100644 index 0579fc21..00000000 --- a/mailstream/lang/ru/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 7f68b7cc..542a1a42 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -6,19 +6,22 @@ * Author: Matthew Exon */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\User; use Friendica\Network\HTTPClient\Client\HttpClientAccept; -use Friendica\Network\HTTPClient\Client\HttpClientOptions; use Friendica\Protocol\Activity; +use Friendica\Util\DateTimeFormat; /** * Sets up the addon hooks and the database table @@ -31,7 +34,26 @@ function mailstream_install() Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); Hook::register('mailstream_send_hook', 'addon/mailstream/mailstream.php', 'mailstream_send_hook'); - DI::logger()->info("installed mailstream"); + Logger::info("mailstream: installed"); +} + +/** + * Enforces that mailstream_install has set up the current version + */ +function mailstream_check_version() +{ + if (!is_null(DI::config()->get('mailstream', 'dbversion'))) { + DI::config()->delete('mailstream', 'dbversion'); + Logger::info("mailstream_check_version: old version detected, reinstalling"); + mailstream_install(); + Hook::loadHooks(); + Hook::add( + 'mailstream_convert_table_entries', + 'addon/mailstream/mailstream.php', + 'mailstream_convert_table_entries' + ); + Hook::fork(Worker::PRIORITY_LOW, 'mailstream_convert_table_entries'); + } } /** @@ -44,18 +66,17 @@ function mailstream_module() {} /** * Adds an item in "addon features" in the admin menu of the site * + * @param App $a App object (unused) * @param string $o HTML form data */ -function mailstream_addon_admin(string &$o) +function mailstream_addon_admin(App $a, string &$o) { $frommail = DI::config()->get('mailstream', 'frommail'); $template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/'); - $config = [ - 'frommail', + $config = ['frommail', DI::l10n()->t('From Address'), $frommail, - DI::l10n()->t('Email address that stream items will appear to be from.') - ]; + DI::l10n()->t('Email address that stream items will appear to be from.')]; $o .= Renderer::replaceMacros($template, [ '$frommail' => $config, '$submit' => DI::l10n()->t('Save Settings') @@ -72,68 +93,6 @@ function mailstream_addon_admin_post() } } -/** - * Creates content for the "References" header. When the message is - * part of a thread, this contains a handful of message IDs of other - * messages in the thread. This should provide enough clues for mail - * agents to thread messages together, even if some messages or - * references are missing. See https://www.jwz.org/doc/threading.html - * - * According to RFC 1036, these references should be in forwards - * chronological order separated by spaces. That is, the first - * message ID is the top-level post, then the first-level reply, then - * the second-level reply, and so on, ending in the direct parent. - * The RFC allows for message IDs to be omitted for length. To save - * database queries we only include the three nearest replies in the - * chain, plus the top-level post. - * - * @param array $item content of the item - * - * @return string the set of references as a space-separated string - */ -function mailstream_generate_references(array $item): string -{ - $ancestor_message_ids = []; - - $top_level_post_uri = ""; - if (array_key_exists("parent-uri", $item)) { - $top_level_post_uri = $item["parent-uri"]; - } - - $ancestor_uri = ""; - if (array_key_exists("thr-parent", $item)) { - $ancestor_uri = $item["thr-parent"]; - } - while ($ancestor_uri && count($ancestor_message_ids) < 3) { - if ($ancestor_uri == $top_level_post_uri) { - break; - } - $ancestor_message_id = mailstream_generate_id($ancestor_uri); - array_unshift($ancestor_message_ids, $ancestor_message_id); - - $ancestor = Post::selectFirst([], array("uid" => $item["uid"], "uri" => $ancestor_uri)); - if (empty($ancestor)) { - DI::logger()->error("Could not retrieve ancestor post", ["uri" => $item["uri"], "uid" => $item["uid"], "ancestor-uri" => $ancestor_uri]); - break; - } - if (!array_key_exists("thr-parent", $ancestor)) { - break; - } - $ancestor_uri = $ancestor["thr-parent"]; - } - - if ($top_level_post_uri) { - $top_level_post_message_id = mailstream_generate_id($top_level_post_uri); - array_unshift($ancestor_message_ids, $top_level_post_message_id); - } - - if (empty($ancestor_message_ids)) { - DI::logger()->error('cannot generate references for item with no parent', ["uri" => $item['uri']]); - return ""; - } - return implode(" ", $ancestor_message_ids); -} - /** * Creates a message ID for a post URI in accordance with RFC 1036 * See also http://www.jwz.org/doc/mid.html @@ -144,60 +103,32 @@ function mailstream_generate_references(array $item): string */ function mailstream_generate_id(string $uri): string { - $host = DI::baseUrl()->getHost(); + $host = DI::baseUrl()->getHostname(); $resource = hash('md5', $uri); $message_id = "<" . $resource . "@" . $host . ">"; - DI::logger()->debug('generated message ID', ['id' => $message_id, 'uri' => $uri]); + Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri); return $message_id; } -function mailstream_send_hook(array $data) +function mailstream_send_hook(App $a, array $data) { $criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']); $item = Post::selectFirst([], $criteria); if (empty($item)) { - DI::logger()->error('could not find item'); + Logger::error('mailstream_send_hook could not find item'); return; } $user = User::getById($item['uid']); if (empty($user)) { - DI::logger()->error('could not find user', ['uid' => $item['uid']]); + Logger::error('mailstream_send_hook could not fund user', ['uid' => $item['uid']]); return; } - $author = DBA::selectFirst('contact', ['nick', 'blocked', 'uri-id'], ['id' => $data['author-id'], 'self' => false]); - if (!DBA::isResult($author)) { - DI::logger()->error('could not find author', ['guid' => $item['guid'], 'author-id' => $data['author-id']]); - return; - } - if ($author['blocked']) { - DI::logger()->info('author is blocked', ['guid' => $item['guid'], 'author-id' => $data['author-id']]); - return; - } - $collapsed = false; - $user_contact = DBA::selectFirst('user-contact', ['cid', 'blocked', 'ignored', 'collapsed'], ['uid' => $item['uid'], 'uri-id' => $item['author-uri-id']]); - if (!DBA::isResult($user_contact)) { - $user_contact = DBA::selectFirst('user-contact', ['cid', 'blocked', 'ignored', 'collapsed'], ['uid' => $item['uid'], 'cid' => $item['author-id']]); - } - if (DBA::isResult($user_contact)) { - if ($user_contact['blocked']) { - DI::logger()->info('author is blocked', ['guid' => $item['guid'], 'cid' => $user_contact['cid']]); - return; - } - if ($user_contact['ignored']) { - DI::logger()->info('author is ignored', ['guid' => $item['guid'], 'cid' => $user_contact['cid']]); - return; - } - if ($user_contact['collapsed']) { - $collapsed = true; - } - } - - if (!mailstream_send($data['message_id'], $item, $user, $collapsed)) { - DI::logger()->debug('send failed, will retry', $data); + if (!mailstream_send($data['message_id'], $item, $user)) { + Logger::debug('mailstream_send_hook send failed, will retry', $data); if (!Worker::defer()) { - DI::logger()->error('failed and could not defer', $data); + Logger::error('mailstream_send_hook failed and could not defer', $data); } } } @@ -207,38 +138,37 @@ function mailstream_send_hook(array $data) * mailstream is enabled and the necessary data is available, forks a * workerqueue item to send the email. * + * @param App $a App object (unused) * @param array $item content of the item (may or may not already be stored in the item table) * @return void */ -function mailstream_post_hook(array &$item) +function mailstream_post_hook(App $a, array &$item) { - if ($item['uid'] === 0) { - DI::logger()->debug('mailstream: root user, skipping item ' . $item['id']); + mailstream_check_version(); + + if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) { + Logger::debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]); return; } - if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) { - DI::logger()->debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]); + if (!$item['uid']) { + Logger::debug('mailstream: no uid for item ' . $item['id']); return; } if (!$item['contact-id']) { - DI::logger()->debug('no contact-id', ['item' => $item['id']]); + Logger::debug('mailstream: no contact-id for item ' . $item['id']); return; } if (!$item['uri']) { - DI::logger()->debug('no uri', ['item' => $item['id']]); + Logger::debug('mailstream: no uri for item ' . $item['id']); return; } if ($item['verb'] == Activity::ANNOUNCE) { - DI::logger()->debug('ignoring announce', ['item' => $item['id']]); + Logger::debug('mailstream: announce item ', ['item' => $item['id']]); return; } if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) { if ($item['verb'] == Activity::LIKE) { - DI::logger()->debug('ignoring like', ['item' => $item['id']]); - return; - } - if ($item['verb'] == Activity::DISLIKE) { - DI::logger()->debug('ignoring dislike', ['item' => $item['id']]); + Logger::debug('mailstream: like item ' . $item['id']); return; } } @@ -248,7 +178,6 @@ function mailstream_post_hook(array &$item) $send_hook_data = [ 'uid' => $item['uid'], 'contact-id' => $item['contact-id'], - 'author-id' => $item['author-id'], 'uri' => $item['uri'], 'message_id' => $message_id, 'tries' => 0, @@ -270,7 +199,7 @@ function mailstream_post_hook(array &$item) function mailstream_do_images(array &$item, array &$attachments) { if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) { - return $attachments; + return; } $attachments = []; @@ -287,22 +216,9 @@ function mailstream_do_images(array &$item, array &$attachments) } $cookiejar = tempnam(System::getTempPath(), 'cookiejar-mailstream-'); - try { - $curlResult = DI::httpClient()->get($url, HttpClientAccept::DEFAULT, [HttpClientOptions::COOKIEJAR => $cookiejar]); - if (!$curlResult->isSuccess()) { - DI::logger()->debug('mailstream: fetch image url failed', [ - 'url' => $url, - 'item_id' => $item['id'], - 'return_code' => $curlResult->getReturnCode() - ]); - continue; - } - } catch (InvalidArgumentException $e) { - DI::logger()->error('exception fetching url', ['url' => $url, 'item_id' => $item['id']]); - continue; - } + $curlResult = DI::httpClient()->fetchFull($url, HttpClientAccept::DEFAULT, 0, $cookiejar); $attachments[$url] = [ - 'data' => $curlResult->getBodyString(), + 'data' => $curlResult->getBody(), 'guid' => hash('crc32', $url), 'filename' => basename($components['path']), 'type' => $curlResult->getContentType() @@ -339,13 +255,12 @@ function mailstream_sender(array $item): string * Converts a bbcode-encoded subject line into a plaintext version suitable for the subject line of an email * * @param string $subject bbcode-encoded subject line - * @param int $uri_id * * @return string plaintext subject line */ -function mailstream_decode_subject(string $subject, int $uri_id): string +function mailstream_decode_subject(string $subject): string { - $html = BBCode::convertForUriId($uri_id, $subject); + $html = BBCode::convert($subject); if (!$html) { return $subject; } @@ -380,7 +295,7 @@ function mailstream_decode_subject(string $subject, int $uri_id): string function mailstream_subject(array $item): string { if ($item['title']) { - return mailstream_decode_subject($item['title'], $item['uri-id']); + return mailstream_decode_subject($item['title']); } $parent = $item['thr-parent']; // Don't look more than 100 levels deep for a subject, in case of loops @@ -393,18 +308,19 @@ function mailstream_subject(array $item): string break; } if ($parent_item['title']) { - return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title'], $item['uri-id']); + return DI::l10n()->t('Re:') . ' ' . mailstream_decode_subject($parent_item['title']); } $parent = $parent_item['thr-parent']; } $contact = Contact::selectFirst([], ['id' => $item['contact-id'], 'uid' => $item['uid']]); if (!DBA::isResult($contact)) { - DI::logger()->error('no contact', [ - 'item' => $item['id'], - 'plink' => $item['plink'], - 'contact id' => $item['contact-id'], - 'uid' => $item['uid'] - ]); + Logger::error( + 'mailstream_subject no contact for item', + ['id' => $item['id'], + 'plink' => $item['plink'], + 'contact id' => $item['contact-id'], + 'uid' => $item['uid']] + ); return DI::l10n()->t("Friendica post"); } if ($contact['network'] === 'dfrn') { @@ -414,7 +330,7 @@ function mailstream_subject(array $item): string return DI::l10n()->t("Diaspora post"); } if ($contact['network'] === 'face') { - $text = mailstream_decode_subject($item['body'], $item['uri-id']); + $text = mailstream_decode_subject($item['body']); // For some reason these do show up in Facebook $text = preg_replace('/\xA0$/', '', $text); $subject = (strlen($text) > 150) ? (substr($text, 0, 140) . '...') : $text; @@ -435,38 +351,32 @@ function mailstream_subject(array $item): string * @param string $message_id ID of the message (RFC 1036) * @param array $item content of the item * @param array $user results from the user table - * @param bool $collapsed true if the content should be hidden * * @return bool True if this message has been completed. False if it should be retried. */ -function mailstream_send(string $message_id, array $item, array $user, bool $collapsed): bool +function mailstream_send(string $message_id, array $item, array $user): bool { if (!is_array($item)) { - DI::logger()->error('item is empty', ['message_id' => $message_id]); + Logger::error('mailstream_send item is empty', ['message_id' => $message_id]); return false; } if (!$item['visible']) { - DI::logger()->debug('item not yet visible', ['item uri' => $item['uri']]); + Logger::debug('mailstream_send item not yet visible', ['item uri' => $item['uri']]); return false; } if (!$message_id) { - DI::logger()->error('no message ID supplied', ['item uri' => $item['uri'], 'user email' => $user['email']]); + Logger::error('mailstream_send no message ID supplied', ['item uri' => $item['uri'], + 'user email' => $user['email']]); return true; } - require_once(dirname(__file__) . '/phpmailer/class.phpmailer.php'); + require_once (dirname(__file__) . '/phpmailer/class.phpmailer.php'); - if ($collapsed) { - $item['body'] = DI::l10n()->t('Content from %s is collapsed', $item['author-name']); - } else { - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); - } + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); $attachments = []; - if (!$collapsed) { - mailstream_do_images($item, $attachments); - } + mailstream_do_images($item, $attachments); $frommail = DI::config()->get('mailstream', 'frommail'); if ($frommail == '') { $frommail = 'friendica@localhost.local'; @@ -475,7 +385,7 @@ function mailstream_send(string $message_id, array $item, array $user, bool $col if (!$address) { $address = $user['email']; } - $mail = new PHPMailer(); + $mail = new PHPmailer(); try { $mail->XMailer = 'Friendica Mailstream Addon'; $mail->SetFrom($frommail, mailstream_sender($item)); @@ -484,7 +394,6 @@ function mailstream_send(string $message_id, array $item, array $user, bool $col $mail->Subject = mailstream_subject($item); if ($item['thr-parent'] != $item['uri']) { $mail->addCustomHeader('In-Reply-To: ' . mailstream_generate_id($item['thr-parent'])); - $mail->addCustomHeader('References: ' . mailstream_generate_references($item)); } $mail->addCustomHeader('X-Friendica-Mailstream-URI: ' . $item['uri']); if ($item['plink']) { @@ -505,26 +414,23 @@ function mailstream_send(string $message_id, array $item, array $user, bool $col $template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/'); $mail->AltBody = BBCode::toPlaintext($item['body']); $item['body'] = BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::CONNECTORS); - $item['url'] = DI::baseUrl() . '/display/' . $item['guid']; + $item['url'] = DI::baseUrl()->get() . '/display/' . $item['guid']; $mail->Body = Renderer::replaceMacros($template, [ - '$upstream' => DI::l10n()->t('Upstream'), - '$uri' => DI::l10n()->t('URI'), - '$local' => DI::l10n()->t('Local'), - '$item' => $item - ]); + '$upstream' => DI::l10n()->t('Upstream'), + '$uri' => DI::l10n()->t('URI'), + '$local' => DI::l10n()->t('Local'), + '$item' => $item]); $mail->Body = mailstream_html_wrap($mail->Body); if (!$mail->Send()) { throw new Exception($mail->ErrorInfo); } - DI::logger()->debug('sent message', [ - 'message ID' => $mail->MessageID, - 'subject' => $mail->Subject, - 'address' => $address - ]); + Logger::debug('mailstream_send sent message', ['message ID' => $mail->MessageID, + 'subject' => $mail->Subject, + 'address' => $address]); } catch (phpmailerException $e) { - DI::logger()->debug('PHPMailer exception sending message', ['id' => $message_id, 'error' => $e->errorMessage()]); + Logger::debug('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage()); } catch (Exception $e) { - DI::logger()->debug('exception sending message', ['id' => $message_id, 'error' => $e->getMessage()]); + Logger::debug('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage()); } return true; @@ -548,13 +454,37 @@ function mailstream_html_wrap(string &$text) return $text; } +/** + * Convert v1 mailstream table entries to v2 workerqueue items + */ +function mailstream_convert_table_entries() +{ + $ms_item_ids = DBA::selectToArray('mailstream_item', [], ['message-id', 'uri', 'uid', 'contact-id'], ["`mailstream_item`.`completed` IS NULL"]); + Logger::debug('mailstream_convert_table_entries processing ' . count($ms_item_ids) . ' items'); + foreach ($ms_item_ids as $ms_item_id) { + $send_hook_data = array('uid' => $ms_item_id['uid'], + 'contact-id' => $ms_item_id['contact-id'], + 'uri' => $ms_item_id['uri'], + 'message_id' => $ms_item_id['message-id'], + 'tries' => 0); + if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) { + Logger::info('mailstream_convert_table_entries: item has no message-id.', 'item' => $ms_item_id['id'], 'uri' => $ms_item_id['uri']]); + continue; + } + Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data); + Hook::fork(Worker::PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data); + } + DBA::e('DROP TABLE `mailstream_item`'); +} + /** * Form for configuring mailstream features for a user * + * @param App $a App object * @param array $data Hook data array * @throws \Friendica\Network\HTTPException\ServiceUnavailableException */ -function mailstream_addon_settings(array &$data) +function mailstream_addon_settings(App &$a, array &$data) { $enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'enabled'); $address = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'address'); @@ -598,10 +528,11 @@ function mailstream_addon_settings(array &$data) /** * Process data submitted to user's mailstream features form + * @param App $a * @param array $post POST data * @return void */ -function mailstream_addon_settings_post(array $post) +function mailstream_addon_settings_post(App $a, array $post) { if (!DI::userSession()->getLocalUserId() || empty($post['mailstream-submit'])) { return; diff --git a/mailstream/phpmailer/class.phpmailer.php b/mailstream/phpmailer/class.phpmailer.php index 8cd05a2c..ab7fe030 100644 --- a/mailstream/phpmailer/class.phpmailer.php +++ b/mailstream/phpmailer/class.phpmailer.php @@ -2690,10 +2690,10 @@ class PHPMailer if (!is_readable($path)) { throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); } - $magic_quotes = false; + $magic_quotes = get_magic_quotes_runtime(); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { - //set_magic_quotes_runtime(false); + set_magic_quotes_runtime(false); } else { //Doesn't exist in PHP 5.4, but we don't need to check because //get_magic_quotes_runtime always returns false in 5.4+ @@ -2705,7 +2705,7 @@ class PHPMailer $file_buffer = $this->encodeString($file_buffer, $encoding); if ($magic_quotes) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { - //set_magic_quotes_runtime($magic_quotes); + set_magic_quotes_runtime($magic_quotes); } else { ini_set('magic_quotes_runtime', $magic_quotes); } @@ -3286,7 +3286,7 @@ class PHPMailer $result = 'localhost.localdomain'; if (!empty($this->Hostname)) { $result = $this->Hostname; - } elseif (!empty($_SERVER['SERVER_NAME'])) { + } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { $result = $_SERVER['SERVER_NAME']; } elseif (function_exists('gethostname') && gethostname() !== false) { $result = gethostname(); diff --git a/markdown/lang/da-dk/messages.po b/markdown/lang/da-dk/messages.po deleted file mode 100644 index 51359983..00000000 --- a/markdown/lang/da-dk/messages.po +++ /dev/null @@ -1,36 +0,0 @@ -# ADDON markdown -# Copyright (C) -# This file is distributed under the same license as the Friendica markdown addon package. -# -# -# Translators: -# Jesper Stocholm, 2025 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2019-12-27 06:41+0000\n" -"Last-Translator: Jesper Stocholm, 2025\n" -"Language-Team: Danish (Denmark) (https://app.transifex.com/Friendica/teams/12172/da_DK/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: da_DK\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: markdown.php:30 -msgid "Enable Markdown parsing" -msgstr "Aktivér Markdown-understøttelse" - -#: markdown.php:30 -msgid "If enabled, adds Markdown support to the Compose Post form." -msgstr "" -"Hvis aktiveret, tilføjes understøttelse for Markdown ved redigering af " -"opslag." - -#: markdown.php:35 -msgid "Markdown Settings" -msgstr "Markdown-indstillinger" diff --git a/markdown/lang/da-dk/strings.php b/markdown/lang/da-dk/strings.php deleted file mode 100644 index 468ac5f8..00000000 --- a/markdown/lang/da-dk/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -strings['Enable Markdown parsing'] = 'Aktivér Markdown-understøttelse'; -$a->strings['If enabled, adds Markdown support to the Compose Post form.'] = 'Hvis aktiveret, tilføjes understøttelse for Markdown ved redigering af opslag.'; -$a->strings['Markdown Settings'] = 'Markdown-indstillinger'; diff --git a/markdown/markdown.php b/markdown/markdown.php index 1ef6cd9a..236fb297 100644 --- a/markdown/markdown.php +++ b/markdown/markdown.php @@ -5,6 +5,7 @@ * Version: 0.1 * Author: Michael Vogel */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Content\Text\Markdown; use Friendica\Core\Renderer; @@ -26,7 +27,7 @@ function markdown_addon_settings(array &$data) $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/'); $html = Renderer::replaceMacros($t, [ - '$enabled' => ['markdown-enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')], + '$enabled' => ['enabled', DI::l10n()->t('Enable Markdown parsing'), $enabled, DI::l10n()->t('If enabled, adds Markdown support to the Compose Post form.')], ]); $data = [ @@ -42,7 +43,7 @@ function markdown_addon_settings_post(array &$b) return; } - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'markdown', 'enabled', intval($_POST['markdown-enabled'])); + DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'markdown', 'enabled', intval($_POST['enabled'])); } function markdown_post_local_start(&$request) { @@ -63,7 +64,6 @@ function markdown_post_local_start(&$request) { // (right chevrons are used for quoting in Markdown) // See https://github.com/friendica/friendica/issues/10634 $text = strtr($text, ['<' => '<']); - $text = str_replace('[*]', '[li]', $text); return Markdown::toBBCode($text); }); diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index fcb8feea..c84f1a4f 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -1,4 +1,5 @@ get($api_url); + $fetchResult = DI::httpClient()->fetchFull($api_url); if ($fetchResult->isSuccess()) { - $emojis_array = json_decode($fetchResult->getBodyString(), true); + $emojis_array = json_decode($fetchResult->getBody(), true); if (is_array($emojis_array) && count($emojis_array)) { foreach ($emojis_array as $emoji) { if (!empty($emoji['shortcode']) && !empty($emoji['static_url'])) { $return['texts'][] = ':' . $emoji['shortcode'] . ':'; - $return['icons'][] = ':' . $emoji['shortcode'] . ':'; + $return['icons'][] = ':' . $emoji['shortcode'] . ':'; } } } diff --git a/mathjax/lang/bg/messages.po b/mathjax/lang/bg/messages.po deleted file mode 100644 index 0693f595..00000000 --- a/mathjax/lang/bg/messages.po +++ /dev/null @@ -1,30 +0,0 @@ -# ADDON mathjax -# Copyright (C) -# This file is distributed under the same license as the Friendica mathjax addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:55+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/bg/strings.php b/mathjax/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/mathjax/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/ca/strings.php b/mathjax/lang/ca/strings.php index d34874f6..a66618a1 100644 --- a/mathjax/lang/ca/strings.php +++ b/mathjax/lang/ca/strings.php @@ -1,7 +1,9 @@ -strings["Settings"] = "Ajustos"; +$a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = "El complement MathJax processa les fórmules matemàtiques escrites utilitzant la sintaxi de LaTeX, envoltades per l'habitual $$ o un bloc de \"eqnarray\" en les publicacions del seu mur, a la fitxa de la xarxa i correu privat."; +$a->strings["Use the MathJax renderer"] = "Utilitzar el processador Mathjax"; +$a->strings["Submit"] = "Enviar"; +$a->strings["Settings updated."] = "Ajustos actualitzats."; +$a->strings["MathJax Base URL"] = "URL Base de Mathjax"; +$a->strings["The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax."] = "La URL del fitxer javascript que ha de ser inclòs per a usar Mathjax. Pot ser utilitzat per Mathjax CDN o un altre instal·lació de Mathjax."; diff --git a/mathjax/lang/eo/messages.po b/mathjax/lang/eo/messages.po deleted file mode 100644 index 74835a6a..00000000 --- a/mathjax/lang/eo/messages.po +++ /dev/null @@ -1,30 +0,0 @@ -# ADDON mathjax -# Copyright (C) -# This file is distributed under the same license as the Friendica mathjax addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:55+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/eo/strings.php b/mathjax/lang/eo/strings.php index 68e8a64c..f0d88442 100644 --- a/mathjax/lang/eo/strings.php +++ b/mathjax/lang/eo/strings.php @@ -1,7 +1,9 @@ -strings["Settings"] = "Agordoj"; +$a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = "La Mathjax kromprogramo bildigas matematikajn formulojn skribitajn en la LaTeX sintakso, cirkaŭigita de la komuna $$ aŭ eqnarray bloko en afiŝoj ĉe via muro, Reto folio kaj privataj mesaĝoj."; +$a->strings["Use the MathJax renderer"] = "Ĉu uzi la Mathjax bildigilo"; +$a->strings["Submit"] = "Sendi"; +$a->strings["Settings updated."] = "Agordoj ĝisdatigita."; +$a->strings["MathJax Base URL"] = "Mathjax Baza URL Adreso"; +$a->strings["The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax."] = "La URL adreso por la javascript dosiero kiu estas inkluzivigonta por uzi Mathjaz. Eblas esti aŭ la Mathjax CDN aŭ alia Mathjax instalo."; diff --git a/mathjax/lang/et/messages.po b/mathjax/lang/et/messages.po deleted file mode 100644 index d7af2521..00000000 --- a/mathjax/lang/et/messages.po +++ /dev/null @@ -1,31 +0,0 @@ -# ADDON mathjax -# Copyright (C) -# This file is distributed under the same license as the Friendica mathjax addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:55+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/et/strings.php b/mathjax/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/mathjax/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/gd/strings.php b/mathjax/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/mathjax/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/mathjax/lang/is/messages.po b/mathjax/lang/is/messages.po deleted file mode 100644 index e8e75052..00000000 --- a/mathjax/lang/is/messages.po +++ /dev/null @@ -1,30 +0,0 @@ -# ADDON mathjax -# Copyright (C) -# This file is distributed under the same license as the Friendica mathjax addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:55+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/is/strings.php b/mathjax/lang/is/strings.php index 975c341e..a7263f30 100644 --- a/mathjax/lang/is/strings.php +++ b/mathjax/lang/is/strings.php @@ -1,7 +1,9 @@ -strings["Settings"] = "Stillingar"; +$a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = ""; +$a->strings["Use the MathJax renderer"] = ""; +$a->strings["Submit"] = "Senda inn"; +$a->strings["Settings updated."] = "Stillingar uppfærðar"; +$a->strings["MathJax Base URL"] = ""; +$a->strings["The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax."] = ""; diff --git a/mathjax/lang/ru/messages.po b/mathjax/lang/ru/messages.po deleted file mode 100644 index 97b81e73..00000000 --- a/mathjax/lang/ru/messages.po +++ /dev/null @@ -1,30 +0,0 @@ -# ADDON mathjax -# Copyright (C) -# This file is distributed under the same license as the Friendica mathjax addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 09:55+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: mathjax.php:42 -msgid "" -"The MathJax addon renders mathematical formulae written using the LaTeX " -"syntax surrounded by the usual $$ or an eqnarray block in the postings of " -"your wall,network tab and private mail." -msgstr "" - -#: mathjax.php:43 -msgid "Use the MathJax renderer" -msgstr "" diff --git a/mathjax/lang/ru/strings.php b/mathjax/lang/ru/strings.php index 0579fc21..f0c2f4a1 100644 --- a/mathjax/lang/ru/strings.php +++ b/mathjax/lang/ru/strings.php @@ -1,7 +1,9 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} +strings["Settings"] = "Настройки"; +$a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = ""; +$a->strings["Use the MathJax renderer"] = ""; +$a->strings["Submit"] = "Подтвердить"; +$a->strings["Settings updated."] = "Настройки обновлены."; +$a->strings["MathJax Base URL"] = ""; +$a->strings["The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax."] = ""; diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index e96aaddf..d0046cf7 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -8,6 +8,7 @@ * License: 3-clause BSD license */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; diff --git a/membersince/membersince.php b/membersince/membersince.php index df6388c6..f8128eb7 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -7,9 +7,9 @@ * Status: Unsupported */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; -use Friendica\Model\User; use Friendica\Util\DateTimeFormat; function membersince_install() @@ -17,25 +17,9 @@ function membersince_install() Hook::register('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); } -/** - * @param array|string|null $b - * @return void - */ -function membersince_display(&$b) +function membersince_display(array &$b) { - $uid = DI::userSession()->getLocalUserId(); - - if ($uid === false) { - return; - } - - $user = User::getById($uid, ['register_date']); - - if ($user === false || !array_key_exists('register_date', $user)) { - return; - } - - if (DI::appHelper()->getCurrentTheme() == 'frio') { + if (DI::app()->getCurrentTheme() == 'frio') { // Works in Frio. $doc = new DOMDocument(); $doc->loadHTML(mb_convert_encoding($b, 'HTML-ENTITIES', 'UTF-8')); @@ -55,7 +39,7 @@ function membersince_display(&$b) $label->setAttribute('class', 'col-lg-4 col-md-4 col-sm-4 col-xs-12 profile-label-name text-muted'); // The div for the register date of the profile owner. - $entry = $doc->createElement('div', DateTimeFormat::local($user['register_date'])); + $entry = $doc->createElement('div', DateTimeFormat::local(DI::app()->profile['register_date'])); $entry->setAttribute('class', 'col-lg-8 col-md-8 col-sm-8 col-xs-12 profile-entry'); $div->appendChild($hr); @@ -63,9 +47,9 @@ function membersince_display(&$b) $div->appendChild($entry); $elm->parentNode->insertBefore($div, $elm->nextSibling); - $b = (string) $doc->saveHTML(); + $b = $doc->saveHTML(); } else { // Works in Vier. - $b = preg_replace('/<\/dl>/', "\n\n\n
\n
" . DI::l10n()->t('Member since:') . "
\n
" . DateTimeFormat::local($user['register_date']) . "
\n
", $b, 1); + $b = preg_replace('/<\/dl>/', "\n\n\n
\n
" . DI::l10n()->t('Member since:') . "
\n
" . DateTimeFormat::local(DI::app()->profile['register_date']) . "
\n
", $b, 1); } } diff --git a/monolog/README.md b/monolog/README.md deleted file mode 100644 index efb7959a..00000000 --- a/monolog/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Monolog Addon - -A Logging framework with lots of additions (see [Monolog](https://github.com/Seldaek/monolog/)). -There are just Friendica additions inside the src directory. diff --git a/monolog/composer.json b/monolog/composer.json index 9cf42dbe..9c7f32c3 100644 --- a/monolog/composer.json +++ b/monolog/composer.json @@ -1,26 +1,23 @@ { - "name": "friendica-addons/monolog", - "description": "Monolog can send your logs to files, sockets, inboxes, database, etc..", - "type": "friendica-addon", - "authors": [ - { - "name": "Philipp Holzer", - "email": "admin@philipp.info", - "homepage": "https://blog.philipp.info", - "role": "Developer" - } - ], - "require": { - "php": ">=7.3", - "monolog/monolog": "^2.9" - }, - "license": "3-clause BSD license", - "config": { - "platform": { - "php": "7.4" - }, - "optimize-autoloader": true, - "autoloader-suffix": "MonologAddon", - "preferred-install": "dist" - } + "name": "friendica-addons/monolog", + "description": "Monolog can send your logs to files, sockets, inboxes, database, etc..", + "type": "friendica-addon", + "authors": [ + { + "name": "Philipp Holzer", + "email": "admin@philipp.info", + "homepage": "https://blog.philipp.info", + "role": "Developer" + } + ], + "require": { + "php": ">=7.0", + "monolog/monolog": "^3.2" + }, + "license": "3-clause BSD license", + "config": { + "optimize-autoloader": true, + "autoloader-suffix": "MonologAddon", + "preferred-install": "dist" + } } diff --git a/monolog/composer.lock b/monolog/composer.lock index 5d1da32f..0566f721 100644 --- a/monolog/composer.lock +++ b/monolog/composer.lock @@ -4,46 +4,45 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "037f2db47e77c9af2960dde65ebafa8d", + "content-hash": "e812bcd051a73d1c9b19c91ec88a6a21", "packages": [ { "name": "monolog/monolog", - "version": "2.9.2", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f" + "reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", - "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81", + "reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "psr/log-implementation": "3.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "aws/aws-sdk-php": "^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "graylog2/gelf-php": "^1.4.2", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^9.5.16", + "predis/predis": "^1.1", "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -66,7 +65,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -102,34 +101,34 @@ "type": "tidelift" } ], - "time": "2023-10-27T15:25:26+00:00" + "time": "2022-07-24T12:00:55+00:00" }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -149,7 +148,7 @@ "psr", "psr-3" ], - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" } ], "packages-dev": [], @@ -159,11 +158,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.3" + "php": ">=7.0" }, "platform-dev": [], - "platform-overrides": { - "php": "7.4" - }, "plugin-api-version": "1.1.0" } diff --git a/monolog/monolog.php b/monolog/monolog.php index f194aac4..efdcb3fe 100644 --- a/monolog/monolog.php +++ b/monolog/monolog.php @@ -1,7 +1,66 @@ setTimezone($loggerTimeZone); + $logger->pushProcessor(new Monolog\Processor\PsrLogMessageProcessor()); + $logger->pushProcessor(new Monolog\Processor\ProcessIdProcessor()); + $logger->pushProcessor(new Monolog\Processor\UidProcessor()); + $logger->pushProcessor(new IntrospectionProcessor($data['introspection'], LogLevel::DEBUG)); + + $stream = DI::config()->get('system', 'logfile'); + + // just add a stream in case it's either writable or not file + if (!is_file($stream) || is_writable($stream)) { + try { + $loglevel = Monolog\Logger::toMonologLevel($data['loglevel']); + + // fallback to notice if an invalid loglevel is set + if (!is_int($loglevel)) { + $loglevel = LogLevel::NOTICE; + } + + $fileHandler = new Monolog\Handler\StreamHandler($stream, $loglevel); + + $formatter = new Monolog\Formatter\LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n"); + $fileHandler->setFormatter($formatter); + + $logger->pushHandler($fileHandler); + } catch (\Throwable $e) { + return; + } + } + + $data['storage'] = $logger; +} diff --git a/monolog/src/Monolog/DevelopHandler.php b/monolog/src/DevelopHandler.php similarity index 98% rename from monolog/src/Monolog/DevelopHandler.php rename to monolog/src/DevelopHandler.php index 735ebac7..e3d31e64 100644 --- a/monolog/src/Monolog/DevelopHandler.php +++ b/monolog/src/DevelopHandler.php @@ -19,7 +19,7 @@ * */ -namespace Friendica\Addon\monolog\src\Monolog; +namespace Friendica\Addon\monolog\src; use Friendica\App\Request; use Monolog\Handler; diff --git a/monolog/src/Factory/MonologFactory.php b/monolog/src/Factory/MonologFactory.php deleted file mode 100644 index e0c11e13..00000000 --- a/monolog/src/Factory/MonologFactory.php +++ /dev/null @@ -1,72 +0,0 @@ -introspection = $introspection; - $this->config = $config; - } - - /** - * Creates and returns a PSR-3 Logger instance. - * - * Calling this method multiple times with the same parameters SHOULD return the same object. - * - * @param \Psr\Log\LogLevel::* $logLevel The log level - * @param \Friendica\Core\Logger\Capability\LogChannel::* $logChannel The log channel - */ - public function createLogger(string $logLevel, string $logChannel): LoggerInterface - { - $loggerTimeZone = new \DateTimeZone('UTC'); - - $logger = new Logger($logChannel); - $logger->setTimezone($loggerTimeZone); - $logger->pushProcessor(new PsrLogMessageProcessor()); - $logger->pushProcessor(new ProcessIdProcessor()); - $logger->pushProcessor(new UidProcessor()); - $logger->pushProcessor(new IntrospectionProcessor($this->introspection, LogLevel::DEBUG)); - - $logfile = $this->config->get('system', 'logfile'); - - // just add a stream in case it's either writable or not file - if (is_writable($logfile)) { - $logLevel = Logger::toMonologLevel($logLevel); - - // fallback to notice if an invalid loglevel is set - if (!is_int($logLevel)) { - $logLevel = LogLevel::NOTICE; - } - - $fileHandler = new StreamHandler($logfile, $logLevel); - - $formatter = new LineFormatter("%datetime% %channel% [%level_name%]: %message% %context% %extra%\n"); - $fileHandler->setFormatter($formatter); - - $logger->pushHandler($fileHandler); - } - - return $logger; - } -} diff --git a/monolog/src/Monolog/IntrospectionProcessor.php b/monolog/src/IntrospectionProcessor.php similarity index 86% rename from monolog/src/Monolog/IntrospectionProcessor.php rename to monolog/src/IntrospectionProcessor.php index 2df0e21a..8ba6023e 100644 --- a/monolog/src/Monolog/IntrospectionProcessor.php +++ b/monolog/src/IntrospectionProcessor.php @@ -19,10 +19,11 @@ * */ -namespace Friendica\Addon\monolog\src\Monolog; +namespace Friendica\Addon\monolog\src; use Friendica\Core\Logger\Util\Introspection; use Monolog\Logger; +use Monolog\LogRecord; use Monolog\Processor\ProcessorInterface; /** @@ -41,19 +42,19 @@ class IntrospectionProcessor implements ProcessorInterface public function __construct(Introspection $introspection, $level = Logger::DEBUG) { $this->level = Logger::toMonologLevel($level); - $introspection->addClasses(['Monolog\\', static::class]); + $introspection->addClasses(['Monolog\\']); $this->introspection = $introspection; } - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { // return if the level is not high enough - if ($record['level'] < $this->level) { + if ($record->level < $this->level) { return $record; } // we should have the call source now - $record['extra'] = array_merge( - $record['extra'], + $record->extra = array_merge( + $record->extra, $this->introspection->getRecord() ); diff --git a/monolog/vendor/composer/autoload_classmap.php b/monolog/vendor/composer/autoload_classmap.php index c12d7340..70609203 100644 --- a/monolog/vendor/composer/autoload_classmap.php +++ b/monolog/vendor/composer/autoload_classmap.php @@ -26,6 +26,7 @@ return array( 'Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', 'Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', + 'Monolog\\Formatter\\SyslogFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php', 'Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', 'Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', @@ -91,7 +92,6 @@ return array( 'Monolog\\Handler\\SocketHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php', 'Monolog\\Handler\\SqsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SqsHandler.php', 'Monolog\\Handler\\StreamHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php', - 'Monolog\\Handler\\SwiftMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php', 'Monolog\\Handler\\SymfonyMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php', 'Monolog\\Handler\\SyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php', 'Monolog\\Handler\\SyslogUdpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php', @@ -121,4 +121,12 @@ return array( 'Monolog\\SignalHandler' => $vendorDir . '/monolog/monolog/src/Monolog/SignalHandler.php', 'Monolog\\Test\\TestCase' => $vendorDir . '/monolog/monolog/src/Monolog/Test/TestCase.php', 'Monolog\\Utils' => $vendorDir . '/monolog/monolog/src/Monolog/Utils.php', + 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/src/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/src/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/src/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/src/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/src/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/src/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php', ); diff --git a/monolog/vendor/composer/autoload_psr4.php b/monolog/vendor/composer/autoload_psr4.php index 9cb5b63d..afcfb31e 100644 --- a/monolog/vendor/composer/autoload_psr4.php +++ b/monolog/vendor/composer/autoload_psr4.php @@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), ); diff --git a/monolog/vendor/composer/autoload_static.php b/monolog/vendor/composer/autoload_static.php index a44984ec..85bd86fd 100644 --- a/monolog/vendor/composer/autoload_static.php +++ b/monolog/vendor/composer/autoload_static.php @@ -20,7 +20,7 @@ class ComposerStaticInitMonologAddon public static $prefixDirsPsr4 = array ( 'Psr\\Log\\' => array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + 0 => __DIR__ . '/..' . '/psr/log/src', ), 'Monolog\\' => array ( @@ -49,6 +49,7 @@ class ComposerStaticInitMonologAddon 'Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', 'Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', + 'Monolog\\Formatter\\SyslogFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php', 'Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', 'Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', @@ -114,7 +115,6 @@ class ComposerStaticInitMonologAddon 'Monolog\\Handler\\SocketHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php', 'Monolog\\Handler\\SqsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SqsHandler.php', 'Monolog\\Handler\\StreamHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php', - 'Monolog\\Handler\\SwiftMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php', 'Monolog\\Handler\\SymfonyMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php', 'Monolog\\Handler\\SyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php', 'Monolog\\Handler\\SyslogUdpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php', @@ -144,6 +144,14 @@ class ComposerStaticInitMonologAddon 'Monolog\\SignalHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/SignalHandler.php', 'Monolog\\Test\\TestCase' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Test/TestCase.php', 'Monolog\\Utils' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Utils.php', + 'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/src/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/src/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/src/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/monolog/vendor/composer/installed.json b/monolog/vendor/composer/installed.json index 2b129417..c01706ed 100644 --- a/monolog/vendor/composer/installed.json +++ b/monolog/vendor/composer/installed.json @@ -1,43 +1,42 @@ [ { "name": "monolog/monolog", - "version": "2.9.2", - "version_normalized": "2.9.2.0", + "version": "3.2.0", + "version_normalized": "3.2.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f" + "reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", - "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/305444bc6fb6c89e490f4b34fa6e979584d7fa81", + "reference": "305444bc6fb6c89e490f4b34fa6e979584d7fa81", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "psr/log-implementation": "3.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "aws/aws-sdk-php": "^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "graylog2/gelf-php": "^1.4.2", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^9.5.16", + "predis/predis": "^1.1", "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -57,11 +56,11 @@ "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2023-10-27T15:25:26+00:00", + "time": "2022-07-24T12:00:55+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } }, "installation-source": "dist", @@ -101,33 +100,33 @@ }, { "name": "psr/log", - "version": "1.1.4", - "version_normalized": "1.1.4.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, - "time": "2021-05-03T11:20:27+00:00", + "time": "2021-07-14T16:46:02+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", diff --git a/monolog/vendor/monolog/monolog/CHANGELOG.md b/monolog/vendor/monolog/monolog/CHANGELOG.md index aca1bdd0..fa0acea3 100644 --- a/monolog/vendor/monolog/monolog/CHANGELOG.md +++ b/monolog/vendor/monolog/monolog/CHANGELOG.md @@ -1,23 +1,70 @@ -### 2.9.2 (2023-10-27) +### 3.2.0 (2022-07-24) - * Fixed display_errors parsing in ErrorHandler which did not support string values (#1804) - * Fixed bug where the previous error handler would not be restored in some cases where StreamHandler fails (#1815) - * Fixed normalization error when normalizing incomplete classes (#1833) + * Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734) + * Marked `Logger` `@final` as it should not be extended, prefer composition or talk to us if you are missing something + * Added RFC 5424 level (`7` to `0`) support to `Logger::log` and `Logger::addRecord` to increase interoperability (#1723) + * Added `SyslogFormatter` to output syslog-like files which can be consumed by tools like [lnav](https://lnav.org/) (#1689) + * Added support for `__toString` for objects which are not json serializable in `JsonFormatter` (#1733) + * Added `GoogleCloudLoggingFormatter` (#1719) + * Added support for Predis 2.x (#1732) + * Added `AmqpHandler->setExtraAttributes` to allow configuring attributes when using an AMQPExchange (#1724) + * Fixed serialization/unserialization of handlers to make sure private properties are included (#1727) + * Fixed allowInlineLineBreaks in LineFormatter causing issues with windows paths containing `\n` or `\r` sequences (#1720) + * Fixed max normalization depth not being taken into account when formatting exceptions with a deep chain of previous exceptions (#1726) + * Fixed PHP 8.2 deprecation warnings (#1722) + * Fixed rare race condition or filesystem issue where StreamHandler is unable to create the directory the log should go into yet it exists already (#1678) -### 2.9.1 (2023-02-06) +### 3.1.0 (2022-06-09) - * Fixed Logger not being serializable anymore (#1792) + * Added `$datetime` parameter to `Logger::addRecord` as low level API to allow logging into the past or future (#1682) + * Added `Logger::useLoggingLoopDetection` to allow disabling cyclic logging detection in concurrent frameworks (#1681) + * Fixed handling of fatal errors if callPrevious is disabled in ErrorHandler (#1670) + * Fixed interop issue by removing the need for a return type in ProcessorInterface (#1680) + * Marked the reusable `Monolog\Test\TestCase` class as `@internal` to make sure PHPStorm does not show it above PHPUnit, you may still use it to test your own handlers/etc though (#1677) + * Fixed RotatingFileHandler issue when the date format contained slashes (#1671) -### 2.9.0 (2023-02-05) +### 3.0.0 (2022-05-10) - * Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748) - * Added support for enum context values in PsrLogMessageProcessor (#1773) - * Added graylog2/gelf-php 2.x support (#1747) - * Improved `BrowserConsoleHandler` logging to use more appropriate methods than just console.log in the browser (#1739) - * Fixed `WhatFailureGroupHandler` not catching errors happening inside `close()` (#1791) - * Fixed datetime field in `GoogleCloudLoggingFormatter` (#1758) - * Fixed infinite loop detection within Fibers (#1753) - * Fixed `AmqpHandler->setExtraAttributes` not working with buffering handler wrappers (#1781) +Changes from RC1 + +- The `Monolog\LevelName` enum does not exist anymore, use `Monolog\Level->getName()` instead. + +### 3.0.0-RC1 (2022-05-08) + +This is mostly a cleanup release offering stronger type guarantees for integrators with the +array->object/enum changes, but there is no big new feature for end users. + +See [UPGRADE notes](UPGRADE.md#300) for details on all breaking changes especially if you are extending/implementing Monolog classes/interfaces. + +Noteworthy BC Breaks: + +- The minimum supported PHP version is now `8.1.0`. +- Log records have been converted from an array to a [`Monolog\LogRecord` object](src/Monolog/LogRecord.php) + with public (and mostly readonly) properties. e.g. instead of doing + `$record['context']` use `$record->context`. + In formatters or handlers if you rather need an array to work with you can use `$record->toArray()` + to get back a Monolog 1/2 style record array. This will contain the enum values instead of enum cases + in the `level` and `level_name` keys to be more backwards compatible and use simpler data types. +- `FormatterInterface`, `HandlerInterface`, `ProcessorInterface`, etc. changed to contain `LogRecord $record` + instead of `array $record` parameter types. If you want to support multiple Monolog versions this should + be possible by type-hinting nothing, or `array|LogRecord` if you support PHP 8.0+. You can then code + against the $record using Monolog 2 style as LogRecord implements ArrayAccess for BC. + The interfaces do not require a `LogRecord` return type even where it would be applicable, but if you only + support Monolog 3 in integration code I would recommend you use `LogRecord` return types wherever fitting + to ensure forward compatibility as it may be added in Monolog 4. +- Log levels are now enums [`Monolog\Level`](src/Monolog/Level.php) and [`Monolog\LevelName`](src/Monolog/LevelName.php) +- Removed deprecated SwiftMailerHandler, migrate to SymfonyMailerHandler instead. +- `ResettableInterface::reset()` now requires a void return type. +- All properties have had types added, which may require you to do so as well if you extended + a Monolog class and declared the same property. + +New deprecations: + +- `Logger::DEBUG`, `Logger::ERROR`, etc. are now deprecated in favor of the `Monolog\Level` enum. + e.g. instead of `Logger::WARNING` use `Level::Warning` if you need to pass the enum case + to Monolog or one of its handlers, or `Level::Warning->value` if you need the integer + value equal to what `Logger::WARNING` was giving you. +- `Logger::getLevelName()` is now deprecated. ### 2.8.0 (2022-07-24) diff --git a/monolog/vendor/monolog/monolog/README.md b/monolog/vendor/monolog/monolog/README.md index bfcae0c0..87c7f664 100644 --- a/monolog/vendor/monolog/monolog/README.md +++ b/monolog/vendor/monolog/monolog/README.md @@ -3,6 +3,8 @@ [![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) [![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) +> ⚠ This is the **documentation for Monolog 3.x**, if you are using older releases +> see the documentation for [Monolog 2.x](https://github.com/Seldaek/monolog/blob/2.x/README.md) or [Monolog 1.x](https://github.com/Seldaek/monolog/blob/1.x/README.md) ⚠ Monolog sends your logs to files, sockets, inboxes, databases and various web services. See the complete list of handlers below. Special handlers @@ -28,12 +30,13 @@ $ composer require monolog/monolog ```php pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); +$log->pushHandler(new StreamHandler('path/to/your.log', Level::Warning)); // add records to the log $log->warning('Foo'); @@ -50,7 +53,7 @@ $log->error('Bar'); ## Support Monolog Financially -Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek). +Get supported Monolog and help fund the project with the [Tidelift Subscription](https://tidelift.com/subscription/pkg/packagist-monolog-monolog?utm_source=packagist-monolog-monolog&utm_medium=referral&utm_campaign=enterprise) or via [GitHub sponsorship](https://github.com/sponsors/Seldaek). Tidelift delivers commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. @@ -64,11 +67,13 @@ can also add your own there if you publish one. ### Requirements -- Monolog `^2.0` works with PHP 7.2 or above, use Monolog `^1.25` for PHP 5.3+ support. +- Monolog `^3.0` works with PHP 8.1 or above. +- Monolog `^2.5` works with PHP 7.2 or above. +- Monolog `^1.25` works with PHP 5.3 up to 8.1, but is not very maintained anymore and will not receive PHP support fixes anymore. ### Support -Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 where possible to benefit from all the latest features and fixes. +Monolog 1.x support is somewhat limited at this point and only important fixes will be done. You should migrate to Monolog 2 or 3 where possible to benefit from all the latest features and fixes. ### Submitting bugs and feature requests diff --git a/monolog/vendor/monolog/monolog/UPGRADE.md b/monolog/vendor/monolog/monolog/UPGRADE.md deleted file mode 100644 index 84e15e6b..00000000 --- a/monolog/vendor/monolog/monolog/UPGRADE.md +++ /dev/null @@ -1,72 +0,0 @@ -### 2.0.0 - -- `Monolog\Logger::API` can be used to distinguish between a Monolog `1` and `2` - install of Monolog when writing integration code. - -- Removed non-PSR-3 methods to add records, all the `add*` (e.g. `addWarning`) - methods as well as `emerg`, `crit`, `err` and `warn`. - -- DateTime are now formatted with a timezone and microseconds (unless disabled). - Various formatters and log output might be affected, which may mess with log parsing - in some cases. - -- The `datetime` in every record array is now a DateTimeImmutable, not that you - should have been modifying these anyway. - -- The timezone is now set per Logger instance and not statically, either - via ->setTimezone or passed in the constructor. Calls to Logger::setTimezone - should be converted. - -- `HandlerInterface` has been split off and two new interfaces now exist for - more granular controls: `ProcessableHandlerInterface` and - `FormattableHandlerInterface`. Handlers not extending `AbstractHandler` - should make sure to implement the relevant interfaces. - -- `HandlerInterface` now requires the `close` method to be implemented. This - only impacts you if you implement the interface yourself, but you can extend - the new `Monolog\Handler\Handler` base class too. - -- There is no more default handler configured on empty Logger instances, if - you were relying on that you will not get any output anymore, make sure to - configure the handler you need. - -#### LogglyFormatter - -- The records' `datetime` is not sent anymore. Only `timestamp` is sent to Loggly. - -#### AmqpHandler - -- Log levels are not shortened to 4 characters anymore. e.g. a warning record - will be sent using the `warning.channel` routing key instead of `warn.channel` - as in 1.x. -- The exchange name does not default to 'log' anymore, and it is completely ignored - now for the AMQP extension users. Only PHPAmqpLib uses it if provided. - -#### RotatingFileHandler - -- The file name format must now contain `{date}` and the date format must be set - to one of the predefined FILE_PER_* constants to avoid issues with file rotation. - See `setFilenameFormat`. - -#### LogstashFormatter - -- Removed Logstash V0 support -- Context/extra prefix has been removed in favor of letting users configure the exact key being sent -- Context/extra data are now sent as an object instead of single keys - -#### HipChatHandler - -- Removed deprecated HipChat handler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead - -#### SlackbotHandler - -- Removed deprecated SlackbotHandler handler, use SlackWebhookHandler or SlackHandler instead - -#### RavenHandler - -- Removed deprecated RavenHandler handler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead - -#### ElasticSearchHandler - -- As support for the official Elasticsearch library was added, the former ElasticSearchHandler has been - renamed to ElasticaHandler and the new one added as ElasticsearchHandler. diff --git a/monolog/vendor/monolog/monolog/composer.json b/monolog/vendor/monolog/monolog/composer.json index b9437d6d..3a48e6db 100644 --- a/monolog/vendor/monolog/monolog/composer.json +++ b/monolog/vendor/monolog/monolog/composer.json @@ -13,26 +13,25 @@ } ], "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" }, "require-dev": { "ext-json": "*", - "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "aws/aws-sdk-php": "^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "graylog2/gelf-php": "^1.4.2", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^9.5.16", + "predis/predis": "^1.1", "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -59,11 +58,11 @@ "psr-4": {"Monolog\\": "tests/Monolog"} }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + "psr/log-implementation": "3.0.0" }, "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "3.x-dev" } }, "scripts": { @@ -73,9 +72,6 @@ "config": { "lock": false, "sort-packages": true, - "platform-check": false, - "allow-plugins": { - "composer/package-versions-deprecated": true - } + "platform-check": false } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php index 188bbb0d..f8b25021 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Attribute/AsMonologProcessor.php @@ -13,34 +13,24 @@ namespace Monolog\Attribute; /** * A reusable attribute to help configure a class or a method as a processor. - * + * * Using it offers no guarantee: it needs to be leveraged by a Monolog third-party consumer. - * + * * Using it with the Monolog library only has no effect at all: processors should still be turned into a callable if * needed and manually pushed to the loggers and to the processable handlers. */ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class AsMonologProcessor { - /** @var string|null */ - public $channel = null; - /** @var string|null */ - public $handler = null; - /** @var string|null */ - public $method = null; - /** - * @param string|null $channel The logging channel the processor should be pushed to. - * @param string|null $handler The handler the processor should be pushed to. - * @param string|null $method The method that processes the records (if the attribute is used at the class level). + * @param string|null $channel The logging channel the processor should be pushed to. + * @param string|null $handler The handler the processor should be pushed to. + * @param string|null $method The method that processes the records (if the attribute is used at the class level). */ public function __construct( - ?string $channel = null, - ?string $handler = null, - ?string $method = null + public readonly ?string $channel = null, + public readonly ?string $handler = null, + public readonly ?string $method = null ) { - $this->channel = $channel; - $this->handler = $handler; - $this->method = $method; } -} +} diff --git a/monolog/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php b/monolog/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php index 6a1ba9b2..274b73ea 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php @@ -21,10 +21,7 @@ use DateTimeZone; */ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable { - /** - * @var bool - */ - private $useMicroseconds; + private bool $useMicroseconds; public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = null) { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 1406d34e..2ed46035 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -11,6 +11,7 @@ namespace Monolog; +use Closure; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; @@ -25,35 +26,33 @@ use Psr\Log\LogLevel; */ class ErrorHandler { - /** @var LoggerInterface */ - private $logger; + private Closure|null $previousExceptionHandler = null; - /** @var ?callable */ - private $previousExceptionHandler = null; /** @var array an array of class name to LogLevel::* constant mapping */ - private $uncaughtExceptionLevelMap = []; + private array $uncaughtExceptionLevelMap = []; + + /** @var Closure|true|null */ + private Closure|bool|null $previousErrorHandler = null; - /** @var callable|true|null */ - private $previousErrorHandler = null; /** @var array an array of E_* constant to LogLevel::* constant mapping */ - private $errorLevelMap = []; - /** @var bool */ - private $handleOnlyReportedErrors = true; + private array $errorLevelMap = []; + + private bool $handleOnlyReportedErrors = true; + + private bool $hasFatalErrorHandler = false; + + private string $fatalLevel = LogLevel::ALERT; + + private string|null $reservedMemory = null; - /** @var bool */ - private $hasFatalErrorHandler = false; - /** @var LogLevel::* */ - private $fatalLevel = LogLevel::ALERT; - /** @var ?string */ - private $reservedMemory = null; /** @var ?array{type: int, message: string, file: string, line: int, trace: mixed} */ - private $lastFatalData = null; - /** @var int[] */ - private static $fatalErrors = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR]; + private array|null $lastFatalData = null; - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; + private const FATAL_ERRORS = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR]; + + public function __construct( + private LoggerInterface $logger + ) { } /** @@ -61,7 +60,6 @@ class ErrorHandler * * By default it will handle errors, exceptions and fatal errors * - * @param LoggerInterface $logger * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling * @param array|false $exceptionLevelMap an array of class name to LogLevel::* constant mapping, or false to disable exception handling * @param LogLevel::*|null|false $fatalLevel a LogLevel::* constant, null to use the default LogLevel::ALERT or false to disable fatal error handling @@ -99,8 +97,8 @@ class ErrorHandler $this->uncaughtExceptionLevelMap[$class] = $level; } } - if ($callPrevious && $prev) { - $this->previousExceptionHandler = $prev; + if ($callPrevious && null !== $prev) { + $this->previousExceptionHandler = $prev(...); } return $this; @@ -112,10 +110,10 @@ class ErrorHandler */ public function registerErrorHandler(array $levelMap = [], bool $callPrevious = true, int $errorTypes = -1, bool $handleOnlyReportedErrors = true): self { - $prev = set_error_handler([$this, 'handleError'], $errorTypes); + $prev = set_error_handler($this->handleError(...), $errorTypes); $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap); if ($callPrevious) { - $this->previousErrorHandler = $prev ?: true; + $this->previousErrorHandler = $prev !== null ? $prev(...) : true; } else { $this->previousErrorHandler = null; } @@ -131,7 +129,7 @@ class ErrorHandler */ public function registerFatalHandler($level = null, int $reservedMemorySize = 20): self { - register_shutdown_function([$this, 'handleFatalError']); + register_shutdown_function($this->handleFatalError(...)); $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize); $this->fatalLevel = null === $level ? LogLevel::ALERT : $level; @@ -175,10 +173,7 @@ class ErrorHandler ]; } - /** - * @phpstan-return never - */ - private function handleException(\Throwable $e): void + private function handleException(\Throwable $e): never { $level = LogLevel::ERROR; foreach ($this->uncaughtExceptionLevelMap as $class => $candidate) { @@ -194,30 +189,25 @@ class ErrorHandler ['exception' => $e] ); - if ($this->previousExceptionHandler) { + if (null !== $this->previousExceptionHandler) { ($this->previousExceptionHandler)($e); } - if (!headers_sent() && in_array(strtolower((string) ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { + if (!headers_sent() && !(bool) ini_get('display_errors')) { http_response_code(500); } exit(255); } - /** - * @private - * - * @param mixed[] $context - */ - public function handleError(int $code, string $message, string $file = '', int $line = 0, ?array $context = []): bool + private function handleError(int $code, string $message, string $file = '', int $line = 0): bool { - if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) { + if ($this->handleOnlyReportedErrors && 0 === (error_reporting() & $code)) { return false; } // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries - if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) { + if (!$this->hasFatalErrorHandler || !in_array($code, self::FATAL_ERRORS, true)) { $level = $this->errorLevelMap[$code] ?? LogLevel::CRITICAL; $this->logger->log($level, self::codeToString($code).': '.$message, ['code' => $code, 'message' => $message, 'file' => $file, 'line' => $line]); } else { @@ -228,8 +218,9 @@ class ErrorHandler if ($this->previousErrorHandler === true) { return false; - } elseif ($this->previousErrorHandler) { - return (bool) ($this->previousErrorHandler)($code, $message, $file, $line, $context); + } + if ($this->previousErrorHandler instanceof Closure) { + return (bool) ($this->previousErrorHandler)($code, $message, $file, $line); } return true; @@ -247,8 +238,7 @@ class ErrorHandler } else { $lastError = error_get_last(); } - - if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) { + if (is_array($lastError) && in_array($lastError['type'], self::FATAL_ERRORS, true)) { $trace = $lastError['trace'] ?? null; $this->logger->log( $this->fatalLevel, @@ -264,44 +254,25 @@ class ErrorHandler } } - /** - * @param int $code - */ - private static function codeToString($code): string + private static function codeToString(int $code): string { - switch ($code) { - case E_ERROR: - return 'E_ERROR'; - case E_WARNING: - return 'E_WARNING'; - case E_PARSE: - return 'E_PARSE'; - case E_NOTICE: - return 'E_NOTICE'; - case E_CORE_ERROR: - return 'E_CORE_ERROR'; - case E_CORE_WARNING: - return 'E_CORE_WARNING'; - case E_COMPILE_ERROR: - return 'E_COMPILE_ERROR'; - case E_COMPILE_WARNING: - return 'E_COMPILE_WARNING'; - case E_USER_ERROR: - return 'E_USER_ERROR'; - case E_USER_WARNING: - return 'E_USER_WARNING'; - case E_USER_NOTICE: - return 'E_USER_NOTICE'; - case E_STRICT: - return 'E_STRICT'; - case E_RECOVERABLE_ERROR: - return 'E_RECOVERABLE_ERROR'; - case E_DEPRECATED: - return 'E_DEPRECATED'; - case E_USER_DEPRECATED: - return 'E_USER_DEPRECATED'; - } - - return 'Unknown PHP error'; + return match ($code) { + E_ERROR => 'E_ERROR', + E_WARNING => 'E_WARNING', + E_PARSE => 'E_PARSE', + E_NOTICE => 'E_NOTICE', + E_CORE_ERROR => 'E_CORE_ERROR', + E_CORE_WARNING => 'E_CORE_WARNING', + E_COMPILE_ERROR => 'E_COMPILE_ERROR', + E_COMPILE_WARNING => 'E_COMPILE_WARNING', + E_USER_ERROR => 'E_USER_ERROR', + E_USER_WARNING => 'E_USER_WARNING', + E_USER_NOTICE => 'E_USER_NOTICE', + E_STRICT => 'E_STRICT', + E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', + E_DEPRECATED => 'E_DEPRECATED', + E_USER_DEPRECATED => 'E_USER_DEPRECATED', + default => 'Unknown PHP error', + }; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php index aa1884b9..3f1d4582 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php @@ -11,7 +11,8 @@ namespace Monolog\Formatter; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Formats a log message according to the ChromePHP array format @@ -23,52 +24,55 @@ class ChromePHPFormatter implements FormatterInterface /** * Translates Monolog log levels to Wildfire levels. * - * @var array + * @return 'log'|'info'|'warn'|'error' */ - private $logLevels = [ - Logger::DEBUG => 'log', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warn', - Logger::ERROR => 'error', - Logger::CRITICAL => 'error', - Logger::ALERT => 'error', - Logger::EMERGENCY => 'error', - ]; + private function toWildfireLevel(Level $level): string + { + return match ($level) { + Level::Debug => 'log', + Level::Info => 'info', + Level::Notice => 'info', + Level::Warning => 'warn', + Level::Error => 'error', + Level::Critical => 'error', + Level::Alert => 'error', + Level::Emergency => 'error', + }; + } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record) + public function format(LogRecord $record) { // Retrieve the line and file if set and remove them from the formatted extra $backtrace = 'unknown'; - if (isset($record['extra']['file'], $record['extra']['line'])) { - $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; - unset($record['extra']['file'], $record['extra']['line']); + if (isset($record->extra['file'], $record->extra['line'])) { + $backtrace = $record->extra['file'].' : '.$record->extra['line']; + unset($record->extra['file'], $record->extra['line']); } - $message = ['message' => $record['message']]; - if ($record['context']) { - $message['context'] = $record['context']; + $message = ['message' => $record->message]; + if (\count($record->context) > 0) { + $message['context'] = $record->context; } - if ($record['extra']) { - $message['extra'] = $record['extra']; + if (\count($record->extra) > 0) { + $message['extra'] = $record->extra; } if (count($message) === 1) { $message = reset($message); } return [ - $record['channel'], + $record->channel, $message, $backtrace, - $this->logLevels[$record['level']], + $this->toWildfireLevel($record->level), ]; } /** - * {@inheritDoc} + * @inheritDoc */ public function formatBatch(array $records) { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php index 6c8a9ab5..160510ad 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php @@ -12,25 +12,24 @@ namespace Monolog\Formatter; use Elastica\Document; +use Monolog\LogRecord; /** * Format a log message into an Elastica Document * * @author Jelle Vink - * - * @phpstan-import-type Record from \Monolog\Logger */ class ElasticaFormatter extends NormalizerFormatter { /** * @var string Elastic search index name */ - protected $index; + protected string $index; /** - * @var ?string Elastic search document type + * @var string|null Elastic search document type */ - protected $type; + protected string|null $type; /** * @param string $index Elastic Search index name @@ -46,9 +45,9 @@ class ElasticaFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record) + public function format(LogRecord $record) { $record = parent::format($record); @@ -72,14 +71,13 @@ class ElasticaFormatter extends NormalizerFormatter /** * Convert a log message into an Elastica Document * - * @phpstan-param Record $record + * @param mixed[] $record */ protected function getDocument(array $record): Document { $document = new Document(); $document->setData($record); if (method_exists($document, 'setType')) { - /** @phpstan-ignore-next-line */ $document->setType($this->type); } $document->setIndex($this->index); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php index b792b819..6c3eb9b2 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ElasticsearchFormatter.php @@ -12,6 +12,7 @@ namespace Monolog\Formatter; use DateTimeInterface; +use Monolog\LogRecord; /** * Format a log message into an Elasticsearch record @@ -23,12 +24,12 @@ class ElasticsearchFormatter extends NormalizerFormatter /** * @var string Elasticsearch index name */ - protected $index; + protected string $index; /** * @var string Elasticsearch record type */ - protected $type; + protected string $type; /** * @param string $index Elasticsearch index name @@ -44,9 +45,9 @@ class ElasticsearchFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record) + public function format(LogRecord $record) { $record = parent::format($record); @@ -55,8 +56,6 @@ class ElasticsearchFormatter extends NormalizerFormatter /** * Getter index - * - * @return string */ public function getIndex(): string { @@ -65,8 +64,6 @@ class ElasticsearchFormatter extends NormalizerFormatter /** * Getter type - * - * @return string */ public function getType(): string { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php index 867ae586..b8f7be52 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php @@ -11,23 +11,18 @@ namespace Monolog\Formatter; +use Monolog\LogRecord; + /** * formats the record to be used in the FlowdockHandler * * @author Dominik Liebler - * @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4 */ class FlowdockFormatter implements FormatterInterface { - /** - * @var string - */ - private $source; + private string $source; - /** - * @var string - */ - private $sourceEmail; + private string $sourceEmail; public function __construct(string $source, string $sourceEmail) { @@ -36,43 +31,41 @@ class FlowdockFormatter implements FormatterInterface } /** - * {@inheritDoc} + * @inheritDoc * * @return mixed[] */ - public function format(array $record): array + public function format(LogRecord $record): array { $tags = [ '#logs', - '#' . strtolower($record['level_name']), - '#' . $record['channel'], + '#' . $record->level->toPsrLogLevel(), + '#' . $record->channel, ]; - foreach ($record['extra'] as $value) { + foreach ($record->extra as $value) { $tags[] = '#' . $value; } $subject = sprintf( 'in %s: %s - %s', $this->source, - $record['level_name'], - $this->getShortMessage($record['message']) + $record->level->getName(), + $this->getShortMessage($record->message) ); - $record['flowdock'] = [ + return [ 'source' => $this->source, 'from_address' => $this->sourceEmail, 'subject' => $subject, - 'content' => $record['message'], + 'content' => $record->message, 'tags' => $tags, 'project' => $this->source, ]; - - return $record; } /** - * {@inheritDoc} + * @inheritDoc * * @return mixed[][] */ diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php index 29b14d30..9bd2c160 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php @@ -12,6 +12,7 @@ namespace Monolog\Formatter; use Monolog\Utils; +use Monolog\LogRecord; /** * Class FluentdFormatter @@ -39,7 +40,7 @@ class FluentdFormatter implements FormatterInterface /** * @var bool $levelTag should message level be a part of the fluentd tag */ - protected $levelTag = false; + protected bool $levelTag = false; public function __construct(bool $levelTag = false) { @@ -55,25 +56,25 @@ class FluentdFormatter implements FormatterInterface return $this->levelTag; } - public function format(array $record): string + public function format(LogRecord $record): string { - $tag = $record['channel']; + $tag = $record->channel; if ($this->levelTag) { - $tag .= '.' . strtolower($record['level_name']); + $tag .= '.' . $record->level->toPsrLogLevel(); } $message = [ - 'message' => $record['message'], - 'context' => $record['context'], - 'extra' => $record['extra'], + 'message' => $record->message, + 'context' => $record->context, + 'extra' => $record->extra, ]; if (!$this->levelTag) { - $message['level'] = $record['level']; - $message['level_name'] = $record['level_name']; + $message['level'] = $record->level->value; + $message['level_name'] = $record->level->getName(); } - return Utils::jsonEncode([$tag, $record['datetime']->getTimestamp(), $message]); + return Utils::jsonEncode([$tag, $record->datetime->getTimestamp(), $message]); } public function formatBatch(array $records): string diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php index 19617ec5..3413a4b0 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php @@ -11,32 +11,28 @@ namespace Monolog\Formatter; +use Monolog\LogRecord; + /** * Interface for formatters * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger */ interface FormatterInterface { /** * Formats a log record. * - * @param array $record A record to format - * @return mixed The formatted record - * - * @phpstan-param Record $record + * @param LogRecord $record A record to format + * @return mixed The formatted record */ - public function format(array $record); + public function format(LogRecord $record); /** * Formats a set of log records. * - * @param array $records A set of records to format - * @return mixed The formatted set of records - * - * @phpstan-param Record[] $records + * @param array $records A set of records to format + * @return mixed The formatted set of records */ public function formatBatch(array $records); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index 3b3e1e7f..33116a26 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -11,17 +11,16 @@ namespace Monolog\Formatter; -use Monolog\Logger; +use Monolog\Level; use Gelf\Message; use Monolog\Utils; +use Monolog\LogRecord; /** * Serializes a log message to GELF * @see http://docs.graylog.org/en/latest/pages/gelf.html * * @author Matt Lehner - * - * @phpstan-import-type Level from \Monolog\Logger */ class GelfMessageFormatter extends NormalizerFormatter { @@ -30,45 +29,39 @@ class GelfMessageFormatter extends NormalizerFormatter /** * @var string the name of the system for the Gelf log message */ - protected $systemName; + protected string $systemName; /** * @var string a prefix for 'extra' fields from the Monolog record (optional) */ - protected $extraPrefix; + protected string $extraPrefix; /** * @var string a prefix for 'context' fields from the Monolog record (optional) */ - protected $contextPrefix; + protected string $contextPrefix; /** * @var int max length per field */ - protected $maxLength; - - /** - * @var int - */ - private $gelfVersion = 2; + protected int $maxLength; /** * Translates Monolog log levels to Graylog2 log priorities. - * - * @var array - * - * @phpstan-var array */ - private $logLevels = [ - Logger::DEBUG => 7, - Logger::INFO => 6, - Logger::NOTICE => 5, - Logger::WARNING => 4, - Logger::ERROR => 3, - Logger::CRITICAL => 2, - Logger::ALERT => 1, - Logger::EMERGENCY => 0, - ]; + private function getGraylog2Priority(Level $level): int + { + return match ($level) { + Level::Debug => 7, + Level::Info => 6, + Level::Notice => 5, + Level::Warning => 4, + Level::Error => 3, + Level::Critical => 2, + Level::Alert => 1, + Level::Emergency => 0, + }; + } public function __construct(?string $systemName = null, ?string $extraPrefix = null, string $contextPrefix = 'ctxt_', ?int $maxLength = null) { @@ -78,64 +71,52 @@ class GelfMessageFormatter extends NormalizerFormatter parent::__construct('U.u'); - $this->systemName = (is_null($systemName) || $systemName === '') ? (string) gethostname() : $systemName; + $this->systemName = (null === $systemName || $systemName === '') ? (string) gethostname() : $systemName; - $this->extraPrefix = is_null($extraPrefix) ? '' : $extraPrefix; + $this->extraPrefix = null === $extraPrefix ? '' : $extraPrefix; $this->contextPrefix = $contextPrefix; - $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; - - if (method_exists(Message::class, 'setFacility')) { - $this->gelfVersion = 1; - } + $this->maxLength = null === $maxLength ? self::DEFAULT_MAX_LENGTH : $maxLength; } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record): Message + public function format(LogRecord $record): Message { $context = $extra = []; - if (isset($record['context'])) { + if (isset($record->context)) { /** @var mixed[] $context */ - $context = parent::normalize($record['context']); + $context = parent::normalize($record->context); } - if (isset($record['extra'])) { + if (isset($record->extra)) { /** @var mixed[] $extra */ - $extra = parent::normalize($record['extra']); - } - - if (!isset($record['datetime'], $record['message'], $record['level'])) { - throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given'); + $extra = parent::normalize($record->extra); } $message = new Message(); $message - ->setTimestamp($record['datetime']) - ->setShortMessage((string) $record['message']) + ->setTimestamp($record->datetime) + ->setShortMessage($record->message) ->setHost($this->systemName) - ->setLevel($this->logLevels[$record['level']]); + ->setLevel($this->getGraylog2Priority($record->level)); // message length + system name length + 200 for padding / metadata - $len = 200 + strlen((string) $record['message']) + strlen($this->systemName); + $len = 200 + strlen($record->message) + strlen($this->systemName); if ($len > $this->maxLength) { - $message->setShortMessage(Utils::substr($record['message'], 0, $this->maxLength)); + $message->setShortMessage(Utils::substr($record->message, 0, $this->maxLength)); } - if ($this->gelfVersion === 1) { - if (isset($record['channel'])) { - $message->setFacility($record['channel']); - } - if (isset($extra['line'])) { - $message->setLine($extra['line']); - unset($extra['line']); - } - if (isset($extra['file'])) { - $message->setFile($extra['file']); - unset($extra['file']); - } - } else { - $message->setAdditional('facility', $record['channel']); + if (isset($record->channel)) { + $message->setAdditional('facility', $record->channel); + } + if (isset($extra['line'])) { + $message->setAdditional('line', $extra['line']); + unset($extra['line']); + } + if (isset($extra['file'])) { + $message->setAdditional('file', $extra['file']); + unset($extra['file']); } foreach ($extra as $key => $val) { @@ -160,13 +141,10 @@ class GelfMessageFormatter extends NormalizerFormatter $message->setAdditional($this->contextPrefix . $key, $val); } - if ($this->gelfVersion === 1) { - /** @phpstan-ignore-next-line */ - if (null === $message->getFile() && isset($context['exception']['file'])) { - if (preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) { - $message->setFile($matches[1]); - $message->setLine($matches[2]); - } + if (!$message->hasAdditional('file') && isset($context['exception']['file'])) { + if (1 === preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) { + $message->setAdditional('file', $matches[1]); + $message->setAdditional('line', $matches[2]); } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php index ca52ebf4..d37d1e0c 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php @@ -17,24 +17,23 @@ use Monolog\LogRecord; /** * Encodes message information into JSON in a format compatible with Cloud logging. * - * @see https://cloud.google.com/logging/docs/structured-logging * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry * * @author Luís Cobucci */ final class GoogleCloudLoggingFormatter extends JsonFormatter { - /** {@inheritdoc} **/ - public function format(array $record): string + protected function normalizeRecord(LogRecord $record): array { + $normalized = parent::normalizeRecord($record); + // Re-key level for GCP logging - $record['severity'] = $record['level_name']; - $record['time'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED); + $normalized['severity'] = $normalized['level_name']; + $normalized['timestamp'] = $record->datetime->format(DateTimeInterface::RFC3339_EXTENDED); // Remove keys that are not used by GCP - unset($record['level'], $record['level_name'], $record['datetime']); + unset($normalized['level'], $normalized['level_name'], $normalized['datetime']); - return parent::format($record); + return $normalized; } } - diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php index 10a4311c..bf1c61da 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php @@ -11,8 +11,9 @@ namespace Monolog\Formatter; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Formats incoming records into an HTML table @@ -25,19 +26,20 @@ class HtmlFormatter extends NormalizerFormatter { /** * Translates Monolog log levels to html color priorities. - * - * @var array */ - protected $logLevels = [ - Logger::DEBUG => '#CCCCCC', - Logger::INFO => '#28A745', - Logger::NOTICE => '#17A2B8', - Logger::WARNING => '#FFC107', - Logger::ERROR => '#FD7E14', - Logger::CRITICAL => '#DC3545', - Logger::ALERT => '#821722', - Logger::EMERGENCY => '#000000', - ]; + protected function getLevelColor(Level $level): string + { + return match ($level) { + Level::Debug => '#CCCCCC', + Level::Info => '#28A745', + Level::Notice => '#17A2B8', + Level::Warning => '#FFC107', + Level::Error => '#FD7E14', + Level::Critical => '#DC3545', + Level::Alert => '#821722', + Level::Emergency => '#000000', + }; + } /** * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format @@ -67,15 +69,13 @@ class HtmlFormatter extends NormalizerFormatter /** * Create a HTML h1 tag * - * @param string $title Text to be in the h1 - * @param int $level Error level - * @return string + * @param string $title Text to be in the h1 */ - protected function addTitle(string $title, int $level): string + protected function addTitle(string $title, Level $level): string { $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'); - return '

'.$title.'

'; + return '

'.$title.'

'; } /** @@ -83,25 +83,25 @@ class HtmlFormatter extends NormalizerFormatter * * @return string The formatted record */ - public function format(array $record): string + public function format(LogRecord $record): string { - $output = $this->addTitle($record['level_name'], $record['level']); + $output = $this->addTitle($record->level->getName(), $record->level); $output .= '
@@ -322,7 +323,7 @@ $o .= <<< EOT - + @@ -344,13 +345,13 @@ $o .= <<< EOT - +
diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 7b5f05c0..2116ac44 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -6,8 +6,11 @@ * Author: Fabio */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; +use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -26,7 +29,7 @@ function catavatar_install() Hook::register('addon_settings', __FILE__, 'catavatar_addon_settings'); Hook::register('addon_settings_post', __FILE__, 'catavatar_addon_settings_post'); - DI::logger()->notice('registered catavatar'); + Logger::notice('registered catavatar'); } /** diff --git a/catavatar/lang/bg/messages.po b/catavatar/lang/bg/messages.po deleted file mode 100644 index 027fc971..00000000 --- a/catavatar/lang/bg/messages.po +++ /dev/null @@ -1,54 +0,0 @@ -# ADDON catavatar -# Copyright (C) -# This file is distributed under the same license as the Friendica catavatar addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Language-Team: Bulgarian (https://app.transifex.com/Friendica/teams/12172/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: catavatar.php:48 -msgid "Set default profile avatar or randomize the cat." -msgstr "" - -#: catavatar.php:53 -msgid "Cat Avatar Settings" -msgstr "" - -#: catavatar.php:56 -msgid "Use Cat as Avatar" -msgstr "" - -#: catavatar.php:57 -msgid "Another random Cat!" -msgstr "" - -#: catavatar.php:58 -msgid "Reset to email Cat" -msgstr "" - -#: catavatar.php:77 -msgid "The cat hadn't found itself." -msgstr "" - -#: catavatar.php:86 -msgid "There was an error, the cat ran away." -msgstr "" - -#: catavatar.php:92 -msgid "Profile Photos" -msgstr "" - -#: catavatar.php:102 -msgid "Meow!" -msgstr "" diff --git a/catavatar/lang/bg/strings.php b/catavatar/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/catavatar/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2019 -# Florent C., 2023 +# Walter Bulbazor, 2021 +# Hypolite Petovan , 2022 # #, fuzzy msgid "" @@ -14,8 +15,8 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-21 19:14-0500\n" "PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Last-Translator: Florent C., 2023\n" -"Language-Team: French (https://app.transifex.com/Friendica/teams/12172/fr/)\n" +"Last-Translator: Hypolite Petovan , 2022\n" +"Language-Team: French (https://www.transifex.com/Friendica/teams/12172/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -24,7 +25,7 @@ msgstr "" #: catavatar.php:48 msgid "Set default profile avatar or randomize the cat." -msgstr "Mettre l'avatar par défaut ou tirer au sort le chat." +msgstr "Mettre l'avatar par défaut ou tirer au sort le Chat." #: catavatar.php:53 msgid "Cat Avatar Settings" @@ -32,15 +33,15 @@ msgstr "Paramètres de Chat avatar" #: catavatar.php:56 msgid "Use Cat as Avatar" -msgstr "Utiliser ce Chat" +msgstr "Utiliser Chat comme avatar" #: catavatar.php:57 msgid "Another random Cat!" -msgstr "Un autre Chat aléatoire !" +msgstr "Un autre chat aléatoire !" #: catavatar.php:58 msgid "Reset to email Cat" -msgstr "Revenir au Chat par défaut" +msgstr "Réinitialiser à Chat courriel" #: catavatar.php:77 msgid "The cat hadn't found itself." diff --git a/catavatar/lang/fr/strings.php b/catavatar/lang/fr/strings.php index b68b9d45..5d8a10a3 100644 --- a/catavatar/lang/fr/strings.php +++ b/catavatar/lang/fr/strings.php @@ -5,11 +5,11 @@ function string_plural_select_fr($n){ $n = intval($n); if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } }} -$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le chat.'; +$a->strings['Set default profile avatar or randomize the cat.'] = 'Mettre l\'avatar par défaut ou tirer au sort le Chat.'; $a->strings['Cat Avatar Settings'] = 'Paramètres de Chat avatar'; -$a->strings['Use Cat as Avatar'] = 'Utiliser ce Chat'; -$a->strings['Another random Cat!'] = 'Un autre Chat aléatoire !'; -$a->strings['Reset to email Cat'] = 'Revenir au Chat par défaut'; +$a->strings['Use Cat as Avatar'] = 'Utiliser Chat comme avatar'; +$a->strings['Another random Cat!'] = 'Un autre chat aléatoire !'; +$a->strings['Reset to email Cat'] = 'Réinitialiser à Chat courriel'; $a->strings['The cat hadn\'t found itself.'] = 'Le Chat ne s\'y est pas retrouvé'; $a->strings['There was an error, the cat ran away.'] = 'Il y a eu une erreur et le chat s\'est enfui'; $a->strings['Profile Photos'] = 'Photos de profil'; diff --git a/catavatar/lang/gd/messages.po b/catavatar/lang/gd/messages.po deleted file mode 100644 index b86ca6f1..00000000 --- a/catavatar/lang/gd/messages.po +++ /dev/null @@ -1,54 +0,0 @@ -# ADDON catavatar -# Copyright (C) -# This file is distributed under the same license as the Friendica catavatar addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Language-Team: Gaelic, Scottish (https://app.transifex.com/Friendica/teams/12172/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: catavatar.php:48 -msgid "Set default profile avatar or randomize the cat." -msgstr "" - -#: catavatar.php:53 -msgid "Cat Avatar Settings" -msgstr "" - -#: catavatar.php:56 -msgid "Use Cat as Avatar" -msgstr "" - -#: catavatar.php:57 -msgid "Another random Cat!" -msgstr "" - -#: catavatar.php:58 -msgid "Reset to email Cat" -msgstr "" - -#: catavatar.php:77 -msgid "The cat hadn't found itself." -msgstr "" - -#: catavatar.php:86 -msgid "There was an error, the cat ran away." -msgstr "" - -#: catavatar.php:92 -msgid "Profile Photos" -msgstr "" - -#: catavatar.php:102 -msgid "Meow!" -msgstr "" diff --git a/catavatar/lang/gd/strings.php b/catavatar/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/catavatar/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/catavatar/lang/it/messages.po b/catavatar/lang/it/messages.po index 9155bb48..e05bd277 100644 --- a/catavatar/lang/it/messages.po +++ b/catavatar/lang/it/messages.po @@ -6,55 +6,55 @@ # Translators: # fabrixxm , 2018 # Davide Pesenti , 2018 -# Sylke Vicious , 2023 +# Sylke Vicious , 2021 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" +"POT-Creation-Date: 2020-12-29 00:53+0000\n" "PO-Revision-Date: 2018-04-07 05:23+0000\n" -"Last-Translator: Sylke Vicious , 2023\n" -"Language-Team: Italian (https://app.transifex.com/Friendica/teams/12172/it/)\n" +"Last-Translator: Sylke Vicious , 2021\n" +"Language-Team: Italian (https://www.transifex.com/Friendica/teams/12172/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: it\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: catavatar.php:48 -msgid "Set default profile avatar or randomize the cat." -msgstr "Imposta l'immagine di profilo predefinita o crea un gatto casuale." - -#: catavatar.php:53 -msgid "Cat Avatar Settings" -msgstr "Impostazioni Avatar Gatto" - -#: catavatar.php:56 msgid "Use Cat as Avatar" msgstr "Usa il Gatto come avatar" -#: catavatar.php:57 -msgid "Another random Cat!" -msgstr "Un altro Gatto casuale!" +#: catavatar.php:49 +msgid "More Random Cat!" +msgstr "Altro Gatto a caso!" -#: catavatar.php:58 +#: catavatar.php:50 msgid "Reset to email Cat" msgstr "Reimposta Gatto" -#: catavatar.php:77 +#: catavatar.php:52 +msgid "Cat Avatar Settings" +msgstr "Impostazioni Avatar Gatto" + +#: catavatar.php:53 +msgid "Set default profile avatar or randomize the cat." +msgstr "Imposta l'immagine di profilo predefinita o crea un gatto casuale." + +#: catavatar.php:78 msgid "The cat hadn't found itself." msgstr "Il gatto non ha trovato sé stesso." -#: catavatar.php:86 +#: catavatar.php:87 msgid "There was an error, the cat ran away." msgstr "Si è verificato un errore, il gatto è scappato." -#: catavatar.php:92 +#: catavatar.php:93 msgid "Profile Photos" msgstr "Foto del profilo" -#: catavatar.php:102 +#: catavatar.php:108 msgid "Meow!" msgstr "Miao!" diff --git a/catavatar/lang/it/strings.php b/catavatar/lang/it/strings.php index 8f78b3fe..3a33374a 100644 --- a/catavatar/lang/it/strings.php +++ b/catavatar/lang/it/strings.php @@ -3,13 +3,13 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ $n = intval($n); - if ($n == 1) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } + return intval($n != 1); }} -$a->strings['Set default profile avatar or randomize the cat.'] = 'Imposta l\'immagine di profilo predefinita o crea un gatto casuale.'; -$a->strings['Cat Avatar Settings'] = 'Impostazioni Avatar Gatto'; $a->strings['Use Cat as Avatar'] = 'Usa il Gatto come avatar'; -$a->strings['Another random Cat!'] = 'Un altro Gatto casuale!'; +$a->strings['More Random Cat!'] = 'Altro Gatto a caso!'; $a->strings['Reset to email Cat'] = 'Reimposta Gatto'; +$a->strings['Cat Avatar Settings'] = 'Impostazioni Avatar Gatto'; +$a->strings['Set default profile avatar or randomize the cat.'] = 'Imposta l\'immagine di profilo predefinita o crea un gatto casuale.'; $a->strings['The cat hadn\'t found itself.'] = 'Il gatto non ha trovato sé stesso.'; $a->strings['There was an error, the cat ran away.'] = 'Si è verificato un errore, il gatto è scappato.'; $a->strings['Profile Photos'] = 'Foto del profilo'; diff --git a/circle_text/group_text.php b/circle_text/group_text.php deleted file mode 100644 index b52cbc19..00000000 --- a/circle_text/group_text.php +++ /dev/null @@ -1,64 +0,0 @@ - - */ - -use Friendica\Core\Hook; -use Friendica\Core\Renderer; -use Friendica\DI; - -function circle_text_install() -{ - Hook::register('addon_settings', __FILE__, 'circle_text_settings'); - Hook::register('addon_settings_post', __FILE__, 'circle_text_settings_post'); -} - -/** - * - * Callback from the settings post function. - * $post contains the $_POST array. - * We will make sure we've got a valid user account - * and if so set our configuration setting for this person. - * - */ - -function circle_text_settings_post(array $post) -{ - if (!DI::userSession()->getLocalUserId() || empty($post['circle_text-submit'])) { - return; - } - - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit', intval($post['circle_text'])); -} - - -/** - * - * Called from the Addon Setting form. - * Add our own settings info to the page. - * - */ - -function circle_text_settings(array &$data) -{ - if (!DI::userSession()->getLocalUserId()) { - return; - } - - $enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'circle_edit_image_limit') ?? - DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit'); - - $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/circle_text/'); - $html = Renderer::replaceMacros($t, [ - '$enabled' => ['circle_text', DI::l10n()->t('Use a text only (non-image) circle selector in the "circle edit" menu'), $enabled], - ]); - - $data = [ - 'addon' => 'circle_text', - 'title' => DI::l10n()->t('Circle Text'), - 'html' => $html, - ]; -} diff --git a/circle_text/lang/C/messages.po b/circle_text/lang/C/messages.po deleted file mode 100644 index 27c0e60e..00000000 --- a/circle_text/lang/C/messages.po +++ /dev/null @@ -1,26 +0,0 @@ -# ADDON circle_text -# Copyright (C) -# This file is distributed under the same license as the Friendica circle_text addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:48-0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: group_text.php:56 -msgid "Use a text only (non-image) circle selector in the \"circle edit\" menu" -msgstr "" - -#: group_text.php:61 -msgid "Circle Text" -msgstr "" diff --git a/circle_text/lang/ar/messages.po b/circle_text/lang/ar/messages.po deleted file mode 100644 index cfe9bb63..00000000 --- a/circle_text/lang/ar/messages.po +++ /dev/null @@ -1,32 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Farida Khalaf , 2021 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2021-02-21 02:59+0000\n" -"Last-Translator: Farida Khalaf \n" -"Language-Team: Arabic (http://www.transifex.com/Friendica/friendica/language/ar/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ar\n" -"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" - -#: group_text.php:62 -msgid "Group Text" -msgstr "نص المجموعة:" - -#: group_text.php:64 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة \"تعديل المجموعة\"" - -#: group_text.php:70 -msgid "Save Settings" -msgstr "حفظ الإعدادات" diff --git a/circle_text/lang/ar/strings.php b/circle_text/lang/ar/strings.php deleted file mode 100644 index 20e8496a..00000000 --- a/circle_text/lang/ar/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -=3 && $n%100<=10) { return 3; } else if ($n%100>=11 && $n%100<=99) { return 4; } else { return 5; } -}} -$a->strings['Group Text'] = 'نص المجموعة:'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'استخدم محدد نصي للمجموعة فقط (غير مصور) في قائمة "تعديل المجموعة"'; -$a->strings['Save Settings'] = 'حفظ الإعدادات'; diff --git a/circle_text/lang/ca/messages.po b/circle_text/lang/ca/messages.po deleted file mode 100644 index 7081c0d7..00000000 --- a/circle_text/lang/ca/messages.po +++ /dev/null @@ -1,36 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Joan Bar , 2019 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2019-10-14 00:45+0000\n" -"Last-Translator: Joan Bar \n" -"Language-Team: Catalan (http://www.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "La configuració del text del grup s'ha actualitzat." - -#: group_text.php:76 -msgid "Group Text" -msgstr "Missatge del grup" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú 'Edita grup'" - -#: group_text.php:84 -msgid "Submit" -msgstr "sotmetre's" diff --git a/circle_text/lang/ca/strings.php b/circle_text/lang/ca/strings.php deleted file mode 100644 index b28db322..00000000 --- a/circle_text/lang/ca/strings.php +++ /dev/null @@ -1,11 +0,0 @@ -strings['Group Text settings updated.'] = 'La configuració del text del grup s\'ha actualitzat.'; -$a->strings['Group Text'] = 'Missatge del grup'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilitzeu un selector de grup de només text (que no sigui una imatge) al menú \'Edita grup\''; -$a->strings['Submit'] = 'sotmetre\'s'; diff --git a/circle_text/lang/cs/messages.po b/circle_text/lang/cs/messages.po deleted file mode 100644 index 8b56b630..00000000 --- a/circle_text/lang/cs/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Aditoo, 2018 -# michal_s , 2014-2015 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2018-09-12 09:47+0000\n" -"Last-Translator: Aditoo\n" -"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: cs\n" -"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "Nastavení Group Text aktualizována." - -#: group_text.php:76 -msgid "Group Text" -msgstr "Skupinový text" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin." - -#: group_text.php:84 -msgid "Submit" -msgstr "Odeslat" diff --git a/circle_text/lang/cs/strings.php b/circle_text/lang/cs/strings.php deleted file mode 100644 index 510453af..00000000 --- a/circle_text/lang/cs/strings.php +++ /dev/null @@ -1,11 +0,0 @@ -= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; } -}} -$a->strings['Group Text settings updated.'] = 'Nastavení Group Text aktualizována.'; -$a->strings['Group Text'] = 'Skupinový text'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Použijte pouze textový (bezobrázkový) výběr skupiny v menu úpravy skupin.'; -$a->strings['Submit'] = 'Odeslat'; diff --git a/circle_text/lang/da-dk/messages.po b/circle_text/lang/da-dk/messages.po deleted file mode 100644 index 9f1fbefa..00000000 --- a/circle_text/lang/da-dk/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Anton , 2022 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:35+0000\n" -"Last-Translator: Anton , 2022\n" -"Language-Team: Danish (Denmark) (http://www.transifex.com/Friendica/friendica/language/da_DK/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: da_DK\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:58 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen" - -#: group_text.php:63 -msgid "Group Text" -msgstr "Gruppebesked" diff --git a/circle_text/lang/da-dk/strings.php b/circle_text/lang/da-dk/strings.php deleted file mode 100644 index 4306b769..00000000 --- a/circle_text/lang/da-dk/strings.php +++ /dev/null @@ -1,9 +0,0 @@ -strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Brug en kun-tekst (intet billede) gruppevælger i grupperedigeringsmenuen'; -$a->strings['Group Text'] = 'Gruppebesked'; diff --git a/circle_text/lang/de/messages.po b/circle_text/lang/de/messages.po deleted file mode 100644 index e4e5d782..00000000 --- a/circle_text/lang/de/messages.po +++ /dev/null @@ -1,31 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Andreas H., 2014 -# Tobias Diekershoff , 2014 -# Tobias Diekershoff , 2021 -# Ulf Rompe , 2019 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:35+0000\n" -"Last-Translator: Tobias Diekershoff , 2021\n" -"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:58 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Beim Bearbeiten von Gruppen Text statt Bilder anzeigen" - -#: group_text.php:63 -msgid "Group Text" -msgstr "Gruppen als Text" diff --git a/circle_text/lang/de/strings.php b/circle_text/lang/de/strings.php deleted file mode 100644 index 7a75b54d..00000000 --- a/circle_text/lang/de/strings.php +++ /dev/null @@ -1,9 +0,0 @@ -strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Beim Bearbeiten von Gruppen Text statt Bilder anzeigen'; -$a->strings['Group Text'] = 'Gruppen als Text'; diff --git a/circle_text/lang/eo/strings.php b/circle_text/lang/eo/strings.php deleted file mode 100644 index 4e220fb0..00000000 --- a/circle_text/lang/eo/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Group Text"] = ""; -$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = ""; -$a->strings["Submit"] = "Sendi"; diff --git a/circle_text/lang/es/messages.po b/circle_text/lang/es/messages.po deleted file mode 100644 index 5d6d4107..00000000 --- a/circle_text/lang/es/messages.po +++ /dev/null @@ -1,33 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Albert, 2016 -# Senex Petrovic , 2021 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2021-04-01 09:56+0000\n" -"Last-Translator: Senex Petrovic \n" -"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: es\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:62 -msgid "Group Text" -msgstr "Grupo de Texto" - -#: group_text.php:64 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Utilice sólo el selector de grupo de texto (no imagen) en el menú \"edición de grupo\"" - -#: group_text.php:70 -msgid "Save Settings" -msgstr "Guardar Ajustes" diff --git a/circle_text/lang/es/strings.php b/circle_text/lang/es/strings.php deleted file mode 100644 index 632130fd..00000000 --- a/circle_text/lang/es/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -strings['Group Text'] = 'Grupo de Texto'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utilice sólo el selector de grupo de texto (no imagen) en el menú "edición de grupo"'; -$a->strings['Save Settings'] = 'Guardar Ajustes'; diff --git a/circle_text/lang/fi-fi/messages.po b/circle_text/lang/fi-fi/messages.po deleted file mode 100644 index 2e3782fd..00000000 --- a/circle_text/lang/fi-fi/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Kris, 2018 -# Kris, 2018 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2018-04-08 15:51+0000\n" -"Last-Translator: Kris\n" -"Language-Team: Finnish (Finland) (http://www.transifex.com/Friendica/friendica/language/fi_FI/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fi_FI\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "Group Text -asetukset päivitetty." - -#: group_text.php:76 -msgid "Group Text" -msgstr "Group Text" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "" - -#: group_text.php:84 -msgid "Submit" -msgstr "Lähetä" diff --git a/circle_text/lang/fi-fi/strings.php b/circle_text/lang/fi-fi/strings.php deleted file mode 100644 index 5bcd0ddc..00000000 --- a/circle_text/lang/fi-fi/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -strings['Group Text settings updated.'] = 'Group Text -asetukset päivitetty.'; -$a->strings['Group Text'] = 'Group Text'; -$a->strings['Submit'] = 'Lähetä'; diff --git a/circle_text/lang/fr/messages.po b/circle_text/lang/fr/messages.po deleted file mode 100644 index c076d697..00000000 --- a/circle_text/lang/fr/messages.po +++ /dev/null @@ -1,29 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# bob lebonche , 2021 -# Hypolite Petovan , 2016 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:35+0000\n" -"Last-Translator: bob lebonche , 2021\n" -"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fr\n" -"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" - -#: group_text.php:58 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Utiliser uniquement un groupe de texte (pas d'image) dans le menu \"groupedit\"" - -#: group_text.php:63 -msgid "Group Text" -msgstr "Groupe de texte" diff --git a/circle_text/lang/fr/strings.php b/circle_text/lang/fr/strings.php deleted file mode 100644 index 657d7657..00000000 --- a/circle_text/lang/fr/strings.php +++ /dev/null @@ -1,9 +0,0 @@ -strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Utiliser uniquement un groupe de texte (pas d\'image) dans le menu "groupedit"'; -$a->strings['Group Text'] = 'Groupe de texte'; diff --git a/circle_text/lang/hu/messages.po b/circle_text/lang/hu/messages.po deleted file mode 100644 index 2c4f19c9..00000000 --- a/circle_text/lang/hu/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Balázs Úr, 2020-2021 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:35+0000\n" -"Last-Translator: Balázs Úr, 2020-2021\n" -"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: hu\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:58 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Csak szöveges (kép nélküli) csoportválasztó használata a „csoportszerkesztés” menüben" - -#: group_text.php:63 -msgid "Group Text" -msgstr "Csoportszöveg" diff --git a/circle_text/lang/hu/strings.php b/circle_text/lang/hu/strings.php deleted file mode 100644 index ac72f9e0..00000000 --- a/circle_text/lang/hu/strings.php +++ /dev/null @@ -1,9 +0,0 @@ -strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Csak szöveges (kép nélküli) csoportválasztó használata a „csoportszerkesztés” menüben'; -$a->strings['Group Text'] = 'Csoportszöveg'; diff --git a/circle_text/lang/is/strings.php b/circle_text/lang/is/strings.php deleted file mode 100644 index d331b2f9..00000000 --- a/circle_text/lang/is/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Group Text"] = ""; -$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = ""; -$a->strings["Submit"] = "Senda inn"; diff --git a/circle_text/lang/it/messages.po b/circle_text/lang/it/messages.po deleted file mode 100644 index daab3fb6..00000000 --- a/circle_text/lang/it/messages.po +++ /dev/null @@ -1,33 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# fabrixxm , 2014-2015 -# Sylke Vicious , 2021 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2021-02-16 12:48+0000\n" -"Last-Translator: Sylke Vicious \n" -"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: it\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:62 -msgid "Group Text" -msgstr "Editor Gruppi Testuale" - -#: group_text.php:64 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Usa un selettore testuale (senza immagini) nella pagina \"modifica gruppo\"" - -#: group_text.php:70 -msgid "Save Settings" -msgstr "Salva Impostazioni" diff --git a/circle_text/lang/it/strings.php b/circle_text/lang/it/strings.php deleted file mode 100644 index e52683e9..00000000 --- a/circle_text/lang/it/strings.php +++ /dev/null @@ -1,10 +0,0 @@ -strings['Group Text'] = 'Editor Gruppi Testuale'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Usa un selettore testuale (senza immagini) nella pagina "modifica gruppo"'; -$a->strings['Save Settings'] = 'Salva Impostazioni'; diff --git a/circle_text/lang/nb-no/strings.php b/circle_text/lang/nb-no/strings.php deleted file mode 100644 index cd9bebd4..00000000 --- a/circle_text/lang/nb-no/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Group Text"] = ""; -$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = ""; -$a->strings["Submit"] = "Lagre"; diff --git a/circle_text/lang/nl/messages.po b/circle_text/lang/nl/messages.po deleted file mode 100644 index 56b5aae0..00000000 --- a/circle_text/lang/nl/messages.po +++ /dev/null @@ -1,36 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Jeroen De Meerleer , 2018 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2018-08-24 13:48+0000\n" -"Last-Translator: Jeroen De Meerleer \n" -"Language-Team: Dutch (http://www.transifex.com/Friendica/friendica/language/nl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: nl\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "Groupsberichten instellingen opgeslagen" - -#: group_text.php:76 -msgid "Group Text" -msgstr "Groepsbericht" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "" - -#: group_text.php:84 -msgid "Submit" -msgstr "" diff --git a/circle_text/lang/nl/strings.php b/circle_text/lang/nl/strings.php deleted file mode 100644 index ba3cb3ec..00000000 --- a/circle_text/lang/nl/strings.php +++ /dev/null @@ -1,9 +0,0 @@ -strings['Group Text settings updated.'] = 'Groupsberichten instellingen opgeslagen'; -$a->strings['Group Text'] = 'Groepsbericht'; diff --git a/circle_text/lang/pl/messages.po b/circle_text/lang/pl/messages.po deleted file mode 100644 index a1d6a3c8..00000000 --- a/circle_text/lang/pl/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Waldemar Stoczkowski, 2018 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:35+0000\n" -"Last-Translator: Waldemar Stoczkowski, 2018\n" -"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: pl\n" -"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" - -#: group_text.php:58 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Użyj tylko tekst (bez obrazu) selektor grupy w menu \"Edycja grupy\"" - -#: group_text.php:63 -msgid "Group Text" -msgstr "Grupuj tekst" diff --git a/circle_text/lang/pl/strings.php b/circle_text/lang/pl/strings.php deleted file mode 100644 index 96157c99..00000000 --- a/circle_text/lang/pl/strings.php +++ /dev/null @@ -1,9 +0,0 @@ -=2 && $n%10<=4) && ($n%100<12 || $n%100>14)) { return 1; } else if ($n!=1 && ($n%10>=0 && $n%10<=1) || ($n%10>=5 && $n%10<=9) || ($n%100>=12 && $n%100<=14)) { return 2; } else { return 3; } -}} -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Użyj tylko tekst (bez obrazu) selektor grupy w menu "Edycja grupy"'; -$a->strings['Group Text'] = 'Grupuj tekst'; diff --git a/circle_text/lang/pt-br/strings.php b/circle_text/lang/pt-br/strings.php deleted file mode 100644 index 4579a5b1..00000000 --- a/circle_text/lang/pt-br/strings.php +++ /dev/null @@ -1,5 +0,0 @@ -strings["Group Text"] = ""; -$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = ""; -$a->strings["Submit"] = "Enviar"; diff --git a/circle_text/lang/ro/messages.po b/circle_text/lang/ro/messages.po deleted file mode 100644 index c912f113..00000000 --- a/circle_text/lang/ro/messages.po +++ /dev/null @@ -1,36 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Doru DEACONU , 2014 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2014-11-27 14:15+0000\n" -"Last-Translator: Doru DEACONU \n" -"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/friendica/language/ro_RO/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ro_RO\n" -"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "Configurările Text Grup, au fost actualizate." - -#: group_text.php:76 -msgid "Group Text" -msgstr "Text Grup" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Folosiți în meniul \"editare grup\" un selector de grup strict textual (fără-imagine)" - -#: group_text.php:84 -msgid "Submit" -msgstr "Trimite" diff --git a/circle_text/lang/ro/strings.php b/circle_text/lang/ro/strings.php deleted file mode 100644 index 892ffc68..00000000 --- a/circle_text/lang/ro/strings.php +++ /dev/null @@ -1,11 +0,0 @@ -19)||(($n%100==0)&&($n!=0)))) { return 2; } else { return 1; } -}} -$a->strings['Group Text settings updated.'] = 'Configurările Text Grup, au fost actualizate.'; -$a->strings['Group Text'] = 'Text Grup'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Folosiți în meniul "editare grup" un selector de grup strict textual (fără-imagine)'; -$a->strings['Submit'] = 'Trimite'; diff --git a/circle_text/lang/ru/messages.po b/circle_text/lang/ru/messages.po deleted file mode 100644 index 05a25367..00000000 --- a/circle_text/lang/ru/messages.po +++ /dev/null @@ -1,36 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Stanislav N. , 2017 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" -"PO-Revision-Date: 2017-04-08 17:26+0000\n" -"Last-Translator: Stanislav N. \n" -"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: group_text.php:46 -msgid "Group Text settings updated." -msgstr "Настройки Group Text обновлены." - -#: group_text.php:76 -msgid "Group Text" -msgstr "Group Text" - -#: group_text.php:78 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "Используйте текстовый (не изображение) селектор группы в режиме редактирования группы" - -#: group_text.php:84 -msgid "Submit" -msgstr "Добавить" diff --git a/circle_text/lang/ru/strings.php b/circle_text/lang/ru/strings.php deleted file mode 100644 index 0f74e7ca..00000000 --- a/circle_text/lang/ru/strings.php +++ /dev/null @@ -1,11 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} -$a->strings['Group Text settings updated.'] = 'Настройки Group Text обновлены.'; -$a->strings['Group Text'] = 'Group Text'; -$a->strings['Use a text only (non-image) group selector in the "group edit" menu'] = 'Используйте текстовый (не изображение) селектор группы в режиме редактирования группы'; -$a->strings['Submit'] = 'Добавить'; diff --git a/circle_text/lang/sv/messages.po b/circle_text/lang/sv/messages.po deleted file mode 100644 index 8ddc1806..00000000 --- a/circle_text/lang/sv/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON group_text -# Copyright (C) -# This file is distributed under the same license as the Friendica group_text addon package. -# -# -# Translators: -# Kristoffer Grundström , 2022 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2022-01-16 00:35+0000\n" -"Last-Translator: Kristoffer Grundström \n" -"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: sv\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: group_text.php:58 -msgid "Use a text only (non-image) group selector in the \"group edit\" menu" -msgstr "" - -#: group_text.php:63 -msgid "Group Text" -msgstr "Grupptext" diff --git a/circle_text/lang/sv/strings.php b/circle_text/lang/sv/strings.php deleted file mode 100644 index 5d5e98db..00000000 --- a/circle_text/lang/sv/strings.php +++ /dev/null @@ -1,8 +0,0 @@ -strings['Group Text'] = 'Grupptext'; diff --git a/circle_text/lang/zh-cn/strings.php b/circle_text/lang/zh-cn/strings.php deleted file mode 100644 index a7b37bf2..00000000 --- a/circle_text/lang/zh-cn/strings.php +++ /dev/null @@ -1,6 +0,0 @@ -strings["Group Text settings updated."] = "组正文设置更新了。"; -$a->strings["Group Text"] = "组正文"; -$a->strings["Use a text only (non-image) group selector in the \"group edit\" menu"] = "用光正文(无图片)组选择器在「组编辑」单"; -$a->strings["Submit"] = "提交"; diff --git a/circle_text/templates/settings.tpl b/circle_text/templates/settings.tpl deleted file mode 100644 index 2f3f4ce7..00000000 --- a/circle_text/templates/settings.tpl +++ /dev/null @@ -1 +0,0 @@ -{{include file="field_checkbox.tpl" field=$enabled}} diff --git a/cld/README.md b/cld/README.md deleted file mode 100644 index 933dbcee..00000000 --- a/cld/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Compact Language Detector -=== -CLD2 is an advanced language dectection library with a high reliability. - -This addon depends on the CLD PHP module which is not included in any Linux distribution. -It needs to be built and installed by hand, which is not totally straightforward. - -Prerequisite ---- -To be able to build the extension, you need the CLD module and the files for the PHP module development. -On Debian you install the packages php-dev, libcld2-dev and libcld2-0. -Make sure to have installed the correct PHP version. -Means: When you have got both PHP 8.0 and 8.2 on your system, you have to install php8.0-dev as well. - -Installation ---- -The original PHP extension is https://github.com/fntlnz/cld2-php-ext. -However, it doesn't support PHP8. -So https://github.com/hiteule/cld2-php-ext/tree/support-php8 has to be used. - -Download the source code: -``` -wget https://github.com/hiteule/cld2-php-ext/archive/refs/heads/support-php8.zip -``` - -Unzip it: -``` -unzip support-php8.zip -``` - -Change into the folder: -``` -cd cld2-php-ext-support-php8/ -``` - -Configure for the PHP Api version: -``` -phpize -``` -(if you have got several PHP versions on your system, execute the command with the version that you run Friendica with, e.g. `phpize8.0`) - -Create the Makefile: -``` -./configure --with-cld2=/usr/include/cld2 -``` - -Have a look at the line `checking for PHP includes`. -When the output (for example `/usr/include/php/20220829` doesn't match the API version that you got from `phpize`, then you have to change all the version codes in your `Makefile` afterwards) - -Create the module: -``` -make -j -``` - -Install it: -``` -sudo make install -``` - -Change to the folder with the available modules. When you use PHP 8.2 on Debian it is: -``` -cd /etc/php/8.2/mods-available -``` - -Create the file `cld2.ini` with this content: -``` -; configuration for php cld2 module -; priority=20 -extension=cld2.so -``` - -Enable the module for all versions and all sapi: -``` -phpenmod -v ALL -s ALL cld2 -``` - -Then restart the apache or fpm (or whatever you use) to load the changed configuration. - -Call `/admin/phpinfo` on your webserver. -You then see the PHP Info. -Search for "cld2". -The module is installed, when you find it here. -**Only proceed when the module is installed** - -Now you can enable the addon. \ No newline at end of file diff --git a/cld/cld.php b/cld/cld.php deleted file mode 100644 index d4fef6c5..00000000 --- a/cld/cld.php +++ /dev/null @@ -1,80 +0,0 @@ - - */ - -use Friendica\Core\Hook; -use Friendica\DI; - -function cld_install() -{ - Hook::register('detect_languages', __FILE__, 'cld_detect_languages'); -} - -function cld_detect_languages(array &$data) -{ - if (!in_array('cld2', get_loaded_extensions())) { - DI::logger()->warning('CLD2 is not installed.'); - return; - } - - if (!class_exists('CLD2Detector')) { - DI::logger()->warning('CLD2Detector class does not exist.'); - return; - } - - if (!class_exists('CLD2Encoding')) { - DI::logger()->warning('CLD2Encoding class does not exist.'); - return; - } - - $cld2 = new \CLD2Detector(); - - $cld2->setEncodingHint(CLD2Encoding::UTF8); // optional, hints about text encoding - $cld2->setPlainText(true); - - $result = $cld2->detect($data['text']); - - if ($data['detected']) { - $original = array_key_first($data['detected']); - } else { - $original = ''; - } - - $detected = DI::l10n()->toISO6391($result['language_code']); - - // languages that aren't supported via the base language detection or tend to false detections - if ((strlen($detected) == 3) || in_array($detected, ['ht', 'kk', 'ku', 'ky', 'lg', 'mg', 'mk', 'mt', 'ny', 'rw', 'st', 'su', 'tg', 'ts', 'xx'])) { - return; - } - - if (!$result['is_reliable']) { - DI::logger()->debug('Unreliable detection', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]); - if (($original == $detected) && ($data['detected'][$original] < $result['language_probability'] / 100)) { - $data['detected'][$original] = $result['language_probability'] / 100; - } - return; - } - - $available = array_keys(DI::l10n()->getLanguageCodes()); - - if (!in_array($detected, $available)) { - DI::logger()->debug('Unsupported language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]); - return; - } - - if ($original != $detected) { - DI::logger()->debug('Detected different language', ['uri-id' => $data['uri-id'], 'original' => $original, 'detected' => $detected, 'name' => $result['language_name'], 'probability' => $result['language_probability'], 'text' => $data['text']]); - } - - $length = count($data['detected']); - if ($length > 0) { - unset($data['detected'][$detected]); - $data['detected'] = array_merge([$detected => $result['language_probability'] / 100], array_slice($data['detected'], 0, $length - 1)); - } else { - $data['detected'] = [$detected => $result['language_probability'] / 100]; - } -} diff --git a/convert/UnitConvertor.php b/convert/UnitConvertor.php index a3650e9b..d7933a8f 100644 --- a/convert/UnitConvertor.php +++ b/convert/UnitConvertor.php @@ -169,6 +169,7 @@ class UnitConvertor * @param string name of the source unit from which to convert * @param string name of the target unit to which we are converting * @param integer double precision of the end result + * @return void * @access public */ function convert($value, $from_unit, $to_unit, $precision) @@ -279,4 +280,4 @@ class UnitConvertor } // end func getConvSpecs } // end class UnitConvertor -?> +?> \ No newline at end of file diff --git a/convert/convert.php b/convert/convert.php index 2545974c..57ce6ea8 100644 --- a/convert/convert.php +++ b/convert/convert.php @@ -6,6 +6,7 @@ * Author: Mike Macgirvin */ +use Friendica\App; use Friendica\Core\Hook; function convert_install() { @@ -25,7 +26,7 @@ function convert_content() { // @TODO Let's one day rewrite this to a modern composer package include 'UnitConvertor.php'; - $conv = new class('en') extends UnitConvertor + class TP_Converter extends UnitConvertor { public function __construct(string $lang = 'en') { @@ -42,7 +43,7 @@ function convert_content() { private function findBaseUnit($from, $to) { - foreach ($this->bases as $skey => $sval) { + while (list($skey, $sval) = each($this->bases)) { if ($skey == $from || $to == $skey || in_array($to, $sval) || in_array($from, $sval)) { return $skey; } @@ -62,7 +63,7 @@ function convert_content() { $cells[] = $cell; // We now have the base unit and value now lets produce the table; - foreach ($this->bases[$base_unit] as $val) { + while (list($key, $val) = each($this->bases[$base_unit])) { $cell ['value'] = $this->convert($value, $from_unit, $val, $precision) . ' ' . $val; $cell ['class'] = ($val == $from_unit || $val == $to_unit) ? 'framedred' : ''; $cells[] = $cell; @@ -85,7 +86,9 @@ function convert_content() { return $string; } - }; + } + + $conv = new TP_Converter('en'); $conversions = [ 'Temperature' => ['base' => 'Celsius', @@ -173,15 +176,15 @@ function convert_content() { ] ]; - foreach ($conversions as $key => $val) { + while (list($key, $val) = each($conversions)) { $conv->addConversion($val['base'], $val['conv']); $list[$key][] = $val['base']; - foreach ($val['conv'] as $ukey => $uval) { + while (list($ukey, $uval) = each($val['conv'])) { $list[$key][] = $ukey; } } - $o = '

Unit Conversions

'; + $o .= '

Unit Conversions

'; if (isset($_POST['from_unit']) && isset($_POST['value'])) { $o .= ($conv->getTable(intval($_POST['value']), $_POST['from_unit'], $_POST['to_unit'], 5)) . '

'; @@ -199,9 +202,10 @@ function convert_content() { $o .= ''; $o .= ' diff --git a/invidious/templates/settings.tpl b/invidious/templates/settings.tpl deleted file mode 100644 index 387286ef..00000000 --- a/invidious/templates/settings.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{{include file="field_checkbox.tpl" field=$enabled}} -{{include file="field_input.tpl" field=$server}} diff --git a/irc/irc.php b/irc/irc.php index a0cb899e..d4435851 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -7,6 +7,7 @@ * Author: Tobias Diekershoff */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; @@ -74,7 +75,6 @@ function irc_content() { $baseurl = DI::baseUrl() . '/addon/irc'; $o = ''; - $usernick = ''; /* set the list of popular channels */ if (DI::userSession()->getLocalUserId()) { @@ -82,7 +82,6 @@ function irc_content() if (!$sitechats) { $sitechats = DI::config()->get('irc', 'sitechats'); } - $usernick = "nick=" . DI::userSession()->getLocalUserNickname() . "&"; } else { $sitechats = DI::config()->get('irc','sitechats'); } @@ -119,7 +118,7 @@ function irc_content() $o .= <<< EOT

IRC chat

A beginner's guide to using IRC. [en]

- + EOT; return $o; diff --git a/irc/lang/bg/messages.po b/irc/lang/bg/messages.po deleted file mode 100644 index 6c227e4c..00000000 --- a/irc/lang/bg/messages.po +++ /dev/null @@ -1,62 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:41+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/bg/strings.php b/irc/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/irc/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/ca/strings.php b/irc/lang/ca/strings.php index d34874f6..561e24c0 100644 --- a/irc/lang/ca/strings.php +++ b/irc/lang/ca/strings.php @@ -1,7 +1,9 @@ -strings["IRC Settings"] = "Ajustos de IRC"; +$a->strings["Channel(s) to auto connect (comma separated)"] = "Canal(s) per auto connectar (separats per comes)"; +$a->strings["Popular Channels (comma separated)"] = "Canals Populars (separats per comes)"; +$a->strings["Submit"] = "Enviar"; +$a->strings["IRC settings saved."] = "Ajustos del IRC guardats."; +$a->strings["IRC Chatroom"] = "IRC Chatroom"; +$a->strings["Popular Channels"] = "Canals Populars"; diff --git a/irc/lang/eo/messages.po b/irc/lang/eo/messages.po deleted file mode 100644 index 45888b62..00000000 --- a/irc/lang/eo/messages.po +++ /dev/null @@ -1,62 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:41+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/eo/strings.php b/irc/lang/eo/strings.php index 68e8a64c..92dee9e1 100644 --- a/irc/lang/eo/strings.php +++ b/irc/lang/eo/strings.php @@ -1,7 +1,9 @@ -strings["IRC Settings"] = "IRC Agordoj"; +$a->strings["Channel(s) to auto connect (comma separated)"] = "Aŭtomate konektiĝi al la kanalo(j) (disigita per komo)"; +$a->strings["Popular Channels (comma separated)"] = "Popularaj kanaloj (disigita per komo)"; +$a->strings["Submit"] = "Sendi"; +$a->strings["IRC settings saved."] = "IRC agordoj konservitaj."; +$a->strings["IRC Chatroom"] = "IRC babilejo"; +$a->strings["Popular Channels"] = "Popularaj Kanaloj"; diff --git a/irc/lang/et/messages.po b/irc/lang/et/messages.po deleted file mode 100644 index 216ecdb2..00000000 --- a/irc/lang/et/messages.po +++ /dev/null @@ -1,62 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:41+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/et/strings.php b/irc/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/irc/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/gd/strings.php b/irc/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/irc/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/irc/lang/is/messages.po b/irc/lang/is/messages.po deleted file mode 100644 index 3b28f0d0..00000000 --- a/irc/lang/is/messages.po +++ /dev/null @@ -1,62 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:41+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/is/strings.php b/irc/lang/is/strings.php index 975c341e..d4fbd85d 100644 --- a/irc/lang/is/strings.php +++ b/irc/lang/is/strings.php @@ -1,7 +1,9 @@ -strings["IRC Settings"] = "IRC stillingar"; +$a->strings["Channel(s) to auto connect (comma separated)"] = "Tengjast rásum sjálfkrafa (komma á milli)"; +$a->strings["Popular Channels (comma separated)"] = "Vinsælar rásir (komma á milli)"; +$a->strings["Submit"] = "Senda inn"; +$a->strings["IRC settings saved."] = "IRC stillingum vistað"; +$a->strings["IRC Chatroom"] = ""; +$a->strings["Popular Channels"] = ""; diff --git a/irc/lang/ru/messages.po b/irc/lang/ru/messages.po deleted file mode 100644 index 318fdbd2..00000000 --- a/irc/lang/ru/messages.po +++ /dev/null @@ -1,62 +0,0 @@ -# ADDON irc -# Copyright (C) -# This file is distributed under the same license as the Friendica irc addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2014-06-23 08:41+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: irc.php:32 -msgid "" -"Here you can change the system wide settings for the channels to " -"automatically join and access via the side bar. Note the changes you do " -"here, only effect the channel selection if you are logged in." -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "Channel(s) to auto connect (comma separated)" -msgstr "" - -#: irc.php:33 irc.php:133 -msgid "" -"List of channels that shall automatically connected to when the app is " -"launched." -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "Popular Channels (comma separated)" -msgstr "" - -#: irc.php:34 irc.php:134 -msgid "" -"List of popular channels, will be displayed at the side and hotlinked for " -"easy joining." -msgstr "" - -#: irc.php:39 -msgid "IRC Settings" -msgstr "" - -#: irc.php:60 -msgid "IRC Chatroom" -msgstr "" - -#: irc.php:88 -msgid "Popular Channels" -msgstr "" - -#: irc.php:132 -msgid "Save Settings" -msgstr "" diff --git a/irc/lang/ru/strings.php b/irc/lang/ru/strings.php index 0579fc21..84131f0b 100644 --- a/irc/lang/ru/strings.php +++ b/irc/lang/ru/strings.php @@ -1,7 +1,9 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} +strings["IRC Settings"] = ""; +$a->strings["Channel(s) to auto connect (comma separated)"] = ""; +$a->strings["Popular Channels (comma separated)"] = ""; +$a->strings["Submit"] = "Подтвердить"; +$a->strings["IRC settings saved."] = ""; +$a->strings["IRC Chatroom"] = ""; +$a->strings["Popular Channels"] = ""; diff --git a/js_upload/file-uploader/server/php.php b/js_upload/file-uploader/server/php.php index ff485dec..2248c8f0 100644 --- a/js_upload/file-uploader/server/php.php +++ b/js_upload/file-uploader/server/php.php @@ -77,10 +77,10 @@ class qqFileUploader { public function __construct(array $allowedExtensions = [], $sizeLimit = 10485760) { $allowedExtensions = array_map('strtolower', $allowedExtensions); - + $this->allowedExtensions = $allowedExtensions; $this->sizeLimit = $sizeLimit; - + $this->checkServerSettings(); if (isset($_GET['qqfile'])) { @@ -88,7 +88,7 @@ class qqFileUploader { } elseif (isset($_FILES['qqfile'])) { $this->file = new qqUploadedFileForm(); } else { - $this->file = false; + $this->file = false; } } @@ -105,7 +105,7 @@ class qqFileUploader { private function toBytes(string $str): int { - $val = (int) trim($str); + $val = trim($str); $last = strtolower($str[strlen($str) - 1]); switch($last) { diff --git a/js_upload/file-uploader/tests/action-acceptance.php b/js_upload/file-uploader/tests/action-acceptance.php index 172b8857..fc9583f2 100644 --- a/js_upload/file-uploader/tests/action-acceptance.php +++ b/js_upload/file-uploader/tests/action-acceptance.php @@ -2,12 +2,12 @@ usleep(100000); -$fileName = ''; -$fileSize = 0;; +$fileName; +$fileSize; if (isset($_GET['qqfile'])){ $fileName = $_GET['qqfile']; - + // xhr request $headers = apache_request_headers(); $fileSize = (int)$headers['Content-Length']; @@ -34,13 +34,13 @@ if ($fileSize > 9 * 1024){ die ('{error: "server-error file size is bigger than 9kB"}'); } -if (count($_GET)){ +if (count($_GET)){ array_merge($_GET, array('fileName'=>$fileName)); - + $response = array_merge($_GET, array('success'=>true, 'fileName'=>$fileName)); - - // to pass data through iframe you will need to encode all html tags - echo htmlspecialchars(json_encode($response), ENT_NOQUOTES); + + // to pass data through iframe you will need to encode all html tags + echo htmlspecialchars(json_encode($response), ENT_NOQUOTES); } else { die ('{error: "server-error query params not passed"}'); } diff --git a/js_upload/file-uploader/tests/action-handler-queue-test.php b/js_upload/file-uploader/tests/action-handler-queue-test.php index 78760d64..ff13576d 100644 --- a/js_upload/file-uploader/tests/action-handler-queue-test.php +++ b/js_upload/file-uploader/tests/action-handler-queue-test.php @@ -2,11 +2,11 @@ sleep(4); -$fileName = ''; +$fileName; if (isset($_GET['qqfile'])){ $fileName = $_GET['qqfile']; - + // xhr request $headers = apache_request_headers(); if ((int)$headers['Content-Length'] == 0){ @@ -14,7 +14,7 @@ if (isset($_GET['qqfile'])){ } } elseif (isset($_FILES['qqfile'])){ $fileName = basename($_FILES['qqfile']['name']); - + // form request if ($_FILES['qqfile']['size'] == 0){ die ('{error: "file size is zero"}'); @@ -25,7 +25,7 @@ if (isset($_GET['qqfile'])){ if (count($_GET)){ $_GET['success'] = true; - echo json_encode(array_merge($_GET)); + echo json_encode(array_merge($_GET)); } else { die ('{error: "query params not passed"}'); } diff --git a/js_upload/file-uploader/tests/action-handler-test.php b/js_upload/file-uploader/tests/action-handler-test.php index 9fa72023..24466b12 100644 --- a/js_upload/file-uploader/tests/action-handler-test.php +++ b/js_upload/file-uploader/tests/action-handler-test.php @@ -2,11 +2,11 @@ usleep(300); -$fileName = ''; +$fileName; if (isset($_GET['qqfile'])){ $fileName = $_GET['qqfile']; - + // xhr request $headers = apache_request_headers(); if ((int)$headers['Content-Length'] == 0){ @@ -14,7 +14,7 @@ if (isset($_GET['qqfile'])){ } } elseif (isset($_FILES['qqfile'])){ $fileName = basename($_FILES['qqfile']['name']); - + // form request if ($_FILES['qqfile']['size'] == 0){ die ('{error: "file size is zero"}'); @@ -25,7 +25,7 @@ if (isset($_GET['qqfile'])){ if (count($_GET)){ //return query params - echo json_encode(array_merge($_GET, array('fileName'=>$fileName))); + echo json_encode(array_merge($_GET, array('fileName'=>$fileName))); } else { die ('{error: "query params not passed"}'); } diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index 4bf91de1..089cb7e2 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -7,10 +7,11 @@ * Maintainer: Hypolite Petovan */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; -use Friendica\Util\Images; use Friendica\Util\Strings; global $js_upload_jsonresponse; @@ -19,9 +20,9 @@ global $js_upload_result; function js_upload_install() { Hook::register('photo_upload_form', __FILE__, 'js_upload_form'); - Hook::register('photo_post_init', __FILE__, 'js_upload_post_init'); - Hook::register('photo_post_file', __FILE__, 'js_upload_post_file'); - Hook::register('photo_post_end', __FILE__, 'js_upload_post_end'); + Hook::register('photo_post_init', __FILE__, 'js_upload_post_init'); + Hook::register('photo_post_file', __FILE__, 'js_upload_post_file'); + Hook::register('photo_post_end', __FILE__, 'js_upload_post_end'); } function js_upload_form(array &$b) @@ -33,11 +34,11 @@ function js_upload_form(array &$b) $tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload'); $b['addon_text'] .= Renderer::replaceMacros($tpl, [ - '$upload_msg' => DI::l10n()->t('Select files for upload'), - '$drop_msg' => DI::l10n()->t('Drop files here to upload'), - '$cancel' => DI::l10n()->t('Cancel'), - '$failed' => DI::l10n()->t('Failed'), - '$post_url' => $b['post_url'], + '$upload_msg' => DI::l10n()->t('Select files for upload'), + '$drop_msg' => DI::l10n()->t('Drop files here to upload'), + '$cancel' => DI::l10n()->t('Cancel'), + '$failed' => DI::l10n()->t('Failed'), + '$post_url' => $b['post_url'], '$maximagesize' => Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')), ]); } @@ -47,19 +48,12 @@ function js_upload_post_init(array &$b) global $js_upload_result, $js_upload_jsonresponse; // list of valid extensions - $allowedExtensions = []; - foreach (Images::IMAGETYPES as $type) { - $extension = image_type_to_extension($type, false); - if ($extension == 'jpeg') { - $allowedExtensions[] = 'jpg'; - } - $allowedExtensions[] = $extension; - } + $allowedExtensions = ['jpeg', 'gif', 'png', 'jpg']; // max file size in bytes $sizeLimit = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); - $uploader = new js_upload_qqFileUploader($allowedExtensions, $sizeLimit); + $uploader = new qqFileUploader($allowedExtensions, $sizeLimit); $result = $uploader->handleUpload(); @@ -67,7 +61,7 @@ function js_upload_post_init(array &$b) $js_upload_jsonresponse = htmlspecialchars(json_encode($result), ENT_NOQUOTES); if (isset($result['error'])) { - DI::logger()->info('mod/photos.php: photos_post(): error uploading photo: ' . $result['error']); + Logger::info('mod/photos.php: photos_post(): error uploading photo: ' . $result['error']); echo json_encode($result); exit(); } @@ -81,16 +75,17 @@ function js_upload_post_file(array &$b) $result = $js_upload_result; - $b['src'] = $result['path']; + $b['src'] = $result['path']; $b['filename'] = $result['filename']; $b['filesize'] = filesize($b['src']); + } function js_upload_post_end(int &$b) { global $js_upload_jsonresponse; - DI::logger()->notice('upload_post_end'); + Logger::notice('upload_post_end'); if (!empty($js_upload_jsonresponse)) { echo $js_upload_jsonresponse; exit(); @@ -100,7 +95,7 @@ function js_upload_post_end(int &$b) /** * Handle file uploads via XMLHttpRequest */ -class js_upload_qqUploadedFileXhr +class qqUploadedFileXhr { private $pathnm = ''; @@ -154,7 +149,7 @@ class js_upload_qqUploadedFileXhr /** * Handle file uploads via regular form post (uses the $_FILES array) */ -class js_upload_qqUploadedFileForm +class qqUploadedFileForm { /** * Save the file to the specified path @@ -182,17 +177,13 @@ class js_upload_qqUploadedFileForm } } -class js_upload_qqFileUploader +class qqFileUploader { - private $allowedExtensions; - private $sizeLimit; - - /** - * @var js_upload_qqUploadedFileXhr|js_upload_qqUploadedFileForm|false - */ + private $allowedExtensions = []; + private $sizeLimit = 10485760; private $file; - function __construct(array $allowedExtensions = [], $sizeLimit) + function __construct(array $allowedExtensions = [], $sizeLimit = 10485760) { $allowedExtensions = array_map('strtolower', $allowedExtensions); @@ -200,12 +191,13 @@ class js_upload_qqFileUploader $this->sizeLimit = $sizeLimit; if (isset($_GET['qqfile'])) { - $this->file = new js_upload_qqUploadedFileXhr(); + $this->file = new qqUploadedFileXhr(); } elseif (isset($_FILES['qqfile'])) { - $this->file = new js_upload_qqUploadedFileForm(); + $this->file = new qqUploadedFileForm(); } else { $this->file = false; } + } /** @@ -223,9 +215,11 @@ class js_upload_qqFileUploader return ['error' => DI::l10n()->t('Uploaded file is empty')]; } - // if ($size > $this->sizeLimit) { - // return array('error' => DI::l10n()->t('Uploaded file is too large')); - // } +// if ($size > $this->sizeLimit) { + +// return array('error' => DI::l10n()->t('Uploaded file is too large')); +// } + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); @@ -237,7 +231,7 @@ class js_upload_qqFileUploader $filename = $pathinfo['filename']; if (!isset($pathinfo['extension'])) { - DI::logger()->warning('extension isn\'t set.', ['filename' => $filename]); + Logger::warning('extension isn\'t set.', ['filename' => $filename]); } $ext = $pathinfo['extension'] ?? ''; @@ -247,14 +241,14 @@ class js_upload_qqFileUploader if ($this->file->save()) { return [ - 'success' => true, - 'path' => $this->file->getPath(), + 'success' => true, + 'path' => $this->file->getPath(), 'filename' => $filename . '.' . $ext ]; } else { return [ - 'error' => DI::l10n()->t('Upload was cancelled, or server error encountered'), - 'path' => $this->file->getPath(), + 'error' => DI::l10n()->t('Upload was cancelled, or server error encountered'), + 'path' => $this->file->getPath(), 'filename' => $filename . '.' . $ext ]; } diff --git a/js_upload/lang/C/messages.po b/js_upload/lang/C/messages.po index 0d607bd5..4d16fe17 100644 --- a/js_upload/lang/C/messages.po +++ b/js_upload/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" +"POT-Creation-Date: 2021-03-23 23:53-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,40 +17,40 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: js_upload.php:37 +#: js_upload.php:34 msgid "Select files for upload" msgstr "" -#: js_upload.php:38 +#: js_upload.php:35 msgid "Drop files here to upload" msgstr "" -#: js_upload.php:39 +#: js_upload.php:36 msgid "Cancel" msgstr "" -#: js_upload.php:40 +#: js_upload.php:37 msgid "Failed" msgstr "" -#: js_upload.php:209 +#: js_upload.php:215 msgid "No files were uploaded." msgstr "" -#: js_upload.php:215 +#: js_upload.php:221 msgid "Uploaded file is empty" msgstr "" -#: js_upload.php:227 +#: js_upload.php:233 #, php-format msgid "Image exceeds size limit of %s" msgstr "" -#: js_upload.php:239 +#: js_upload.php:245 #, php-format msgid "File has an invalid extension, it should be one of %s." msgstr "" -#: js_upload.php:250 +#: js_upload.php:256 msgid "Upload was cancelled, or server error encountered" msgstr "" diff --git a/js_upload/lang/bg/messages.po b/js_upload/lang/bg/messages.po deleted file mode 100644 index 65274d18..00000000 --- a/js_upload/lang/bg/messages.po +++ /dev/null @@ -1,57 +0,0 @@ -# ADDON js_upload -# Copyright (C) -# This file is distributed under the same license as the Friendica js_upload addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 08:46+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: js_upload.php:37 -msgid "Select files for upload" -msgstr "" - -#: js_upload.php:38 -msgid "Drop files here to upload" -msgstr "" - -#: js_upload.php:39 -msgid "Cancel" -msgstr "" - -#: js_upload.php:40 -msgid "Failed" -msgstr "" - -#: js_upload.php:209 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:215 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:227 -#, php-format -msgid "Image exceeds size limit of %s" -msgstr "" - -#: js_upload.php:239 -#, php-format -msgid "File has an invalid extension, it should be one of %s." -msgstr "" - -#: js_upload.php:250 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/bg/strings.php b/js_upload/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/js_upload/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: js_upload.php:37 -msgid "Select files for upload" -msgstr "" - -#: js_upload.php:38 -msgid "Drop files here to upload" -msgstr "" - -#: js_upload.php:39 -msgid "Cancel" -msgstr "" - -#: js_upload.php:40 -msgid "Failed" -msgstr "" - -#: js_upload.php:209 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:215 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:227 -#, php-format -msgid "Image exceeds size limit of %s" -msgstr "" - -#: js_upload.php:239 -#, php-format -msgid "File has an invalid extension, it should be one of %s." -msgstr "" - -#: js_upload.php:250 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/ca/strings.php b/js_upload/lang/ca/strings.php index d34874f6..85b403f9 100644 --- a/js_upload/lang/ca/strings.php +++ b/js_upload/lang/ca/strings.php @@ -1,7 +1,11 @@ -strings["Upload a file"] = "Carrega un arxiu"; +$a->strings["Drop files here to upload"] = "Deixa aquí el arxiu a carregar"; +$a->strings["Cancel"] = "Cancel·lar"; +$a->strings["Failed"] = "Fracassar"; +$a->strings["No files were uploaded."] = "No hi ha arxius carregats."; +$a->strings["Uploaded file is empty"] = "L'arxiu carregat està buit"; +$a->strings["Image exceeds size limit of "] = "La imatge excedeix el límit de "; +$a->strings["File has an invalid extension, it should be one of "] = "Arxiu té una extensió no vàlida, ha de ser una de"; +$a->strings["Upload was cancelled, or server error encountered"] = "La pujada va ser cancel.lada, o es va trobar un error de servidor"; diff --git a/js_upload/lang/eo/messages.po b/js_upload/lang/eo/messages.po deleted file mode 100644 index e2b0c0a5..00000000 --- a/js_upload/lang/eo/messages.po +++ /dev/null @@ -1,57 +0,0 @@ -# ADDON js_upload -# Copyright (C) -# This file is distributed under the same license as the Friendica js_upload addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 08:46+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: js_upload.php:37 -msgid "Select files for upload" -msgstr "" - -#: js_upload.php:38 -msgid "Drop files here to upload" -msgstr "" - -#: js_upload.php:39 -msgid "Cancel" -msgstr "" - -#: js_upload.php:40 -msgid "Failed" -msgstr "" - -#: js_upload.php:209 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:215 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:227 -#, php-format -msgid "Image exceeds size limit of %s" -msgstr "" - -#: js_upload.php:239 -#, php-format -msgid "File has an invalid extension, it should be one of %s." -msgstr "" - -#: js_upload.php:250 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/eo/strings.php b/js_upload/lang/eo/strings.php index 68e8a64c..fd358ea8 100644 --- a/js_upload/lang/eo/strings.php +++ b/js_upload/lang/eo/strings.php @@ -1,7 +1,11 @@ -strings["Upload a file"] = "Alŝuti dosieron"; +$a->strings["Drop files here to upload"] = "Ŝovmeti dosierojn ĉi tie por alŝuti ilin."; +$a->strings["Cancel"] = "Nuligi"; +$a->strings["Failed"] = "Malsukcesi"; +$a->strings["No files were uploaded."] = "Neniom da dosieroj alŝutita."; +$a->strings["Uploaded file is empty"] = "Alŝutita dosiero estas malplena."; +$a->strings["Image exceeds size limit of "] = "Bildo estas pli granda ol la limito de"; +$a->strings["File has an invalid extension, it should be one of "] = "Dosiero havas nevalidan sufikson. Ĝi estu unu de "; +$a->strings["Upload was cancelled, or server error encountered"] = "Alŝutado estas nuligita aŭ okazis eraro sur la servilo"; diff --git a/js_upload/lang/et/messages.po b/js_upload/lang/et/messages.po deleted file mode 100644 index 034fd248..00000000 --- a/js_upload/lang/et/messages.po +++ /dev/null @@ -1,57 +0,0 @@ -# ADDON js_upload -# Copyright (C) -# This file is distributed under the same license as the Friendica js_upload addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 08:46+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: js_upload.php:37 -msgid "Select files for upload" -msgstr "" - -#: js_upload.php:38 -msgid "Drop files here to upload" -msgstr "" - -#: js_upload.php:39 -msgid "Cancel" -msgstr "" - -#: js_upload.php:40 -msgid "Failed" -msgstr "" - -#: js_upload.php:209 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:215 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:227 -#, php-format -msgid "Image exceeds size limit of %s" -msgstr "" - -#: js_upload.php:239 -#, php-format -msgid "File has an invalid extension, it should be one of %s." -msgstr "" - -#: js_upload.php:250 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/et/strings.php b/js_upload/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/js_upload/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: js_upload.php:37 -msgid "Select files for upload" -msgstr "" - -#: js_upload.php:38 -msgid "Drop files here to upload" -msgstr "" - -#: js_upload.php:39 -msgid "Cancel" -msgstr "" - -#: js_upload.php:40 -msgid "Failed" -msgstr "" - -#: js_upload.php:209 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:215 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:227 -#, php-format -msgid "Image exceeds size limit of %s" -msgstr "" - -#: js_upload.php:239 -#, php-format -msgid "File has an invalid extension, it should be one of %s." -msgstr "" - -#: js_upload.php:250 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/gd/strings.php b/js_upload/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/js_upload/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/js_upload/lang/is/messages.po b/js_upload/lang/is/messages.po deleted file mode 100644 index 39528f2d..00000000 --- a/js_upload/lang/is/messages.po +++ /dev/null @@ -1,57 +0,0 @@ -# ADDON js_upload -# Copyright (C) -# This file is distributed under the same license as the Friendica js_upload addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 08:46+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: js_upload.php:37 -msgid "Select files for upload" -msgstr "" - -#: js_upload.php:38 -msgid "Drop files here to upload" -msgstr "" - -#: js_upload.php:39 -msgid "Cancel" -msgstr "" - -#: js_upload.php:40 -msgid "Failed" -msgstr "" - -#: js_upload.php:209 -msgid "No files were uploaded." -msgstr "" - -#: js_upload.php:215 -msgid "Uploaded file is empty" -msgstr "" - -#: js_upload.php:227 -#, php-format -msgid "Image exceeds size limit of %s" -msgstr "" - -#: js_upload.php:239 -#, php-format -msgid "File has an invalid extension, it should be one of %s." -msgstr "" - -#: js_upload.php:250 -msgid "Upload was cancelled, or server error encountered" -msgstr "" diff --git a/js_upload/lang/is/strings.php b/js_upload/lang/is/strings.php index 975c341e..d09928c0 100644 --- a/js_upload/lang/is/strings.php +++ b/js_upload/lang/is/strings.php @@ -1,7 +1,11 @@ -strings["Upload a file"] = "Hlaða upp skrá"; +$a->strings["Drop files here to upload"] = "Slepptu skrám hér til að hala upp"; +$a->strings["Cancel"] = "Hætta við"; +$a->strings["Failed"] = "Mistókst"; +$a->strings["No files were uploaded."] = "Engum skráð hlaðið upp."; +$a->strings["Uploaded file is empty"] = "Skrá sem var hlaðið upp er tóm"; +$a->strings["Image exceeds size limit of "] = "Mynd er yfir stærðamörkum"; +$a->strings["File has an invalid extension, it should be one of "] = "Skrá hefur ógilda skránafnsendingu, ætti að vera eitt af"; +$a->strings["Upload was cancelled, or server error encountered"] = "Hætt var við upphal eða kerfisvilla kom upp"; diff --git a/js_upload/templates/js_upload.tpl b/js_upload/templates/js_upload.tpl index b482cd2b..f45b495c 100644 --- a/js_upload/templates/js_upload.tpl +++ b/js_upload/templates/js_upload.tpl @@ -35,18 +35,18 @@ let albumElm = document.getElementById('photos-upload-album-select'); let contact_allow = document.querySelector('[name="contact_allow"]:not(:disabled)'); - let circle_allow = document.querySelector('[name="circle_allow"]:not(:disabled)'); - let contact_deny = document.querySelector('[name="contact_deny"]:not(:disabled)'); - let circle_deny = document.querySelector('[name="circle_deny"]:not(:disabled)'); + let group_allow = document.querySelector('[name="group_allow"]:not(:disabled)'); + let contact_deny = document.querySelector('[name="contact_deny"]:not(:disabled)'); + let group_deny = document.querySelector('[name="group_deny"]:not(:disabled)'); uploader.setParams({ newalbum : newalbumElm ? newalbumElm.value : '', album : albumElm ? albumElm.value : '', not_visible : document.getElementById('photos-upload-noshare').checked, contact_allow : contact_allow ? contact_allow.value : '', - circle_allow : circle_allow ? circle_allow.value : '', + group_allow : group_allow ? group_allow.value : '', contact_deny : contact_deny ? contact_deny.value : '', - circle_deny : circle_deny ? circle_deny.value : '', + group_deny : group_deny ? group_deny.value : '', }); } }); diff --git a/keycloakpassword/keycloakpassword.php b/keycloakpassword/keycloakpassword.php index 11034ffe..bfff4ea4 100644 --- a/keycloakpassword/keycloakpassword.php +++ b/keycloakpassword/keycloakpassword.php @@ -6,7 +6,9 @@ * Author: Ryan */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; @@ -36,7 +38,7 @@ function keycloakpassword_request($client_id, $secret, $url, $params = []) $res = curl_exec($ch); if (curl_errno($ch)) { - DI::logger()->error(curl_error($ch)); + Logger::error(curl_error($ch)); } curl_close($ch); @@ -90,7 +92,7 @@ function keycloakpassword_authenticate(array &$b) $client_id, $secret, $endpoint . '/logout', - [ 'refresh_token' => $res['refresh_token'] ] + [ 'refresh_token' => res['refresh_token'] ] ); } } diff --git a/krynn/krynn.php b/krynn/krynn.php index b57d827e..f7e77c26 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -10,7 +10,9 @@ *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; @@ -30,7 +32,7 @@ function krynn_install() Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); - DI::logger()->notice("installed krynn"); + Logger::notice("installed krynn"); } function krynn_post_hook(&$item) diff --git a/krynn/lang/bg/messages.po b/krynn/lang/bg/messages.po deleted file mode 100644 index 608a0340..00000000 --- a/krynn/lang/bg/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/bg/strings.php b/krynn/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/krynn/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/ca/strings.php b/krynn/lang/ca/strings.php index d34874f6..d5e09e7e 100644 --- a/krynn/lang/ca/strings.php +++ b/krynn/lang/ca/strings.php @@ -1,7 +1,5 @@ -strings["Krynn Settings"] = "Ajustos de Krynn"; +$a->strings["Enable Krynn Addon"] = "Activa Addon de Krynn"; +$a->strings["Submit"] = "Enviar"; diff --git a/krynn/lang/eo/messages.po b/krynn/lang/eo/messages.po deleted file mode 100644 index a58129a6..00000000 --- a/krynn/lang/eo/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/eo/strings.php b/krynn/lang/eo/strings.php index 68e8a64c..eae02345 100644 --- a/krynn/lang/eo/strings.php +++ b/krynn/lang/eo/strings.php @@ -1,7 +1,5 @@ -strings["Krynn Settings"] = "Agordo pri Krynn"; +$a->strings["Enable Krynn Addon"] = "Ŝalti la Krynn kromprogamon"; +$a->strings["Submit"] = "Sendi"; diff --git a/krynn/lang/et/messages.po b/krynn/lang/et/messages.po deleted file mode 100644 index 01c6ed86..00000000 --- a/krynn/lang/et/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/et/strings.php b/krynn/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/krynn/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2021 -# cracrayol, 2024 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-21 19:14-0500\n" "PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: cracrayol, 2024\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: bob lebonche , 2021\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -22,7 +21,7 @@ msgstr "" #: krynn.php:127 msgid "Enable Krynn Addon" -msgstr "Activer l'extension Krynn" +msgstr "Activer l'application complémentaire Krynn" #: krynn.php:132 msgid "Krynn Settings" diff --git a/krynn/lang/fr/strings.php b/krynn/lang/fr/strings.php index 84293f79..3c3574d0 100644 --- a/krynn/lang/fr/strings.php +++ b/krynn/lang/fr/strings.php @@ -5,5 +5,5 @@ function string_plural_select_fr($n){ $n = intval($n); if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } }} -$a->strings['Enable Krynn Addon'] = 'Activer l\'extension Krynn'; +$a->strings['Enable Krynn Addon'] = 'Activer l\'application complémentaire Krynn'; $a->strings['Krynn Settings'] = 'Paramètres de Krynn'; diff --git a/krynn/lang/gd/messages.po b/krynn/lang/gd/messages.po deleted file mode 100644 index 23f81bf9..00000000 --- a/krynn/lang/gd/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/gd/strings.php b/krynn/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/krynn/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/krynn/lang/is/messages.po b/krynn/lang/is/messages.po deleted file mode 100644 index bab3ab42..00000000 --- a/krynn/lang/is/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/is/strings.php b/krynn/lang/is/strings.php index 975c341e..11fd5b57 100644 --- a/krynn/lang/is/strings.php +++ b/krynn/lang/is/strings.php @@ -1,7 +1,5 @@ -strings["Krynn Settings"] = ""; +$a->strings["Enable Krynn Addon"] = ""; +$a->strings["Submit"] = "Senda inn"; diff --git a/krynn/lang/ru/messages.po b/krynn/lang/ru/messages.po deleted file mode 100644 index b2846c2d..00000000 --- a/krynn/lang/ru/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON krynn -# Copyright (C) -# This file is distributed under the same license as the Friendica krynn addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:14-0500\n" -"PO-Revision-Date: 2015-07-07 15:14+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: krynn.php:127 -msgid "Enable Krynn Addon" -msgstr "" - -#: krynn.php:132 -msgid "Krynn Settings" -msgstr "" diff --git a/krynn/lang/ru/strings.php b/krynn/lang/ru/strings.php index 0579fc21..88ba6719 100644 --- a/krynn/lang/ru/strings.php +++ b/krynn/lang/ru/strings.php @@ -1,7 +1,5 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} +strings["Krynn Settings"] = ""; +$a->strings["Enable Krynn Addon"] = ""; +$a->strings["Submit"] = "Подтвердить"; diff --git a/langfilter/lang/bg/messages.po b/langfilter/lang/bg/messages.po deleted file mode 100644 index 92c40191..00000000 --- a/langfilter/lang/bg/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON langfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica langfilter addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2015-07-25 08:05+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: langfilter.php:49 -msgid "" -"This addon tries to identify the language posts are written in. If it does " -"not match any language specified below, posts will be hidden by collapsing " -"them." -msgstr "" - -#: langfilter.php:50 -msgid "Use the language filter" -msgstr "" - -#: langfilter.php:51 -msgid "Able to read" -msgstr "" - -#: langfilter.php:51 -msgid "" -"List of abbreviations (ISO 639-1 codes) for languages you speak, comma " -"separated. For example \"de,it\"." -msgstr "" - -#: langfilter.php:52 -msgid "Minimum confidence in language detection" -msgstr "" - -#: langfilter.php:52 -msgid "" -"Minimum confidence in language detection being correct, from 0 to 100. Posts" -" will not be filtered when the confidence of language detection is below " -"this percent value." -msgstr "" - -#: langfilter.php:53 -msgid "Minimum length of message body" -msgstr "" - -#: langfilter.php:53 -msgid "" -"Minimum number of characters in message body for filter to be used. Posts " -"shorter than this will not be filtered. Note: Language detection is " -"unreliable for short content (<200 characters)." -msgstr "" - -#: langfilter.php:58 -msgid "Language Filter" -msgstr "" - -#: langfilter.php:60 -msgid "Save Settings" -msgstr "" - -#: langfilter.php:193 -#, php-format -msgid "Filtered language: %s" -msgstr "" diff --git a/langfilter/lang/bg/strings.php b/langfilter/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/langfilter/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: langfilter.php:49 -msgid "" -"This addon tries to identify the language posts are written in. If it does " -"not match any language specified below, posts will be hidden by collapsing " -"them." -msgstr "" - -#: langfilter.php:50 -msgid "Use the language filter" -msgstr "" - -#: langfilter.php:51 -msgid "Able to read" -msgstr "" - -#: langfilter.php:51 -msgid "" -"List of abbreviations (ISO 639-1 codes) for languages you speak, comma " -"separated. For example \"de,it\"." -msgstr "" - -#: langfilter.php:52 -msgid "Minimum confidence in language detection" -msgstr "" - -#: langfilter.php:52 -msgid "" -"Minimum confidence in language detection being correct, from 0 to 100. Posts" -" will not be filtered when the confidence of language detection is below " -"this percent value." -msgstr "" - -#: langfilter.php:53 -msgid "Minimum length of message body" -msgstr "" - -#: langfilter.php:53 -msgid "" -"Minimum number of characters in message body for filter to be used. Posts " -"shorter than this will not be filtered. Note: Language detection is " -"unreliable for short content (<200 characters)." -msgstr "" - -#: langfilter.php:58 -msgid "Language Filter" -msgstr "" - -#: langfilter.php:60 -msgid "Save Settings" -msgstr "" - -#: langfilter.php:193 -#, php-format -msgid "Filtered language: %s" -msgstr "" diff --git a/langfilter/lang/eo/strings.php b/langfilter/lang/eo/strings.php deleted file mode 100644 index 68e8a64c..00000000 --- a/langfilter/lang/eo/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: langfilter.php:49 -msgid "" -"This addon tries to identify the language posts are written in. If it does " -"not match any language specified below, posts will be hidden by collapsing " -"them." -msgstr "" - -#: langfilter.php:50 -msgid "Use the language filter" -msgstr "" - -#: langfilter.php:51 -msgid "Able to read" -msgstr "" - -#: langfilter.php:51 -msgid "" -"List of abbreviations (ISO 639-1 codes) for languages you speak, comma " -"separated. For example \"de,it\"." -msgstr "" - -#: langfilter.php:52 -msgid "Minimum confidence in language detection" -msgstr "" - -#: langfilter.php:52 -msgid "" -"Minimum confidence in language detection being correct, from 0 to 100. Posts" -" will not be filtered when the confidence of language detection is below " -"this percent value." -msgstr "" - -#: langfilter.php:53 -msgid "Minimum length of message body" -msgstr "" - -#: langfilter.php:53 -msgid "" -"Minimum number of characters in message body for filter to be used. Posts " -"shorter than this will not be filtered. Note: Language detection is " -"unreliable for short content (<200 characters)." -msgstr "" - -#: langfilter.php:58 -msgid "Language Filter" -msgstr "" - -#: langfilter.php:60 -msgid "Save Settings" -msgstr "" - -#: langfilter.php:193 -#, php-format -msgid "Filtered language: %s" -msgstr "" diff --git a/langfilter/lang/gd/strings.php b/langfilter/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/langfilter/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/langfilter/lang/is/messages.po b/langfilter/lang/is/messages.po deleted file mode 100644 index 9734cfde..00000000 --- a/langfilter/lang/is/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON langfilter -# Copyright (C) -# This file is distributed under the same license as the Friendica langfilter addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2015-07-25 08:05+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: langfilter.php:49 -msgid "" -"This addon tries to identify the language posts are written in. If it does " -"not match any language specified below, posts will be hidden by collapsing " -"them." -msgstr "" - -#: langfilter.php:50 -msgid "Use the language filter" -msgstr "" - -#: langfilter.php:51 -msgid "Able to read" -msgstr "" - -#: langfilter.php:51 -msgid "" -"List of abbreviations (ISO 639-1 codes) for languages you speak, comma " -"separated. For example \"de,it\"." -msgstr "" - -#: langfilter.php:52 -msgid "Minimum confidence in language detection" -msgstr "" - -#: langfilter.php:52 -msgid "" -"Minimum confidence in language detection being correct, from 0 to 100. Posts" -" will not be filtered when the confidence of language detection is below " -"this percent value." -msgstr "" - -#: langfilter.php:53 -msgid "Minimum length of message body" -msgstr "" - -#: langfilter.php:53 -msgid "" -"Minimum number of characters in message body for filter to be used. Posts " -"shorter than this will not be filtered. Note: Language detection is " -"unreliable for short content (<200 characters)." -msgstr "" - -#: langfilter.php:58 -msgid "Language Filter" -msgstr "" - -#: langfilter.php:60 -msgid "Save Settings" -msgstr "" - -#: langfilter.php:193 -#, php-format -msgid "Filtered language: %s" -msgstr "" diff --git a/langfilter/lang/is/strings.php b/langfilter/lang/is/strings.php deleted file mode 100644 index 975c341e..00000000 --- a/langfilter/lang/is/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2025 # fabrixxm , 2015,2018 # Sandro Santilli , 2015 # SickShark X, 2021 @@ -15,7 +14,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-21 19:15-0500\n" "PO-Revision-Date: 2015-07-25 08:05+0000\n" -"Last-Translator: Diego Beraldin , 2025\n" +"Last-Translator: SickShark X, 2021\n" "Language-Team: Italian (http://app.transifex.com/Friendica/friendica/language/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -28,7 +27,7 @@ msgid "" "This addon tries to identify the language posts are written in. If it does " "not match any language specified below, posts will be hidden by collapsing " "them." -msgstr "Questo componente aggiuntivo prova a identificare la lingua con cui sono stati scritti i messaggi. Se non corrisponde a nessuna delle lingue specificate qui sotto, i messaggi verranno nascosti." +msgstr "Questo plug-in prova a identificare la lingua con cui sono stati scritti i posts. Se non corrisponde a nessuna delle lingue specificate qui sotto, i post verranno nascosti." #: langfilter.php:50 msgid "Use the language filter" diff --git a/langfilter/lang/it/strings.php b/langfilter/lang/it/strings.php index cbce2841..8cae0b57 100644 --- a/langfilter/lang/it/strings.php +++ b/langfilter/lang/it/strings.php @@ -5,7 +5,7 @@ function string_plural_select_it($n){ $n = intval($n); if ($n == 1) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } }} -$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Questo componente aggiuntivo prova a identificare la lingua con cui sono stati scritti i messaggi. Se non corrisponde a nessuna delle lingue specificate qui sotto, i messaggi verranno nascosti.'; +$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Questo plug-in prova a identificare la lingua con cui sono stati scritti i posts. Se non corrisponde a nessuna delle lingue specificate qui sotto, i post verranno nascosti.'; $a->strings['Use the language filter'] = 'Usa il filtro lingua'; $a->strings['Able to read'] = 'In grado di leggere'; $a->strings['List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".'] = 'Lista di abbreviazioni (codici ISO 639-1) per le lingue che parli, separate da virgola. Per esempio "it,de".'; diff --git a/langfilter/lang/ru/messages.po b/langfilter/lang/ru/messages.po index 45ad7b3d..e1fbc9e8 100644 --- a/langfilter/lang/ru/messages.po +++ b/langfilter/lang/ru/messages.po @@ -4,59 +4,63 @@ # # # Translators: -# Alexander An , 2020,2023 +# Alexander An , 2020 # Stanislav N. , 2018 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2015-07-25 08:05+0000\n" -"Last-Translator: Alexander An , 2020,2023\n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" +"POT-Creation-Date: 2020-10-03 22:02-0400\n" +"PO-Revision-Date: 2020-10-09 17:48+0000\n" +"Last-Translator: Alexander An \n" +"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" -#: langfilter.php:49 +#: langfilter.php:52 +msgid "Language Filter" +msgstr "Языковой фильтр" + +#: langfilter.php:53 msgid "" "This addon tries to identify the language posts are written in. If it does " "not match any language specified below, posts will be hidden by collapsing " "them." -msgstr "Это дополнение пытается идентифицировать язык, на котором сделаны записи. Если язык не соответствует ни одному, указанному ниже, то такие посты будут свёрнуты." +msgstr "Это дополнение пытается идентифицировать язык, на котором написаны посты. Если язык не соответствует ни одному, указанному ниже, то такие посты будут скрыты." -#: langfilter.php:50 +#: langfilter.php:54 msgid "Use the language filter" msgstr "Использовать языковой фильтр" -#: langfilter.php:51 +#: langfilter.php:55 msgid "Able to read" msgstr "Возможность читать" -#: langfilter.php:51 +#: langfilter.php:55 msgid "" "List of abbreviations (ISO 639-1 codes) for languages you speak, comma " "separated. For example \"de,it\"." msgstr "Список аббревиатур (кодов по ISO 639-1 ) для языков, на которых вы говорите. Например, \"ru,en\"." -#: langfilter.php:52 +#: langfilter.php:56 msgid "Minimum confidence in language detection" msgstr "Минимальная уверенность в определении языка" -#: langfilter.php:52 +#: langfilter.php:56 msgid "" "Minimum confidence in language detection being correct, from 0 to 100. Posts" " will not be filtered when the confidence of language detection is below " "this percent value." msgstr "Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения." -#: langfilter.php:53 +#: langfilter.php:57 msgid "Minimum length of message body" msgstr "Минимальная длина тела сообщения" -#: langfilter.php:53 +#: langfilter.php:57 msgid "" "Minimum number of characters in message body for filter to be used. Posts " "shorter than this will not be filtered. Note: Language detection is " @@ -64,14 +68,10 @@ msgid "" msgstr "Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов)." #: langfilter.php:58 -msgid "Language Filter" -msgstr "Языковой фильтр" - -#: langfilter.php:60 msgid "Save Settings" msgstr "Сохранить настройки" -#: langfilter.php:193 +#: langfilter.php:189 #, php-format msgid "Filtered language: %s" msgstr "Отфильтрованный язык: %s" diff --git a/langfilter/lang/ru/strings.php b/langfilter/lang/ru/strings.php index 1f5619f7..0489bd4f 100644 --- a/langfilter/lang/ru/strings.php +++ b/langfilter/lang/ru/strings.php @@ -5,7 +5,8 @@ function string_plural_select_ru($n){ $n = intval($n); if ($n%10==1 && $n%100!=11) { return 0; } else if ($n%10>=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } }} -$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Это дополнение пытается идентифицировать язык, на котором сделаны записи. Если язык не соответствует ни одному, указанному ниже, то такие посты будут свёрнуты.'; +$a->strings['Language Filter'] = 'Языковой фильтр'; +$a->strings['This addon tries to identify the language posts are written in. If it does not match any language specified below, posts will be hidden by collapsing them.'] = 'Это дополнение пытается идентифицировать язык, на котором написаны посты. Если язык не соответствует ни одному, указанному ниже, то такие посты будут скрыты.'; $a->strings['Use the language filter'] = 'Использовать языковой фильтр'; $a->strings['Able to read'] = 'Возможность читать'; $a->strings['List of abbreviations (ISO 639-1 codes) for languages you speak, comma separated. For example "de,it".'] = 'Список аббревиатур (кодов по ISO 639-1 ) для языков, на которых вы говорите. Например, "ru,en".'; @@ -13,6 +14,5 @@ $a->strings['Minimum confidence in language detection'] = 'Минимальна $a->strings['Minimum confidence in language detection being correct, from 0 to 100. Posts will not be filtered when the confidence of language detection is below this percent value.'] = 'Минимальная уверенность в правильном определении языка, от 0 до 100. Посты не будут скрыты, если уверенность в правильном определении языка в процентах ниже этого значения.'; $a->strings['Minimum length of message body'] = 'Минимальная длина тела сообщения'; $a->strings['Minimum number of characters in message body for filter to be used. Posts shorter than this will not be filtered. Note: Language detection is unreliable for short content (<200 characters).'] = 'Минимальное количество знаков в теле сообщения для применения фильтрации. Посты, длина которых меньше указанного значения, не будут отфильтрованы. Обратите внимание, что определение языка работает ненадежно для небольших постов (<200 символов).'; -$a->strings['Language Filter'] = 'Языковой фильтр'; $a->strings['Save Settings'] = 'Сохранить настройки'; $a->strings['Filtered language: %s'] = 'Отфильтрованный язык: %s'; diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index 3a202fcd..61b357f6 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -7,6 +7,7 @@ * License: MIT */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Renderer; @@ -99,8 +100,8 @@ function langfilter_addon_settings_post(array &$b) function langfilter_prepare_body_content_filter(&$hook_data) { - $uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId(); - if (!$uid) { + $logged_user = DI::userSession()->getLocalUserId(); + if (!$logged_user) { return; } @@ -112,8 +113,8 @@ function langfilter_prepare_body_content_filter(&$hook_data) } // Don't filter if language filter is disabled - if (!DI::pConfig()->get($uid, 'langfilter', 'enable', - !DI::pConfig()->get($uid, 'langfilter', 'disable')) + if (!DI::pConfig()->get($logged_user, 'langfilter', 'enable', + !DI::pConfig()->get($logged_user, 'langfilter', 'disable')) ) { return; } @@ -121,13 +122,13 @@ function langfilter_prepare_body_content_filter(&$hook_data) $naked_body = strip_tags( $hook_data['item']['rendered-html'] ??''?: // Equivalent of !empty() - BBCode::convertForUriId($hook_data['item']['uri-id'], $hook_data['item']['body'], BBCode::ACTIVITYPUB) + BBCode::convert($hook_data['item']['body'], false, BBCode::ACTIVITYPUB, true) ); $naked_body = preg_replace('#\s+#', ' ', trim($naked_body)); // Don't filter if body lenght is below minimum - $minlen = DI::pConfig()->get($uid, 'langfilter', 'minlength', 32); + $minlen = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'langfilter', 'minlength', 32); if (!$minlen) { $minlen = 32; } @@ -136,8 +137,8 @@ function langfilter_prepare_body_content_filter(&$hook_data) return; } - $read_languages_string = DI::pConfig()->get($uid, 'langfilter', 'languages'); - $minconfidence = DI::pConfig()->get($uid, 'langfilter', 'minconfidence'); + $read_languages_string = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'langfilter', 'languages'); + $minconfidence = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'langfilter', 'minconfidence'); // Don't filter if no spoken languages are configured if (!$read_languages_string) { @@ -147,8 +148,6 @@ function langfilter_prepare_body_content_filter(&$hook_data) $iso639 = new Matriphe\ISO639\ISO639; - $confidence = null; - // Extract the language of the post if (!empty($hook_data['item']['language'])) { $languages = json_decode($hook_data['item']['language'], true); @@ -164,7 +163,7 @@ function langfilter_prepare_body_content_filter(&$hook_data) return; } - $lang = $iso639->languageByCode1(substr($iso2, 0, 2)); + $lang = $iso639->languageByCode1($iso2); } else { $opts = $hook_data['item']['postopts']; if (!$opts) { diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index b80c5226..38e2d6a1 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -29,7 +29,9 @@ * The configuration options for this module are described in the config/ldapauth.config.php file */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\User; @@ -43,7 +45,7 @@ function ldapauth_install() function ldapauth_load_config(ConfigFileManager $loader) { - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); + DI::app()->getConfigCache()->load($loader->loadAddonConfig('ldapauth'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); } function ldapauth_hook_authenticate(array &$b) @@ -68,54 +70,54 @@ function ldapauth_authenticate($username, $password) $ldap_autocreateaccount_nameattribute = DI::config()->get('ldapauth', 'ldap_autocreateaccount_nameattribute'); if (!extension_loaded('ldap') || !strlen($ldap_server)) { - DI::logger()->error('Addon not configured or missing php-ldap extension', ['extension_loaded' => extension_loaded('ldap'), 'server' => $ldap_server]); + Logger::error('Addon not configured or missing php-ldap extension', ['extension_loaded' => extension_loaded('ldap'), 'server' => $ldap_server]); return false; } if (!strlen($password)) { - DI::logger()->error('Empty password disallowed', ['provided_password_length' => strlen($password)]); + Logger::error('Empty password disallowed', ['provided_password_length' => strlen($password)]); return false; } $connect = @ldap_connect($ldap_server); if ($connect === false) { - DI::logger()->warning('Could not connect to LDAP server', ['server' => $ldap_server]); + Logger::warning('Could not connect to LDAP server', ['server' => $ldap_server]); return false; } @ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); @ldap_set_option($connect, LDAP_OPT_REFERRALS, 0); if ((@ldap_bind($connect, $ldap_binddn, $ldap_bindpw)) === false) { - DI::logger()->warning('Could not bind to LDAP server', ['server' => $ldap_server, 'binddn' => $ldap_binddn, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); + Logger::warning('Could not bind to LDAP server', ['server' => $ldap_server, 'binddn' => $ldap_binddn, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); return false; } $res = @ldap_search($connect, $ldap_searchdn, $ldap_userattr . '=' . $username); if (!$res) { - DI::logger()->notice('LDAP user not found.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); + Logger::notice('LDAP user not found.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); return false; } $id = @ldap_first_entry($connect, $res); if (!$id) { - DI::logger()->notice('Could not retrieve first LDAP entry.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); + Logger::notice('Could not retrieve first LDAP entry.', ['searchdn' => $ldap_searchdn, 'userattr' => $ldap_userattr, 'username' => $username, 'errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); return false; } $dn = @ldap_get_dn($connect, $id); if (!@ldap_bind($connect, $dn, $password)) { - DI::logger()->notice('Could not authenticate LDAP user with provided password', ['errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); + Logger::notice('Could not authenticate LDAP user with provided password', ['errno' => ldap_errno($connect), 'error' => ldap_error($connect)]); return false; } if (strlen($ldap_group) && @ldap_compare($connect, $ldap_group, 'member', $dn) !== true) { $errno = @ldap_errno($connect); if ($errno === 32) { - DI::logger()->notice('LDAP Access Control Group does not exist', ['errno' => $errno, 'error' => ldap_error($connect)]); + Logger::notice('LDAP Access Control Group does not exist', ['errno' => $errno, 'error' => ldap_error($connect)]); } elseif ($errno === 16) { - DI::logger()->notice('LDAP membership attribute does not exist in access control group', ['errno' => $errno, 'error' => ldap_error($connect)]); + Logger::notice('LDAP membership attribute does not exist in access control group', ['errno' => $errno, 'error' => ldap_error($connect)]); } else { - DI::logger()->notice('LDAP user isn\'t part of the authorized group', ['dn' => $dn]); + Logger::notice('LDAP user isn\'t part of the authorized group', ['dn' => $dn]); } @ldap_close($connect); @@ -139,7 +141,7 @@ function ldapauth_authenticate($username, $password) $authentication = User::getAuthenticationInfo($username); return User::getById($authentication['uid']); } catch (Exception $e) { - DI::logger()->notice('LDAP authentication error: ' . $e->getMessage()); + Logger::notice('LDAP authentication error: ' . $e->getMessage()); return false; } } @@ -147,7 +149,7 @@ function ldapauth_authenticate($username, $password) function ldap_createaccount($username, $password, $email, $name) { if (!strlen($email) || !strlen($name)) { - DI::logger()->notice('Could not create local user from LDAP data, no email or nickname provided'); + Logger::notice('Could not create local user from LDAP data, no email or nickname provided'); return false; } @@ -159,10 +161,10 @@ function ldap_createaccount($username, $password, $email, $name) 'password' => $password, 'verified' => 1 ]); - DI::logger()->info('Local user created from LDAP data', ['username' => $username, 'name' => $name]); + Logger::info('Local user created from LDAP data', ['username' => $username, 'name' => $name]); return $user; } catch (Exception $ex) { - DI::logger()->error('Could not create local user from LDAP data', ['username' => $username, 'exception' => $ex->getMessage()]); + Logger::error('Could not create local user from LDAP data', ['username' => $username, 'exception' => $ex->getMessage()]); } return false; diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index 891cb6ca..f6c65399 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -6,7 +6,9 @@ * Author: Michael Vogel */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\DI; function leistungsschutzrecht_install() @@ -147,7 +149,7 @@ function leistungsschutzrecht_is_member_site(string $url): bool $cleanedurlpart = explode('%', $urldata['host']); $hostname = explode('.', $cleanedurlpart[0]); - if ($hostname === false || $hostname === '') { + if (empty($hostname)) { return false; } @@ -167,7 +169,7 @@ function leistungsschutzrecht_cron($b) if ($last) { $next = $last + 86400; if ($next > time()) { - DI::logger()->notice('poll intervall not reached'); + Logger::notice('poll intervall not reached'); return; } } diff --git a/libertree/lang/C/messages.po b/libertree/lang/C/messages.po index 3162b6a7..6feeef8d 100644 --- a/libertree/lang/C/messages.po +++ b/libertree/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" +"POT-Creation-Date: 2021-11-21 19:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,22 +21,22 @@ msgstr "" msgid "Post to libertree" msgstr "" -#: libertree.php:59 +#: libertree.php:60 msgid "Enable Libertree Post Addon" msgstr "" -#: libertree.php:60 +#: libertree.php:61 msgid "Libertree site URL" msgstr "" -#: libertree.php:61 +#: libertree.php:62 msgid "Libertree API token" msgstr "" -#: libertree.php:62 +#: libertree.php:63 msgid "Post to Libertree by default" msgstr "" -#: libertree.php:67 +#: libertree.php:68 msgid "Libertree Export" msgstr "" diff --git a/libertree/lang/bg/messages.po b/libertree/lang/bg/messages.po deleted file mode 100644 index c92eb2fc..00000000 --- a/libertree/lang/bg/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON libertree -# Copyright (C) -# This file is distributed under the same license as the Friendica libertree addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 09:44+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libertree.php:39 -msgid "Post to libertree" -msgstr "" - -#: libertree.php:59 -msgid "Enable Libertree Post Addon" -msgstr "" - -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "" - -#: libertree.php:61 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:62 -msgid "Post to Libertree by default" -msgstr "" - -#: libertree.php:67 -msgid "Libertree Export" -msgstr "" diff --git a/libertree/lang/bg/strings.php b/libertree/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/libertree/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libertree.php:39 -msgid "Post to libertree" -msgstr "" - -#: libertree.php:59 -msgid "Enable Libertree Post Addon" -msgstr "" - -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "" - -#: libertree.php:61 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:62 -msgid "Post to Libertree by default" -msgstr "" - -#: libertree.php:67 -msgid "Libertree Export" -msgstr "" diff --git a/libertree/lang/ca/strings.php b/libertree/lang/ca/strings.php index d34874f6..02c7d22c 100644 --- a/libertree/lang/ca/strings.php +++ b/libertree/lang/ca/strings.php @@ -1,7 +1,9 @@ -strings["Post to libertree"] = "Enviament a libertree"; +$a->strings["libertree Post Settings"] = "Ajustos d'enviaments a libertree"; +$a->strings["Enable Libertree Post Addon"] = "Activa el addon d'enviaments a libertree"; +$a->strings["Libertree API token"] = "Libertree API token"; +$a->strings["Libertree site URL"] = "lloc URL libertree"; +$a->strings["Post to Libertree by default"] = "Enviar a libertree per defecte"; +$a->strings["Submit"] = "Enviar"; diff --git a/libertree/lang/eo/messages.po b/libertree/lang/eo/messages.po deleted file mode 100644 index ee003644..00000000 --- a/libertree/lang/eo/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON libertree -# Copyright (C) -# This file is distributed under the same license as the Friendica libertree addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 09:44+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libertree.php:39 -msgid "Post to libertree" -msgstr "" - -#: libertree.php:59 -msgid "Enable Libertree Post Addon" -msgstr "" - -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "" - -#: libertree.php:61 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:62 -msgid "Post to Libertree by default" -msgstr "" - -#: libertree.php:67 -msgid "Libertree Export" -msgstr "" diff --git a/libertree/lang/eo/strings.php b/libertree/lang/eo/strings.php index 68e8a64c..674972d0 100644 --- a/libertree/lang/eo/strings.php +++ b/libertree/lang/eo/strings.php @@ -1,7 +1,9 @@ -strings["Post to libertree"] = "Afiŝi al libertree"; +$a->strings["libertree Post Settings"] = "Agordoj por Afiŝoj ĉe libertree"; +$a->strings["Enable Libertree Post Addon"] = "Aktivigi Kromprogramon por Afiŝoj ĉe libertree"; +$a->strings["Libertree API token"] = "Libertree API ĵetono"; +$a->strings["Libertree site URL"] = "URL adreso de libertree retejo:"; +$a->strings["Post to Libertree by default"] = "Defaŭlte afiŝi ĉe Libertree"; +$a->strings["Submit"] = "Sendi"; diff --git a/libertree/lang/et/messages.po b/libertree/lang/et/messages.po deleted file mode 100644 index f9a7cca0..00000000 --- a/libertree/lang/et/messages.po +++ /dev/null @@ -1,44 +0,0 @@ -# ADDON libertree -# Copyright (C) -# This file is distributed under the same license as the Friendica libertree addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 09:44+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libertree.php:39 -msgid "Post to libertree" -msgstr "" - -#: libertree.php:59 -msgid "Enable Libertree Post Addon" -msgstr "" - -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "" - -#: libertree.php:61 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:62 -msgid "Post to Libertree by default" -msgstr "" - -#: libertree.php:67 -msgid "Libertree Export" -msgstr "" diff --git a/libertree/lang/et/strings.php b/libertree/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/libertree/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: libertree.php:39 -msgid "Post to libertree" -msgstr "" - -#: libertree.php:59 -msgid "Enable Libertree Post Addon" -msgstr "" - -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "" - -#: libertree.php:61 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:62 -msgid "Post to Libertree by default" -msgstr "" - -#: libertree.php:67 -msgid "Libertree Export" -msgstr "" diff --git a/libertree/lang/gd/strings.php b/libertree/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/libertree/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/libertree/lang/is/messages.po b/libertree/lang/is/messages.po deleted file mode 100644 index bede59ec..00000000 --- a/libertree/lang/is/messages.po +++ /dev/null @@ -1,43 +0,0 @@ -# ADDON libertree -# Copyright (C) -# This file is distributed under the same license as the Friendica libertree addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 09:44+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: libertree.php:39 -msgid "Post to libertree" -msgstr "" - -#: libertree.php:59 -msgid "Enable Libertree Post Addon" -msgstr "" - -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "" - -#: libertree.php:61 -msgid "Libertree API token" -msgstr "" - -#: libertree.php:62 -msgid "Post to Libertree by default" -msgstr "" - -#: libertree.php:67 -msgid "Libertree Export" -msgstr "" diff --git a/libertree/lang/is/strings.php b/libertree/lang/is/strings.php index 975c341e..6256e21c 100644 --- a/libertree/lang/is/strings.php +++ b/libertree/lang/is/strings.php @@ -1,7 +1,9 @@ -strings["Post to libertree"] = ""; +$a->strings["libertree Post Settings"] = ""; +$a->strings["Enable Libertree Post Addon"] = ""; +$a->strings["Libertree API token"] = ""; +$a->strings["Libertree site URL"] = ""; +$a->strings["Post to Libertree by default"] = ""; +$a->strings["Submit"] = "Senda inn"; diff --git a/libertree/lang/it/messages.po b/libertree/lang/it/messages.po index cc890cc5..7c3bc1ec 100644 --- a/libertree/lang/it/messages.po +++ b/libertree/lang/it/messages.po @@ -5,41 +5,45 @@ # # Translators: # fabrixxm , 2014-2015,2018 -# Sylke Vicious , 2021,2023 +# Sylke Vicious , 2021 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:49-0400\n" -"PO-Revision-Date: 2014-06-23 09:44+0000\n" -"Last-Translator: Sylke Vicious , 2021,2023\n" -"Language-Team: Italian (http://app.transifex.com/Friendica/friendica/language/it/)\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"PO-Revision-Date: 2021-02-16 12:47+0000\n" +"Last-Translator: Sylke Vicious \n" +"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: it\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: libertree.php:39 +#: libertree.php:37 msgid "Post to libertree" msgstr "Invia a Libertree" -#: libertree.php:59 +#: libertree.php:71 libertree.php:75 +msgid "libertree Export" +msgstr "Esporta libertree" + +#: libertree.php:79 msgid "Enable Libertree Post Addon" msgstr "Abilita il componente aggiuntivo di invio a Libertree" -#: libertree.php:60 -msgid "Libertree site URL" -msgstr "Indirizzo sito Libertree" - -#: libertree.php:61 +#: libertree.php:84 msgid "Libertree API token" msgstr "Token API Libertree" -#: libertree.php:62 +#: libertree.php:89 +msgid "Libertree site URL" +msgstr "Indirizzo sito Libertree" + +#: libertree.php:94 msgid "Post to Libertree by default" msgstr "Invia sempre a Libertree" -#: libertree.php:67 -msgid "Libertree Export" -msgstr "Esporta Libertree" +#: libertree.php:100 +msgid "Save Settings" +msgstr "Salva Impostazioni" diff --git a/libertree/lang/it/strings.php b/libertree/lang/it/strings.php index 8abcfa2d..02d26542 100644 --- a/libertree/lang/it/strings.php +++ b/libertree/lang/it/strings.php @@ -3,11 +3,12 @@ if(! function_exists("string_plural_select_it")) { function string_plural_select_it($n){ $n = intval($n); - if ($n == 1) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } + return intval($n != 1); }} $a->strings['Post to libertree'] = 'Invia a Libertree'; +$a->strings['libertree Export'] = 'Esporta libertree'; $a->strings['Enable Libertree Post Addon'] = 'Abilita il componente aggiuntivo di invio a Libertree'; -$a->strings['Libertree site URL'] = 'Indirizzo sito Libertree'; $a->strings['Libertree API token'] = 'Token API Libertree'; +$a->strings['Libertree site URL'] = 'Indirizzo sito Libertree'; $a->strings['Post to Libertree by default'] = 'Invia sempre a Libertree'; -$a->strings['Libertree Export'] = 'Esporta Libertree'; +$a->strings['Save Settings'] = 'Salva Impostazioni'; diff --git a/libertree/libertree.php b/libertree/libertree.php index c1bb2a07..8e8c9ba9 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -6,12 +6,13 @@ * Author: Tony Baldwin */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; -use Friendica\Model\Item; use Friendica\Model\Post; function libertree_install() @@ -73,11 +74,13 @@ function libertree_settings(array &$data) function libertree_settings_post(array &$b) { if (!empty($_POST['libertree-submit'])) { - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'libertree', 'post', intval($_POST['libertree'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'libertree', 'post_by_default', intval($_POST['libertree_bydefault'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'libertree', 'libertree_api_token', trim($_POST['libertree_api_token'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'libertree', 'libertree_url', trim($_POST['libertree_url'])); + DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','post',intval($_POST['libertree'])); + DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','post_by_default',intval($_POST['libertree_bydefault'])); + DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','libertree_api_token',trim($_POST['libertree_api_token'])); + DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','libertree_url',trim($_POST['libertree_url'])); + } + } function libertree_hook_fork(array &$b) @@ -88,10 +91,8 @@ function libertree_hook_fork(array &$b) $post = $b['data']; - if ( - $post['deleted'] || ($post['private'] == Item::PRIVATE) || ($post['created'] !== $post['edited']) || - !strstr($post['postopts'], 'libertree') || ($post['gravity'] != Item::GRAVITY_PARENT) - ) { + if ($post['deleted'] || $post['private'] || ($post['created'] !== $post['edited']) || + !strstr($post['postopts'], 'libertree') || ($post['parent'] != $post['id'])) { $b['execute'] = false; return; } @@ -99,20 +100,26 @@ function libertree_hook_fork(array &$b) function libertree_post_local(array &$b) { + + // This can probably be changed to allow editing by pointing to a different API endpoint + + if ($b['edit']) { + return; + } + if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) { return; } - // This can probably be changed to allow editing by pointing to a different API endpoint - if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) { + if ($b['private'] || $b['parent']) { return; } - $ltree_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'libertree', 'post')); + $ltree_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(),'libertree','post')); $ltree_enable = (($ltree_post && !empty($_REQUEST['libertree_enable'])) ? intval($_REQUEST['libertree_enable']) : 0); - if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'libertree', 'post_by_default'))) { + if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(),'libertree','post_by_default'))) { $ltree_enable = 1; } @@ -129,17 +136,13 @@ function libertree_post_local(array &$b) function libertree_send(array &$b) { - DI::logger()->notice('libertree_send: invoked'); + Logger::notice('libertree_send: invoked'); - if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) { + if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) { return; } - if (! strstr($b['postopts'], 'libertree')) { - return; - } - - if (Item::isGroupPost($b['uri-id'])) { + if (! strstr($b['postopts'],'libertree')) { return; } @@ -148,7 +151,7 @@ function libertree_send(array &$b) } // Dont't post if the post doesn't belong to us. - // This is a check for group postings + // This is a check for forum postings $self = DBA::selectFirst('contact', ['id'], ['uid' => $b['uid'], 'self' => true]); if ($b['contact-id'] != $self['id']) { return; @@ -156,15 +159,15 @@ function libertree_send(array &$b) $b['body'] = Post\Media::addAttachmentsToBody($b['uri-id'], DI::contentItem()->addSharedPost($b)); - $ltree_api_token = DI::pConfig()->get($b['uid'], 'libertree', 'libertree_api_token'); - $ltree_url = DI::pConfig()->get($b['uid'], 'libertree', 'libertree_url'); + $ltree_api_token = DI::pConfig()->get($b['uid'],'libertree','libertree_api_token'); + $ltree_url = DI::pConfig()->get($b['uid'],'libertree','libertree_url'); $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; $ltree_source = DI::baseUrl()->getHost(); if ($b['app'] != "") - $ltree_source .= " (" . $b['app'] . ")"; + $ltree_source .= " (".$b['app'].")"; - if ($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { + if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { $title = $b['title']; $body = $b['body']; // Insert a newline before and after a quote @@ -174,7 +177,7 @@ function libertree_send(array &$b) // Removal of tags and mentions // #-tags $body = preg_replace('/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $body); - // @-mentions + // @-mentions $body = preg_replace('/@\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '@$2', $body); // remove multiple newlines @@ -195,10 +198,10 @@ function libertree_send(array &$b) $params = [ 'text' => $body, 'source' => $ltree_source - // 'token' => $ltree_api_token + // 'token' => $ltree_api_token ]; - $result = DI::httpClient()->post($ltree_blog, $params)->getBodyString(); - DI::logger()->notice('libertree: ' . $result); + $result = DI::httpClient()->post($ltree_blog, $params)->getBody(); + Logger::notice('libertree: ' . $result); } } diff --git a/libravatar/Services/Libravatar.php b/libravatar/Services/Libravatar.php index 8b3dd493..18aa5c90 100644 --- a/libravatar/Services/Libravatar.php +++ b/libravatar/Services/Libravatar.php @@ -217,7 +217,7 @@ class Services_Libravatar * * @param array $options Array of options for getUrl() * - * @return array + * @return void * @throws Exception When an invalid option is used */ protected function checkOptionsArray($options) @@ -361,7 +361,7 @@ class Services_Libravatar protected function domainGet($identifier) { if ($identifier === null) { - return ''; + return null; } // What are we, email or openid? Split ourself up and get the @@ -401,8 +401,9 @@ class Services_Libravatar */ protected function srvGet($domain, $https = false) { + // Are we going secure? Set up a fallback too. - if ($https === true) { + if (isset($https) && $https === true) { $subdomain = '_avatars-sec._tcp.'; $fallback = 'seccdn.'; } else { @@ -425,7 +426,6 @@ class Services_Libravatar $top = $srv[0]; $sum = 0; - $pri = []; // Try to adhere to RFC2782's weighting algorithm, page 3 // "arrange all SRV RRs (that have not been ordered yet) in any order, @@ -462,8 +462,6 @@ class Services_Libravatar return $v['target']; } } - - return ''; } /** diff --git a/libravatar/lang/bg/messages.po b/libravatar/lang/bg/messages.po deleted file mode 100644 index 4b377dc3..00000000 --- a/libravatar/lang/bg/messages.po +++ /dev/null @@ -1,70 +0,0 @@ -# ADDON libravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica libravatar addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/bg/strings.php b/libravatar/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/libravatar/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/ca/strings.php b/libravatar/lang/ca/strings.php index d34874f6..f921b9fd 100644 --- a/libravatar/lang/ca/strings.php +++ b/libravatar/lang/ca/strings.php @@ -1,7 +1,17 @@ -strings["Could NOT install Libravatar successfully.
It requires PHP >= 5.3"] = "No puc instal·lar Libravatar ,
requereix PHP>=5.3"; +$a->strings["generic profile image"] = "imatge de perfil genérica"; +$a->strings["random geometric pattern"] = "Patró geometric aleatori"; +$a->strings["monster face"] = "Cara monstruosa"; +$a->strings["computer generated face"] = "Cara monstruosa generada per ordinador"; +$a->strings["retro arcade style face"] = "Cara d'estil arcade retro"; +$a->strings["Warning"] = "Avís"; +$a->strings["Your PHP version %s is lower than the required PHP >= 5.3."] = "La teva versió de PHP %s es inferior a la requerida, PHP>=5.3"; +$a->strings["This addon is not functional on your server."] = "Aquest addon no es funcional al teu servidor."; +$a->strings["Information"] = "informació"; +$a->strings["Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = "el addon Gravatar està instal·lat. Si us plau, desactiva el addon Gravatar.
El addon Libravatar tornarà a Gravatar si no es trova res a Libravatar."; +$a->strings["Submit"] = "Enviar"; +$a->strings["Default avatar image"] = "Imatge d'avatar per defecte"; +$a->strings["Select default avatar image if none was found. See README"] = "seleccionada la imatge d'avatar per defecte si no es trova cap altre. Veure README"; +$a->strings["Libravatar settings updated."] = "Ajustos de Libravatar actualitzats."; diff --git a/libravatar/lang/eo/messages.po b/libravatar/lang/eo/messages.po deleted file mode 100644 index 7dccdb84..00000000 --- a/libravatar/lang/eo/messages.po +++ /dev/null @@ -1,70 +0,0 @@ -# ADDON libravatar -# Copyright (C) -# This file is distributed under the same license as the Friendica libravatar addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 09:49+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: libravatar.php:68 -msgid "generic profile image" -msgstr "" - -#: libravatar.php:69 -msgid "random geometric pattern" -msgstr "" - -#: libravatar.php:70 -msgid "monster face" -msgstr "" - -#: libravatar.php:71 -msgid "computer generated face" -msgstr "" - -#: libravatar.php:72 -msgid "retro arcade style face" -msgstr "" - -#: libravatar.php:73 -msgid "roboter face" -msgstr "" - -#: libravatar.php:74 -msgid "retro adventure game character" -msgstr "" - -#: libravatar.php:78 -msgid "Information" -msgstr "" - -#: libravatar.php:78 -msgid "" -"Gravatar addon is installed. Please disable the Gravatar addon.
The " -"Libravatar addon will fall back to Gravatar if nothing was found at " -"Libravatar." -msgstr "" - -#: libravatar.php:83 -msgid "Save Settings" -msgstr "" - -#: libravatar.php:84 -msgid "Default avatar image" -msgstr "" - -#: libravatar.php:84 -msgid "Select default avatar image if none was found. See README" -msgstr "" diff --git a/libravatar/lang/eo/strings.php b/libravatar/lang/eo/strings.php index 68e8a64c..455f0e2a 100644 --- a/libravatar/lang/eo/strings.php +++ b/libravatar/lang/eo/strings.php @@ -1,7 +1,17 @@ -strings["Could NOT install Libravatar successfully.
It requires PHP >= 5.3"] = "NE SUKCESIS instali la bibliotekon Libravatar.
Ĝi bezonas PHP >= 5.3"; +$a->strings["generic profile image"] = "komuna profilbildo"; +$a->strings["random geometric pattern"] = "loteca geometria skemo"; +$a->strings["monster face"] = "monstrobildo"; +$a->strings["computer generated face"] = "komputita vizaĝo"; +$a->strings["retro arcade style face"] = "retrostila videoludstila vizaĝo"; +$a->strings["Warning"] = "Averto"; +$a->strings["Your PHP version %s is lower than the required PHP >= 5.3."] = "Via PHP versio %s estas malpli alta ol la bezonata PHP >= 5.3."; +$a->strings["This addon is not functional on your server."] = "Tiu ĉi kromprogramo ne funkcieblas je via servilo."; +$a->strings["Information"] = "Informo"; +$a->strings["Gravatar addon is installed. Please disable the Gravatar addon.
The Libravatar addon will fall back to Gravatar if nothing was found at Libravatar."] = "La Gravatar kromprogramo estas instalita. Bonvolu malŝalti la Gravatar kromprogramon.
'; - $output .= $this->addRow('Message', (string) $record['message']); - $output .= $this->addRow('Time', $this->formatDate($record['datetime'])); - $output .= $this->addRow('Channel', $record['channel']); - if ($record['context']) { + $output .= $this->addRow('Message', $record->message); + $output .= $this->addRow('Time', $this->formatDate($record->datetime)); + $output .= $this->addRow('Channel', $record->channel); + if (\count($record->context) > 0) { $embeddedTable = '
'; - foreach ($record['context'] as $key => $value) { + foreach ($record->context as $key => $value) { $embeddedTable .= $this->addRow((string) $key, $this->convertToString($value)); } $embeddedTable .= '
'; $output .= $this->addRow('Context', $embeddedTable, false); } - if ($record['extra']) { + if (\count($record->extra) > 0) { $embeddedTable = ''; - foreach ($record['extra'] as $key => $value) { + foreach ($record->extra as $key => $value) { $embeddedTable .= $this->addRow((string) $key, $this->convertToString($value)); } $embeddedTable .= '
'; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index b737d82e..b2fc5bcb 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -11,7 +11,9 @@ namespace Monolog\Formatter; +use Stringable; use Throwable; +use Monolog\LogRecord; /** * Encodes whatever record data is passed to it as json @@ -19,8 +21,6 @@ use Throwable; * This can be useful to log to databases or remote APIs * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger */ class JsonFormatter extends NormalizerFormatter { @@ -28,13 +28,13 @@ class JsonFormatter extends NormalizerFormatter public const BATCH_MODE_NEWLINES = 2; /** @var self::BATCH_MODE_* */ - protected $batchMode; - /** @var bool */ - protected $appendNewline; - /** @var bool */ - protected $ignoreEmptyContextAndExtra; - /** @var bool */ - protected $includeStacktraces = false; + protected int $batchMode; + + protected bool $appendNewline; + + protected bool $ignoreEmptyContextAndExtra; + + protected bool $includeStacktraces = false; /** * @param self::BATCH_MODE_* $batchMode @@ -70,11 +70,11 @@ class JsonFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record): string + public function format(LogRecord $record): string { - $normalized = $this->normalize($record); + $normalized = parent::format($record); if (isset($normalized['context']) && $normalized['context'] === []) { if ($this->ignoreEmptyContextAndExtra) { @@ -95,23 +95,16 @@ class JsonFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc */ public function formatBatch(array $records): string { - switch ($this->batchMode) { - case static::BATCH_MODE_NEWLINES: - return $this->formatBatchNewlines($records); - - case static::BATCH_MODE_JSON: - default: - return $this->formatBatchJson($records); - } + return match ($this->batchMode) { + static::BATCH_MODE_NEWLINES => $this->formatBatchNewlines($records), + default => $this->formatBatchJson($records), + }; } - /** - * @return self - */ public function includeStacktraces(bool $include = true): self { $this->includeStacktraces = $include; @@ -122,7 +115,7 @@ class JsonFormatter extends NormalizerFormatter /** * Return a JSON-encoded array of records. * - * @phpstan-param Record[] $records + * @phpstan-param LogRecord[] $records */ protected function formatBatchJson(array $records): string { @@ -133,30 +126,24 @@ class JsonFormatter extends NormalizerFormatter * Use new lines to separate records instead of a * JSON-encoded array. * - * @phpstan-param Record[] $records + * @phpstan-param LogRecord[] $records */ protected function formatBatchNewlines(array $records): string { - $instance = $this; - $oldNewline = $this->appendNewline; $this->appendNewline = false; - array_walk($records, function (&$value, $key) use ($instance) { - $value = $instance->format($value); - }); + $formatted = array_map(fn (LogRecord $record) => $this->format($record), $records); $this->appendNewline = $oldNewline; - return implode("\n", $records); + return implode("\n", $formatted); } /** * Normalizes given $data. * - * @param mixed $data - * - * @return mixed + * @return null|scalar|array|object */ - protected function normalize($data, int $depth = 0) + protected function normalize(mixed $data, int $depth = 0): mixed { if ($depth > $this->maxNormalizeDepth) { return 'Over '.$this->maxNormalizeDepth.' levels deep, aborting normalization'; @@ -192,7 +179,7 @@ class JsonFormatter extends NormalizerFormatter return $data; } - if (method_exists($data, '__toString')) { + if ($data instanceof Stringable) { return $data->__toString(); } @@ -210,7 +197,7 @@ class JsonFormatter extends NormalizerFormatter * Normalizes given exception with or without its own stack trace based on * `includeStacktraces` property. * - * {@inheritDoc} + * @inheritDoc */ protected function normalizeException(Throwable $e, int $depth = 0): array { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index e6e78983..19fb72c5 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -11,7 +11,9 @@ namespace Monolog\Formatter; +use Closure; use Monolog\Utils; +use Monolog\LogRecord; /** * Formats incoming records into a one-line string @@ -25,22 +27,16 @@ class LineFormatter extends NormalizerFormatter { public const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; - /** @var string */ - protected $format; - /** @var bool */ - protected $allowInlineLineBreaks; - /** @var bool */ - protected $ignoreEmptyContextAndExtra; - /** @var bool */ - protected $includeStacktraces; - /** @var ?callable */ - protected $stacktracesParser; + protected string $format; + protected bool $allowInlineLineBreaks; + protected bool $ignoreEmptyContextAndExtra; + protected bool $includeStacktraces; + protected Closure|null $stacktracesParser = null; /** - * @param string|null $format The format of the message - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries - * @param bool $ignoreEmptyContextAndExtra + * @param string|null $format The format of the message + * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format + * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries */ public function __construct(?string $format = null, ?string $dateFormat = null, bool $allowInlineLineBreaks = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = false) { @@ -51,7 +47,7 @@ class LineFormatter extends NormalizerFormatter parent::__construct($dateFormat); } - public function includeStacktraces(bool $include = true, ?callable $parser = null): self + public function includeStacktraces(bool $include = true, ?Closure $parser = null): self { $this->includeStacktraces = $include; if ($this->includeStacktraces) { @@ -77,14 +73,13 @@ class LineFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record): string + public function format(LogRecord $record): string { $vars = parent::format($record); $output = $this->format; - foreach ($vars['extra'] as $var => $val) { if (false !== strpos($output, '%extra.'.$var.'%')) { $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output); @@ -100,12 +95,12 @@ class LineFormatter extends NormalizerFormatter } if ($this->ignoreEmptyContextAndExtra) { - if (empty($vars['context'])) { + if (\count($vars['context']) === 0) { unset($vars['context']); $output = str_replace('%context%', '', $output); } - if (empty($vars['extra'])) { + if (\count($vars['extra']) === 0) { unset($vars['extra']); $output = str_replace('%extra%', '', $output); } @@ -122,6 +117,7 @@ class LineFormatter extends NormalizerFormatter $output = preg_replace('/%(?:extra|context)\..+?%/', '', $output); if (null === $output) { $pcreErrorCode = preg_last_error(); + throw new \RuntimeException('Failed to run preg_replace: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); } } @@ -151,11 +147,11 @@ class LineFormatter extends NormalizerFormatter { $str = $this->formatException($e); - if ($previous = $e->getPrevious()) { + if (($previous = $e->getPrevious()) instanceof \Throwable) { do { $depth++; if ($depth > $this->maxNormalizeDepth) { - $str .= "\n[previous exception] Over " . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; + $str .= '\n[previous exception] Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; break; } @@ -232,7 +228,7 @@ class LineFormatter extends NormalizerFormatter { $trace = $e->getTraceAsString(); - if ($this->stacktracesParser) { + if ($this->stacktracesParser !== null) { $trace = $this->stacktracesParserCustom($trace); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php index 29841aa3..5f0b6a45 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php @@ -11,6 +11,8 @@ namespace Monolog\Formatter; +use Monolog\LogRecord; + /** * Encodes message information into JSON in a format compatible with Loggly. * @@ -33,13 +35,13 @@ class LogglyFormatter extends JsonFormatter * @see https://www.loggly.com/docs/automated-parsing/#json * @see \Monolog\Formatter\JsonFormatter::format() */ - public function format(array $record): string + protected function normalizeRecord(LogRecord $record): array { - if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTimeInterface)) { - $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO"); - unset($record["datetime"]); - } + $recordData = parent::normalizeRecord($record); - return parent::format($record); + $recordData["timestamp"] = $record->datetime->format("Y-m-d\TH:i:s.uO"); + unset($recordData["datetime"]); + + return $recordData; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php index b0451aba..10ad0d9c 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogmaticFormatter.php @@ -11,6 +11,8 @@ namespace Monolog\Formatter; +use Monolog\LogRecord; + /** * Encodes message information into JSON in a format compatible with Logmatic. * @@ -20,15 +22,9 @@ class LogmaticFormatter extends JsonFormatter { protected const MARKERS = ["sourcecode", "php"]; - /** - * @var string - */ - protected $hostname = ''; + protected string $hostname = ''; - /** - * @var string - */ - protected $appname = ''; + protected string $appName = ''; public function setHostname(string $hostname): self { @@ -37,9 +33,9 @@ class LogmaticFormatter extends JsonFormatter return $this; } - public function setAppname(string $appname): self + public function setAppName(string $appName): self { - $this->appname = $appname; + $this->appName = $appName; return $this; } @@ -50,17 +46,19 @@ class LogmaticFormatter extends JsonFormatter * @see http://doc.logmatic.io/docs/basics-to-send-data * @see \Monolog\Formatter\JsonFormatter::format() */ - public function format(array $record): string + public function normalizeRecord(LogRecord $record): array { - if (!empty($this->hostname)) { + $record = parent::normalizeRecord($record); + + if ($this->hostname !== '') { $record["hostname"] = $this->hostname; } - if (!empty($this->appname)) { - $record["appname"] = $this->appname; + if ($this->appName !== '') { + $record["appname"] = $this->appName; } $record["@marker"] = static::MARKERS; - return parent::format($record); + return $record; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php index f8de0d33..d0e8749e 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php @@ -11,6 +11,8 @@ namespace Monolog\Formatter; +use Monolog\LogRecord; + /** * Serializes a log message to Logstash Event Format * @@ -24,22 +26,22 @@ class LogstashFormatter extends NormalizerFormatter /** * @var string the name of the system for the Logstash log message, used to fill the @source field */ - protected $systemName; + protected string $systemName; /** * @var string an application name for the Logstash log message, used to fill the @type field */ - protected $applicationName; + protected string $applicationName; /** * @var string the key for 'extra' fields from the Monolog record */ - protected $extraKey; + protected string $extraKey; /** * @var string the key for 'context' fields from the Monolog record */ - protected $contextKey; + protected string $contextKey; /** * @param string $applicationName The application that sends the data, used as the "type" field of logstash @@ -59,41 +61,38 @@ class LogstashFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc */ - public function format(array $record): string + public function format(LogRecord $record): string { - $record = parent::format($record); + $recordData = parent::format($record); - if (empty($record['datetime'])) { - $record['datetime'] = gmdate('c'); - } $message = [ - '@timestamp' => $record['datetime'], + '@timestamp' => $recordData['datetime'], '@version' => 1, 'host' => $this->systemName, ]; - if (isset($record['message'])) { - $message['message'] = $record['message']; + if (isset($recordData['message'])) { + $message['message'] = $recordData['message']; } - if (isset($record['channel'])) { - $message['type'] = $record['channel']; - $message['channel'] = $record['channel']; + if (isset($recordData['channel'])) { + $message['type'] = $recordData['channel']; + $message['channel'] = $recordData['channel']; } - if (isset($record['level_name'])) { - $message['level'] = $record['level_name']; + if (isset($recordData['level_name'])) { + $message['level'] = $recordData['level_name']; } - if (isset($record['level'])) { - $message['monolog_level'] = $record['level']; + if (isset($recordData['level'])) { + $message['monolog_level'] = $recordData['level']; } - if ($this->applicationName) { + if ('' !== $this->applicationName) { $message['type'] = $this->applicationName; } - if (!empty($record['extra'])) { - $message[$this->extraKey] = $record['extra']; + if (\count($recordData['extra']) > 0) { + $message[$this->extraKey] = $recordData['extra']; } - if (!empty($record['context'])) { - $message[$this->contextKey] = $record['context']; + if (\count($recordData['context']) > 0) { + $message[$this->contextKey] = $recordData['context']; } return $this->toJson($message) . "\n"; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php index fca69a89..a3bdd4f8 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php @@ -14,6 +14,7 @@ namespace Monolog\Formatter; use MongoDB\BSON\Type; use MongoDB\BSON\UTCDateTime; use Monolog\Utils; +use Monolog\LogRecord; /** * Formats a record for use with the MongoDBHandler. @@ -22,15 +23,12 @@ use Monolog\Utils; */ class MongoDBFormatter implements FormatterInterface { - /** @var bool */ - private $exceptionTraceAsString; - /** @var int */ - private $maxNestingLevel; - /** @var bool */ - private $isLegacyMongoExt; + private bool $exceptionTraceAsString; + private int $maxNestingLevel; + private bool $isLegacyMongoExt; /** - * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2 + * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record->context is 2 * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings */ public function __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsString = true) @@ -42,20 +40,20 @@ class MongoDBFormatter implements FormatterInterface } /** - * {@inheritDoc} + * @inheritDoc * * @return mixed[] */ - public function format(array $record): array + public function format(LogRecord $record): array { /** @var mixed[] $res */ - $res = $this->formatArray($record); + $res = $this->formatArray($record->toArray()); return $res; } /** - * {@inheritDoc} + * @inheritDoc * * @return array */ diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index f926a842..1323587b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -14,6 +14,7 @@ namespace Monolog\Formatter; use Monolog\DateTimeImmutable; use Monolog\Utils; use Throwable; +use Monolog\LogRecord; /** * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets @@ -24,15 +25,11 @@ class NormalizerFormatter implements FormatterInterface { public const SIMPLE_DATE = "Y-m-d\TH:i:sP"; - /** @var string */ - protected $dateFormat; - /** @var int */ - protected $maxNormalizeDepth = 9; - /** @var int */ - protected $maxNormalizeItemCount = 1000; + protected string $dateFormat; + protected int $maxNormalizeDepth = 9; + protected int $maxNormalizeItemCount = 1000; - /** @var int */ - private $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS; + private int $jsonEncodeOptions = Utils::DEFAULT_JSON_FLAGS; /** * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format @@ -46,17 +43,25 @@ class NormalizerFormatter implements FormatterInterface } /** - * {@inheritDoc} - * - * @param mixed[] $record + * @inheritDoc */ - public function format(array $record) + public function format(LogRecord $record) { - return $this->normalize($record); + return $this->normalizeRecord($record); } /** - * {@inheritDoc} + * Normalize an arbitrary value to a scalar|array|null + * + * @return null|scalar|array + */ + public function normalizeValue(mixed $data): mixed + { + return $this->normalize($data); + } + + /** + * @inheritDoc */ public function formatBatch(array $records) { @@ -124,10 +129,25 @@ class NormalizerFormatter implements FormatterInterface } /** - * @param mixed $data - * @return null|scalar|array + * Provided as extension point + * + * Because normalize is called with sub-values of context data etc, normalizeRecord can be + * extended when data needs to be appended on the record array but not to other normalized data. + * + * @return array */ - protected function normalize($data, int $depth = 0) + protected function normalizeRecord(LogRecord $record): array + { + /** @var array $normalized */ + $normalized = $this->normalize($record->toArray()); + + return $normalized; + } + + /** + * @return null|scalar|array + */ + protected function normalize(mixed $data, int $depth = 0): mixed { if ($depth > $this->maxNormalizeDepth) { return 'Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; @@ -172,17 +192,14 @@ class NormalizerFormatter implements FormatterInterface } if ($data instanceof \JsonSerializable) { - /** @var null|scalar|array $value */ + /** @var null|scalar|array $value */ $value = $data->jsonSerialize(); - } elseif (\get_class($data) === '__PHP_Incomplete_Class') { - $accessor = new \ArrayObject($data); - $value = (string) $accessor['__PHP_Incomplete_Class_Name']; } elseif (method_exists($data, '__toString')) { /** @var string $value */ $value = $data->__toString(); } else { // the rest is normalized by json encoding and decoding it - /** @var null|scalar|array $value */ + /** @var null|scalar|array $value */ $value = json_decode($this->toJson($data, true), true); } @@ -236,12 +253,12 @@ class NormalizerFormatter implements FormatterInterface $trace = $e->getTrace(); foreach ($trace as $frame) { - if (isset($frame['file'])) { + if (isset($frame['file'], $frame['line'])) { $data['trace'][] = $frame['file'].':'.$frame['line']; } } - if ($previous = $e->getPrevious()) { + if (($previous = $e->getPrevious()) instanceof \Throwable) { $data['previous'] = $this->normalizeException($previous, $depth + 1); } @@ -260,10 +277,7 @@ class NormalizerFormatter implements FormatterInterface return Utils::jsonEncode($data, $this->jsonEncodeOptions, $ignoreErrors); } - /** - * @return string - */ - protected function formatDate(\DateTimeInterface $date) + protected function formatDate(\DateTimeInterface $date): string { // in case the date format isn't custom then we defer to the custom DateTimeImmutable // formatting logic, which will pick the right format based on whether useMicroseconds is on diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php index 187bc550..4bc20a08 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php @@ -11,8 +11,10 @@ namespace Monolog\Formatter; +use Monolog\LogRecord; + /** - * Formats data into an associative array of scalar values. + * Formats data into an associative array of scalar (+ null) values. * Objects and arrays will be JSON encoded. * * @author Andrew Lawson @@ -20,25 +22,21 @@ namespace Monolog\Formatter; class ScalarFormatter extends NormalizerFormatter { /** - * {@inheritDoc} + * @inheritDoc * * @phpstan-return array $record */ - public function format(array $record): array + public function format(LogRecord $record): array { $result = []; - foreach ($record as $key => $value) { - $result[$key] = $this->normalizeValue($value); + foreach ($record->toArray() as $key => $value) { + $result[$key] = $this->toScalar($value); } return $result; } - /** - * @param mixed $value - * @return scalar|null - */ - protected function normalizeValue($value) + protected function toScalar(mixed $value): string|int|float|bool|null { $normalized = $this->normalize($value); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php new file mode 100644 index 00000000..6ed7e92e --- /dev/null +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/SyslogFormatter.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Level; +use Monolog\LogRecord; + +/** + * Serializes a log message according to RFC 5424 + * + * @author Dalibor Karlović + * @author Renat Gabdullin + */ +class SyslogFormatter extends LineFormatter +{ + private const SYSLOG_FACILITY_USER = 1; + private const FORMAT = "<%extra.priority%>1 %datetime% %extra.hostname% %extra.app-name% %extra.procid% %channel% %extra.structured-data% %level_name%: %message% %context% %extra%\n"; + private const NILVALUE = '-'; + + private string $hostname; + private int $procid; + + public function __construct(private string $applicationName = self::NILVALUE) + { + parent::__construct(self::FORMAT, 'Y-m-d\TH:i:s.uP', true, true); + $this->hostname = (string) gethostname(); + $this->procid = (int) getmypid(); + } + + public function format(LogRecord $record): string + { + $record->extra = $this->formatExtra($record); + + return parent::format($record); + } + + /** + * @param LogRecord $record + * @return array + */ + private function formatExtra(LogRecord $record): array + { + $extra = $record->extra; + $extra['app-name'] = $this->applicationName; + $extra['hostname'] = $this->hostname; + $extra['procid'] = $this->procid; + $extra['priority'] = self::calculatePriority($record->level); + $extra['structured-data'] = self::NILVALUE; + + return $extra; + } + + private static function calculatePriority(Level $level): int + { + return (self::SYSLOG_FACILITY_USER * 8) + $level->toRFC5424Level(); + } +} diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php index 6539b347..8ef7b7d1 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php @@ -11,7 +11,8 @@ namespace Monolog\Formatter; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Serializes a log message according to Wildfire's header requirements @@ -19,27 +20,9 @@ use Monolog\Logger; * @author Eric Clemmons (@ericclemmons) * @author Christophe Coevoet * @author Kirill chEbba Chebunin - * - * @phpstan-import-type Level from \Monolog\Logger */ class WildfireFormatter extends NormalizerFormatter { - /** - * Translates Monolog log levels to Wildfire levels. - * - * @var array - */ - private $logLevels = [ - Logger::DEBUG => 'LOG', - Logger::INFO => 'INFO', - Logger::NOTICE => 'INFO', - Logger::WARNING => 'WARN', - Logger::ERROR => 'ERROR', - Logger::CRITICAL => 'ERROR', - Logger::ALERT => 'ERROR', - Logger::EMERGENCY => 'ERROR', - ]; - /** * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format */ @@ -52,46 +35,61 @@ class WildfireFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * Translates Monolog log levels to Wildfire levels. * - * @return string + * @return 'LOG'|'INFO'|'WARN'|'ERROR' */ - public function format(array $record): string + private function toWildfireLevel(Level $level): string + { + return match ($level) { + Level::Debug => 'LOG', + Level::Info => 'INFO', + Level::Notice => 'INFO', + Level::Warning => 'WARN', + Level::Error => 'ERROR', + Level::Critical => 'ERROR', + Level::Alert => 'ERROR', + Level::Emergency => 'ERROR', + }; + } + + /** + * @inheritDoc + */ + public function format(LogRecord $record): string { // Retrieve the line and file if set and remove them from the formatted extra $file = $line = ''; - if (isset($record['extra']['file'])) { - $file = $record['extra']['file']; - unset($record['extra']['file']); + if (isset($record->extra['file'])) { + $file = $record->extra['file']; + unset($record->extra['file']); } - if (isset($record['extra']['line'])) { - $line = $record['extra']['line']; - unset($record['extra']['line']); + if (isset($record->extra['line'])) { + $line = $record->extra['line']; + unset($record->extra['line']); } - /** @var mixed[] $record */ - $record = $this->normalize($record); - $message = ['message' => $record['message']]; + $message = ['message' => $record->message]; $handleError = false; - if ($record['context']) { - $message['context'] = $record['context']; + if (count($record->context) > 0) { + $message['context'] = $this->normalize($record->context); $handleError = true; } - if ($record['extra']) { - $message['extra'] = $record['extra']; + if (count($record->extra) > 0) { + $message['extra'] = $this->normalize($record->extra); $handleError = true; } if (count($message) === 1) { $message = reset($message); } - if (isset($record['context']['table'])) { + if (is_array($message) && isset($message['context']['table'])) { $type = 'TABLE'; - $label = $record['channel'] .': '. $record['message']; - $message = $record['context']['table']; + $label = $record->channel .': '. $record->message; + $message = $message['context']['table']; } else { - $type = $this->logLevels[$record['level']]; - $label = $record['channel']; + $type = $this->toWildfireLevel($record->level); + $label = $record->channel; } // Create JSON object describing the appearance of the message in the console @@ -114,7 +112,7 @@ class WildfireFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc * * @phpstan-return never */ @@ -124,11 +122,11 @@ class WildfireFormatter extends NormalizerFormatter } /** - * {@inheritDoc} + * @inheritDoc * - * @return null|scalar|array|object + * @return null|scalar|array|object */ - protected function normalize($data, int $depth = 0) + protected function normalize(mixed $data, int $depth = 0): mixed { if (is_object($data) && !$data instanceof \DateTimeInterface) { return $data; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php index a5cdaa71..3399a54e 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php @@ -11,55 +11,50 @@ namespace Monolog\Handler; +use Monolog\Level; use Monolog\Logger; use Monolog\ResettableInterface; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Base Handler class providing basic level/bubble support * * @author Jordi Boggiano - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ abstract class AbstractHandler extends Handler implements ResettableInterface { - /** - * @var int - * @phpstan-var Level - */ - protected $level = Logger::DEBUG; - /** @var bool */ - protected $bubble = true; + protected Level $level = Level::Debug; + protected bool $bubble = true; /** - * @param int|string $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|string|Level|LogLevel::* $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function __construct($level = Logger::DEBUG, bool $bubble = true) + public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true) { $this->setLevel($level); $this->bubble = $bubble; } /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { - return $record['level'] >= $this->level; + return $record->level->value >= $this->level->value; } /** * Sets minimum logging level at which this handler will be triggered. * - * @param Level|LevelName|LogLevel::* $level Level or level name - * @return self + * @param Level|LogLevel::* $level Level or level name + * + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function setLevel($level): self + public function setLevel(int|string|Level $level): self { $this->level = Logger::toMonologLevel($level); @@ -68,12 +63,8 @@ abstract class AbstractHandler extends Handler implements ResettableInterface /** * Gets minimum logging level at which this handler will be triggered. - * - * @return int - * - * @phpstan-return Level */ - public function getLevel(): int + public function getLevel(): Level { return $this->level; } @@ -81,9 +72,8 @@ abstract class AbstractHandler extends Handler implements ResettableInterface /** * Sets the bubbling behavior. * - * @param bool $bubble true means that this handler allows bubbling. - * false means that bubbling is not permitted. - * @return self + * @param bool $bubble true means that this handler allows bubbling. + * false means that bubbling is not permitted. */ public function setBubble(bool $bubble): self { @@ -104,9 +94,9 @@ abstract class AbstractHandler extends Handler implements ResettableInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function reset() + public function reset(): void { } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php index 77e533fc..de13a76b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php @@ -11,6 +11,8 @@ namespace Monolog\Handler; +use Monolog\LogRecord; + /** * Base Handler class providing the Handler structure, including processors and formatters * @@ -18,11 +20,6 @@ namespace Monolog\Handler; * * @author Jordi Boggiano * @author Christophe Coevoet - * - * @phpstan-import-type LevelName from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-type FormattedRecord array{message: string, context: mixed[], level: Level, level_name: LevelName, channel: string, datetime: \DateTimeImmutable, extra: mixed[], formatted: mixed} */ abstract class AbstractProcessingHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface { @@ -30,20 +27,19 @@ abstract class AbstractProcessingHandler extends AbstractHandler implements Proc use FormattableHandlerTrait; /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { if (!$this->isHandling($record)) { return false; } - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } - $record['formatted'] = $this->getFormatter()->format($record); + $record->formatted = $this->getFormatter()->format($record); $this->write($record); @@ -51,16 +47,11 @@ abstract class AbstractProcessingHandler extends AbstractHandler implements Proc } /** - * Writes the record down to the log of the implementing handler - * - * @phpstan-param FormattedRecord $record + * Writes the (already formatted) record down to the log of the implementing handler */ - abstract protected function write(array $record): void; + abstract protected function write(LogRecord $record): void; - /** - * @return void - */ - public function reset() + public function reset(): void { parent::reset(); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php index 5e5ad1c1..695a1c07 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php @@ -11,70 +11,59 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LineFormatter; /** * Common syslog functionality - * - * @phpstan-import-type Level from \Monolog\Logger */ abstract class AbstractSyslogHandler extends AbstractProcessingHandler { - /** @var int */ - protected $facility; - - /** - * Translates Monolog log levels to syslog log priorities. - * @var array - * @phpstan-var array - */ - protected $logLevels = [ - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::NOTICE => LOG_NOTICE, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - Logger::EMERGENCY => LOG_EMERG, - ]; + protected int $facility; /** * List of valid log facility names. * @var array */ - protected $facilities = [ - 'auth' => LOG_AUTH, - 'authpriv' => LOG_AUTHPRIV, - 'cron' => LOG_CRON, - 'daemon' => LOG_DAEMON, - 'kern' => LOG_KERN, - 'lpr' => LOG_LPR, - 'mail' => LOG_MAIL, - 'news' => LOG_NEWS, - 'syslog' => LOG_SYSLOG, - 'user' => LOG_USER, - 'uucp' => LOG_UUCP, + protected array $facilities = [ + 'auth' => \LOG_AUTH, + 'authpriv' => \LOG_AUTHPRIV, + 'cron' => \LOG_CRON, + 'daemon' => \LOG_DAEMON, + 'kern' => \LOG_KERN, + 'lpr' => \LOG_LPR, + 'mail' => \LOG_MAIL, + 'news' => \LOG_NEWS, + 'syslog' => \LOG_SYSLOG, + 'user' => \LOG_USER, + 'uucp' => \LOG_UUCP, ]; + /** + * Translates Monolog log levels to syslog log priorities. + */ + protected function toSyslogPriority(Level $level): int + { + return $level->toRFC5424Level(); + } + /** * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant */ - public function __construct($facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(string|int $facility = \LOG_USER, int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->facilities['local0'] = LOG_LOCAL0; - $this->facilities['local1'] = LOG_LOCAL1; - $this->facilities['local2'] = LOG_LOCAL2; - $this->facilities['local3'] = LOG_LOCAL3; - $this->facilities['local4'] = LOG_LOCAL4; - $this->facilities['local5'] = LOG_LOCAL5; - $this->facilities['local6'] = LOG_LOCAL6; - $this->facilities['local7'] = LOG_LOCAL7; + $this->facilities['local0'] = \LOG_LOCAL0; + $this->facilities['local1'] = \LOG_LOCAL1; + $this->facilities['local2'] = \LOG_LOCAL2; + $this->facilities['local3'] = \LOG_LOCAL3; + $this->facilities['local4'] = \LOG_LOCAL4; + $this->facilities['local5'] = \LOG_LOCAL5; + $this->facilities['local6'] = \LOG_LOCAL6; + $this->facilities['local7'] = \LOG_LOCAL7; } else { $this->facilities['local0'] = 128; // LOG_LOCAL0 $this->facilities['local1'] = 136; // LOG_LOCAL1 @@ -97,7 +86,7 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php index 994872ce..b25e4f13 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php @@ -11,24 +11,38 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\JsonFormatter; use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Channel\AMQPChannel; use AMQPExchange; +use Monolog\LogRecord; -/** - * @phpstan-import-type Record from \Monolog\Logger - */ class AmqpHandler extends AbstractProcessingHandler { - /** - * @var AMQPExchange|AMQPChannel $exchange - */ - protected $exchange; + protected AMQPExchange|AMQPChannel $exchange; + /** @var array */ - private $extraAttributes = []; + private array $extraAttributes = []; + + protected string $exchangeName; + + /** + * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use + * @param string|null $exchangeName Optional exchange name, for AMQPChannel (PhpAmqpLib) only + */ + public function __construct(AMQPExchange|AMQPChannel $exchange, ?string $exchangeName = null, int|string|Level $level = Level::Debug, bool $bubble = true) + { + if ($exchange instanceof AMQPChannel) { + $this->exchangeName = (string) $exchangeName; + } elseif ($exchangeName !== null) { + @trigger_error('The $exchangeName parameter can only be passed when using PhpAmqpLib, if using an AMQPExchange instance configure it beforehand', E_USER_DEPRECATED); + } + $this->exchange = $exchange; + + parent::__construct($level, $bubble); + } /** * @return array @@ -45,7 +59,7 @@ class AmqpHandler extends AbstractProcessingHandler * message_id, user_id, app_id, delivery_mode, * priority, timestamp, expiration, type * or reply_to, headers. - * @return AmqpHandler + * @return $this */ public function setExtraAttributes(array $extraAttributes): self { @@ -54,34 +68,11 @@ class AmqpHandler extends AbstractProcessingHandler } /** - * @var string + * @inheritDoc */ - protected $exchangeName; - - /** - * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use - * @param string|null $exchangeName Optional exchange name, for AMQPChannel (PhpAmqpLib) only - */ - public function __construct($exchange, ?string $exchangeName = null, $level = Logger::DEBUG, bool $bubble = true) + protected function write(LogRecord $record): void { - if ($exchange instanceof AMQPChannel) { - $this->exchangeName = (string) $exchangeName; - } elseif (!$exchange instanceof AMQPExchange) { - throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required'); - } elseif ($exchangeName) { - @trigger_error('The $exchangeName parameter can only be passed when using PhpAmqpLib, if using an AMQPExchange instance configure it beforehand', E_USER_DEPRECATED); - } - $this->exchange = $exchange; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record): void - { - $data = $record["formatted"]; + $data = $record->formatted; $routingKey = $this->getRoutingKey($record); if ($this->exchange instanceof AMQPExchange) { @@ -89,7 +80,7 @@ class AmqpHandler extends AbstractProcessingHandler 'delivery_mode' => 2, 'content_type' => 'application/json', ]; - if ($this->extraAttributes) { + if (\count($this->extraAttributes) > 0) { $attributes = array_merge($attributes, $this->extraAttributes); } $this->exchange->publish( @@ -108,7 +99,7 @@ class AmqpHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { @@ -123,7 +114,6 @@ class AmqpHandler extends AbstractProcessingHandler continue; } - /** @var Record $record */ $record = $this->processRecord($record); $data = $this->getFormatter()->format($record); @@ -139,30 +129,27 @@ class AmqpHandler extends AbstractProcessingHandler /** * Gets the routing key for the AMQP exchange - * - * @phpstan-param Record $record */ - protected function getRoutingKey(array $record): string + protected function getRoutingKey(LogRecord $record): string { - $routingKey = sprintf('%s.%s', $record['level_name'], $record['channel']); + $routingKey = sprintf('%s.%s', $record->level->name, $record->channel); return strtolower($routingKey); } private function createAmqpMessage(string $data): AMQPMessage { - $attributes = [ - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ]; - if ($this->extraAttributes) { - $attributes = array_merge($attributes, $this->extraAttributes); - } - return new AMQPMessage($data, $attributes); + return new AMQPMessage( + $data, + [ + 'delivery_mode' => 2, + 'content_type' => 'application/json', + ] + ); } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 95bbfed4..28564b3f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -14,35 +14,30 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LineFormatter; use Monolog\Utils; -use Monolog\Logger; +use Monolog\LogRecord; use function count; use function headers_list; use function stripos; -use function trigger_error; - -use const E_USER_DEPRECATED; /** * Handler sending logs to browser's javascript console with no browser extension required * * @author Olivier Poitrey - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class BrowserConsoleHandler extends AbstractProcessingHandler { - /** @var bool */ - protected static $initialized = false; - /** @var FormattedRecord[] */ - protected static $records = []; + protected static bool $initialized = false; + + /** @var LogRecord[] */ + protected static array $records = []; protected const FORMAT_HTML = 'html'; protected const FORMAT_JS = 'js'; protected const FORMAT_UNKNOWN = 'unknown'; /** - * {@inheritDoc} + * @inheritDoc * * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format. * @@ -56,9 +51,9 @@ class BrowserConsoleHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { // Accumulate records static::$records[] = $record; @@ -81,11 +76,11 @@ class BrowserConsoleHandler extends AbstractProcessingHandler return; } - if (count(static::$records)) { + if (count(static::$records) > 0) { if ($format === self::FORMAT_HTML) { - static::writeOutput(''); - } elseif ($format === self::FORMAT_JS) { - static::writeOutput(static::generateScript()); + static::writeOutput(''); + } else { // js format + static::writeOutput(self::generateScript()); } static::resetStatic(); } @@ -96,7 +91,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler self::resetStatic(); } - public function reset() + public function reset(): void { parent::reset(); @@ -174,18 +169,18 @@ class BrowserConsoleHandler extends AbstractProcessingHandler { $script = []; foreach (static::$records as $record) { - $context = static::dump('Context', $record['context']); - $extra = static::dump('Extra', $record['extra']); + $context = self::dump('Context', $record->context); + $extra = self::dump('Extra', $record->extra); - if (empty($context) && empty($extra)) { - $script[] = static::call_array(static::getConsoleMethodForLevel($record['level']), static::handleStyles($record['formatted'])); + if (\count($context) === 0 && \count($extra) === 0) { + $script[] = self::call_array('log', self::handleStyles($record->formatted)); } else { $script = array_merge( $script, - [static::call_array('groupCollapsed', static::handleStyles($record['formatted']))], + [self::call_array('groupCollapsed', self::handleStyles($record->formatted))], $context, $extra, - [static::call('groupEnd')] + [self::call('groupEnd')] ); } } @@ -193,20 +188,6 @@ class BrowserConsoleHandler extends AbstractProcessingHandler return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; } - private static function getConsoleMethodForLevel(int $level): string - { - return [ - Logger::DEBUG => 'debug', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warn', - Logger::ERROR => 'error', - Logger::CRITICAL => 'error', - Logger::ALERT => 'error', - Logger::EMERGENCY => 'error', - ][$level] ?? 'log'; - } - /** * @return string[] */ @@ -218,14 +199,14 @@ class BrowserConsoleHandler extends AbstractProcessingHandler foreach (array_reverse($matches) as $match) { $args[] = '"font-weight: normal"'; - $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); + $args[] = self::quote(self::handleCustomStyles($match[2][0], $match[1][0])); $pos = $match[0][1]; $format = Utils::substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . Utils::substr($format, $pos + strlen($match[0][0])); } - $args[] = static::quote('font-weight: normal'); - $args[] = static::quote($format); + $args[] = self::quote('font-weight: normal'); + $args[] = self::quote($format); return array_reverse($args); } @@ -251,6 +232,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler if (null === $style) { $pcreErrorCode = preg_last_error(); + throw new \RuntimeException('Failed to run preg_replace_callback: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); } @@ -265,16 +247,16 @@ class BrowserConsoleHandler extends AbstractProcessingHandler { $script = []; $dict = array_filter($dict); - if (empty($dict)) { + if (\count($dict) === 0) { return $script; } - $script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title)); + $script[] = self::call('log', self::quote('%c%s'), self::quote('font-weight: bold'), self::quote($title)); foreach ($dict as $key => $value) { $value = json_encode($value); if (empty($value)) { - $value = static::quote(''); + $value = self::quote(''); } - $script[] = static::call('log', static::quote('%s: %o'), static::quote((string) $key), $value); + $script[] = self::call('log', self::quote('%s: %o'), self::quote((string) $key), $value); } return $script; @@ -295,7 +277,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler throw new \UnexpectedValueException('Expected the first arg to be a string, got: '.var_export($method, true)); } - return static::call_array($method, $args); + return self::call_array($method, $args); } /** diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php index fcce5d63..ff89faa8 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php @@ -11,9 +11,10 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\ResettableInterface; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Buffers all records until closing the handler and then pass them as batch. @@ -22,32 +23,30 @@ use Monolog\Formatter\FormatterInterface; * sending one per log message. * * @author Christophe Coevoet - * - * @phpstan-import-type Record from \Monolog\Logger */ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface { use ProcessableHandlerTrait; - /** @var HandlerInterface */ - protected $handler; - /** @var int */ - protected $bufferSize = 0; - /** @var int */ - protected $bufferLimit; - /** @var bool */ - protected $flushOnOverflow; - /** @var Record[] */ - protected $buffer = []; - /** @var bool */ - protected $initialized = false; + protected HandlerInterface $handler; + + protected int $bufferSize = 0; + + protected int $bufferLimit; + + protected bool $flushOnOverflow; + + /** @var LogRecord[] */ + protected array $buffer = []; + + protected bool $initialized = false; /** * @param HandlerInterface $handler Handler. * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded */ - public function __construct(HandlerInterface $handler, int $bufferLimit = 0, $level = Logger::DEBUG, bool $bubble = true, bool $flushOnOverflow = false) + public function __construct(HandlerInterface $handler, int $bufferLimit = 0, int|string|Level $level = Level::Debug, bool $bubble = true, bool $flushOnOverflow = false) { parent::__construct($level, $bubble); $this->handler = $handler; @@ -56,11 +55,11 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - if ($record['level'] < $this->level) { + if ($record->level->isLowerThan($this->level)) { return false; } @@ -79,8 +78,7 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa } } - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } @@ -108,7 +106,7 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { @@ -126,7 +124,7 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa $this->buffer = []; } - public function reset() + public function reset(): void { $this->flush(); @@ -140,7 +138,7 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -154,7 +152,7 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php index 234ecf61..3742d47d 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php @@ -13,8 +13,10 @@ namespace Monolog\Handler; use Monolog\Formatter\ChromePHPFormatter; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; +use Monolog\DateTimeImmutable; /** * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) @@ -22,8 +24,6 @@ use Monolog\Utils; * This also works out of the box with Firefox 43+ * * @author Christophe Coevoet - * - * @phpstan-import-type Record from \Monolog\Logger */ class ChromePHPHandler extends AbstractProcessingHandler { @@ -44,29 +44,25 @@ class ChromePHPHandler extends AbstractProcessingHandler */ protected const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; - /** @var bool */ - protected static $initialized = false; + protected static bool $initialized = false; /** * Tracks whether we sent too much data * * Chrome limits the headers to 4KB, so when we sent 3KB we stop sending - * - * @var bool */ - protected static $overflowed = false; + protected static bool $overflowed = false; /** @var mixed[] */ - protected static $json = [ + protected static array $json = [ 'version' => self::VERSION, 'columns' => ['label', 'log', 'backtrace', 'type'], 'rows' => [], ]; - /** @var bool */ - protected static $sendHeaders = true; + protected static bool $sendHeaders = true; - public function __construct($level = Logger::DEBUG, bool $bubble = true) + public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); if (!function_exists('json_encode')) { @@ -75,7 +71,7 @@ class ChromePHPHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { @@ -86,15 +82,15 @@ class ChromePHPHandler extends AbstractProcessingHandler $messages = []; foreach ($records as $record) { - if ($record['level'] < $this->level) { + if ($record->level < $this->level) { continue; } - /** @var Record $message */ + $message = $this->processRecord($record); $messages[] = $message; } - if (!empty($messages)) { + if (\count($messages) > 0) { $messages = $this->getFormatter()->formatBatch($messages); self::$json['rows'] = array_merge(self::$json['rows'], $messages); $this->send(); @@ -102,7 +98,7 @@ class ChromePHPHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { @@ -115,13 +111,13 @@ class ChromePHPHandler extends AbstractProcessingHandler * @see sendHeader() * @see send() */ - protected function write(array $record): void + protected function write(LogRecord $record): void { if (!$this->isWebRequest()) { return; } - self::$json['rows'][] = $record['formatted']; + self::$json['rows'][] = $record->formatted; $this->send(); } @@ -153,15 +149,12 @@ class ChromePHPHandler extends AbstractProcessingHandler if (strlen($data) > 3 * 1024) { self::$overflowed = true; - $record = [ - 'message' => 'Incomplete logs, chrome header size limit reached', - 'context' => [], - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'monolog', - 'datetime' => new \DateTimeImmutable(), - 'extra' => [], - ]; + $record = new LogRecord( + message: 'Incomplete logs, chrome header size limit reached', + level: Level::Warning, + channel: 'monolog', + datetime: new DateTimeImmutable(true), + ); self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); $json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true); $data = base64_encode($json); @@ -187,7 +180,7 @@ class ChromePHPHandler extends AbstractProcessingHandler */ protected function headersAccepted(): bool { - if (empty($_SERVER['HTTP_USER_AGENT'])) { + if (!isset($_SERVER['HTTP_USER_AGENT'])) { return false; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php index 52657613..8d9c10e7 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php @@ -13,22 +13,42 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\JsonFormatter; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * CouchDB handler * * @author Markus Bachmann + * @phpstan-type Options array{ + * host: string, + * port: int, + * dbname: string, + * username: string|null, + * password: string|null + * } + * @phpstan-type InputOptions array{ + * host?: string, + * port?: int, + * dbname?: string, + * username?: string|null, + * password?: string|null + * } */ class CouchDBHandler extends AbstractProcessingHandler { - /** @var mixed[] */ - private $options; + /** + * @var mixed[] + * @phpstan-var Options + */ + private array $options; /** * @param mixed[] $options + * + * @phpstan-param InputOptions $options */ - public function __construct(array $options = [], $level = Logger::DEBUG, bool $bubble = true) + public function __construct(array $options = [], int|string|Level $level = Level::Debug, bool $bubble = true) { $this->options = array_merge([ 'host' => 'localhost', @@ -42,12 +62,12 @@ class CouchDBHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { $basicAuth = null; - if ($this->options['username']) { + if (null !== $this->options['username'] && null !== $this->options['password']) { $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']); } @@ -55,7 +75,7 @@ class CouchDBHandler extends AbstractProcessingHandler $context = stream_context_create([ 'http' => [ 'method' => 'POST', - 'content' => $record['formatted'], + 'content' => $record->formatted, 'ignore_errors' => true, 'max_redirects' => 0, 'header' => 'Content-type: application/json', @@ -68,7 +88,7 @@ class CouchDBHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php index 3535a4fc..8388f5ad 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php @@ -11,8 +11,9 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Logs to Cube. @@ -23,18 +24,13 @@ use Monolog\Utils; */ class CubeHandler extends AbstractProcessingHandler { - /** @var resource|\Socket|null */ - private $udpConnection = null; - /** @var resource|\CurlHandle|null */ - private $httpConnection = null; - /** @var string */ - private $scheme; - /** @var string */ - private $host; - /** @var int */ - private $port; + private ?\Socket $udpConnection = null; + private ?\CurlHandle $httpConnection = null; + private string $scheme; + private string $host; + private int $port; /** @var string[] */ - private $acceptedSchemes = ['http', 'udp']; + private array $acceptedSchemes = ['http', 'udp']; /** * Create a Cube handler @@ -43,7 +39,7 @@ class CubeHandler extends AbstractProcessingHandler * A valid url must consist of three parts : protocol://host:port * Only valid protocols used by Cube are http and udp */ - public function __construct(string $url, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(string $url, int|string|Level $level = Level::Debug, bool $bubble = true) { $urlInfo = parse_url($url); @@ -51,7 +47,7 @@ class CubeHandler extends AbstractProcessingHandler throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); } - if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) { + if (!in_array($urlInfo['scheme'], $this->acceptedSchemes, true)) { throw new \UnexpectedValueException( 'Invalid protocol (' . $urlInfo['scheme'] . ').' . ' Valid options are ' . implode(', ', $this->acceptedSchemes) @@ -60,7 +56,7 @@ class CubeHandler extends AbstractProcessingHandler $this->scheme = $urlInfo['scheme']; $this->host = $urlInfo['host']; - $this->port = (int) $urlInfo['port']; + $this->port = $urlInfo['port']; parent::__construct($level, $bubble); } @@ -111,24 +107,24 @@ class CubeHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $date = $record['datetime']; + $date = $record->datetime; $data = ['time' => $date->format('Y-m-d\TH:i:s.uO')]; - unset($record['datetime']); + $context = $record->context; - if (isset($record['context']['type'])) { - $data['type'] = $record['context']['type']; - unset($record['context']['type']); + if (isset($context['type'])) { + $data['type'] = $context['type']; + unset($context['type']); } else { - $data['type'] = $record['channel']; + $data['type'] = $record->channel; } - $data['data'] = $record['context']; - $data['data']['level'] = $record['level']; + $data['data'] = $context; + $data['data']['level'] = $record->level; if ($this->scheme === 'http') { $this->writeHttp(Utils::jsonEncode($data)); @@ -139,16 +135,20 @@ class CubeHandler extends AbstractProcessingHandler private function writeUdp(string $data): void { - if (!$this->udpConnection) { + if (null === $this->udpConnection) { $this->connectUdp(); } + if (null === $this->udpConnection) { + throw new \LogicException('No UDP socket could be opened'); + } + socket_send($this->udpConnection, $data, strlen($data), 0); } private function writeHttp(string $data): void { - if (!$this->httpConnection) { + if (null === $this->httpConnection) { $this->connectHttp(); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php index 7213e8ee..4decf0e6 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php @@ -21,7 +21,7 @@ use CurlHandle; final class Util { /** @var array */ - private static $retriableErrorCodes = [ + private static array $retriableErrorCodes = [ CURLE_COULDNT_RESOLVE_HOST, CURLE_COULDNT_CONNECT, CURLE_HTTP_NOT_FOUND, @@ -34,19 +34,17 @@ final class Util /** * Executes a CURL request with optional retries and exception on failure * - * @param resource|CurlHandle $ch curl handler - * @param int $retries - * @param bool $closeAfterDone - * @return bool|string @see curl_exec + * @param CurlHandle $ch curl handler + * @return bool|string @see curl_exec */ - public static function execute($ch, int $retries = 5, bool $closeAfterDone = true) + public static function execute(CurlHandle $ch, int $retries = 5, bool $closeAfterDone = true) { while ($retries--) { $curlResponse = curl_exec($ch); if ($curlResponse === false) { $curlErrno = curl_errno($ch); - if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) { + if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || $retries === 0) { $curlError = curl_error($ch); if ($closeAfterDone) { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php index 9b85ae7e..35549121 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php @@ -11,8 +11,10 @@ namespace Monolog\Handler; +use Monolog\Level; use Monolog\Logger; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Simple handler wrapper that deduplicates log records across multiple requests @@ -33,45 +35,29 @@ use Psr\Log\LogLevel; * same way. * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger */ class DeduplicationHandler extends BufferHandler { - /** - * @var string - */ - protected $deduplicationStore; + protected string $deduplicationStore; + + protected Level $deduplicationLevel; + + protected int $time; + + private bool $gc = false; /** - * @var Level - */ - protected $deduplicationLevel; - - /** - * @var int - */ - protected $time; - - /** - * @var bool - */ - private $gc = false; - - /** - * @param HandlerInterface $handler Handler. - * @param string $deduplicationStore The file/path where the deduplication log should be kept - * @param string|int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes - * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param HandlerInterface $handler Handler. + * @param string $deduplicationStore The file/path where the deduplication log should be kept + * @param int|string|Level|LogLevel::* $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes + * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * - * @phpstan-param Level|LevelName|LogLevel::* $deduplicationLevel + * @phpstan-param value-of|value-of|Level|LogLevel::* $deduplicationLevel */ - public function __construct(HandlerInterface $handler, ?string $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, int $time = 60, bool $bubble = true) + public function __construct(HandlerInterface $handler, ?string $deduplicationStore = null, int|string|Level $deduplicationLevel = Level::Error, int $time = 60, bool $bubble = true) { - parent::__construct($handler, 0, Logger::DEBUG, $bubble, false); + parent::__construct($handler, 0, Level::Debug, $bubble, false); $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore; $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel); @@ -87,8 +73,8 @@ class DeduplicationHandler extends BufferHandler $passthru = null; foreach ($this->buffer as $record) { - if ($record['level'] >= $this->deduplicationLevel) { - $passthru = $passthru || !$this->isDuplicate($record); + if ($record->level->value >= $this->deduplicationLevel->value) { + $passthru = $passthru === true || !$this->isDuplicate($record); if ($passthru) { $this->appendRecord($record); } @@ -107,10 +93,7 @@ class DeduplicationHandler extends BufferHandler } } - /** - * @phpstan-param Record $record - */ - private function isDuplicate(array $record): bool + private function isDuplicate(LogRecord $record): bool { if (!file_exists($this->deduplicationStore)) { return false; @@ -122,13 +105,13 @@ class DeduplicationHandler extends BufferHandler } $yesterday = time() - 86400; - $timestampValidity = $record['datetime']->getTimestamp() - $this->time; - $expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']); + $timestampValidity = $record->datetime->getTimestamp() - $this->time; + $expectedMessage = preg_replace('{[\r\n].*}', '', $record->message); for ($i = count($store) - 1; $i >= 0; $i--) { list($timestamp, $level, $message) = explode(':', $store[$i], 3); - if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) { + if ($level === $record->level->getName() && $message === $expectedMessage && $timestamp > $timestampValidity) { return true; } @@ -148,7 +131,7 @@ class DeduplicationHandler extends BufferHandler $handle = fopen($this->deduplicationStore, 'rw+'); - if (!$handle) { + if (false === $handle) { throw new \RuntimeException('Failed to open file for reading and writing: ' . $this->deduplicationStore); } @@ -159,7 +142,7 @@ class DeduplicationHandler extends BufferHandler while (!feof($handle)) { $log = fgets($handle); - if ($log && substr($log, 0, 10) >= $timestampValidity) { + if (is_string($log) && '' !== $log && substr($log, 0, 10) >= $timestampValidity) { $validLogs[] = $log; } } @@ -176,11 +159,8 @@ class DeduplicationHandler extends BufferHandler $this->gc = false; } - /** - * @phpstan-param Record $record - */ - private function appendRecord(array $record): void + private function appendRecord(LogRecord $record): void { - file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND); + file_put_contents($this->deduplicationStore, $record->datetime->getTimestamp() . ':' . $record->level->getName() . ':' . preg_replace('{[\r\n].*}', '', $record->message) . "\n", FILE_APPEND); } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php index ebd52c3a..eab9f108 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php @@ -11,10 +11,11 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\FormatterInterface; use Doctrine\CouchDB\CouchDBClient; +use Monolog\LogRecord; /** * CouchDB handler for Doctrine CouchDB ODM @@ -23,21 +24,20 @@ use Doctrine\CouchDB\CouchDBClient; */ class DoctrineCouchDBHandler extends AbstractProcessingHandler { - /** @var CouchDBClient */ - private $client; + private CouchDBClient $client; - public function __construct(CouchDBClient $client, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(CouchDBClient $client, int|string|Level $level = Level::Debug, bool $bubble = true) { $this->client = $client; parent::__construct($level, $bubble); } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->client->postDocument($record['formatted']); + $this->client->postDocument($record->formatted); } protected function getDefaultFormatter(): FormatterInterface diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php index 21840bf6..f1c5a959 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php @@ -16,7 +16,8 @@ use Aws\DynamoDb\DynamoDbClient; use Monolog\Formatter\FormatterInterface; use Aws\DynamoDb\Marshaler; use Monolog\Formatter\ScalarFormatter; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/) @@ -28,35 +29,15 @@ class DynamoDbHandler extends AbstractProcessingHandler { public const DATE_FORMAT = 'Y-m-d\TH:i:s.uO'; - /** - * @var DynamoDbClient - */ - protected $client; + protected DynamoDbClient $client; - /** - * @var string - */ - protected $table; + protected string $table; - /** - * @var int - */ - protected $version; + protected Marshaler $marshaler; - /** - * @var Marshaler - */ - protected $marshaler; - - public function __construct(DynamoDbClient $client, string $table, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(DynamoDbClient $client, string $table, int|string|Level $level = Level::Debug, bool $bubble = true) { - /** @phpstan-ignore-next-line */ - if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { - $this->version = 3; - $this->marshaler = new Marshaler; - } else { - $this->version = 2; - } + $this->marshaler = new Marshaler; $this->client = $client; $this->table = $table; @@ -65,17 +46,12 @@ class DynamoDbHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $filtered = $this->filterEmptyFields($record['formatted']); - if ($this->version === 3) { - $formatted = $this->marshaler->marshalItem($filtered); - } else { - /** @phpstan-ignore-next-line */ - $formatted = $this->client->formatAttributes($filtered); - } + $filtered = $this->filterEmptyFields($record->formatted); + $formatted = $this->marshaler->marshalItem($filtered); $this->client->putItem([ 'TableName' => $this->table, @@ -90,12 +66,12 @@ class DynamoDbHandler extends AbstractProcessingHandler protected function filterEmptyFields(array $record): array { return array_filter($record, function ($value) { - return !empty($value) || false === $value || 0 === $value; + return [] !== $value; }); } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php index fc92ca42..d9b85b4d 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticaHandler.php @@ -14,9 +14,10 @@ namespace Monolog\Handler; use Elastica\Document; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\ElasticaFormatter; -use Monolog\Logger; +use Monolog\Level; use Elastica\Client; use Elastica\Exception\ExceptionInterface; +use Monolog\LogRecord; /** * Elastic Search handler @@ -33,24 +34,34 @@ use Elastica\Exception\ExceptionInterface; * $log->pushHandler($handler); * * @author Jelle Vink + * @phpstan-type Options array{ + * index: string, + * type: string, + * ignore_error: bool + * } + * @phpstan-type InputOptions array{ + * index?: string, + * type?: string, + * ignore_error?: bool + * } */ class ElasticaHandler extends AbstractProcessingHandler { - /** - * @var Client - */ - protected $client; + protected Client $client; /** * @var mixed[] Handler config options + * @phpstan-var Options */ - protected $options = []; + protected array $options; /** * @param Client $client Elastica Client object * @param mixed[] $options Handler configuration + * + * @phpstan-param InputOptions $options */ - public function __construct(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true) + public function __construct(Client $client, array $options = [], int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); $this->client = $client; @@ -65,15 +76,15 @@ class ElasticaHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->bulkSend([$record['formatted']]); + $this->bulkSend([$record->formatted]); } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -86,6 +97,8 @@ class ElasticaHandler extends AbstractProcessingHandler /** * @return mixed[] + * + * @phpstan-return Options */ public function getOptions(): array { @@ -93,7 +106,7 @@ class ElasticaHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { @@ -101,7 +114,7 @@ class ElasticaHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php index e88375c0..c288824a 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php @@ -14,12 +14,13 @@ namespace Monolog\Handler; use Elastic\Elasticsearch\Response\Elasticsearch; use Throwable; use RuntimeException; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\ElasticsearchFormatter; use InvalidArgumentException; use Elasticsearch\Common\Exceptions\RuntimeException as ElasticsearchRuntimeException; use Elasticsearch\Client; +use Monolog\LogRecord; use Elastic\Elasticsearch\Exception\InvalidArgumentException as ElasticInvalidArgumentException; use Elastic\Elasticsearch\Client as Client8; @@ -43,18 +44,26 @@ use Elastic\Elasticsearch\Client as Client8; * $log->pushHandler($handler); * * @author Avtandil Kikabidze + * @phpstan-type Options array{ + * index: string, + * type: string, + * ignore_error: bool + * } + * @phpstan-type InputOptions array{ + * index?: string, + * type?: string, + * ignore_error?: bool + * } */ class ElasticsearchHandler extends AbstractProcessingHandler { - /** - * @var Client|Client8 - */ - protected $client; + protected Client|Client8 $client; /** * @var mixed[] Handler config options + * @phpstan-var Options */ - protected $options = []; + protected array $options; /** * @var bool @@ -64,13 +73,11 @@ class ElasticsearchHandler extends AbstractProcessingHandler /** * @param Client|Client8 $client Elasticsearch Client object * @param mixed[] $options Handler configuration + * + * @phpstan-param InputOptions $options */ - public function __construct($client, array $options = [], $level = Logger::DEBUG, bool $bubble = true) + public function __construct(Client|Client8 $client, array $options = [], int|string|Level $level = Level::Debug, bool $bubble = true) { - if (!$client instanceof Client && !$client instanceof Client8) { - throw new \TypeError('Elasticsearch\Client or Elastic\Elasticsearch\Client instance required'); - } - parent::__construct($level, $bubble); $this->client = $client; $this->options = array_merge( @@ -92,15 +99,15 @@ class ElasticsearchHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->bulkSend([$record['formatted']]); + $this->bulkSend([$record->formatted]); } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -115,6 +122,8 @@ class ElasticsearchHandler extends AbstractProcessingHandler * Getter options * * @return mixed[] + * + * @phpstan-return Options */ public function getOptions(): array { @@ -122,7 +131,7 @@ class ElasticsearchHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { @@ -130,7 +139,7 @@ class ElasticsearchHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { @@ -141,7 +150,7 @@ class ElasticsearchHandler extends AbstractProcessingHandler /** * Use Elasticsearch bulk API to send list of documents * - * @param array[] $records Records + _index/_type keys + * @param array> $records Records + _index/_type keys * @throws \RuntimeException */ protected function bulkSend(array $records): void diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php index f2e22036..477d7e45 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php @@ -13,8 +13,9 @@ namespace Monolog\Handler; use Monolog\Formatter\LineFormatter; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Stores to PHP error_log() handler. @@ -26,16 +27,14 @@ class ErrorLogHandler extends AbstractProcessingHandler public const OPERATING_SYSTEM = 0; public const SAPI = 4; - /** @var int */ - protected $messageType; - /** @var bool */ - protected $expandNewlines; + protected int $messageType; + protected bool $expandNewlines; /** * @param int $messageType Says where the error should go. * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries */ - public function __construct(int $messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, bool $bubble = true, bool $expandNewlines = false) + public function __construct(int $messageType = self::OPERATING_SYSTEM, int|string|Level $level = Level::Debug, bool $bubble = true, bool $expandNewlines = false) { parent::__construct($level, $bubble); @@ -61,7 +60,7 @@ class ErrorLogHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { @@ -69,19 +68,20 @@ class ErrorLogHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { if (!$this->expandNewlines) { - error_log((string) $record['formatted'], $this->messageType); + error_log((string) $record->formatted, $this->messageType); return; } - $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); + $lines = preg_split('{[\r\n]+}', (string) $record->formatted); if ($lines === false) { $pcreErrorCode = preg_last_error(); + throw new \RuntimeException('Failed to preg_split formatted string: ' . $pcreErrorCode . ' / '. Utils::pcreLastErrorMessage($pcreErrorCode)); } foreach ($lines as $line) { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php index d4e234ce..1776eb51 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FallbackGroupHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Throwable; +use Monolog\LogRecord; /** * Forwards records to at most one handler @@ -19,18 +20,15 @@ use Throwable; * If a handler fails, the exception is suppressed and the record is forwarded to the next handler. * * As soon as one handler handles a record successfully, the handling stops there. - * - * @phpstan-import-type Record from \Monolog\Logger */ class FallbackGroupHandler extends GroupHandler { /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } foreach ($this->handlers as $handler) { @@ -46,16 +44,15 @@ class FallbackGroupHandler extends GroupHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { - if ($this->processors) { + if (\count($this->processors) > 0) { $processed = []; foreach ($records as $record) { $processed[] = $this->processRecord($record); } - /** @var Record[] $records */ $records = $processed; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php index 718f17ef..00381ab4 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -11,10 +11,13 @@ namespace Monolog\Handler; +use Closure; +use Monolog\Level; use Monolog\Logger; use Monolog\ResettableInterface; use Monolog\Formatter\FormatterInterface; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Simple handler wrapper that filters records based on a list of levels @@ -23,110 +26,99 @@ use Psr\Log\LogLevel; * * @author Hennadiy Verkh * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class FilterHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface, FormattableHandlerInterface { use ProcessableHandlerTrait; /** - * Handler or factory callable($record, $this) + * Handler or factory Closure($record, $this) * - * @var callable|HandlerInterface - * @phpstan-var callable(?Record, HandlerInterface): HandlerInterface|HandlerInterface + * @phpstan-var (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface */ - protected $handler; + protected Closure|HandlerInterface $handler; /** * Minimum level for logs that are passed to handler * - * @var int[] - * @phpstan-var array + * @var bool[] Map of Level value => true + * @phpstan-var array, true> */ - protected $acceptedLevels; + protected array $acceptedLevels; /** * Whether the messages that are handled can bubble up the stack or not - * - * @var bool */ - protected $bubble; + protected bool $bubble; /** - * @psalm-param HandlerInterface|callable(?Record, HandlerInterface): HandlerInterface $handler + * @phpstan-param (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface $handler * - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler). - * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided - * @param int|string $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $filterHandler). + * @param int|string|Level|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided + * @param int|string|Level|LogLevel::* $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * - * @phpstan-param Level|LevelName|LogLevel::*|array $minLevelOrList - * @phpstan-param Level|LevelName|LogLevel::* $maxLevel + * @phpstan-param value-of|value-of|Level|LogLevel::*|array|value-of|Level|LogLevel::*> $minLevelOrList + * @phpstan-param value-of|value-of|Level|LogLevel::* $maxLevel */ - public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, bool $bubble = true) + public function __construct(Closure|HandlerInterface $handler, int|string|Level|array $minLevelOrList = Level::Debug, int|string|Level $maxLevel = Level::Emergency, bool $bubble = true) { $this->handler = $handler; $this->bubble = $bubble; $this->setAcceptedLevels($minLevelOrList, $maxLevel); - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } } /** - * @phpstan-return array + * @phpstan-return list List of levels */ public function getAcceptedLevels(): array { - return array_flip($this->acceptedLevels); + return array_map(fn (int $level) => Level::from($level), array_keys($this->acceptedLevels)); } /** - * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided - * @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array + * @param int|string|Level|LogLevel::*|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided + * @param int|string|Level|LogLevel::* $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array * - * @phpstan-param Level|LevelName|LogLevel::*|array $minLevelOrList - * @phpstan-param Level|LevelName|LogLevel::* $maxLevel + * @phpstan-param value-of|value-of|Level|LogLevel::*|array|value-of|Level|LogLevel::*> $minLevelOrList + * @phpstan-param value-of|value-of|Level|LogLevel::* $maxLevel */ - public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY): self + public function setAcceptedLevels(int|string|Level|array $minLevelOrList = Level::Debug, int|string|Level $maxLevel = Level::Emergency): self { if (is_array($minLevelOrList)) { - $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList); + $acceptedLevels = array_map(Logger::toMonologLevel(...), $minLevelOrList); } else { $minLevelOrList = Logger::toMonologLevel($minLevelOrList); $maxLevel = Logger::toMonologLevel($maxLevel); - $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) { - return $level >= $minLevelOrList && $level <= $maxLevel; - })); + $acceptedLevels = array_values(array_filter(Level::cases(), fn (Level $level) => $level->value >= $minLevelOrList->value && $level->value <= $maxLevel->value)); + } + $this->acceptedLevels = []; + foreach ($acceptedLevels as $level) { + $this->acceptedLevels[$level->value] = true; } - $this->acceptedLevels = array_flip($acceptedLevels); return $this; } /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { - return isset($this->acceptedLevels[$record['level']]); + return isset($this->acceptedLevels[$record->level->value]); } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { if (!$this->isHandling($record)) { return false; } - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } @@ -136,7 +128,7 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { @@ -155,26 +147,23 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese /** * Return the nested handler * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - * - * @phpstan-param Record $record + * If the handler was provided as a factory, this will trigger the handler's instantiation. */ - public function getHandler(array $record = null) + public function getHandler(LogRecord $record = null): HandlerInterface { if (!$this->handler instanceof HandlerInterface) { - $this->handler = ($this->handler)($record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); + $handler = ($this->handler)($record, $this); + if (!$handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory Closure should return a HandlerInterface"); } + $this->handler = $handler; } return $this->handler; } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -189,7 +178,7 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { @@ -201,7 +190,7 @@ class FilterHandler extends Handler implements ProcessableHandlerInterface, Rese throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.'); } - public function reset() + public function reset(): void { $this->resetProcessors(); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php index 0aa5607b..e8a1b0b0 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php @@ -11,19 +11,17 @@ namespace Monolog\Handler\FingersCrossed; +use Monolog\LogRecord; + /** * Interface for activation strategies for the FingersCrossedHandler. * * @author Johannes M. Schmitt - * - * @phpstan-import-type Record from \Monolog\Logger */ interface ActivationStrategyInterface { /** * Returns whether the given record activates the handler. - * - * @phpstan-param Record $record */ - public function isHandlerActivated(array $record): bool; + public function isHandlerActivated(LogRecord $record): bool; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php index 7b9abb58..383e19af 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php @@ -11,8 +11,10 @@ namespace Monolog\Handler\FingersCrossed; +use Monolog\Level; use Monolog\Logger; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Channel and Error level based monolog activation strategy. Allows to trigger activation @@ -23,55 +25,45 @@ use Psr\Log\LogLevel; * * * $activationStrategy = new ChannelLevelActivationStrategy( - * Logger::CRITICAL, + * Level::Critical, * array( - * 'request' => Logger::ALERT, - * 'sensitive' => Logger::ERROR, + * 'request' => Level::Alert, + * 'sensitive' => Level::Error, * ) * ); * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy); * * * @author Mike Meessen - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class ChannelLevelActivationStrategy implements ActivationStrategyInterface { - /** - * @var Level - */ - private $defaultActionLevel; + private Level $defaultActionLevel; /** * @var array */ - private $channelToActionLevel; + private array $channelToActionLevel; /** - * @param int|string $defaultActionLevel The default action level to be used if the record's category doesn't match any - * @param array $channelToActionLevel An array that maps channel names to action levels. + * @param int|string|Level|LogLevel::* $defaultActionLevel The default action level to be used if the record's category doesn't match any + * @param array $channelToActionLevel An array that maps channel names to action levels. * - * @phpstan-param array $channelToActionLevel - * @phpstan-param Level|LevelName|LogLevel::* $defaultActionLevel + * @phpstan-param value-of|value-of|Level|LogLevel::* $defaultActionLevel + * @phpstan-param array|value-of|Level|LogLevel::*> $channelToActionLevel */ - public function __construct($defaultActionLevel, array $channelToActionLevel = []) + public function __construct(int|string|Level $defaultActionLevel, array $channelToActionLevel = []) { $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel); - $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); + $this->channelToActionLevel = array_map(Logger::toMonologLevel(...), $channelToActionLevel); } - /** - * @phpstan-param Record $record - */ - public function isHandlerActivated(array $record): bool + public function isHandlerActivated(LogRecord $record): bool { - if (isset($this->channelToActionLevel[$record['channel']])) { - return $record['level'] >= $this->channelToActionLevel[$record['channel']]; + if (isset($this->channelToActionLevel[$record->channel])) { + return $record->level->value >= $this->channelToActionLevel[$record->channel]->value; } - return $record['level'] >= $this->defaultActionLevel; + return $record->level->value >= $this->defaultActionLevel->value; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php index 5ec88eab..c3ca2967 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php @@ -11,6 +11,8 @@ namespace Monolog\Handler\FingersCrossed; +use Monolog\Level; +use Monolog\LogRecord; use Monolog\Logger; use Psr\Log\LogLevel; @@ -18,29 +20,23 @@ use Psr\Log\LogLevel; * Error level based activation strategy. * * @author Johannes M. Schmitt - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class ErrorLevelActivationStrategy implements ActivationStrategyInterface { - /** - * @var Level - */ - private $actionLevel; + private Level $actionLevel; /** - * @param int|string $actionLevel Level or name or value + * @param int|string|Level $actionLevel Level or name or value * - * @phpstan-param Level|LevelName|LogLevel::* $actionLevel + * @phpstan-param value-of|value-of|Level|LogLevel::* $actionLevel */ - public function __construct($actionLevel) + public function __construct(int|string|Level $actionLevel) { $this->actionLevel = Logger::toMonologLevel($actionLevel); } - public function isHandlerActivated(array $record): bool + public function isHandlerActivated(LogRecord $record): bool { - return $record['level'] >= $this->actionLevel; + return $record->level->value >= $this->actionLevel->value; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php index 0627b445..ce2a3a8e 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -11,12 +11,15 @@ namespace Monolog\Handler; +use Closure; use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; +use Monolog\Level; use Monolog\Logger; use Monolog\ResettableInterface; use Monolog\Formatter\FormatterInterface; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Buffers all records until a certain level is reached @@ -33,55 +36,50 @@ use Psr\Log\LogLevel; * Monolog\Handler\FingersCrossed\ namespace. * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface, FormattableHandlerInterface { use ProcessableHandlerTrait; /** - * @var callable|HandlerInterface - * @phpstan-var callable(?Record, HandlerInterface): HandlerInterface|HandlerInterface + * Handler or factory Closure($record, $this) + * + * @phpstan-var (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface */ - protected $handler; - /** @var ActivationStrategyInterface */ - protected $activationStrategy; - /** @var bool */ - protected $buffering = true; - /** @var int */ - protected $bufferSize; - /** @var Record[] */ - protected $buffer = []; - /** @var bool */ - protected $stopBuffering; - /** - * @var ?int - * @phpstan-var ?Level - */ - protected $passthruLevel; - /** @var bool */ - protected $bubble; + protected Closure|HandlerInterface $handler; + + protected ActivationStrategyInterface $activationStrategy; + + protected bool $buffering = true; + + protected int $bufferSize; + + /** @var LogRecord[] */ + protected array $buffer = []; + + protected bool $stopBuffering; + + protected Level|null $passthruLevel = null; + + protected bool $bubble; /** - * @psalm-param HandlerInterface|callable(?Record, HandlerInterface): HandlerInterface $handler + * @phpstan-param (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface $handler * - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler). - * @param int|string|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action, or a level name/value at which the handler is activated - * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) - * @param int|string $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered + * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $fingersCrossedHandler). + * @param int|string|Level|LogLevel::* $activationStrategy Strategy which determines when this handler takes action, or a level name/value at which the handler is activated + * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) + * @param int|string|Level|LogLevel::*|null $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered * - * @phpstan-param Level|LevelName|LogLevel::* $passthruLevel - * @phpstan-param Level|LevelName|LogLevel::*|ActivationStrategyInterface $activationStrategy + * @phpstan-param value-of|value-of|Level|LogLevel::*|ActivationStrategyInterface $activationStrategy + * @phpstan-param value-of|value-of|Level|LogLevel::* $passthruLevel */ - public function __construct($handler, $activationStrategy = null, int $bufferSize = 0, bool $bubble = true, bool $stopBuffering = true, $passthruLevel = null) + public function __construct(Closure|HandlerInterface $handler, int|string|Level|ActivationStrategyInterface $activationStrategy = null, int $bufferSize = 0, bool $bubble = true, bool $stopBuffering = true, int|string|Level|null $passthruLevel = null) { if (null === $activationStrategy) { - $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); + $activationStrategy = new ErrorLevelActivationStrategy(Level::Warning); } // convert simple int activationStrategy to an object @@ -98,16 +96,12 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa if ($passthruLevel !== null) { $this->passthruLevel = Logger::toMonologLevel($passthruLevel); } - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } } /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { return true; } @@ -126,12 +120,11 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } @@ -151,7 +144,7 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { @@ -160,7 +153,7 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa $this->getHandler()->close(); } - public function reset() + public function reset(): void { $this->flushBuffer(); @@ -190,7 +183,7 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa if (null !== $this->passthruLevel) { $level = $this->passthruLevel; $this->buffer = array_filter($this->buffer, function ($record) use ($level) { - return $record['level'] >= $level; + return $record->level >= $level; }); if (count($this->buffer) > 0) { $this->getHandler(end($this->buffer))->handleBatch($this->buffer); @@ -204,26 +197,23 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa /** * Return the nested handler * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - * - * @phpstan-param Record $record + * If the handler was provided as a factory, this will trigger the handler's instantiation. */ - public function getHandler(array $record = null) + public function getHandler(LogRecord $record = null): HandlerInterface { if (!$this->handler instanceof HandlerInterface) { - $this->handler = ($this->handler)($record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); + $handler = ($this->handler)($record, $this); + if (!$handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory Closure should return a HandlerInterface"); } + $this->handler = $handler; } return $this->handler; } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -238,7 +228,7 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php index 72718de6..6b9e5103 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php @@ -13,13 +13,12 @@ namespace Monolog\Handler; use Monolog\Formatter\WildfireFormatter; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. * * @author Eric Clemmons (@ericclemmons) - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class FirePHPHandler extends AbstractProcessingHandler { @@ -47,18 +46,15 @@ class FirePHPHandler extends AbstractProcessingHandler /** * Whether or not Wildfire vendor-specific headers have been generated & sent yet - * @var bool */ - protected static $initialized = false; + protected static bool $initialized = false; /** * Shared static message index between potentially multiple handlers - * @var int */ - protected static $messageIndex = 1; + protected static int $messageIndex = 1; - /** @var bool */ - protected static $sendHeaders = true; + protected static bool $sendHeaders = true; /** * Base header creation function used by init headers & record headers @@ -85,21 +81,19 @@ class FirePHPHandler extends AbstractProcessingHandler * @phpstan-return non-empty-array * * @see createHeader() - * - * @phpstan-param FormattedRecord $record */ - protected function createRecordHeader(array $record): array + protected function createRecordHeader(LogRecord $record): array { // Wildfire is extensible to support multiple protocols & plugins in a single request, // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. return $this->createHeader( [1, 1, 1, self::$messageIndex++], - $record['formatted'] + $record->formatted ); } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { @@ -140,7 +134,7 @@ class FirePHPHandler extends AbstractProcessingHandler * @see sendHeader() * @see sendInitHeaders() */ - protected function write(array $record): void + protected function write(LogRecord $record): void { if (!self::$sendHeaders || !$this->isWebRequest()) { return; @@ -171,7 +165,7 @@ class FirePHPHandler extends AbstractProcessingHandler */ protected function headersAccepted(): bool { - if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) { + if (isset($_SERVER['HTTP_USER_AGENT']) && 1 === preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) { return true; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php index 85c95b9d..9f44ba71 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php @@ -13,7 +13,8 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LineFormatter; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Sends logs to Fleep.io using Webhook integrations @@ -22,8 +23,6 @@ use Monolog\Logger; * * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation * @author Ando Roots - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class FleepHookHandler extends SocketHandler { @@ -34,7 +33,7 @@ class FleepHookHandler extends SocketHandler /** * @var string Webhook token (specifies the conversation where logs are sent) */ - protected $token; + protected string $token; /** * Construct a new Fleep.io Handler. @@ -42,12 +41,12 @@ class FleepHookHandler extends SocketHandler * For instructions on how to create a new web hook in your conversations * see https://fleep.io/integrations/webhooks/ * - * @param string $token Webhook token + * @param string $token Webhook token * @throws MissingExtensionException */ public function __construct( string $token, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, bool $persistent = false, float $timeout = 0.0, @@ -89,16 +88,16 @@ class FleepHookHandler extends SocketHandler /** * Handles a log record */ - public function write(array $record): void + public function write(LogRecord $record): void { parent::write($record); $this->closeSocket(); } /** - * {@inheritDoc} + * @inheritDoc */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { $content = $this->buildContent($record); @@ -121,13 +120,11 @@ class FleepHookHandler extends SocketHandler /** * Builds the body of API call - * - * @phpstan-param FormattedRecord $record */ - private function buildContent(array $record): string + private function buildContent(LogRecord $record): string { $dataArray = [ - 'message' => $record['formatted'], + 'message' => $record->formatted, ]; return http_build_query($dataArray); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php index 5715d580..13581548 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php @@ -11,10 +11,11 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; use Monolog\Formatter\FlowdockFormatter; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Sends notifications through the Flowdock push API @@ -26,23 +27,17 @@ use Monolog\Formatter\FormatterInterface; * * @author Dominik Liebler * @see https://www.flowdock.com/api/push - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - * @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4 */ class FlowdockHandler extends SocketHandler { - /** - * @var string - */ - protected $apiToken; + protected string $apiToken; /** * @throws MissingExtensionException if OpenSSL is missing */ public function __construct( string $apiToken, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, bool $persistent = false, float $timeout = 0.0, @@ -68,7 +63,7 @@ class FlowdockHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -88,9 +83,9 @@ class FlowdockHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { parent::write($record); @@ -98,9 +93,9 @@ class FlowdockHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { $content = $this->buildContent($record); @@ -109,12 +104,10 @@ class FlowdockHandler extends SocketHandler /** * Builds the body of API call - * - * @phpstan-param FormattedRecord $record */ - private function buildContent(array $record): string + private function buildContent(LogRecord $record): string { - return Utils::jsonEncode($record['formatted']['flowdock']); + return Utils::jsonEncode($record->formatted); } /** diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php index fc1693cd..72da59e1 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php @@ -23,15 +23,12 @@ interface FormattableHandlerInterface /** * Sets the formatter. * - * @param FormatterInterface $formatter - * @return HandlerInterface self + * @return HandlerInterface self */ public function setFormatter(FormatterInterface $formatter): HandlerInterface; /** * Gets the formatter. - * - * @return FormatterInterface */ public function getFormatter(): FormatterInterface; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php index b60bdce0..c044e078 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php @@ -21,13 +21,10 @@ use Monolog\Formatter\LineFormatter; */ trait FormattableHandlerTrait { - /** - * @var ?FormatterInterface - */ - protected $formatter; + protected FormatterInterface|null $formatter = null; /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -37,11 +34,11 @@ trait FormattableHandlerTrait } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { - if (!$this->formatter) { + if (null === $this->formatter) { $this->formatter = $this->getDefaultFormatter(); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php index 4ff26c4c..ba5bb975 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php @@ -12,9 +12,10 @@ namespace Monolog\Handler; use Gelf\PublisherInterface; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\GelfMessageFormatter; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Handler to send messages to a Graylog2 (http://www.graylog2.org) server @@ -27,12 +28,12 @@ class GelfHandler extends AbstractProcessingHandler /** * @var PublisherInterface the publisher object that sends the message to the server */ - protected $publisher; + protected PublisherInterface $publisher; /** * @param PublisherInterface $publisher a gelf publisher object */ - public function __construct(PublisherInterface $publisher, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(PublisherInterface $publisher, int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); @@ -40,15 +41,15 @@ class GelfHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->publisher->publish($record['formatted']); + $this->publisher->publish($record->formatted); } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php index 3c9dc4b3..7ab8bd97 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php @@ -13,22 +13,20 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\ResettableInterface; +use Monolog\LogRecord; /** * Forwards records to multiple handlers * * @author Lenar Lõhmus - * - * @phpstan-import-type Record from \Monolog\Logger */ class GroupHandler extends Handler implements ProcessableHandlerInterface, ResettableInterface { use ProcessableHandlerTrait; /** @var HandlerInterface[] */ - protected $handlers; - /** @var bool */ - protected $bubble; + protected array $handlers; + protected bool $bubble; /** * @param HandlerInterface[] $handlers Array of Handlers. @@ -47,9 +45,9 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset } /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { foreach ($this->handlers as $handler) { if ($handler->isHandling($record)) { @@ -61,12 +59,11 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } @@ -78,16 +75,15 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { - if ($this->processors) { + if (\count($this->processors) > 0) { $processed = []; foreach ($records as $record) { $processed[] = $this->processRecord($record); } - /** @var Record[] $records */ $records = $processed; } @@ -96,7 +92,7 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset } } - public function reset() + public function reset(): void { $this->resetProcessors(); @@ -117,7 +113,7 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/Handler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/Handler.php index 34b4935d..e89f969b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/Handler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/Handler.php @@ -19,7 +19,7 @@ namespace Monolog\Handler; abstract class Handler implements HandlerInterface { /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { @@ -29,7 +29,7 @@ abstract class Handler implements HandlerInterface } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php index affcc51f..83905c32 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php @@ -11,13 +11,12 @@ namespace Monolog\Handler; +use Monolog\LogRecord; + /** * Interface that all Monolog Handlers must implement * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger */ interface HandlerInterface { @@ -30,13 +29,9 @@ interface HandlerInterface * is no guarantee that handle() will not be called, and isHandling() might not be called * for a given record. * - * @param array $record Partial log record containing only a level key - * - * @return bool - * - * @phpstan-param array{level: Level} $record + * @param LogRecord $record Partial log record having only a level initialized */ - public function isHandling(array $record): bool; + public function isHandling(LogRecord $record): bool; /** * Handles a record. @@ -48,20 +43,16 @@ interface HandlerInterface * Unless the bubbling is interrupted (by returning true), the Logger class will keep on * calling further handlers in the stack with a given log record. * - * @param array $record The record to handle - * @return bool true means that this handler handled the record, and that bubbling is not permitted. - * false means the record was either not processed or that this handler allows bubbling. - * - * @phpstan-param Record $record + * @param LogRecord $record The record to handle + * @return bool true means that this handler handled the record, and that bubbling is not permitted. + * false means the record was either not processed or that this handler allows bubbling. */ - public function handle(array $record): bool; + public function handle(LogRecord $record): bool; /** * Handles a set of records at once. * - * @param array $records The records to handle (an array of record arrays) - * - * @phpstan-param Record[] $records + * @param array $records The records to handle */ public function handleBatch(array $records): void; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php index d4351b9f..541ec254 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php @@ -13,6 +13,7 @@ namespace Monolog\Handler; use Monolog\ResettableInterface; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * This simple wrapper class can be used to extend handlers functionality. @@ -21,7 +22,7 @@ use Monolog\Formatter\FormatterInterface; * * Inherit from this class and override handle() like this: * - * public function handle(array $record) + * public function handle(LogRecord $record) * { * if ($record meets certain conditions) { * return false; @@ -33,10 +34,7 @@ use Monolog\Formatter\FormatterInterface; */ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, FormattableHandlerInterface, ResettableInterface { - /** - * @var HandlerInterface - */ - protected $handler; + protected HandlerInterface $handler; public function __construct(HandlerInterface $handler) { @@ -44,23 +42,23 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F } /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { return $this->handler->isHandling($record); } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { return $this->handler->handle($record); } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { @@ -68,7 +66,7 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { @@ -76,7 +74,7 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F } /** - * {@inheritDoc} + * @inheritDoc */ public function pushProcessor(callable $callback): HandlerInterface { @@ -90,7 +88,7 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F } /** - * {@inheritDoc} + * @inheritDoc */ public function popProcessor(): callable { @@ -102,7 +100,7 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -116,7 +114,7 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { @@ -127,7 +125,7 @@ class HandlerWrapper implements HandlerInterface, ProcessableHandlerInterface, F throw new \LogicException('The wrapped handler does not implement ' . FormattableHandlerInterface::class); } - public function reset() + public function reset(): void { if ($this->handler instanceof ResettableInterface) { $this->handler->reset(); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php index 000ccea4..ee7f81f6 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php @@ -11,8 +11,9 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * IFTTTHandler uses cURL to trigger IFTTT Maker actions @@ -27,16 +28,14 @@ use Monolog\Utils; */ class IFTTTHandler extends AbstractProcessingHandler { - /** @var string */ - private $eventName; - /** @var string */ - private $secretKey; + private string $eventName; + private string $secretKey; /** * @param string $eventName The name of the IFTTT Maker event that should be triggered * @param string $secretKey A valid IFTTT secret key */ - public function __construct(string $eventName, string $secretKey, $level = Logger::ERROR, bool $bubble = true) + public function __construct(string $eventName, string $secretKey, int|string|Level $level = Level::Error, bool $bubble = true) { if (!extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the IFTTTHandler'); @@ -49,14 +48,14 @@ class IFTTTHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - public function write(array $record): void + public function write(LogRecord $record): void { $postData = [ - "value1" => $record["channel"], + "value1" => $record->channel, "value2" => $record["level_name"], - "value3" => $record["message"], + "value3" => $record->message, ]; $postString = Utils::jsonEncode($postData); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php index 71f64a26..abb2f88f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php @@ -11,7 +11,8 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Inspired on LogEntriesHandler. @@ -21,15 +22,12 @@ use Monolog\Logger; */ class InsightOpsHandler extends SocketHandler { - /** - * @var string - */ - protected $logToken; + protected string $logToken; /** - * @param string $token Log token supplied by InsightOps - * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. - * @param bool $useSSL Whether or not SSL encryption should be used + * @param string $token Log token supplied by InsightOps + * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. + * @param bool $useSSL Whether or not SSL encryption should be used * * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing */ @@ -37,7 +35,7 @@ class InsightOpsHandler extends SocketHandler string $token, string $region = 'us', bool $useSSL = true, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, bool $persistent = false, float $timeout = 0.0, @@ -67,10 +65,10 @@ class InsightOpsHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { - return $this->logToken . ' ' . $record['formatted']; + return $this->logToken . ' ' . $record->formatted; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php index 25fcd159..00259834 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php @@ -11,29 +11,27 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * @author Robert Kaufmann III */ class LogEntriesHandler extends SocketHandler { - /** - * @var string - */ - protected $logToken; + protected string $logToken; /** - * @param string $token Log token supplied by LogEntries - * @param bool $useSSL Whether or not SSL encryption should be used. - * @param string $host Custom hostname to send the data to if needed + * @param string $token Log token supplied by LogEntries + * @param bool $useSSL Whether or not SSL encryption should be used. + * @param string $host Custom hostname to send the data to if needed * * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing */ public function __construct( string $token, bool $useSSL = true, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, string $host = 'data.logentries.com', bool $persistent = false, @@ -61,10 +59,10 @@ class LogEntriesHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { - return $this->logToken . ' ' . $record['formatted']; + return $this->logToken . ' ' . $record->formatted; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php index 6d13db37..2d8e66f1 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php @@ -11,11 +11,12 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LogglyFormatter; use function array_key_exists; use CurlHandle; +use Monolog\LogRecord; /** * Sends errors to Loggly. @@ -33,22 +34,21 @@ class LogglyHandler extends AbstractProcessingHandler /** * Caches the curl handlers for every given endpoint. * - * @var resource[]|CurlHandle[] + * @var CurlHandle[] */ - protected $curlHandlers = []; + protected array $curlHandlers = []; - /** @var string */ - protected $token; + protected string $token; /** @var string[] */ - protected $tag = []; + protected array $tag = []; /** * @param string $token API token supplied by Loggly * * @throws MissingExtensionException If the curl extension is missing */ - public function __construct(string $token, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(string $token, int|string|Level $level = Level::Debug, bool $bubble = true) { if (!extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the LogglyHandler'); @@ -61,12 +61,8 @@ class LogglyHandler extends AbstractProcessingHandler /** * Loads and returns the shared curl handler for the given endpoint. - * - * @param string $endpoint - * - * @return resource|CurlHandle */ - protected function getCurlHandler(string $endpoint) + protected function getCurlHandler(string $endpoint): CurlHandle { if (!array_key_exists($endpoint, $this->curlHandlers)) { $this->curlHandlers[$endpoint] = $this->loadCurlHandle($endpoint); @@ -77,12 +73,8 @@ class LogglyHandler extends AbstractProcessingHandler /** * Starts a fresh curl session for the given endpoint and returns its handler. - * - * @param string $endpoint - * - * @return resource|CurlHandle */ - private function loadCurlHandle(string $endpoint) + private function loadCurlHandle(string $endpoint): CurlHandle { $url = sprintf("https://%s/%s/%s/", static::HOST, $endpoint, $this->token); @@ -98,10 +90,13 @@ class LogglyHandler extends AbstractProcessingHandler /** * @param string[]|string $tag */ - public function setTag($tag): self + public function setTag(string|array $tag): self { - $tag = !empty($tag) ? $tag : []; - $this->tag = is_array($tag) ? $tag : [$tag]; + if ('' === $tag || [] === $tag) { + $this->tag = []; + } else { + $this->tag = is_array($tag) ? $tag : [$tag]; + } return $this; } @@ -109,9 +104,9 @@ class LogglyHandler extends AbstractProcessingHandler /** * @param string[]|string $tag */ - public function addTag($tag): self + public function addTag(string|array $tag): self { - if (!empty($tag)) { + if ('' !== $tag) { $tag = is_array($tag) ? $tag : [$tag]; $this->tag = array_unique(array_merge($this->tag, $tag)); } @@ -119,9 +114,9 @@ class LogglyHandler extends AbstractProcessingHandler return $this; } - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->send($record["formatted"], static::ENDPOINT_SINGLE); + $this->send($record->formatted, static::ENDPOINT_SINGLE); } public function handleBatch(array $records): void @@ -129,10 +124,10 @@ class LogglyHandler extends AbstractProcessingHandler $level = $this->level; $records = array_filter($records, function ($record) use ($level) { - return ($record['level'] >= $level); + return ($record->level >= $level); }); - if ($records) { + if (\count($records) > 0) { $this->send($this->getFormatter()->formatBatch($records), static::ENDPOINT_BATCH); } } @@ -143,7 +138,7 @@ class LogglyHandler extends AbstractProcessingHandler $headers = ['Content-Type: application/json']; - if (!empty($this->tag)) { + if (\count($this->tag) > 0) { $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php index 859a4690..876b1a95 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/LogmaticHandler.php @@ -11,44 +11,36 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LogmaticFormatter; +use Monolog\LogRecord; /** * @author Julien Breux */ class LogmaticHandler extends SocketHandler { - /** - * @var string - */ - private $logToken; + private string $logToken; + + private string $hostname; + + private string $appName; /** - * @var string - */ - private $hostname; - - /** - * @var string - */ - private $appname; - - /** - * @param string $token Log token supplied by Logmatic. - * @param string $hostname Host name supplied by Logmatic. - * @param string $appname Application name supplied by Logmatic. - * @param bool $useSSL Whether or not SSL encryption should be used. + * @param string $token Log token supplied by Logmatic. + * @param string $hostname Host name supplied by Logmatic. + * @param string $appName Application name supplied by Logmatic. + * @param bool $useSSL Whether or not SSL encryption should be used. * * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing */ public function __construct( string $token, string $hostname = '', - string $appname = '', + string $appName = '', bool $useSSL = true, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, bool $persistent = false, float $timeout = 0.0, @@ -76,29 +68,29 @@ class LogmaticHandler extends SocketHandler $this->logToken = $token; $this->hostname = $hostname; - $this->appname = $appname; + $this->appName = $appName; } /** - * {@inheritDoc} + * @inheritDoc */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { - return $this->logToken . ' ' . $record['formatted']; + return $this->logToken . ' ' . $record->formatted; } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { $formatter = new LogmaticFormatter(); - if (!empty($this->hostname)) { + if ($this->hostname !== '') { $formatter->setHostname($this->hostname); } - if (!empty($this->appname)) { - $formatter->setAppname($this->appname); + if ($this->appName !== '') { + $formatter->setAppName($this->appName); } return $formatter; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php index 97f34320..b6c82277 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php @@ -13,33 +13,32 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\HtmlFormatter; +use Monolog\LogRecord; /** * Base class for all mail handlers * * @author Gyula Sallai - * - * @phpstan-import-type Record from \Monolog\Logger */ abstract class MailHandler extends AbstractProcessingHandler { /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { $messages = []; foreach ($records as $record) { - if ($record['level'] < $this->level) { + if ($record->level->isLowerThan($this->level)) { continue; } - /** @var Record $message */ + $message = $this->processRecord($record); $messages[] = $message; } - if (!empty($messages)) { + if (\count($messages) > 0) { $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); } } @@ -50,27 +49,26 @@ abstract class MailHandler extends AbstractProcessingHandler * @param string $content formatted email body to be sent * @param array $records the array of log records that formed this content * - * @phpstan-param Record[] $records + * @phpstan-param non-empty-array $records */ abstract protected function send(string $content, array $records): void; /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->send((string) $record['formatted'], [$record]); + $this->send((string) $record->formatted, [$record]); } /** - * @phpstan-param non-empty-array $records - * @phpstan-return Record + * @phpstan-param non-empty-array $records */ - protected function getHighestRecord(array $records): array + protected function getHighestRecord(array $records): LogRecord { $highestRecord = null; foreach ($records as $record) { - if ($highestRecord === null || $highestRecord['level'] < $record['level']) { + if ($highestRecord === null || $record->level->isHigherThan($highestRecord->level)) { $highestRecord = $record; } } @@ -85,8 +83,6 @@ abstract class MailHandler extends AbstractProcessingHandler /** * Gets the default formatter. - * - * @return FormatterInterface */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php index 3003500e..0f923bc5 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php @@ -11,7 +11,7 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Swift; use Swift_Message; @@ -22,22 +22,20 @@ use Swift_Message; */ class MandrillHandler extends MailHandler { - /** @var Swift_Message */ - protected $message; - /** @var string */ - protected $apiKey; + protected Swift_Message $message; + protected string $apiKey; /** - * @psalm-param Swift_Message|callable(): Swift_Message $message + * @phpstan-param (Swift_Message|callable(): Swift_Message) $message * * @param string $apiKey A valid Mandrill API key * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced */ - public function __construct(string $apiKey, $message, $level = Logger::ERROR, bool $bubble = true) + public function __construct(string $apiKey, callable|Swift_Message $message, int|string|Level $level = Level::Error, bool $bubble = true) { parent::__construct($level, $bubble); - if (!$message instanceof Swift_Message && is_callable($message)) { + if (!$message instanceof Swift_Message) { $message = $message(); } if (!$message instanceof Swift_Message) { @@ -48,7 +46,7 @@ class MandrillHandler extends MailHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function send(string $content, array $records): void { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php index 30630911..33ab68c6 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php @@ -14,9 +14,10 @@ namespace Monolog\Handler; use MongoDB\Driver\BulkWrite; use MongoDB\Driver\Manager; use MongoDB\Client; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\MongoDBFormatter; +use Monolog\LogRecord; /** * Logs to a MongoDB database. @@ -33,12 +34,11 @@ use Monolog\Formatter\MongoDBFormatter; */ class MongoDBHandler extends AbstractProcessingHandler { - /** @var \MongoDB\Collection */ - private $collection; - /** @var Client|Manager */ - private $manager; - /** @var string */ - private $namespace; + private \MongoDB\Collection $collection; + + private Client|Manager $manager; + + private string|null $namespace = null; /** * Constructor. @@ -47,12 +47,8 @@ class MongoDBHandler extends AbstractProcessingHandler * @param string $database Database name * @param string $collection Collection name */ - public function __construct($mongodb, string $database, string $collection, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(Client|Manager $mongodb, string $database, string $collection, int|string|Level $level = Level::Debug, bool $bubble = true) { - if (!($mongodb instanceof Client || $mongodb instanceof Manager)) { - throw new \InvalidArgumentException('MongoDB\Client or MongoDB\Driver\Manager instance required'); - } - if ($mongodb instanceof Client) { $this->collection = $mongodb->selectCollection($database, $collection); } else { @@ -63,21 +59,21 @@ class MongoDBHandler extends AbstractProcessingHandler parent::__construct($level, $bubble); } - protected function write(array $record): void + protected function write(LogRecord $record): void { if (isset($this->collection)) { - $this->collection->insertOne($record['formatted']); + $this->collection->insertOne($record->formatted); } if (isset($this->manager, $this->namespace)) { $bulk = new BulkWrite; - $bulk->insert($record["formatted"]); + $bulk->insert($record->formatted); $this->manager->executeBulkWrite($this->namespace, $bulk); } } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php index 0c0a3bdb..d4c9d801 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php @@ -11,7 +11,7 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\LineFormatter; /** @@ -26,43 +26,39 @@ class NativeMailerHandler extends MailHandler * The email addresses to which the message will be sent * @var string[] */ - protected $to; + protected array $to; /** * The subject of the email - * @var string */ - protected $subject; + protected string $subject; /** * Optional headers for the message * @var string[] */ - protected $headers = []; + protected array $headers = []; /** * Optional parameters for the message * @var string[] */ - protected $parameters = []; + protected array $parameters = []; /** * The wordwrap length for the message - * @var int */ - protected $maxColumnWidth; + protected int $maxColumnWidth; /** * The Content-type for the message - * @var string|null */ - protected $contentType; + protected string|null $contentType = null; /** * The encoding for the message - * @var string */ - protected $encoding = 'utf-8'; + protected string $encoding = 'utf-8'; /** * @param string|string[] $to The receiver of the mail @@ -70,7 +66,7 @@ class NativeMailerHandler extends MailHandler * @param string $from The sender of the mail * @param int $maxColumnWidth The maximum column width that the message lines will have */ - public function __construct($to, string $subject, string $from, $level = Logger::ERROR, bool $bubble = true, int $maxColumnWidth = 70) + public function __construct(string|array $to, string $subject, string $from, int|string|Level $level = Level::Error, bool $bubble = true, int $maxColumnWidth = 70) { parent::__construct($level, $bubble); $this->to = (array) $to; @@ -109,11 +105,11 @@ class NativeMailerHandler extends MailHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function send(string $content, array $records): void { - $contentType = $this->getContentType() ?: ($this->isHtmlBody($content) ? 'text/html' : 'text/plain'); + $contentType = $this->getContentType() ?? ($this->isHtmlBody($content) ? 'text/html' : 'text/plain'); if ($contentType !== 'text/html') { $content = wordwrap($content, $this->maxColumnWidth); @@ -125,11 +121,8 @@ class NativeMailerHandler extends MailHandler $headers .= 'MIME-Version: 1.0' . "\r\n"; } - $subject = $this->subject; - if ($records) { - $subjectFormatter = new LineFormatter($this->subject); - $subject = $subjectFormatter->format($this->getHighestRecord($records)); - } + $subjectFormatter = new LineFormatter($this->subject); + $subject = $subjectFormatter->format($this->getHighestRecord($records)); $parameters = implode(' ', $this->parameters); foreach ($this->to as $to) { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php index 114d749e..b8cb3785 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -11,16 +11,17 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Class to record a log on a NewRelic application. * Enabling New Relic High Security mode may prevent capture of useful information. * - * This handler requires a NormalizerFormatter to function and expects an array in $record['formatted'] + * This handler requires a NormalizerFormatter to function and expects an array in $record->formatted * * @see https://docs.newrelic.com/docs/agents/php-agent * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security @@ -28,75 +29,58 @@ use Monolog\Formatter\FormatterInterface; class NewRelicHandler extends AbstractProcessingHandler { /** - * Name of the New Relic application that will receive logs from this handler. - * - * @var ?string - */ - protected $appName; - - /** - * Name of the current transaction - * - * @var ?string - */ - protected $transactionName; - - /** - * Some context and extra data is passed into the handler as arrays of values. Do we send them as is - * (useful if we are using the API), or explode them for display on the NewRelic RPM website? - * - * @var bool - */ - protected $explodeArrays; - - /** - * {@inheritDoc} - * - * @param string|null $appName - * @param bool $explodeArrays - * @param string|null $transactionName + * @inheritDoc */ public function __construct( - $level = Logger::ERROR, + int|string|Level $level = Level::Error, bool $bubble = true, - ?string $appName = null, - bool $explodeArrays = false, - ?string $transactionName = null + + /** + * Name of the New Relic application that will receive logs from this handler. + */ + protected string|null $appName = null, + + /** + * Some context and extra data is passed into the handler as arrays of values. Do we send them as is + * (useful if we are using the API), or explode them for display on the NewRelic RPM website? + */ + protected bool $explodeArrays = false, + + /** + * Name of the current transaction + */ + protected string|null $transactionName = null ) { parent::__construct($level, $bubble); - - $this->appName = $appName; - $this->explodeArrays = $explodeArrays; - $this->transactionName = $transactionName; } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { if (!$this->isNewRelicEnabled()) { throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler'); } - if ($appName = $this->getAppName($record['context'])) { + if (null !== ($appName = $this->getAppName($record->context))) { $this->setNewRelicAppName($appName); } - if ($transactionName = $this->getTransactionName($record['context'])) { + if (null !== ($transactionName = $this->getTransactionName($record->context))) { $this->setNewRelicTransactionName($transactionName); - unset($record['formatted']['context']['transaction_name']); + unset($record->formatted['context']['transaction_name']); } - if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) { - newrelic_notice_error($record['message'], $record['context']['exception']); - unset($record['formatted']['context']['exception']); + if (isset($record->context['exception']) && $record->context['exception'] instanceof \Throwable) { + newrelic_notice_error($record->message, $record->context['exception']); + unset($record->formatted['context']['exception']); } else { - newrelic_notice_error($record['message']); + newrelic_notice_error($record->message); } - if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) { - foreach ($record['formatted']['context'] as $key => $parameter) { + if (isset($record->formatted['context']) && is_array($record->formatted['context'])) { + foreach ($record->formatted['context'] as $key => $parameter) { if (is_array($parameter) && $this->explodeArrays) { foreach ($parameter as $paramKey => $paramValue) { $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue); @@ -107,8 +91,8 @@ class NewRelicHandler extends AbstractProcessingHandler } } - if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) { - foreach ($record['formatted']['extra'] as $key => $parameter) { + if (isset($record->formatted['extra']) && is_array($record->formatted['extra'])) { + foreach ($record->formatted['extra'] as $key => $parameter) { if (is_array($parameter) && $this->explodeArrays) { foreach ($parameter as $paramKey => $paramValue) { $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue); @@ -122,8 +106,6 @@ class NewRelicHandler extends AbstractProcessingHandler /** * Checks whether the NewRelic extension is enabled in the system. - * - * @return bool */ protected function isNewRelicEnabled(): bool { @@ -177,8 +159,7 @@ class NewRelicHandler extends AbstractProcessingHandler } /** - * @param string $key - * @param mixed $value + * @param mixed $value */ protected function setNewRelicParameter(string $key, $value): void { @@ -190,7 +171,7 @@ class NewRelicHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php index 1ddf0beb..d9fea180 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php @@ -11,6 +11,8 @@ namespace Monolog\Handler; +use Monolog\LogRecord; + /** * No-op * @@ -23,17 +25,17 @@ namespace Monolog\Handler; class NoopHandler extends Handler { /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { return true; } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { return false; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php index e75ee0c6..1aa84e4f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php @@ -11,8 +11,10 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Psr\Log\LogLevel; +use Monolog\Logger; +use Monolog\LogRecord; /** * Blackhole @@ -21,40 +23,34 @@ use Psr\Log\LogLevel; * to put on top of an existing stack to override it temporarily. * * @author Jordi Boggiano - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class NullHandler extends Handler { - /** - * @var int - */ - private $level; + private Level $level; /** - * @param string|int $level The minimum logging level at which this handler will be triggered + * @param string|int|Level $level The minimum logging level at which this handler will be triggered * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function __construct($level = Logger::DEBUG) + public function __construct(string|int|Level $level = Level::Debug) { $this->level = Logger::toMonologLevel($level); } /** - * {@inheritDoc} + * @inheritDoc */ - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { - return $record['level'] >= $this->level; + return $record->level->value >= $this->level->value; } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - return $record['level'] >= $this->level; + return $record->level->value >= $this->level->value; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php index 22068c9a..a72b7a11 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/OverflowHandler.php @@ -11,8 +11,9 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Handler to only pass log messages when a certain threshold of number of messages is reached. @@ -27,7 +28,7 @@ use Monolog\Formatter\FormatterInterface; * $handler = new SomeHandler(...) * * // Pass all warnings to the handler when more than 10 & all error messages when more then 5 - * $overflow = new OverflowHandler($handler, [Logger::WARNING => 10, Logger::ERROR => 5]); + * $overflow = new OverflowHandler($handler, [Level::Warning->value => 10, Level::Error->value => 5]); * * $log->pushHandler($overflow); *``` @@ -36,36 +37,25 @@ use Monolog\Formatter\FormatterInterface; */ class OverflowHandler extends AbstractHandler implements FormattableHandlerInterface { - /** @var HandlerInterface */ - private $handler; + private HandlerInterface $handler; - /** @var int[] */ - private $thresholdMap = [ - Logger::DEBUG => 0, - Logger::INFO => 0, - Logger::NOTICE => 0, - Logger::WARNING => 0, - Logger::ERROR => 0, - Logger::CRITICAL => 0, - Logger::ALERT => 0, - Logger::EMERGENCY => 0, - ]; + /** @var array */ + private array $thresholdMap = []; /** * Buffer of all messages passed to the handler before the threshold was reached * * @var mixed[][] */ - private $buffer = []; + private array $buffer = []; /** - * @param HandlerInterface $handler - * @param int[] $thresholdMap Dictionary of logger level => threshold + * @param array $thresholdMap Dictionary of log level value => threshold */ public function __construct( HandlerInterface $handler, array $thresholdMap = [], - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true ) { $this->handler = $handler; @@ -85,15 +75,15 @@ class OverflowHandler extends AbstractHandler implements FormattableHandlerInter * Unless the bubbling is interrupted (by returning true), the Logger class will keep on * calling further handlers in the stack with a given log record. * - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - if ($record['level'] < $this->level) { + if ($record->level->isLowerThan($this->level)) { return false; } - $level = $record['level']; + $level = $record->level->value; if (!isset($this->thresholdMap[$level])) { $this->thresholdMap[$level] = 0; @@ -122,7 +112,7 @@ class OverflowHandler extends AbstractHandler implements FormattableHandlerInter } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -136,7 +126,7 @@ class OverflowHandler extends AbstractHandler implements FormattableHandlerInter } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php index 23a1d117..8aa78e4c 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php @@ -13,11 +13,13 @@ namespace Monolog\Handler; use Monolog\Formatter\LineFormatter; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; use PhpConsole\Connector; use PhpConsole\Handler as VendorPhpConsoleHandler; use PhpConsole\Helper; +use Monolog\LogRecord; +use PhpConsole\Storage; /** * Monolog handler for Google Chrome extension "PHP Console" @@ -37,14 +39,59 @@ use PhpConsole\Helper; * PC::debug($_SERVER); // PHP Console debugger for any type of vars * * @author Sergey Barbushin https://www.linkedin.com/in/barbushin + * @phpstan-type Options array{ + * enabled: bool, + * classesPartialsTraceIgnore: string[], + * debugTagsKeysInContext: array, + * useOwnErrorsHandler: bool, + * useOwnExceptionsHandler: bool, + * sourcesBasePath: string|null, + * registerHelper: bool, + * serverEncoding: string|null, + * headersLimit: int|null, + * password: string|null, + * enableSslOnlyMode: bool, + * ipMasks: string[], + * enableEvalListener: bool, + * dumperDetectCallbacks: bool, + * dumperLevelLimit: int, + * dumperItemsCountLimit: int, + * dumperItemSizeLimit: int, + * dumperDumpSizeLimit: int, + * detectDumpTraceAndSource: bool, + * dataStorage: Storage|null + * } + * @phpstan-type InputOptions array{ + * enabled?: bool, + * classesPartialsTraceIgnore?: string[], + * debugTagsKeysInContext?: array, + * useOwnErrorsHandler?: bool, + * useOwnExceptionsHandler?: bool, + * sourcesBasePath?: string|null, + * registerHelper?: bool, + * serverEncoding?: string|null, + * headersLimit?: int|null, + * password?: string|null, + * enableSslOnlyMode?: bool, + * ipMasks?: string[], + * enableEvalListener?: bool, + * dumperDetectCallbacks?: bool, + * dumperLevelLimit?: int, + * dumperItemsCountLimit?: int, + * dumperItemSizeLimit?: int, + * dumperDumpSizeLimit?: int, + * detectDumpTraceAndSource?: bool, + * dataStorage?: Storage|null + * } * - * @phpstan-import-type Record from \Monolog\Logger * @deprecated Since 2.8.0 and 3.2.0, PHPConsole is abandoned and thus we will drop this handler in Monolog 4 */ class PHPConsoleHandler extends AbstractProcessingHandler { - /** @var array */ - private $options = [ + /** + * @phpstan-var Options + */ + private array $options = [ 'enabled' => true, // bool Is PHP Console server enabled 'classesPartialsTraceIgnore' => ['Monolog\\'], // array Hide calls of classes started with... 'debugTagsKeysInContext' => [0, 'tag'], // bool Is PHP Console server enabled @@ -67,15 +114,15 @@ class PHPConsoleHandler extends AbstractProcessingHandler 'dataStorage' => null, // \PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ) ]; - /** @var Connector */ - private $connector; + private Connector $connector; /** * @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional) * @throws \RuntimeException + * @phpstan-param InputOptions $options */ - public function __construct(array $options = [], ?Connector $connector = null, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(array $options = [], ?Connector $connector = null, int|string|Level $level = Level::Debug, bool $bubble = true) { if (!class_exists('PhpConsole\Connector')) { throw new \RuntimeException('PHP Console library not found. See https://github.com/barbushin/php-console#installation'); @@ -86,14 +133,16 @@ class PHPConsoleHandler extends AbstractProcessingHandler } /** - * @param array $options - * + * @param array $options * @return array + * + * @phpstan-param InputOptions $options + * @phpstan-return Options */ private function initOptions(array $options): array { $wrongOptions = array_diff(array_keys($options), array_keys($this->options)); - if ($wrongOptions) { + if (\count($wrongOptions) > 0) { throw new \RuntimeException('Unknown options: ' . implode(', ', $wrongOptions)); } @@ -102,8 +151,8 @@ class PHPConsoleHandler extends AbstractProcessingHandler private function initConnector(?Connector $connector = null): Connector { - if (!$connector) { - if ($this->options['dataStorage']) { + if (null === $connector) { + if ($this->options['dataStorage'] instanceof Storage) { Connector::setPostponeStorage($this->options['dataStorage']); } $connector = Connector::getInstance(); @@ -120,22 +169,22 @@ class PHPConsoleHandler extends AbstractProcessingHandler $handler->setHandleExceptions($this->options['useOwnExceptionsHandler']); $handler->start(); } - if ($this->options['sourcesBasePath']) { + if (null !== $this->options['sourcesBasePath']) { $connector->setSourcesBasePath($this->options['sourcesBasePath']); } - if ($this->options['serverEncoding']) { + if (null !== $this->options['serverEncoding']) { $connector->setServerEncoding($this->options['serverEncoding']); } - if ($this->options['password']) { + if (null !== $this->options['password']) { $connector->setPassword($this->options['password']); } if ($this->options['enableSslOnlyMode']) { $connector->enableSslOnlyMode(); } - if ($this->options['ipMasks']) { + if (\count($this->options['ipMasks']) > 0) { $connector->setAllowedIpMasks($this->options['ipMasks']); } - if ($this->options['headersLimit']) { + if (null !== $this->options['headersLimit'] && $this->options['headersLimit'] > 0) { $connector->setHeadersLimit($this->options['headersLimit']); } if ($this->options['detectDumpTraceAndSource']) { @@ -168,7 +217,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler return $this->options; } - public function handle(array $record): bool + public function handle(LogRecord $record): bool { if ($this->options['enabled'] && $this->connector->isActiveClient()) { return parent::handle($record); @@ -180,48 +229,39 @@ class PHPConsoleHandler extends AbstractProcessingHandler /** * Writes the record down to the log of the implementing handler */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - if ($record['level'] < Logger::NOTICE) { + if ($record->level->isLowerThan(Level::Notice)) { $this->handleDebugRecord($record); - } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) { + } elseif (isset($record->context['exception']) && $record->context['exception'] instanceof \Throwable) { $this->handleExceptionRecord($record); } else { $this->handleErrorRecord($record); } } - /** - * @phpstan-param Record $record - */ - private function handleDebugRecord(array $record): void + private function handleDebugRecord(LogRecord $record): void { - $tags = $this->getRecordTags($record); - $message = $record['message']; - if ($record['context']) { - $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true); + [$tags, $filteredContext] = $this->getRecordTags($record); + $message = $record->message; + if (\count($filteredContext) > 0) { + $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($filteredContext)), null, true); } $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']); } - /** - * @phpstan-param Record $record - */ - private function handleExceptionRecord(array $record): void + private function handleExceptionRecord(LogRecord $record): void { - $this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']); + $this->connector->getErrorsDispatcher()->dispatchException($record->context['exception']); } - /** - * @phpstan-param Record $record - */ - private function handleErrorRecord(array $record): void + private function handleErrorRecord(LogRecord $record): void { - $context = $record['context']; + $context = $record->context; $this->connector->getErrorsDispatcher()->dispatchError( $context['code'] ?? null, - $context['message'] ?? $record['message'], + $context['message'] ?? $record->message, $context['file'] ?? null, $context['line'] ?? null, $this->options['classesPartialsTraceIgnore'] @@ -229,32 +269,32 @@ class PHPConsoleHandler extends AbstractProcessingHandler } /** - * @phpstan-param Record $record - * @return string + * @return array{string, mixed[]} */ - private function getRecordTags(array &$record) + private function getRecordTags(LogRecord $record): array { $tags = null; - if (!empty($record['context'])) { - $context = & $record['context']; + $filteredContext = []; + if ($record->context !== []) { + $filteredContext = $record->context; foreach ($this->options['debugTagsKeysInContext'] as $key) { - if (!empty($context[$key])) { - $tags = $context[$key]; + if (isset($filteredContext[$key])) { + $tags = $filteredContext[$key]; if ($key === 0) { - array_shift($context); + array_shift($filteredContext); } else { - unset($context[$key]); + unset($filteredContext[$key]); } break; } } } - return $tags ?: strtolower($record['level_name']); + return [$tags ?? $record->level->toPsrLogLevel(), $filteredContext]; } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php index 8a8cf1be..9edc9ac5 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessHandler.php @@ -11,7 +11,8 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Stores to STDIN of any process, specified by a command. @@ -33,20 +34,14 @@ class ProcessHandler extends AbstractProcessingHandler */ private $process; - /** - * @var string - */ - private $command; + private string $command; - /** - * @var string|null - */ - private $cwd; + private ?string $cwd; /** * @var resource[] */ - private $pipes = []; + private array $pipes = []; /** * @var array @@ -63,7 +58,7 @@ class ProcessHandler extends AbstractProcessingHandler * @param string|null $cwd "Current working directory" (CWD) for the process to be executed in. * @throws \InvalidArgumentException */ - public function __construct(string $command, $level = Logger::DEBUG, bool $bubble = true, ?string $cwd = null) + public function __construct(string $command, int|string|Level $level = Level::Debug, bool $bubble = true, ?string $cwd = null) { if ($command === '') { throw new \InvalidArgumentException('The command argument must be a non-empty string.'); @@ -83,14 +78,14 @@ class ProcessHandler extends AbstractProcessingHandler * * @throws \UnexpectedValueException */ - protected function write(array $record): void + protected function write(LogRecord $record): void { $this->ensureProcessIsStarted(); - $this->writeProcessInput($record['formatted']); + $this->writeProcessInput($record->formatted); $errors = $this->readProcessErrors(); - if (empty($errors) === false) { + if ($errors !== '') { throw new \UnexpectedValueException(sprintf('Errors while writing to process: %s', $errors)); } } @@ -134,7 +129,7 @@ class ProcessHandler extends AbstractProcessingHandler $errors = $this->readProcessErrors(); - if (is_resource($this->process) === false || empty($errors) === false) { + if (is_resource($this->process) === false || $errors !== '') { throw new \UnexpectedValueException( sprintf('The process "%s" could not be opened: ' . $errors, $this->command) ); @@ -176,7 +171,7 @@ class ProcessHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php index 3adec7a4..9fb290fa 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php @@ -12,20 +12,19 @@ namespace Monolog\Handler; use Monolog\Processor\ProcessorInterface; +use Monolog\LogRecord; /** * Interface to describe loggers that have processors * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger */ interface ProcessableHandlerInterface { /** * Adds a processor in the stack. * - * @psalm-param ProcessorInterface|callable(Record): Record $callback + * @phpstan-param ProcessorInterface|(callable(LogRecord): LogRecord) $callback * * @param ProcessorInterface|callable $callback * @return HandlerInterface self @@ -35,7 +34,7 @@ interface ProcessableHandlerInterface /** * Removes the processor on top of the stack and returns it. * - * @psalm-return ProcessorInterface|callable(Record): Record $callback + * @phpstan-return ProcessorInterface|(callable(LogRecord): LogRecord) $callback * * @throws \LogicException In case the processor stack is empty * @return callable|ProcessorInterface diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php index 9ef6e301..74eedddd 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php @@ -13,24 +13,23 @@ namespace Monolog\Handler; use Monolog\ResettableInterface; use Monolog\Processor\ProcessorInterface; +use Monolog\LogRecord; /** * Helper trait for implementing ProcessableInterface * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger */ trait ProcessableHandlerTrait { /** * @var callable[] - * @phpstan-var array + * @phpstan-var array<(callable(LogRecord): LogRecord)|ProcessorInterface> */ - protected $processors = []; + protected array $processors = []; /** - * {@inheritDoc} + * @inheritDoc */ public function pushProcessor(callable $callback): HandlerInterface { @@ -40,24 +39,18 @@ trait ProcessableHandlerTrait } /** - * {@inheritDoc} + * @inheritDoc */ public function popProcessor(): callable { - if (!$this->processors) { + if (\count($this->processors) === 0) { throw new \LogicException('You tried to pop from an empty processor stack.'); } return array_shift($this->processors); } - /** - * Processes a record. - * - * @phpstan-param Record $record - * @phpstan-return Record - */ - protected function processRecord(array $record): array + protected function processRecord(LogRecord $record): LogRecord { foreach ($this->processors as $processor) { $record = $processor($record); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php index 36e19ccc..6599a83b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php @@ -11,9 +11,10 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Psr\Log\LoggerInterface; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Proxies log messages to an existing PSR-3 compliant logger. @@ -28,20 +29,15 @@ class PsrHandler extends AbstractHandler implements FormattableHandlerInterface { /** * PSR-3 compliant logger - * - * @var LoggerInterface */ - protected $logger; + protected LoggerInterface $logger; - /** - * @var FormatterInterface|null - */ - protected $formatter; + protected FormatterInterface|null $formatter = null; /** * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied */ - public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(LoggerInterface $logger, int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); @@ -49,19 +45,19 @@ class PsrHandler extends AbstractHandler implements FormattableHandlerInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { if (!$this->isHandling($record)) { return false; } - if ($this->formatter) { + if ($this->formatter !== null) { $formatted = $this->formatter->format($record); - $this->logger->log(strtolower($record['level_name']), (string) $formatted, $record['context']); + $this->logger->log($record->level->toPsrLogLevel(), (string) $formatted, $record->context); } else { - $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']); + $this->logger->log($record->level->toPsrLogLevel(), $record->message, $record->context); } return false === $this->bubble; @@ -69,8 +65,6 @@ class PsrHandler extends AbstractHandler implements FormattableHandlerInterface /** * Sets the formatter. - * - * @param FormatterInterface $formatter */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -81,12 +75,10 @@ class PsrHandler extends AbstractHandler implements FormattableHandlerInterface /** * Gets the formatter. - * - * @return FormatterInterface */ public function getFormatter(): FormatterInterface { - if (!$this->formatter) { + if ($this->formatter === null) { throw new \LogicException('No formatter has been set and this handler does not have a default formatter'); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php index fed2303d..118f5760 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php @@ -11,48 +11,45 @@ namespace Monolog\Handler; +use Monolog\Level; use Monolog\Logger; use Monolog\Utils; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Sends notifications through the pushover api to mobile phones * * @author Sebastian Göttschkes * @see https://www.pushover.net/api - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class PushoverHandler extends SocketHandler { - /** @var string */ - private $token; - /** @var array */ - private $users; - /** @var string */ - private $title; - /** @var string|int|null */ - private $user = null; - /** @var int */ - private $retry; - /** @var int */ - private $expire; + private string $token; - /** @var int */ - private $highPriorityLevel; - /** @var int */ - private $emergencyLevel; - /** @var bool */ - private $useFormattedMessage = false; + /** @var array */ + private array $users; + + private string $title; + + private string|int|null $user = null; + + private int $retry; + + private int $expire; + + private Level $highPriorityLevel; + + private Level $emergencyLevel; + + private bool $useFormattedMessage = false; /** * All parameters that can be sent to Pushover * @see https://pushover.net/api * @var array */ - private $parameterNames = [ + private array $parameterNames = [ 'token' => true, 'user' => true, 'message' => true, @@ -73,40 +70,42 @@ class PushoverHandler extends SocketHandler * @see https://pushover.net/api#sounds * @var string[] */ - private $sounds = [ + private array $sounds = [ 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming', 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb', 'persistent', 'echo', 'updown', 'none', ]; /** - * @param string $token Pushover api token - * @param string|array $users Pushover user id or array of ids the message will be sent to - * @param string|null $title Title sent to the Pushover API - * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not - * the pushover.net app owner. OpenSSL is required for this option. - * @param string|int $highPriorityLevel The minimum logging level at which this handler will start - * sending "high priority" requests to the Pushover API - * @param string|int $emergencyLevel The minimum logging level at which this handler will start - * sending "emergency" requests to the Pushover API - * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will - * send the same notification to the user. - * @param int $expire The expire parameter specifies how many seconds your notification will continue - * to be retried for (every retry seconds). + * @param string $token Pushover api token + * @param string|array $users Pushover user id or array of ids the message will be sent to + * @param string|null $title Title sent to the Pushover API + * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not + * the pushover.net app owner. OpenSSL is required for this option. + * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will + * send the same notification to the user. + * @param int $expire The expire parameter specifies how many seconds your notification will continue + * to be retried for (every retry seconds). + * + * @param int|string|Level|LogLevel::* $highPriorityLevel The minimum logging level at which this handler will start + * sending "high priority" requests to the Pushover API + * @param int|string|Level|LogLevel::* $emergencyLevel The minimum logging level at which this handler will start + * sending "emergency" requests to the Pushover API + * * * @phpstan-param string|array $users - * @phpstan-param Level|LevelName|LogLevel::* $highPriorityLevel - * @phpstan-param Level|LevelName|LogLevel::* $emergencyLevel + * @phpstan-param value-of|value-of|Level|LogLevel::* $highPriorityLevel + * @phpstan-param value-of|value-of|Level|LogLevel::* $emergencyLevel */ public function __construct( string $token, $users, ?string $title = null, - $level = Logger::CRITICAL, + int|string|Level $level = Level::Critical, bool $bubble = true, bool $useSSL = true, - $highPriorityLevel = Logger::CRITICAL, - $emergencyLevel = Logger::EMERGENCY, + int|string|Level $highPriorityLevel = Level::Critical, + int|string|Level $emergencyLevel = Level::Emergency, int $retry = 30, int $expire = 25200, bool $persistent = false, @@ -129,32 +128,29 @@ class PushoverHandler extends SocketHandler $this->token = $token; $this->users = (array) $users; - $this->title = $title ?: (string) gethostname(); + $this->title = $title ?? (string) gethostname(); $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel); $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel); $this->retry = $retry; $this->expire = $expire; } - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { $content = $this->buildContent($record); return $this->buildHeader($content) . $content; } - /** - * @phpstan-param FormattedRecord $record - */ - private function buildContent(array $record): string + private function buildContent(LogRecord $record): string { // Pushover has a limit of 512 characters on title and message combined. $maxMessageLength = 512 - strlen($this->title); - $message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message']; + $message = ($this->useFormattedMessage) ? $record->formatted : $record->message; $message = Utils::substr($message, 0, $maxMessageLength); - $timestamp = $record['datetime']->getTimestamp(); + $timestamp = $record->datetime->getTimestamp(); $dataArray = [ 'token' => $this->token, @@ -164,23 +160,23 @@ class PushoverHandler extends SocketHandler 'timestamp' => $timestamp, ]; - if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) { + if ($record->level->value >= $this->emergencyLevel->value) { $dataArray['priority'] = 2; $dataArray['retry'] = $this->retry; $dataArray['expire'] = $this->expire; - } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) { + } elseif ($record->level->value >= $this->highPriorityLevel->value) { $dataArray['priority'] = 1; } // First determine the available parameters - $context = array_intersect_key($record['context'], $this->parameterNames); - $extra = array_intersect_key($record['extra'], $this->parameterNames); + $context = array_intersect_key($record->context, $this->parameterNames); + $extra = array_intersect_key($record->extra, $this->parameterNames); // Least important info should be merged with subsequent info $dataArray = array_merge($extra, $context, $dataArray); // Only pass sounds that are supported by the API - if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) { + if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds, true)) { unset($dataArray['sound']); } @@ -198,7 +194,7 @@ class PushoverHandler extends SocketHandler return $header; } - protected function write(array $record): void + protected function write(LogRecord $record): void { foreach ($this->users as $user) { $this->user = $user; @@ -211,25 +207,25 @@ class PushoverHandler extends SocketHandler } /** - * @param int|string $value + * @param int|string|Level|LogLevel::* $level * - * @phpstan-param Level|LevelName|LogLevel::* $value + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function setHighPriorityLevel($value): self + public function setHighPriorityLevel(int|string|Level $level): self { - $this->highPriorityLevel = Logger::toMonologLevel($value); + $this->highPriorityLevel = Logger::toMonologLevel($level); return $this; } /** - * @param int|string $value + * @param int|string|Level|LogLevel::* $level * - * @phpstan-param Level|LevelName|LogLevel::* $value + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function setEmergencyLevel($value): self + public function setEmergencyLevel(int|string|Level $level): self { - $this->emergencyLevel = Logger::toMonologLevel($value); + $this->emergencyLevel = Logger::toMonologLevel($level); return $this; } @@ -237,9 +233,9 @@ class PushoverHandler extends SocketHandler /** * Use the formatted message? */ - public function useFormattedMessage(bool $value): self + public function useFormattedMessage(bool $useFormattedMessage): self { - $this->useFormattedMessage = $value; + $this->useFormattedMessage = $useFormattedMessage; return $this; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php index 91d16eaf..5eee5dc6 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php @@ -13,7 +13,10 @@ namespace Monolog\Handler; use Monolog\Formatter\LineFormatter; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; +use Predis\Client as Predis; +use Redis; /** * Logs to a Redis key using rpush @@ -25,29 +28,21 @@ use Monolog\Logger; * $log->pushHandler($redis); * * @author Thomas Tourlourat - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class RedisHandler extends AbstractProcessingHandler { - /** @var \Predis\Client<\Predis\Client>|\Redis */ - private $redisClient; - /** @var string */ - private $redisKey; - /** @var int */ - protected $capSize; + /** @var Predis|Redis */ + private Predis|Redis $redisClient; + private string $redisKey; + protected int $capSize; /** - * @param \Predis\Client<\Predis\Client>|\Redis $redis The redis instance - * @param string $key The key name to push records to - * @param int $capSize Number of entries to limit list size to, 0 = unlimited + * @param Predis|Redis $redis The redis instance + * @param string $key The key name to push records to + * @param int $capSize Number of entries to limit list size to, 0 = unlimited */ - public function __construct($redis, string $key, $level = Logger::DEBUG, bool $bubble = true, int $capSize = 0) + public function __construct(Predis|Redis $redis, string $key, int|string|Level $level = Level::Debug, bool $bubble = true, int $capSize = 0) { - if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { - throw new \InvalidArgumentException('Predis\Client or Redis instance required'); - } - $this->redisClient = $redis; $this->redisKey = $key; $this->capSize = $capSize; @@ -56,43 +51,41 @@ class RedisHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - if ($this->capSize) { + if ($this->capSize > 0) { $this->writeCapped($record); } else { - $this->redisClient->rpush($this->redisKey, $record["formatted"]); + $this->redisClient->rpush($this->redisKey, $record->formatted); } } /** * Write and cap the collection * Writes the record to the redis list and caps its - * - * @phpstan-param FormattedRecord $record */ - protected function writeCapped(array $record): void + protected function writeCapped(LogRecord $record): void { - if ($this->redisClient instanceof \Redis) { - $mode = defined('\Redis::MULTI') ? \Redis::MULTI : 1; + if ($this->redisClient instanceof Redis) { + $mode = defined('Redis::MULTI') ? Redis::MULTI : 1; $this->redisClient->multi($mode) - ->rpush($this->redisKey, $record["formatted"]) + ->rPush($this->redisKey, $record->formatted) ->ltrim($this->redisKey, -$this->capSize, -1) ->exec(); } else { $redisKey = $this->redisKey; $capSize = $this->capSize; $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) { - $tx->rpush($redisKey, $record["formatted"]); + $tx->rpush($redisKey, $record->formatted); $tx->ltrim($redisKey, -$capSize, -1); }); } } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php index 7789309c..fa8e9e9f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RedisPubSubHandler.php @@ -13,7 +13,10 @@ namespace Monolog\Handler; use Monolog\Formatter\LineFormatter; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; +use Predis\Client as Predis; +use Redis; /** * Sends the message to a Redis Pub/Sub channel using PUBLISH @@ -21,28 +24,23 @@ use Monolog\Logger; * usage example: * * $log = new Logger('application'); - * $redis = new RedisPubSubHandler(new Predis\Client("tcp://localhost:6379"), "logs", Logger::WARNING); + * $redis = new RedisPubSubHandler(new Predis\Client("tcp://localhost:6379"), "logs", Level::Warning); * $log->pushHandler($redis); * * @author Gaëtan Faugère */ class RedisPubSubHandler extends AbstractProcessingHandler { - /** @var \Predis\Client<\Predis\Client>|\Redis */ - private $redisClient; - /** @var string */ - private $channelKey; + /** @var Predis|Redis */ + private Predis|Redis $redisClient; + private string $channelKey; /** - * @param \Predis\Client<\Predis\Client>|\Redis $redis The redis instance - * @param string $key The channel key to publish records to + * @param Predis|Redis $redis The redis instance + * @param string $key The channel key to publish records to */ - public function __construct($redis, string $key, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(Predis|Redis $redis, string $key, int|string|Level $level = Level::Debug, bool $bubble = true) { - if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { - throw new \InvalidArgumentException('Predis\Client or Redis instance required'); - } - $this->redisClient = $redis; $this->channelKey = $key; @@ -50,15 +48,15 @@ class RedisPubSubHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->redisClient->publish($this->channelKey, $record["formatted"]); + $this->redisClient->publish($this->channelKey, $record->formatted); } /** - * {@inheritDoc} + * @inheritDoc */ protected function getDefaultFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php index adcc9395..1d124723 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php @@ -11,9 +11,10 @@ namespace Monolog\Handler; +use Monolog\Level; use Rollbar\RollbarLogger; use Throwable; -use Monolog\Logger; +use Monolog\LogRecord; /** * Sends errors to Rollbar @@ -33,37 +34,19 @@ use Monolog\Logger; */ class RollbarHandler extends AbstractProcessingHandler { - /** - * @var RollbarLogger - */ - protected $rollbarLogger; - - /** @var string[] */ - protected $levelMap = [ - Logger::DEBUG => 'debug', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warning', - Logger::ERROR => 'error', - Logger::CRITICAL => 'critical', - Logger::ALERT => 'critical', - Logger::EMERGENCY => 'critical', - ]; + protected RollbarLogger $rollbarLogger; /** * Records whether any log records have been added since the last flush of the rollbar notifier - * - * @var bool */ - private $hasRecords = false; + private bool $hasRecords = false; - /** @var bool */ - protected $initialized = false; + protected bool $initialized = false; /** * @param RollbarLogger $rollbarLogger RollbarLogger object constructed with valid token */ - public function __construct(RollbarLogger $rollbarLogger, $level = Logger::ERROR, bool $bubble = true) + public function __construct(RollbarLogger $rollbarLogger, int|string|Level $level = Level::Error, bool $bubble = true) { $this->rollbarLogger = $rollbarLogger; @@ -71,22 +54,41 @@ class RollbarHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * Translates Monolog log levels to Rollbar levels. + * + * @return 'debug'|'info'|'warning'|'error'|'critical' */ - protected function write(array $record): void + protected function toRollbarLevel(Level $level): string + { + return match ($level) { + Level::Debug => 'debug', + Level::Info => 'info', + Level::Notice => 'info', + Level::Warning => 'warning', + Level::Error => 'error', + Level::Critical => 'critical', + Level::Alert => 'critical', + Level::Emergency => 'critical', + }; + } + + /** + * @inheritDoc + */ + protected function write(LogRecord $record): void { if (!$this->initialized) { // __destructor() doesn't get called on Fatal errors - register_shutdown_function(array($this, 'close')); + register_shutdown_function([$this, 'close']); $this->initialized = true; } - $context = $record['context']; - $context = array_merge($context, $record['extra'], [ - 'level' => $this->levelMap[$record['level']], - 'monolog_level' => $record['level_name'], - 'channel' => $record['channel'], - 'datetime' => $record['datetime']->format('U'), + $context = $record->context; + $context = array_merge($context, $record->extra, [ + 'level' => $this->toRollbarLevel($record->level), + 'monolog_level' => $record->level->getName(), + 'channel' => $record->channel, + 'datetime' => $record->datetime->format('U'), ]); if (isset($context['exception']) && $context['exception'] instanceof Throwable) { @@ -94,7 +96,7 @@ class RollbarHandler extends AbstractProcessingHandler unset($context['exception']); $toLog = $exception; } else { - $toLog = $record['message']; + $toLog = $record->message; } // @phpstan-ignore-next-line @@ -112,7 +114,7 @@ class RollbarHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { @@ -120,9 +122,9 @@ class RollbarHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - public function reset() + public function reset(): void { $this->flush(); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php index 17745d22..12ce6923 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -12,8 +12,9 @@ namespace Monolog\Handler; use InvalidArgumentException; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Stores logs to files that are rotated every day and a limited number of files are kept. @@ -30,26 +31,19 @@ class RotatingFileHandler extends StreamHandler public const FILE_PER_MONTH = 'Y-m'; public const FILE_PER_YEAR = 'Y'; - /** @var string */ - protected $filename; - /** @var int */ - protected $maxFiles; - /** @var bool */ - protected $mustRotate; - /** @var \DateTimeImmutable */ - protected $nextRotation; - /** @var string */ - protected $filenameFormat; - /** @var string */ - protected $dateFormat; + protected string $filename; + protected int $maxFiles; + protected bool|null $mustRotate = null; + protected \DateTimeImmutable $nextRotation; + protected string $filenameFormat; + protected string $dateFormat; /** - * @param string $filename - * @param int $maxFiles The maximal amount of files to keep (0 means unlimited) - * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) - * @param bool $useLocking Try to lock log file before doing any writes + * @param int $maxFiles The maximal amount of files to keep (0 means unlimited) + * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) + * @param bool $useLocking Try to lock log file before doing any writes */ - public function __construct(string $filename, int $maxFiles = 0, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) + public function __construct(string $filename, int $maxFiles = 0, int|string|Level $level = Level::Debug, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) { $this->filename = Utils::canonicalizePath($filename); $this->maxFiles = $maxFiles; @@ -61,7 +55,7 @@ class RotatingFileHandler extends StreamHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { @@ -73,9 +67,9 @@ class RotatingFileHandler extends StreamHandler } /** - * {@inheritDoc} + * @inheritDoc */ - public function reset() + public function reset(): void { parent::reset(); @@ -86,7 +80,7 @@ class RotatingFileHandler extends StreamHandler public function setFilenameFormat(string $filenameFormat, string $dateFormat): self { - if (!preg_match('{^[Yy](([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { + if (0 === preg_match('{^[Yy](([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { throw new InvalidArgumentException( 'Invalid date format - format must be one of '. 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '. @@ -108,16 +102,16 @@ class RotatingFileHandler extends StreamHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { // on the first record written, if the log is new, we should rotate (once per day) if (null === $this->mustRotate) { $this->mustRotate = null === $this->url || !file_exists($this->url); } - if ($this->nextRotation <= $record['datetime']) { + if ($this->nextRotation <= $record->datetime) { $this->mustRotate = true; $this->close(); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php index c128a32d..511ec585 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -11,7 +11,9 @@ namespace Monolog\Handler; +use Closure; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Sampling handler @@ -26,52 +28,42 @@ use Monolog\Formatter\FormatterInterface; * * @author Bryan Davis * @author Kunal Mehta - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger */ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInterface, FormattableHandlerInterface { use ProcessableHandlerTrait; /** - * @var HandlerInterface|callable - * @phpstan-var HandlerInterface|callable(Record|array{level: Level}|null, HandlerInterface): HandlerInterface - */ - protected $handler; - - /** - * @var int $factor - */ - protected $factor; - - /** - * @psalm-param HandlerInterface|callable(Record|array{level: Level}|null, HandlerInterface): HandlerInterface $handler + * Handler or factory Closure($record, $this) * - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler). - * @param int $factor Sample factor (e.g. 10 means every ~10th record is sampled) + * @phpstan-var (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface */ - public function __construct($handler, int $factor) + protected Closure|HandlerInterface $handler; + + protected int $factor; + + /** + * @phpstan-param (Closure(LogRecord|null, HandlerInterface): HandlerInterface)|HandlerInterface $handler + * + * @param Closure|HandlerInterface $handler Handler or factory Closure($record|null, $samplingHandler). + * @param int $factor Sample factor (e.g. 10 means every ~10th record is sampled) + */ + public function __construct(Closure|HandlerInterface $handler, int $factor) { parent::__construct(); $this->handler = $handler; $this->factor = $factor; - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } } - public function isHandling(array $record): bool + public function isHandling(LogRecord $record): bool { return $this->getHandler($record)->isHandling($record); } - public function handle(array $record): bool + public function handle(LogRecord $record): bool { if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } @@ -84,26 +76,23 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter /** * Return the nested handler * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @phpstan-param Record|array{level: Level}|null $record - * - * @return HandlerInterface + * If the handler was provided as a factory, this will trigger the handler's instantiation. */ - public function getHandler(array $record = null) + public function getHandler(LogRecord $record = null): HandlerInterface { if (!$this->handler instanceof HandlerInterface) { - $this->handler = ($this->handler)($record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); + $handler = ($this->handler)($record, $this); + if (!$handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory Closure should return a HandlerInterface"); } + $this->handler = $handler; } return $this->handler; } /** - * {@inheritDoc} + * @inheritDoc */ public function setFormatter(FormatterInterface $formatter): HandlerInterface { @@ -118,7 +107,7 @@ class SamplingHandler extends AbstractHandler implements ProcessableHandlerInter } /** - * {@inheritDoc} + * @inheritDoc */ public function getFormatter(): FormatterInterface { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php index 1280ee70..6228a02f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SendGridHandler.php @@ -11,7 +11,7 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; /** * SendGridrHandler uses the SendGrid API v2 function to send Log emails, more information in https://sendgrid.com/docs/API_Reference/Web_API/mail.html @@ -22,33 +22,29 @@ class SendGridHandler extends MailHandler { /** * The SendGrid API User - * @var string */ - protected $apiUser; + protected string $apiUser; /** * The SendGrid API Key - * @var string */ - protected $apiKey; + protected string $apiKey; /** * The email addresses to which the message will be sent - * @var string */ - protected $from; + protected string $from; /** * The email addresses to which the message will be sent * @var string[] */ - protected $to; + protected array $to; /** * The subject of the email - * @var string */ - protected $subject; + protected string $subject; /** * @param string $apiUser The SendGrid API User @@ -57,7 +53,7 @@ class SendGridHandler extends MailHandler * @param string|string[] $to The recipients of the email * @param string $subject The subject of the mail */ - public function __construct(string $apiUser, string $apiKey, string $from, $to, string $subject, $level = Logger::ERROR, bool $bubble = true) + public function __construct(string $apiUser, string $apiKey, string $from, string|array $to, string $subject, int|string|Level $level = Level::Error, bool $bubble = true) { if (!extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the SendGridHandler'); @@ -72,7 +68,7 @@ class SendGridHandler extends MailHandler } /** - * {@inheritDoc} + * @inheritDoc */ protected function send(string $content, array $records): void { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index 71a41094..7e9cccc9 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -11,10 +11,11 @@ namespace Monolog\Handler\Slack; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; use Monolog\Formatter\NormalizerFormatter; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; /** * Slack record utility helping to log to Slack webhooks or API. @@ -23,9 +24,6 @@ use Monolog\Formatter\FormatterInterface; * @author Haralan Dobrev * @see https://api.slack.com/incoming-webhooks * @see https://api.slack.com/docs/message-attachments - * - * @phpstan-import-type FormattedRecord from \Monolog\Handler\AbstractProcessingHandler - * @phpstan-import-type Record from \Monolog\Logger */ class SlackRecord { @@ -39,55 +37,43 @@ class SlackRecord /** * Slack channel (encoded ID or name) - * @var string|null */ - private $channel; + private string|null $channel; /** * Name of a bot - * @var string|null */ - private $username; + private string|null $username; /** * User icon e.g. 'ghost', 'http://example.com/user.png' - * @var string|null */ - private $userIcon; + private string|null $userIcon; /** * Whether the message should be added to Slack as attachment (plain text otherwise) - * @var bool */ - private $useAttachment; + private bool $useAttachment; /** * Whether the the context/extra messages added to Slack as attachments are in a short style - * @var bool */ - private $useShortAttachment; + private bool $useShortAttachment; /** * Whether the attachment should include context and extra data - * @var bool */ - private $includeContextAndExtra; + private bool $includeContextAndExtra; /** * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] * @var string[] */ - private $excludeFields; + private array $excludeFields; - /** - * @var ?FormatterInterface - */ - private $formatter; + private FormatterInterface|null $formatter; - /** - * @var NormalizerFormatter - */ - private $normalizerFormatter; + private NormalizerFormatter $normalizerFormatter; /** * @param string[] $excludeFields @@ -99,7 +85,7 @@ class SlackRecord ?string $userIcon = null, bool $useShortAttachment = false, bool $includeContextAndExtra = false, - array $excludeFields = array(), + array $excludeFields = [], FormatterInterface $formatter = null ) { $this @@ -121,77 +107,76 @@ class SlackRecord * Returns required data in format that Slack * is expecting. * - * @phpstan-param FormattedRecord $record * @phpstan-return mixed[] */ - public function getSlackData(array $record): array + public function getSlackData(LogRecord $record): array { - $dataArray = array(); - $record = $this->removeExcludedFields($record); + $dataArray = []; - if ($this->username) { + if ($this->username !== null) { $dataArray['username'] = $this->username; } - if ($this->channel) { + if ($this->channel !== null) { $dataArray['channel'] = $this->channel; } - if ($this->formatter && !$this->useAttachment) { - /** @phpstan-ignore-next-line */ + if ($this->formatter !== null && !$this->useAttachment) { $message = $this->formatter->format($record); } else { - $message = $record['message']; + $message = $record->message; } + $recordData = $this->removeExcludedFields($record); + if ($this->useAttachment) { - $attachment = array( - 'fallback' => $message, - 'text' => $message, - 'color' => $this->getAttachmentColor($record['level']), - 'fields' => array(), - 'mrkdwn_in' => array('fields'), - 'ts' => $record['datetime']->getTimestamp(), + $attachment = [ + 'fallback' => $message, + 'text' => $message, + 'color' => $this->getAttachmentColor($record->level), + 'fields' => [], + 'mrkdwn_in' => ['fields'], + 'ts' => $recordData['datetime']->getTimestamp(), 'footer' => $this->username, 'footer_icon' => $this->userIcon, - ); + ]; if ($this->useShortAttachment) { - $attachment['title'] = $record['level_name']; + $attachment['title'] = $recordData['level_name']; } else { $attachment['title'] = 'Message'; - $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); + $attachment['fields'][] = $this->generateAttachmentField('Level', $recordData['level_name']); } if ($this->includeContextAndExtra) { - foreach (array('extra', 'context') as $key) { - if (empty($record[$key])) { + foreach (['extra', 'context'] as $key) { + if (!isset($recordData[$key]) || \count($recordData[$key]) === 0) { continue; } if ($this->useShortAttachment) { $attachment['fields'][] = $this->generateAttachmentField( - (string) $key, - $record[$key] + $key, + $recordData[$key] ); } else { // Add all extra fields as individual fields in attachment $attachment['fields'] = array_merge( $attachment['fields'], - $this->generateAttachmentFields($record[$key]) + $this->generateAttachmentFields($recordData[$key]) ); } } } - $dataArray['attachments'] = array($attachment); + $dataArray['attachments'] = [$attachment]; } else { $dataArray['text'] = $message; } - if ($this->userIcon) { - if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { - $dataArray['icon_url'] = $this->userIcon; + if ($this->userIcon !== null) { + if (false !== ($iconUrl = filter_var($this->userIcon, FILTER_VALIDATE_URL))) { + $dataArray['icon_url'] = $iconUrl; } else { $dataArray['icon_emoji'] = ":{$this->userIcon}:"; } @@ -204,18 +189,14 @@ class SlackRecord * Returns a Slack message attachment color associated with * provided level. */ - public function getAttachmentColor(int $level): string + public function getAttachmentColor(Level $level): string { - switch (true) { - case $level >= Logger::ERROR: - return static::COLOR_DANGER; - case $level >= Logger::WARNING: - return static::COLOR_WARNING; - case $level >= Logger::INFO: - return static::COLOR_GOOD; - default: - return static::COLOR_DEFAULT; - } + return match ($level) { + Level::Error, Level::Critical, Level::Alert, Level::Emergency => static::COLOR_DANGER, + Level::Warning => static::COLOR_WARNING, + Level::Info, Level::Notice => static::COLOR_GOOD, + Level::Debug => static::COLOR_DEFAULT + }; } /** @@ -225,13 +206,13 @@ class SlackRecord */ public function stringify(array $fields): string { - /** @var Record $fields */ - $normalized = $this->normalizerFormatter->format($fields); + /** @var array $normalized */ + $normalized = $this->normalizerFormatter->normalizeValue($fields); - $hasSecondDimension = count(array_filter($normalized, 'is_array')); - $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); + $hasSecondDimension = \count(array_filter($normalized, 'is_array')) > 0; + $hasOnlyNonNumericKeys = \count(array_filter(array_keys($normalized), 'is_numeric')) === 0; - return $hasSecondDimension || $hasNonNumericKeys + return $hasSecondDimension || $hasOnlyNonNumericKeys ? Utils::jsonEncode($normalized, JSON_PRETTY_PRINT|Utils::DEFAULT_JSON_FLAGS) : Utils::jsonEncode($normalized, Utils::DEFAULT_JSON_FLAGS); } @@ -330,11 +311,11 @@ class SlackRecord ? sprintf('```%s```', substr($this->stringify($value), 0, 1990)) : $value; - return array( + return [ 'title' => ucfirst($title), 'value' => $value, 'short' => false, - ); + ]; } /** @@ -346,10 +327,10 @@ class SlackRecord */ private function generateAttachmentFields(array $data): array { - /** @var Record $data */ - $normalized = $this->normalizerFormatter->format($data); + /** @var array $normalized */ + $normalized = $this->normalizerFormatter->normalizeValue($data); - $fields = array(); + $fields = []; foreach ($normalized as $key => $value) { $fields[] = $this->generateAttachmentField((string) $key, $value); } @@ -360,15 +341,14 @@ class SlackRecord /** * Get a copy of record with fields excluded according to $this->excludeFields * - * @phpstan-param FormattedRecord $record - * * @return mixed[] */ - private function removeExcludedFields(array $record): array + private function removeExcludedFields(LogRecord $record): array { + $recordData = $record->toArray(); foreach ($this->excludeFields as $field) { $keys = explode('.', $field); - $node = &$record; + $node = &$recordData; $lastKey = end($keys); foreach ($keys as $key) { if (!isset($node[$key])) { @@ -382,6 +362,6 @@ class SlackRecord } } - return $record; + return $recordData; } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index a648513e..321d8660 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -12,31 +12,28 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; use Monolog\Handler\Slack\SlackRecord; +use Monolog\LogRecord; /** * Sends notifications through Slack API * * @author Greg Kedzierski * @see https://api.slack.com/ - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class SlackHandler extends SocketHandler { /** * Slack API token - * @var string */ - private $token; + private string $token; /** * Instance of the SlackRecord util class preparing data for Slack API. - * @var SlackRecord */ - private $slackRecord; + private SlackRecord $slackRecord; /** * @param string $token Slack API token @@ -55,11 +52,11 @@ class SlackHandler extends SocketHandler ?string $username = null, bool $useAttachment = true, ?string $iconEmoji = null, - $level = Logger::CRITICAL, + $level = Level::Critical, bool $bubble = true, bool $useShortAttachment = false, bool $includeContextAndExtra = false, - array $excludeFields = array(), + array $excludeFields = [], bool $persistent = false, float $timeout = 0.0, float $writingTimeout = 10.0, @@ -105,9 +102,9 @@ class SlackHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { $content = $this->buildContent($record); @@ -116,10 +113,8 @@ class SlackHandler extends SocketHandler /** * Builds the body of API call - * - * @phpstan-param FormattedRecord $record */ - private function buildContent(array $record): string + private function buildContent(LogRecord $record): string { $dataArray = $this->prepareContentData($record); @@ -127,15 +122,14 @@ class SlackHandler extends SocketHandler } /** - * @phpstan-param FormattedRecord $record * @return string[] */ - protected function prepareContentData(array $record): array + protected function prepareContentData(LogRecord $record): array { $dataArray = $this->slackRecord->getSlackData($record); $dataArray['token'] = $this->token; - if (!empty($dataArray['attachments'])) { + if (isset($dataArray['attachments']) && is_array($dataArray['attachments']) && \count($dataArray['attachments']) > 0) { $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']); } @@ -157,9 +151,9 @@ class SlackHandler extends SocketHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { parent::write($record); $this->finalizeWrite(); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php index 8ae3c788..14ed6b1f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -12,9 +12,10 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; use Monolog\Handler\Slack\SlackRecord; +use Monolog\LogRecord; /** * Sends notifications through Slack Webhooks @@ -26,15 +27,13 @@ class SlackWebhookHandler extends AbstractProcessingHandler { /** * Slack Webhook token - * @var string */ - private $webhookUrl; + private string $webhookUrl; /** * Instance of the SlackRecord util class preparing data for Slack API. - * @var SlackRecord */ - private $slackRecord; + private SlackRecord $slackRecord; /** * @param string $webhookUrl Slack Webhook URL @@ -54,9 +53,9 @@ class SlackWebhookHandler extends AbstractProcessingHandler ?string $iconEmoji = null, bool $useShortAttachment = false, bool $includeContextAndExtra = false, - $level = Logger::CRITICAL, + $level = Level::Critical, bool $bubble = true, - array $excludeFields = array() + array $excludeFields = [] ) { if (!extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the SlackWebhookHandler'); @@ -88,21 +87,21 @@ class SlackWebhookHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { $postData = $this->slackRecord->getSlackData($record); $postString = Utils::jsonEncode($postData); $ch = curl_init(); - $options = array( + $options = [ CURLOPT_URL => $this->webhookUrl, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => array('Content-type: application/json'), + CURLOPT_HTTPHEADER => ['Content-type: application/json'], CURLOPT_POSTFIELDS => $postString, - ); + ]; if (defined('CURLOPT_SAFE_UPLOAD')) { $options[CURLOPT_SAFE_UPLOAD] = true; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php index 21701afa..c5f70888 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php @@ -11,41 +11,29 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Stores to any socket - uses fsockopen() or pfsockopen(). * * @author Pablo de Leon Belloc * @see http://php.net/manual/en/function.fsockopen.php - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class SocketHandler extends AbstractProcessingHandler { - /** @var string */ - private $connectionString; - /** @var float */ - private $connectionTimeout; + private string $connectionString; + private float $connectionTimeout; /** @var resource|null */ private $resource; - /** @var float */ - private $timeout; - /** @var float */ - private $writingTimeout; - /** @var ?int */ - private $lastSentBytes = null; - /** @var ?int */ - private $chunkSize; - /** @var bool */ - private $persistent; - /** @var ?int */ - private $errno = null; - /** @var ?string */ - private $errstr = null; - /** @var ?float */ - private $lastWritingAt = null; + private float $timeout; + private float $writingTimeout; + private int|null $lastSentBytes = null; + private int|null $chunkSize; + private bool $persistent; + private int|null $errno = null; + private string|null $errstr = null; + private float|null $lastWritingAt = null; /** * @param string $connectionString Socket connection string @@ -56,11 +44,11 @@ class SocketHandler extends AbstractProcessingHandler * established * @param int|null $chunkSize Sets the chunk size. Only has effect during connection in the writing cycle * - * @throws \InvalidArgumentException If an invalid timeout value (less than 0) is passed. + * @throws \InvalidArgumentException If an invalid timeout value (less than 0) is passed. */ public function __construct( string $connectionString, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, bool $persistent = false, float $timeout = 0.0, @@ -87,12 +75,12 @@ class SocketHandler extends AbstractProcessingHandler /** * Connect (if necessary) and write to the socket * - * {@inheritDoc} + * @inheritDoc * * @throws \UnexpectedValueException * @throws \RuntimeException */ - protected function write(array $record): void + protected function write(LogRecord $record): void { $this->connectIfNotConnected(); $data = $this->generateDataStream($record); @@ -213,8 +201,6 @@ class SocketHandler extends AbstractProcessingHandler /** * Get current local writing timeout - * - * @return float */ public function getWritingTimeout(): float { @@ -264,10 +250,8 @@ class SocketHandler extends AbstractProcessingHandler * Wrapper to allow mocking * * @see http://php.net/manual/en/function.stream-set-timeout.php - * - * @return bool */ - protected function streamSetTimeout() + protected function streamSetTimeout(): bool { $seconds = floor($this->timeout); $microseconds = round(($this->timeout - $seconds) * 1e6); @@ -284,9 +268,9 @@ class SocketHandler extends AbstractProcessingHandler * * @see http://php.net/manual/en/function.stream-set-chunk-size.php * - * @return int|bool + * @return int|false */ - protected function streamSetChunkSize() + protected function streamSetChunkSize(): int|bool { if (!is_resource($this->resource)) { throw new \LogicException('streamSetChunkSize called but $this->resource is not a resource'); @@ -302,9 +286,9 @@ class SocketHandler extends AbstractProcessingHandler /** * Wrapper to allow mocking * - * @return int|bool + * @return int|false */ - protected function fwrite(string $data) + protected function fwrite(string $data): int|bool { if (!is_resource($this->resource)) { throw new \LogicException('fwrite called but $this->resource is not a resource'); @@ -318,7 +302,7 @@ class SocketHandler extends AbstractProcessingHandler * * @return mixed[]|bool */ - protected function streamGetMetadata() + protected function streamGetMetadata(): array|bool { if (!is_resource($this->resource)) { throw new \LogicException('streamGetMetadata called but $this->resource is not a resource'); @@ -342,12 +326,9 @@ class SocketHandler extends AbstractProcessingHandler $this->connect(); } - /** - * @phpstan-param FormattedRecord $record - */ - protected function generateDataStream(array $record): string + protected function generateDataStream(LogRecord $record): string { - return (string) $record['formatted']; + return (string) $record->formatted; } /** @@ -387,7 +368,7 @@ class SocketHandler extends AbstractProcessingHandler private function setStreamChunkSize(): void { - if ($this->chunkSize && !$this->streamSetChunkSize()) { + if (null !== $this->chunkSize && false === $this->streamSetChunkSize()) { throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()"); } } @@ -408,7 +389,7 @@ class SocketHandler extends AbstractProcessingHandler } $sent += $chunk; $socketInfo = $this->streamGetMetadata(); - if (is_array($socketInfo) && $socketInfo['timed_out']) { + if (is_array($socketInfo) && (bool) $socketInfo['timed_out']) { throw new \RuntimeException("Write timed-out"); } @@ -437,7 +418,7 @@ class SocketHandler extends AbstractProcessingHandler usleep(100); } - if ((microtime(true) - $this->lastWritingAt) >= $this->writingTimeout) { + if ((microtime(true) - (float) $this->lastWritingAt) >= $this->writingTimeout) { $this->closeSocket(); return true; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php index dcf282b4..b4512a60 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SqsHandler.php @@ -12,8 +12,9 @@ namespace Monolog\Handler; use Aws\Sqs\SqsClient; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Writes to any sqs queue. @@ -27,12 +28,10 @@ class SqsHandler extends AbstractProcessingHandler /** 100 KB in bytes - head message size for new error log */ protected const HEAD_MESSAGE_SIZE = 102400; - /** @var SqsClient */ - private $client; - /** @var string */ - private $queueUrl; + private SqsClient $client; + private string $queueUrl; - public function __construct(SqsClient $sqsClient, string $queueUrl, $level = Logger::DEBUG, bool $bubble = true) + public function __construct(SqsClient $sqsClient, string $queueUrl, int|string|Level $level = Level::Debug, bool $bubble = true) { parent::__construct($level, $bubble); @@ -41,15 +40,15 @@ class SqsHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - if (!isset($record['formatted']) || 'string' !== gettype($record['formatted'])) { + if (!isset($record->formatted) || 'string' !== gettype($record->formatted)) { throw new \InvalidArgumentException('SqsHandler accepts only formatted records as a string' . Utils::getRecordMessageForException($record)); } - $messageBody = $record['formatted']; + $messageBody = $record->formatted; if (strlen($messageBody) >= static::MAX_MESSAGE_SIZE) { $messageBody = Utils::substr($messageBody, 0, static::HEAD_MESSAGE_SIZE); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index 82c048e1..027a7217 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -11,8 +11,9 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Stores to any stream resource @@ -20,29 +21,21 @@ use Monolog\Utils; * Can be used to store into php://stderr, remote and local files, etc. * * @author Jordi Boggiano - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class StreamHandler extends AbstractProcessingHandler { - /** @const int */ protected const MAX_CHUNK_SIZE = 2147483647; - /** @const int 10MB */ + /** 10MB */ protected const DEFAULT_CHUNK_SIZE = 10 * 1024 * 1024; - /** @var int */ - protected $streamChunkSize; + protected int $streamChunkSize; /** @var resource|null */ protected $stream; - /** @var ?string */ - protected $url = null; - /** @var ?string */ - private $errorMessage = null; - /** @var ?int */ - protected $filePermission; - /** @var bool */ - protected $useLocking; + protected string|null $url = null; + private string|null $errorMessage = null; + protected int|null $filePermission; + protected bool $useLocking; /** @var true|null */ - private $dirCreated = null; + private bool|null $dirCreated = null; /** * @param resource|string $stream If a missing path can't be created, an UnexpectedValueException will be thrown on first write @@ -51,7 +44,7 @@ class StreamHandler extends AbstractProcessingHandler * * @throws \InvalidArgumentException If stream is not a resource or string */ - public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) + public function __construct($stream, int|string|Level $level = Level::Debug, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) { parent::__construct($level, $bubble); @@ -83,11 +76,11 @@ class StreamHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { - if ($this->url && is_resource($this->stream)) { + if (null !== $this->url && is_resource($this->stream)) { fclose($this->stream); } $this->stream = null; @@ -106,26 +99,21 @@ class StreamHandler extends AbstractProcessingHandler /** * Return the stream URL if it was configured with a URL and not an active resource - * - * @return string|null */ public function getUrl(): ?string { return $this->url; } - /** - * @return int - */ public function getStreamChunkSize(): int { return $this->streamChunkSize; } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { if (!is_resource($this->stream)) { $url = $this->url; @@ -135,14 +123,11 @@ class StreamHandler extends AbstractProcessingHandler $this->createDir($url); $this->errorMessage = null; set_error_handler([$this, 'customErrorHandler']); - try { - $stream = fopen($url, 'a'); - if ($this->filePermission !== null) { - @chmod($url, $this->filePermission); - } - } finally { - restore_error_handler(); + $stream = fopen($url, 'a'); + if ($this->filePermission !== null) { + @chmod($url, $this->filePermission); } + restore_error_handler(); if (!is_resource($stream)) { $this->stream = null; @@ -153,10 +138,6 @@ class StreamHandler extends AbstractProcessingHandler } $stream = $this->stream; - if (!is_resource($stream)) { - throw new \LogicException('No stream was opened yet' . Utils::getRecordMessageForException($record)); - } - if ($this->useLocking) { // ignoring errors here, there's not much we can do about them flock($stream, LOCK_EX); @@ -172,13 +153,10 @@ class StreamHandler extends AbstractProcessingHandler /** * Write to stream * @param resource $stream - * @param array $record - * - * @phpstan-param FormattedRecord $record */ - protected function streamWrite($stream, array $record): void + protected function streamWrite($stream, LogRecord $record): void { - fwrite($stream, (string) $record['formatted']); + fwrite($stream, (string) $record->formatted); } private function customErrorHandler(int $code, string $msg): bool @@ -205,7 +183,7 @@ class StreamHandler extends AbstractProcessingHandler private function createDir(string $url): void { // Do not try to create dir if it has already been tried. - if ($this->dirCreated) { + if (true === $this->dirCreated) { return; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php deleted file mode 100644 index fae92514..00000000 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Swift_Message; -use Swift; - -/** - * SwiftMailerHandler uses Swift_Mailer to send the emails - * - * @author Gyula Sallai - * - * @phpstan-import-type Record from \Monolog\Logger - * @deprecated Since Monolog 2.6. Use SymfonyMailerHandler instead. - */ -class SwiftMailerHandler extends MailHandler -{ - /** @var \Swift_Mailer */ - protected $mailer; - /** @var Swift_Message|callable(string, Record[]): Swift_Message */ - private $messageTemplate; - - /** - * @psalm-param Swift_Message|callable(string, Record[]): Swift_Message $message - * - * @param \Swift_Mailer $mailer The mailer to use - * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced - */ - public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, bool $bubble = true) - { - parent::__construct($level, $bubble); - - @trigger_error('The SwiftMailerHandler is deprecated since Monolog 2.6. Use SymfonyMailerHandler instead.', E_USER_DEPRECATED); - - $this->mailer = $mailer; - $this->messageTemplate = $message; - } - - /** - * {@inheritDoc} - */ - protected function send(string $content, array $records): void - { - $this->mailer->send($this->buildMessage($content, $records)); - } - - /** - * Gets the formatter for the Swift_Message subject. - * - * @param string|null $format The format of the subject - */ - protected function getSubjectFormatter(?string $format): FormatterInterface - { - return new LineFormatter($format); - } - - /** - * Creates instance of Swift_Message to be sent - * - * @param string $content formatted email body to be sent - * @param array $records Log records that formed the content - * @return Swift_Message - * - * @phpstan-param Record[] $records - */ - protected function buildMessage(string $content, array $records): Swift_Message - { - $message = null; - if ($this->messageTemplate instanceof Swift_Message) { - $message = clone $this->messageTemplate; - $message->generateId(); - } elseif (is_callable($this->messageTemplate)) { - $message = ($this->messageTemplate)($content, $records); - } - - if (!$message instanceof Swift_Message) { - $record = reset($records); - throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it' . ($record ? Utils::getRecordMessageForException($record) : '')); - } - - if ($records) { - $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); - $message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); - } - - $mime = 'text/plain'; - if ($this->isHtmlBody($content)) { - $mime = 'text/html'; - } - - $message->setBody($content, $mime); - /** @phpstan-ignore-next-line */ - if (version_compare(Swift::VERSION, '6.0.0', '>=')) { - $message->setDate(new \DateTimeImmutable()); - } else { - /** @phpstan-ignore-next-line */ - $message->setDate(time()); - } - - return $message; - } -} diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php index 130e6f1f..842b6577 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SymfonyMailerHandler.php @@ -11,7 +11,10 @@ namespace Monolog\Handler; +use Closure; +use Monolog\Level; use Monolog\Logger; +use Monolog\LogRecord; use Monolog\Utils; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LineFormatter; @@ -23,23 +26,20 @@ use Symfony\Component\Mime\Email; * SymfonyMailerHandler uses Symfony's Mailer component to send the emails * * @author Jordi Boggiano - * - * @phpstan-import-type Record from \Monolog\Logger */ class SymfonyMailerHandler extends MailHandler { - /** @var MailerInterface|TransportInterface */ - protected $mailer; - /** @var Email|callable(string, Record[]): Email */ - private $emailTemplate; + protected MailerInterface|TransportInterface $mailer; + /** @var Email|Closure(string, LogRecord[]): Email */ + private Email|Closure $emailTemplate; /** - * @psalm-param Email|callable(string, Record[]): Email $email + * @phpstan-param Email|Closure(string, LogRecord[]): Email $email * * @param MailerInterface|TransportInterface $mailer The mailer to use - * @param callable|Email $email An email template, the subject/body will be replaced + * @param Closure|Email $email An email template, the subject/body will be replaced */ - public function __construct($mailer, $email, $level = Logger::ERROR, bool $bubble = true) + public function __construct($mailer, Email|Closure $email, int|string|Level $level = Level::Error, bool $bubble = true) { parent::__construct($level, $bubble); @@ -68,10 +68,8 @@ class SymfonyMailerHandler extends MailHandler /** * Creates instance of Email to be sent * - * @param string $content formatted email body to be sent - * @param array $records Log records that formed the content - * - * @phpstan-param Record[] $records + * @param string $content formatted email body to be sent + * @param LogRecord[] $records Log records that formed the content */ protected function buildMessage(string $content, array $records): Email { @@ -84,10 +82,10 @@ class SymfonyMailerHandler extends MailHandler if (!$message instanceof Email) { $record = reset($records); - throw new \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it' . ($record ? Utils::getRecordMessageForException($record) : '')); + throw new \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it' . ($record instanceof LogRecord ? Utils::getRecordMessageForException($record) : '')); } - if ($records) { + if (\count($records) > 0) { $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); $message->subject($subjectFormatter->format($this->getHighestRecord($records))); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php index 1d543b7e..0816a011 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php @@ -11,8 +11,9 @@ namespace Monolog\Handler; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Logs to syslog service. @@ -29,17 +30,14 @@ use Monolog\Utils; */ class SyslogHandler extends AbstractSyslogHandler { - /** @var string */ - protected $ident; - /** @var int */ - protected $logopts; + protected string $ident; + protected int $logopts; /** - * @param string $ident * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID */ - public function __construct(string $ident, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, int $logopts = LOG_PID) + public function __construct(string $ident, string|int $facility = LOG_USER, int|string|Level $level = Level::Debug, bool $bubble = true, int $logopts = LOG_PID) { parent::__construct($facility, $level, $bubble); @@ -48,7 +46,7 @@ class SyslogHandler extends AbstractSyslogHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function close(): void { @@ -56,13 +54,13 @@ class SyslogHandler extends AbstractSyslogHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { if (!openlog($this->ident, $this->logopts, $this->facility)) { throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"' . Utils::getRecordMessageForException($record)); } - syslog($this->logLevels[$record['level']], (string) $record['formatted']); + syslog($this->toSyslogPriority($record->level), (string) $record->formatted); } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php index dbd8ef69..6a483345 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php @@ -18,12 +18,9 @@ class UdpSocket { protected const DATAGRAM_MAX_LENGTH = 65023; - /** @var string */ - protected $ip; - /** @var int */ - protected $port; - /** @var resource|Socket|null */ - protected $socket = null; + protected string $ip; + protected int $port; + protected ?Socket $socket = null; public function __construct(string $ip, int $port = 514) { @@ -31,28 +28,20 @@ class UdpSocket $this->port = $port; } - /** - * @param string $line - * @param string $header - * @return void - */ - public function write($line, $header = "") + public function write(string $line, string $header = ""): void { $this->send($this->assembleMessage($line, $header)); } public function close(): void { - if (is_resource($this->socket) || $this->socket instanceof Socket) { + if ($this->socket instanceof Socket) { socket_close($this->socket); $this->socket = null; } } - /** - * @return resource|Socket - */ - protected function getSocket() + protected function getSocket(): Socket { if (null !== $this->socket) { return $this->socket; @@ -66,12 +55,12 @@ class UdpSocket $protocol = IPPROTO_IP; } - $this->socket = socket_create($domain, SOCK_DGRAM, $protocol) ?: null; - if (null === $this->socket) { - throw new \RuntimeException('The UdpSocket to '.$this->ip.':'.$this->port.' could not be opened via socket_create'); + $socket = socket_create($domain, SOCK_DGRAM, $protocol); + if ($socket instanceof Socket) { + return $this->socket = $socket; } - return $this->socket; + throw new \RuntimeException('The UdpSocket to '.$this->ip.':'.$this->port.' could not be opened via socket_create'); } protected function send(string $chunk): void diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php index deaa19f8..abb8be9b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php @@ -12,8 +12,9 @@ namespace Monolog\Handler; use DateTimeInterface; -use Monolog\Logger; use Monolog\Handler\SyslogUdp\UdpSocket; +use Monolog\Level; +use Monolog\LogRecord; use Monolog\Utils; /** @@ -29,31 +30,29 @@ class SyslogUdpHandler extends AbstractSyslogHandler const RFC5424e = 2; /** @var array */ - private $dateFormats = array( + private array $dateFormats = [ self::RFC3164 => 'M d H:i:s', self::RFC5424 => \DateTime::RFC3339, self::RFC5424e => \DateTime::RFC3339_EXTENDED, - ); + ]; - /** @var UdpSocket */ - protected $socket; - /** @var string */ - protected $ident; + protected UdpSocket $socket; + protected string $ident; /** @var self::RFC* */ - protected $rfc; + protected int $rfc; /** - * @param string $host Either IP/hostname or a path to a unix socket (port must be 0 then) - * @param int $port Port number, or 0 if $host is a unix socket - * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param string $ident Program name or tag for each log message. - * @param int $rfc RFC to format the message for. + * @param string $host Either IP/hostname or a path to a unix socket (port must be 0 then) + * @param int $port Port number, or 0 if $host is a unix socket + * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param string $ident Program name or tag for each log message. + * @param int $rfc RFC to format the message for. * @throws MissingExtensionException * * @phpstan-param self::RFC* $rfc */ - public function __construct(string $host, int $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, string $ident = 'php', int $rfc = self::RFC5424) + public function __construct(string $host, int $port = 514, string|int $facility = LOG_USER, int|string|Level $level = Level::Debug, bool $bubble = true, string $ident = 'php', int $rfc = self::RFC5424) { if (!extension_loaded('sockets')) { throw new MissingExtensionException('The sockets extension is required to use the SyslogUdpHandler'); @@ -67,11 +66,11 @@ class SyslogUdpHandler extends AbstractSyslogHandler $this->socket = new UdpSocket($host, $port); } - protected function write(array $record): void + protected function write(LogRecord $record): void { - $lines = $this->splitMessageIntoLines($record['formatted']); + $lines = $this->splitMessageIntoLines($record->formatted); - $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']], $record['datetime']); + $header = $this->makeCommonSyslogHeader($this->toSyslogPriority($record->level), $record->datetime); foreach ($lines as $line) { $this->socket->write($line, $header); @@ -96,6 +95,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler $lines = preg_split('/$\R?^/m', (string) $message, -1, PREG_SPLIT_NO_EMPTY); if (false === $lines) { $pcreErrorCode = preg_last_error(); + throw new \RuntimeException('Could not preg_split: ' . $pcreErrorCode . ' / ' . Utils::pcreLastErrorMessage($pcreErrorCode)); } @@ -109,11 +109,13 @@ class SyslogUdpHandler extends AbstractSyslogHandler { $priority = $severity + $this->facility; - if (!$pid = getmypid()) { + $pid = getmypid(); + if (false === $pid) { $pid = '-'; } - if (!$hostname = gethostname()) { + $hostname = gethostname(); + if (false === $hostname) { $hostname = '-'; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php index 8912eba5..2e1be9f6 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php @@ -12,8 +12,9 @@ namespace Monolog\Handler; use RuntimeException; -use Monolog\Logger; +use Monolog\Level; use Monolog\Utils; +use Monolog\LogRecord; /** * Handler send logs to Telegram using Telegram Bot API. @@ -28,8 +29,6 @@ use Monolog\Utils; * @link https://core.telegram.org/bots/api * * @author Mazur Alexandr - * - * @phpstan-import-type Record from \Monolog\Logger */ class TelegramBotHandler extends AbstractProcessingHandler { @@ -52,69 +51,61 @@ class TelegramBotHandler extends AbstractProcessingHandler /** * Telegram bot access token provided by BotFather. * Create telegram bot with https://telegram.me/BotFather and use access token from it. - * @var string */ - private $apiKey; + private string $apiKey; /** * Telegram channel name. * Since to start with '@' symbol as prefix. - * @var string */ - private $channel; + private string $channel; /** * The kind of formatting that is used for the message. * See available options at https://core.telegram.org/bots/api#formatting-options * or in AVAILABLE_PARSE_MODES - * @var ?string */ - private $parseMode; + private string|null $parseMode; /** * Disables link previews for links in the message. - * @var ?bool */ - private $disableWebPagePreview; + private bool|null $disableWebPagePreview; /** * Sends the message silently. Users will receive a notification with no sound. - * @var ?bool */ - private $disableNotification; + private bool|null $disableNotification; /** * True - split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages. * False - truncates a message that is too long. - * @var bool */ - private $splitLongMessages; + private bool $splitLongMessages; /** * Adds 1-second delay between sending a split message (according to Telegram API to avoid 429 Too Many Requests). - * @var bool */ - private $delayBetweenMessages; + private bool $delayBetweenMessages; /** - * @param string $apiKey Telegram bot access token provided by BotFather - * @param string $channel Telegram channel name - * @param bool $splitLongMessages Split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages - * @param bool $delayBetweenMessages Adds delay between sending a split message according to Telegram API + * @param string $apiKey Telegram bot access token provided by BotFather + * @param string $channel Telegram channel name + * @param bool $splitLongMessages Split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages + * @param bool $delayBetweenMessages Adds delay between sending a split message according to Telegram API * @throws MissingExtensionException */ public function __construct( string $apiKey, string $channel, - $level = Logger::DEBUG, + $level = Level::Debug, bool $bubble = true, string $parseMode = null, bool $disableWebPagePreview = null, bool $disableNotification = null, bool $splitLongMessages = false, bool $delayBetweenMessages = false - ) - { + ) { if (!extension_loaded('curl')) { throw new MissingExtensionException('The curl extension is needed to use the TelegramBotHandler'); } @@ -132,7 +123,7 @@ class TelegramBotHandler extends AbstractProcessingHandler public function setParseMode(string $parseMode = null): self { - if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES)) { + if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES, true)) { throw new \InvalidArgumentException('Unknown parseMode, use one of these: ' . implode(', ', self::AVAILABLE_PARSE_MODES) . '.'); } @@ -158,7 +149,6 @@ class TelegramBotHandler extends AbstractProcessingHandler /** * True - split a message longer than MAX_MESSAGE_LENGTH into parts and send in multiple messages. * False - truncates a message that is too long. - * @param bool $splitLongMessages * @return $this */ public function splitLongMessages(bool $splitLongMessages = false): self @@ -170,7 +160,6 @@ class TelegramBotHandler extends AbstractProcessingHandler /** * Adds 1-second delay between sending a split message (according to Telegram API to avoid 429 Too Many Requests). - * @param bool $delayBetweenMessages * @return $this */ public function delayBetweenMessages(bool $delayBetweenMessages = false): self @@ -181,11 +170,10 @@ class TelegramBotHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { - /** @var Record[] $messages */ $messages = []; foreach ($records as $record) { @@ -193,30 +181,28 @@ class TelegramBotHandler extends AbstractProcessingHandler continue; } - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } $messages[] = $record; } - if (!empty($messages)) { - $this->send((string)$this->getFormatter()->formatBatch($messages)); + if (\count($messages) > 0) { + $this->send((string) $this->getFormatter()->formatBatch($messages)); } } /** * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->send($record['formatted']); + $this->send($record->formatted); } /** * Send request to @link https://api.telegram.org/bot on SendMessage action. - * @param string $message */ protected function send(string $message): void { @@ -259,7 +245,6 @@ class TelegramBotHandler extends AbstractProcessingHandler /** * Handle a message that is too long: truncates or splits into several - * @param string $message * @return string[] */ private function handleMessageLength(string $message): array diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php index 0986da27..1884f83f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php @@ -11,8 +11,10 @@ namespace Monolog\Handler; +use Monolog\Level; use Monolog\Logger; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Used for testing purposes. @@ -65,85 +67,67 @@ use Psr\Log\LogLevel; * @method bool hasNoticeThatPasses($message) * @method bool hasInfoThatPasses($message) * @method bool hasDebugThatPasses($message) - * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class TestHandler extends AbstractProcessingHandler { - /** @var Record[] */ - protected $records = []; - /** @var array */ - protected $recordsByLevel = []; - /** @var bool */ - private $skipReset = false; + /** @var LogRecord[] */ + protected array $records = []; + /** @phpstan-var array, LogRecord[]> */ + protected array $recordsByLevel = []; + private bool $skipReset = false; /** - * @return array - * - * @phpstan-return Record[] + * @return array */ - public function getRecords() + public function getRecords(): array { return $this->records; } - /** - * @return void - */ - public function clear() + public function clear(): void { $this->records = []; $this->recordsByLevel = []; } - /** - * @return void - */ - public function reset() + public function reset(): void { if (!$this->skipReset) { $this->clear(); } } - /** - * @return void - */ - public function setSkipReset(bool $skipReset) + public function setSkipReset(bool $skipReset): void { $this->skipReset = $skipReset; } /** - * @param string|int $level Logging level value or name + * @param int|string|Level|LogLevel::* $level Logging level value or name * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function hasRecords($level): bool + public function hasRecords(int|string|Level $level): bool { - return isset($this->recordsByLevel[Logger::toMonologLevel($level)]); + return isset($this->recordsByLevel[Logger::toMonologLevel($level)->value]); } /** - * @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records - * @param string|int $level Logging level value or name + * @param string|array $recordAssertions Either a message string or an array containing message and optionally context keys that will be checked against all records * - * @phpstan-param array{message: string, context?: mixed[]}|string $record - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param array{message: string, context?: mixed[]}|string $recordAssertions */ - public function hasRecord($record, $level): bool + public function hasRecord(string|array $recordAssertions, Level $level): bool { - if (is_string($record)) { - $record = array('message' => $record); + if (is_string($recordAssertions)) { + $recordAssertions = ['message' => $recordAssertions]; } - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { + return $this->hasRecordThatPasses(function (LogRecord $rec) use ($recordAssertions) { + if ($rec->message !== $recordAssertions['message']) { return false; } - if (isset($record['context']) && $rec['context'] !== $record['context']) { + if (isset($recordAssertions['context']) && $rec->context !== $recordAssertions['context']) { return false; } @@ -151,47 +135,29 @@ class TestHandler extends AbstractProcessingHandler }, $level); } - /** - * @param string|int $level Logging level value or name - * - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecordThatContains(string $message, $level): bool + public function hasRecordThatContains(string $message, Level $level): bool { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); + return $this->hasRecordThatPasses(fn (LogRecord $rec) => str_contains($rec->message, $message), $level); + } + + public function hasRecordThatMatches(string $regex, Level $level): bool + { + return $this->hasRecordThatPasses(fn (LogRecord $rec) => preg_match($regex, $rec->message) > 0, $level); } /** - * @param string|int $level Logging level value or name - * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param callable(LogRecord, int): mixed $predicate */ - public function hasRecordThatMatches(string $regex, $level): bool - { - return $this->hasRecordThatPasses(function (array $rec) use ($regex): bool { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - /** - * @param string|int $level Logging level value or name - * @return bool - * - * @psalm-param callable(Record, int): mixed $predicate - * @phpstan-param Level|LevelName|LogLevel::* $level - */ - public function hasRecordThatPasses(callable $predicate, $level) + public function hasRecordThatPasses(callable $predicate, Level $level): bool { $level = Logger::toMonologLevel($level); - if (!isset($this->recordsByLevel[$level])) { + if (!isset($this->recordsByLevel[$level->value])) { return false; } - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if ($predicate($rec, $i)) { + foreach ($this->recordsByLevel[$level->value] as $i => $rec) { + if ((bool) $predicate($rec, $i)) { return true; } } @@ -200,24 +166,22 @@ class TestHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ - protected function write(array $record): void + protected function write(LogRecord $record): void { - $this->recordsByLevel[$record['level']][] = $record; + $this->recordsByLevel[$record->level->value][] = $record; $this->records[] = $record; } /** - * @param string $method - * @param mixed[] $args - * @return bool + * @param mixed[] $args */ - public function __call($method, $args) + public function __call(string $method, array $args): bool { if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = constant('Monolog\Logger::' . strtoupper($matches[2])); + $level = constant(Level::class.'::' . $matches[2]); $callback = [$this, $genericMethod]; if (is_callable($callback)) { $args[] = $level; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php index c8183528..9c12c3d5 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php @@ -15,7 +15,6 @@ trait WebRequestRecognizerTrait { /** * Checks if PHP's serving a web request - * @return bool */ protected function isWebRequest(): bool { diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php index b6d3d3b1..2dbc5fe8 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php @@ -11,30 +11,30 @@ namespace Monolog\Handler; +use Monolog\LogRecord; +use Throwable; + /** * Forwards records to multiple handlers suppressing failures of each handler * and continuing through to give every handler a chance to succeed. * * @author Craig D'Amelio - * - * @phpstan-import-type Record from \Monolog\Logger */ class WhatFailureGroupHandler extends GroupHandler { /** - * {@inheritDoc} + * @inheritDoc */ - public function handle(array $record): bool + public function handle(LogRecord $record): bool { - if ($this->processors) { - /** @var Record $record */ + if (\count($this->processors) > 0) { $record = $this->processRecord($record); } foreach ($this->handlers as $handler) { try { $handler->handle($record); - } catch (\Throwable $e) { + } catch (Throwable) { // What failure? } } @@ -43,37 +43,22 @@ class WhatFailureGroupHandler extends GroupHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function handleBatch(array $records): void { - if ($this->processors) { - $processed = array(); + if (\count($this->processors) > 0) { + $processed = []; foreach ($records as $record) { $processed[] = $this->processRecord($record); } - /** @var Record[] $records */ $records = $processed; } foreach ($this->handlers as $handler) { try { $handler->handleBatch($records); - } catch (\Throwable $e) { - // What failure? - } - } - } - - /** - * {@inheritDoc} - */ - public function close(): void - { - foreach ($this->handlers as $handler) { - try { - $handler->close(); - } catch (\Throwable $e) { + } catch (Throwable) { // What failure? } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php index ddd46d8c..1e71194b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php @@ -13,70 +13,67 @@ namespace Monolog\Handler; use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\NormalizerFormatter; -use Monolog\Logger; +use Monolog\Level; +use Monolog\LogRecord; /** * Handler sending logs to Zend Monitor * * @author Christian Bergau * @author Jason Davis - * - * @phpstan-import-type FormattedRecord from AbstractProcessingHandler */ class ZendMonitorHandler extends AbstractProcessingHandler { - /** - * Monolog level / ZendMonitor Custom Event priority map - * - * @var array - */ - protected $levelMap = []; - /** * @throws MissingExtensionException */ - public function __construct($level = Logger::DEBUG, bool $bubble = true) + public function __construct(int|string|Level $level = Level::Debug, bool $bubble = true) { if (!function_exists('zend_monitor_custom_event')) { throw new MissingExtensionException( 'You must have Zend Server installed with Zend Monitor enabled in order to use this handler' ); } - //zend monitor constants are not defined if zend monitor is not enabled. - $this->levelMap = [ - Logger::DEBUG => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::INFO => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::NOTICE => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::WARNING => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, - Logger::ERROR => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::CRITICAL => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::ALERT => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::EMERGENCY => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - ]; + parent::__construct($level, $bubble); } /** - * {@inheritDoc} + * Translates Monolog log levels to ZendMonitor levels. */ - protected function write(array $record): void + protected function toZendMonitorLevel(Level $level): int + { + return match ($level) { + Level::Debug => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Level::Info => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Level::Notice => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Level::Warning => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, + Level::Error => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Level::Critical => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Level::Alert => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Level::Emergency => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + }; + } + + /** + * @inheritDoc + */ + protected function write(LogRecord $record): void { $this->writeZendMonitorCustomEvent( - Logger::getLevelName($record['level']), - $record['message'], - $record['formatted'], - $this->levelMap[$record['level']] + $record->level->getName(), + $record->message, + $record->formatted, + $this->toZendMonitorLevel($record->level) ); } /** * Write to Zend Monitor Events - * @param string $type Text displayed in "Class Name (custom)" field - * @param string $message Text displayed in "Error String" - * @param array $formatted Displayed in Custom Variables tab - * @param int $severity Set the event severity level (-1,0,1) - * - * @phpstan-param FormattedRecord $formatted + * @param string $type Text displayed in "Class Name (custom)" field + * @param string $message Text displayed in "Error String" + * @param array $formatted Displayed in Custom Variables tab + * @param int $severity Set the event severity level (-1,0,1) */ protected function writeZendMonitorCustomEvent(string $type, string $message, array $formatted, int $severity): void { @@ -84,18 +81,10 @@ class ZendMonitorHandler extends AbstractProcessingHandler } /** - * {@inheritDoc} + * @inheritDoc */ public function getDefaultFormatter(): FormatterInterface { return new NormalizerFormatter(); } - - /** - * @return array - */ - public function getLevelMap(): array - { - return $this->levelMap; - } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Level.php b/monolog/vendor/monolog/monolog/src/Monolog/Level.php new file mode 100644 index 00000000..ab04cf4d --- /dev/null +++ b/monolog/vendor/monolog/monolog/src/Monolog/Level.php @@ -0,0 +1,209 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Psr\Log\LogLevel; + +/** + * Represents the log levels + * + * Monolog supports the logging levels described by RFC 5424 {@see https://datatracker.ietf.org/doc/html/rfc5424} + * but due to BC the severity values used internally are not 0-7. + * + * To get the level name out of a Level there are three options: + * + * - Use ->getName() to get the standard Monolog name which is full uppercased (e.g. "DEBUG") + * - Use ->toPsrLogLevel() to get the standard PSR-3 name which is full lowercased (e.g. "debug") + * - Use ->toRFC5424Level() to get the standard RFC 5424 value (e.g. 7 for debug, 0 for emergency) + * - Use ->name to get the enum case's name which is capitalized (e.g. "Debug") + * + * To get the value for filtering, if the includes/isLowerThan/isHigherThan methods are + * not enough, you can use ->value to get the enum case's integer value. + */ +enum Level: int +{ + /** + * Detailed debug information + */ + case Debug = 100; + + /** + * Interesting events + * + * Examples: User logs in, SQL logs. + */ + case Info = 200; + + /** + * Uncommon events + */ + case Notice = 250; + + /** + * Exceptional occurrences that are not errors + * + * Examples: Use of deprecated APIs, poor use of an API, + * undesirable things that are not necessarily wrong. + */ + case Warning = 300; + + /** + * Runtime errors + */ + case Error = 400; + + /** + * Critical conditions + * + * Example: Application component unavailable, unexpected exception. + */ + case Critical = 500; + + /** + * Action must be taken immediately + * + * Example: Entire website down, database unavailable, etc. + * This should trigger the SMS alerts and wake you up. + */ + case Alert = 550; + + /** + * Urgent alert. + */ + case Emergency = 600; + + /** + * @param value-of|LogLevel::*|'Debug'|'Info'|'Notice'|'Warning'|'Error'|'Critical'|'Alert'|'Emergency' $name + * @return static + */ + public static function fromName(string $name): self + { + return match ($name) { + 'debug', 'Debug', 'DEBUG' => self::Debug, + 'info', 'Info', 'INFO' => self::Info, + 'notice', 'Notice', 'NOTICE' => self::Notice, + 'warning', 'Warning', 'WARNING' => self::Warning, + 'error', 'Error', 'ERROR' => self::Error, + 'critical', 'Critical', 'CRITICAL' => self::Critical, + 'alert', 'Alert', 'ALERT' => self::Alert, + 'emergency', 'Emergency', 'EMERGENCY' => self::Emergency, + }; + } + + /** + * @param value-of $value + * @return static + */ + public static function fromValue(int $value): self + { + return self::from($value); + } + + /** + * Returns true if the passed $level is higher or equal to $this + */ + public function includes(Level $level): bool + { + return $this->value <= $level->value; + } + + public function isHigherThan(Level $level): bool + { + return $this->value > $level->value; + } + + public function isLowerThan(Level $level): bool + { + return $this->value < $level->value; + } + + /** + * Returns the monolog standardized all-capitals name of the level + * + * Use this instead of $level->name which returns the enum case name (e.g. Debug vs DEBUG if you use getName()) + * + * @return value-of + */ + public function getName(): string + { + return match ($this) { + self::Debug => 'DEBUG', + self::Info => 'INFO', + self::Notice => 'NOTICE', + self::Warning => 'WARNING', + self::Error => 'ERROR', + self::Critical => 'CRITICAL', + self::Alert => 'ALERT', + self::Emergency => 'EMERGENCY', + }; + } + + /** + * Returns the PSR-3 level matching this instance + * + * @phpstan-return \Psr\Log\LogLevel::* + */ + public function toPsrLogLevel(): string + { + return match ($this) { + self::Debug => LogLevel::DEBUG, + self::Info => LogLevel::INFO, + self::Notice => LogLevel::NOTICE, + self::Warning => LogLevel::WARNING, + self::Error => LogLevel::ERROR, + self::Critical => LogLevel::CRITICAL, + self::Alert => LogLevel::ALERT, + self::Emergency => LogLevel::EMERGENCY, + }; + } + + /** + * Returns the RFC 5424 level matching this instance + * + * @phpstan-return int<0, 7> + */ + public function toRFC5424Level(): int + { + return match ($this) { + self::Debug => 7, + self::Info => 6, + self::Notice => 5, + self::Warning => 4, + self::Error => 3, + self::Critical => 2, + self::Alert => 1, + self::Emergency => 0, + }; + } + + public const VALUES = [ + 100, + 200, + 250, + 300, + 400, + 500, + 550, + 600, + ]; + + public const NAMES = [ + 'DEBUG', + 'INFO', + 'NOTICE', + 'WARNING', + 'ERROR', + 'CRITICAL', + 'ALERT', + 'EMERGENCY', + ]; +} diff --git a/monolog/vendor/monolog/monolog/src/Monolog/LogRecord.php b/monolog/vendor/monolog/monolog/src/Monolog/LogRecord.php index 702807d7..df758c58 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/LogRecord.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/LogRecord.php @@ -14,21 +14,111 @@ namespace Monolog; use ArrayAccess; /** - * Monolog log record interface for forward compatibility with Monolog 3.0 - * - * This is just present in Monolog 2.4+ to allow interoperable code to be written against - * both versions by type-hinting arguments as `array|\Monolog\LogRecord $record` - * - * Do not rely on this interface for other purposes, and do not implement it. + * Monolog log record * * @author Jordi Boggiano - * @template-extends \ArrayAccess<'message'|'level'|'context'|'level_name'|'channel'|'datetime'|'extra'|'formatted', mixed> - * @phpstan-import-type Record from Logger + * @template-implements ArrayAccess<'message'|'level'|'context'|'level_name'|'channel'|'datetime'|'extra', int|string|\DateTimeImmutable|array> */ -interface LogRecord extends \ArrayAccess +class LogRecord implements ArrayAccess { + private const MODIFIABLE_FIELDS = [ + 'extra' => true, + 'formatted' => true, + ]; + + public function __construct( + public readonly \DateTimeImmutable $datetime, + public readonly string $channel, + public readonly Level $level, + public readonly string $message, + /** @var array */ + public readonly array $context = [], + /** @var array */ + public array $extra = [], + public mixed $formatted = null, + ) { + } + + public function offsetSet(mixed $offset, mixed $value): void + { + if ($offset === 'extra') { + if (!is_array($value)) { + throw new \InvalidArgumentException('extra must be an array'); + } + + $this->extra = $value; + + return; + } + + if ($offset === 'formatted') { + $this->formatted = $value; + + return; + } + + throw new \LogicException('Unsupported operation: setting '.$offset); + } + + public function offsetExists(mixed $offset): bool + { + if ($offset === 'level_name') { + return true; + } + + return isset($this->{$offset}); + } + + public function offsetUnset(mixed $offset): void + { + throw new \LogicException('Unsupported operation'); + } + + public function &offsetGet(mixed $offset): mixed + { + if ($offset === 'level_name' || $offset === 'level') { + // avoid returning readonly props by ref as this is illegal + if ($offset === 'level_name') { + $copy = $this->level->getName(); + } else { + $copy = $this->level->value; + } + + return $copy; + } + + if (isset(self::MODIFIABLE_FIELDS[$offset])) { + return $this->{$offset}; + } + + // avoid returning readonly props by ref as this is illegal + $copy = $this->{$offset}; + + return $copy; + } + /** - * @phpstan-return Record + * @phpstan-return array{message: string, context: mixed[], level: value-of, level_name: value-of, channel: string, datetime: \DateTimeImmutable, extra: mixed[]} */ - public function toArray(): array; + public function toArray(): array + { + return [ + 'message' => $this->message, + 'context' => $this->context, + 'level' => $this->level->value, + 'level_name' => $this->level->getName(), + 'channel' => $this->channel, + 'datetime' => $this->datetime, + 'extra' => $this->extra, + ]; + } + + public function with(mixed ...$args): self + { + foreach (['message', 'context', 'level', 'channel', 'datetime', 'extra'] as $prop) { + $args[$prop] ??= $this->{$prop}; + } + + return new self(...$args); + } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Logger.php b/monolog/vendor/monolog/monolog/src/Monolog/Logger.php index 84a2f551..5aacc6f8 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Logger.php @@ -11,8 +11,10 @@ namespace Monolog; +use Closure; use DateTimeZone; use Monolog\Handler\HandlerInterface; +use Monolog\Processor\ProcessorInterface; use Psr\Log\LoggerInterface; use Psr\Log\InvalidArgumentException; use Psr\Log\LogLevel; @@ -26,15 +28,14 @@ use Stringable; * and uses them to store records that are added to it. * * @author Jordi Boggiano - * - * @phpstan-type Level Logger::DEBUG|Logger::INFO|Logger::NOTICE|Logger::WARNING|Logger::ERROR|Logger::CRITICAL|Logger::ALERT|Logger::EMERGENCY - * @phpstan-type LevelName 'DEBUG'|'INFO'|'NOTICE'|'WARNING'|'ERROR'|'CRITICAL'|'ALERT'|'EMERGENCY' - * @phpstan-type Record array{message: string, context: mixed[], level: Level, level_name: LevelName, channel: string, datetime: \DateTimeImmutable, extra: mixed[]} + * @final */ class Logger implements LoggerInterface, ResettableInterface { /** * Detailed debug information + * + * @deprecated Use \Monolog\Level::Debug */ public const DEBUG = 100; @@ -42,11 +43,15 @@ class Logger implements LoggerInterface, ResettableInterface * Interesting events * * Examples: User logs in, SQL logs. + * + * @deprecated Use \Monolog\Level::Info */ public const INFO = 200; /** * Uncommon events + * + * @deprecated Use \Monolog\Level::Notice */ public const NOTICE = 250; @@ -55,11 +60,15 @@ class Logger implements LoggerInterface, ResettableInterface * * Examples: Use of deprecated APIs, poor use of an API, * undesirable things that are not necessarily wrong. + * + * @deprecated Use \Monolog\Level::Warning */ public const WARNING = 300; /** * Runtime errors + * + * @deprecated Use \Monolog\Level::Error */ public const ERROR = 400; @@ -67,6 +76,8 @@ class Logger implements LoggerInterface, ResettableInterface * Critical conditions * * Example: Application component unavailable, unexpected exception. + * + * @deprecated Use \Monolog\Level::Critical */ public const CRITICAL = 500; @@ -75,11 +86,15 @@ class Logger implements LoggerInterface, ResettableInterface * * Example: Entire website down, database unavailable, etc. * This should trigger the SMS alerts and wake you up. + * + * @deprecated Use \Monolog\Level::Alert */ public const ALERT = 550; /** * Urgent alert. + * + * @deprecated Use \Monolog\Level::Emergency */ public const EMERGENCY = 600; @@ -88,28 +103,8 @@ class Logger implements LoggerInterface, ResettableInterface * * This is only bumped when API breaks are done and should * follow the major version of the library - * - * @var int */ - public const API = 2; - - /** - * This is a static variable and not a constant to serve as an extension point for custom levels - * - * @var array $levels Logging levels with the levels as key - * - * @phpstan-var array $levels Logging levels with the levels as key - */ - protected static $levels = [ - self::DEBUG => 'DEBUG', - self::INFO => 'INFO', - self::NOTICE => 'NOTICE', - self::WARNING => 'WARNING', - self::ERROR => 'ERROR', - self::CRITICAL => 'CRITICAL', - self::ALERT => 'ALERT', - self::EMERGENCY => 'EMERGENCY', - ]; + public const API = 3; /** * Mapping between levels numbers defined in RFC 5424 and Monolog ones @@ -117,90 +112,66 @@ class Logger implements LoggerInterface, ResettableInterface * @phpstan-var array $rfc_5424_levels */ private const RFC_5424_LEVELS = [ - 7 => self::DEBUG, - 6 => self::INFO, - 5 => self::NOTICE, - 4 => self::WARNING, - 3 => self::ERROR, - 2 => self::CRITICAL, - 1 => self::ALERT, - 0 => self::EMERGENCY, + 7 => Level::Debug, + 6 => Level::Info, + 5 => Level::Notice, + 4 => Level::Warning, + 3 => Level::Error, + 2 => Level::Critical, + 1 => Level::Alert, + 0 => Level::Emergency, ]; - /** - * @var string - */ - protected $name; + protected string $name; /** * The handler stack * - * @var HandlerInterface[] + * @var list */ - protected $handlers; + protected array $handlers; /** * Processors that will process all log records * * To process records of a single handler instead, add the processor on that specific handler * - * @var callable[] + * @var array<(callable(LogRecord): LogRecord)|ProcessorInterface> */ - protected $processors; + protected array $processors; + + protected bool $microsecondTimestamps = true; + + protected DateTimeZone $timezone; + + protected Closure|null $exceptionHandler = null; /** - * @var bool + * Keeps track of depth to prevent infinite logging loops */ - protected $microsecondTimestamps = true; + private int $logDepth = 0; /** - * @var DateTimeZone - */ - protected $timezone; - - /** - * @var callable|null - */ - protected $exceptionHandler; - - /** - * @var int Keeps track of depth to prevent infinite logging loops - */ - private $logDepth = 0; - - /** - * @var \WeakMap<\Fiber, int>|null Keeps track of depth inside fibers to prevent infinite logging loops - */ - private $fiberLogDepth; - - /** - * @var bool Whether to detect infinite logging loops + * Whether to detect infinite logging loops * * This can be disabled via {@see useLoggingLoopDetection} if you have async handlers that do not play well with this */ - private $detectCycles = true; + private bool $detectCycles = true; /** - * @psalm-param array $processors - * * @param string $name The logging channel, a simple descriptive name that is attached to all log records * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. * @param callable[] $processors Optional array of processors * @param DateTimeZone|null $timezone Optional timezone, if not provided date_default_timezone_get() will be used + * + * @phpstan-param array<(callable(LogRecord): LogRecord)|ProcessorInterface> $processors */ - public function __construct(string $name, array $handlers = [], array $processors = [], ?DateTimeZone $timezone = null) + public function __construct(string $name, array $handlers = [], array $processors = [], DateTimeZone|null $timezone = null) { $this->name = $name; $this->setHandlers($handlers); $this->processors = $processors; - $this->timezone = $timezone ?: new DateTimeZone(date_default_timezone_get() ?: 'UTC'); - - if (\PHP_VERSION_ID >= 80100) { - // Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412 - /** @var \WeakMap<\Fiber, int> $fiberLogDepth */ - $fiberLogDepth = new \WeakMap(); - $this->fiberLogDepth = $fiberLogDepth; - } + $this->timezone = $timezone ?? new DateTimeZone(date_default_timezone_get()); } public function getName(): string @@ -236,7 +207,7 @@ class Logger implements LoggerInterface, ResettableInterface */ public function popHandler(): HandlerInterface { - if (!$this->handlers) { + if (0 === \count($this->handlers)) { throw new \LogicException('You tried to pop from an empty handler stack.'); } @@ -248,7 +219,7 @@ class Logger implements LoggerInterface, ResettableInterface * * If a map is passed, keys will be ignored. * - * @param HandlerInterface[] $handlers + * @param list $handlers */ public function setHandlers(array $handlers): self { @@ -261,7 +232,7 @@ class Logger implements LoggerInterface, ResettableInterface } /** - * @return HandlerInterface[] + * @return list */ public function getHandlers(): array { @@ -270,8 +241,10 @@ class Logger implements LoggerInterface, ResettableInterface /** * Adds a processor on to the stack. + * + * @phpstan-param ProcessorInterface|(callable(LogRecord): LogRecord) $callback */ - public function pushProcessor(callable $callback): self + public function pushProcessor(ProcessorInterface|callable $callback): self { array_unshift($this->processors, $callback); @@ -281,12 +254,12 @@ class Logger implements LoggerInterface, ResettableInterface /** * Removes the processor on top of the stack and returns it. * + * @phpstan-return ProcessorInterface|(callable(LogRecord): LogRecord) * @throws \LogicException If empty processor stack - * @return callable */ public function popProcessor(): callable { - if (!$this->processors) { + if (0 === \count($this->processors)) { throw new \LogicException('You tried to pop from an empty processor stack.'); } @@ -295,6 +268,7 @@ class Logger implements LoggerInterface, ResettableInterface /** * @return callable[] + * @phpstan-return array */ public function getProcessors(): array { @@ -335,58 +309,49 @@ class Logger implements LoggerInterface, ResettableInterface * @param DateTimeImmutable $datetime Optional log date to log into the past or future * @return bool Whether the record has been processed * - * @phpstan-param Level $level + * @phpstan-param value-of|Level $level */ - public function addRecord(int $level, string $message, array $context = [], DateTimeImmutable $datetime = null): bool + public function addRecord(int|Level $level, string $message, array $context = [], DateTimeImmutable $datetime = null): bool { - if (isset(self::RFC_5424_LEVELS[$level])) { + if (is_int($level) && isset(self::RFC_5424_LEVELS[$level])) { $level = self::RFC_5424_LEVELS[$level]; } if ($this->detectCycles) { - if (\PHP_VERSION_ID >= 80100 && $fiber = \Fiber::getCurrent()) { - $this->fiberLogDepth[$fiber] = $this->fiberLogDepth[$fiber] ?? 0; - $logDepth = ++$this->fiberLogDepth[$fiber]; - } else { - $logDepth = ++$this->logDepth; - } - } else { - $logDepth = 0; + $this->logDepth += 1; } - - if ($logDepth === 3) { + if ($this->logDepth === 3) { $this->warning('A possible infinite logging loop was detected and aborted. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.'); return false; - } elseif ($logDepth >= 5) { // log depth 4 is let through, so we can log the warning above + } elseif ($this->logDepth >= 5) { // log depth 4 is let through so we can log the warning above return false; } try { - $record = null; + $recordInitialized = count($this->processors) === 0; + + $record = new LogRecord( + message: $message, + context: $context, + level: self::toMonologLevel($level), + channel: $this->name, + datetime: $datetime ?? new DateTimeImmutable($this->microsecondTimestamps, $this->timezone), + extra: [], + ); + $handled = false; foreach ($this->handlers as $handler) { - if (null === $record) { - // skip creating the record as long as no handler is going to handle it - if (!$handler->isHandling(['level' => $level])) { + if (false === $recordInitialized) { + // skip initializing the record as long as no handler is going to handle it + if (!$handler->isHandling($record)) { continue; } - $levelName = static::getLevelName($level); - - $record = [ - 'message' => $message, - 'context' => $context, - 'level' => $level, - 'level_name' => $levelName, - 'channel' => $this->name, - 'datetime' => $datetime ?? new DateTimeImmutable($this->microsecondTimestamps, $this->timezone), - 'extra' => [], - ]; - try { foreach ($this->processors as $processor) { $record = $processor($record); } + $recordInitialized = true; } catch (Throwable $e) { $this->handleException($e, $record); @@ -394,8 +359,9 @@ class Logger implements LoggerInterface, ResettableInterface } } - // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted + // once the record is initialized, send it to all handlers as long as the bubbling chain is not interrupted try { + $handled = true; if (true === $handler->handle($record)) { break; } @@ -405,17 +371,13 @@ class Logger implements LoggerInterface, ResettableInterface return true; } } + + return $handled; } finally { if ($this->detectCycles) { - if (isset($fiber)) { - $this->fiberLogDepth[$fiber]--; - } else { - $this->logDepth--; - } + $this->logDepth--; } } - - return null !== $record; } /** @@ -461,77 +423,77 @@ class Logger implements LoggerInterface, ResettableInterface } /** - * Gets all supported logging levels. + * Gets the name of the logging level as a string. * - * @return array Assoc array with human-readable level names => level codes. - * @phpstan-return array - */ - public static function getLevels(): array - { - return array_flip(static::$levels); - } - - /** - * Gets the name of the logging level. + * This still returns a string instead of a Level for BC, but new code should not rely on this method. * * @throws \Psr\Log\InvalidArgumentException If level is not defined * - * @phpstan-param Level $level - * @phpstan-return LevelName + * @phpstan-param value-of|Level $level + * @phpstan-return value-of + * + * @deprecated Since 3.0, use {@see toMonologLevel} or {@see \Monolog\Level->getName()} instead */ - public static function getLevelName(int $level): string + public static function getLevelName(int|Level $level): string { - if (!isset(static::$levels[$level])) { - throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels))); - } - - return static::$levels[$level]; + return self::toMonologLevel($level)->getName(); } /** * Converts PSR-3 levels to Monolog ones if necessary * - * @param string|int $level Level number (monolog) or name (PSR-3) - * @throws \Psr\Log\InvalidArgumentException If level is not defined + * @param int|string|Level|LogLevel::* $level Level number (monolog) or name (PSR-3) + * @throws \Psr\Log\InvalidArgumentException If level is not defined * - * @phpstan-param Level|LevelName|LogLevel::* $level - * @phpstan-return Level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public static function toMonologLevel($level): int + public static function toMonologLevel(string|int|Level $level): Level { - if (is_string($level)) { - if (is_numeric($level)) { - /** @phpstan-ignore-next-line */ - return intval($level); + if ($level instanceof Level) { + return $level; + } + + if (\is_string($level)) { + if (\is_numeric($level)) { + $levelEnum = Level::tryFrom((int) $level); + if ($levelEnum === null) { + throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', Level::NAMES + Level::VALUES)); + } + + return $levelEnum; } - // Contains chars of all log levels and avoids using strtoupper() which may have + // Contains first char of all log levels and avoids using strtoupper() which may have // strange results depending on locale (for example, "i" will become "İ" in Turkish locale) - $upper = strtr($level, 'abcdefgilmnortuwy', 'ABCDEFGILMNORTUWY'); - if (defined(__CLASS__.'::'.$upper)) { - return constant(__CLASS__ . '::' . $upper); + $upper = strtr(substr($level, 0, 1), 'dinweca', 'DINWECA') . strtolower(substr($level, 1)); + if (defined(Level::class.'::'.$upper)) { + return constant(Level::class . '::' . $upper); } - throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels) + static::$levels)); + throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', Level::NAMES + Level::VALUES)); } - if (!is_int($level)) { - throw new InvalidArgumentException('Level "'.var_export($level, true).'" is not defined, use one of: '.implode(', ', array_keys(static::$levels) + static::$levels)); + $levelEnum = Level::tryFrom($level); + if ($levelEnum === null) { + throw new InvalidArgumentException('Level "'.var_export($level, true).'" is not defined, use one of: '.implode(', ', Level::NAMES + Level::VALUES)); } - return $level; + return $levelEnum; } /** * Checks whether the Logger has a handler that listens on the given level * - * @phpstan-param Level $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function isHandling(int $level): bool + public function isHandling(int|string|Level $level): bool { - $record = [ - 'level' => $level, - ]; + $record = new LogRecord( + datetime: new DateTimeImmutable($this->microsecondTimestamps, $this->timezone), + channel: $this->name, + message: '', + level: self::toMonologLevel($level), + ); foreach ($this->handlers as $handler) { if ($handler->isHandling($record)) { @@ -545,16 +507,16 @@ class Logger implements LoggerInterface, ResettableInterface /** * Set a custom exception handler that will be called if adding a new record fails * - * The callable will receive an exception object and the record that failed to be logged + * The Closure will receive an exception object and the record that failed to be logged */ - public function setExceptionHandler(?callable $callback): self + public function setExceptionHandler(Closure|null $callback): self { $this->exceptionHandler = $callback; return $this; } - public function getExceptionHandler(): ?callable + public function getExceptionHandler(): Closure|null { return $this->exceptionHandler; } @@ -568,19 +530,21 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param Level|LogLevel::* $level */ - public function log($level, $message, array $context = []): void + public function log($level, string|\Stringable $message, array $context = []): void { - if (!is_int($level) && !is_string($level)) { - throw new \InvalidArgumentException('$level is expected to be a string or int'); - } + if (!$level instanceof Level) { + if (!is_string($level) && !is_int($level)) { + throw new \InvalidArgumentException('$level is expected to be a string, int or '.Level::class.' instance'); + } - if (isset(self::RFC_5424_LEVELS[$level])) { - $level = self::RFC_5424_LEVELS[$level]; - } + if (isset(self::RFC_5424_LEVELS[$level])) { + $level = self::RFC_5424_LEVELS[$level]; + } - $level = static::toMonologLevel($level); + $level = static::toMonologLevel($level); + } $this->addRecord($level, (string) $message, $context); } @@ -593,9 +557,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function debug($message, array $context = []): void + public function debug(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::DEBUG, (string) $message, $context); + $this->addRecord(Level::Debug, (string) $message, $context); } /** @@ -606,9 +570,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function info($message, array $context = []): void + public function info(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::INFO, (string) $message, $context); + $this->addRecord(Level::Info, (string) $message, $context); } /** @@ -619,9 +583,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function notice($message, array $context = []): void + public function notice(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::NOTICE, (string) $message, $context); + $this->addRecord(Level::Notice, (string) $message, $context); } /** @@ -632,9 +596,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function warning($message, array $context = []): void + public function warning(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::WARNING, (string) $message, $context); + $this->addRecord(Level::Warning, (string) $message, $context); } /** @@ -645,9 +609,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function error($message, array $context = []): void + public function error(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::ERROR, (string) $message, $context); + $this->addRecord(Level::Error, (string) $message, $context); } /** @@ -658,9 +622,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function critical($message, array $context = []): void + public function critical(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::CRITICAL, (string) $message, $context); + $this->addRecord(Level::Critical, (string) $message, $context); } /** @@ -671,9 +635,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function alert($message, array $context = []): void + public function alert(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::ALERT, (string) $message, $context); + $this->addRecord(Level::Alert, (string) $message, $context); } /** @@ -684,9 +648,9 @@ class Logger implements LoggerInterface, ResettableInterface * @param string|Stringable $message The log message * @param mixed[] $context The log context */ - public function emergency($message, array $context = []): void + public function emergency(string|\Stringable $message, array $context = []): void { - $this->addRecord(static::EMERGENCY, (string) $message, $context); + $this->addRecord(Level::Emergency, (string) $message, $context); } /** @@ -710,52 +674,13 @@ class Logger implements LoggerInterface, ResettableInterface /** * Delegates exception management to the custom exception handler, * or throws the exception if no custom handler is set. - * - * @param array $record - * @phpstan-param Record $record */ - protected function handleException(Throwable $e, array $record): void + protected function handleException(Throwable $e, LogRecord $record): void { - if (!$this->exceptionHandler) { + if (null === $this->exceptionHandler) { throw $e; } ($this->exceptionHandler)($e, $record); } - - /** - * @return array - */ - public function __serialize(): array - { - return [ - 'name' => $this->name, - 'handlers' => $this->handlers, - 'processors' => $this->processors, - 'microsecondTimestamps' => $this->microsecondTimestamps, - 'timezone' => $this->timezone, - 'exceptionHandler' => $this->exceptionHandler, - 'logDepth' => $this->logDepth, - 'detectCycles' => $this->detectCycles, - ]; - } - - /** - * @param array $data - */ - public function __unserialize(array $data): void - { - foreach (['name', 'handlers', 'processors', 'microsecondTimestamps', 'timezone', 'exceptionHandler', 'logDepth', 'detectCycles'] as $property) { - if (isset($data[$property])) { - $this->$property = $data[$property]; - } - } - - if (\PHP_VERSION_ID >= 80100) { - // Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412 - /** @var \WeakMap<\Fiber, int> $fiberLogDepth */ - $fiberLogDepth = new \WeakMap(); - $this->fiberLogDepth = $fiberLogDepth; - } - } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php index 8166bdca..4cbd9c84 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php @@ -11,46 +11,44 @@ namespace Monolog\Processor; +use Monolog\Level; use Monolog\Logger; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Injects Git branch and Git commit SHA in all records * * @author Nick Otter * @author Jordi Boggiano - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class GitProcessor implements ProcessorInterface { - /** @var int */ - private $level; + private Level $level; /** @var array{branch: string, commit: string}|array|null */ private static $cache = null; /** - * @param string|int $level The minimum logging level at which this Processor will be triggered + * @param int|string|Level|LogLevel::* $level The minimum logging level at which this Processor will be triggered * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function __construct($level = Logger::DEBUG) + public function __construct(int|string|Level $level = Level::Debug) { $this->level = Logger::toMonologLevel($level); } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { // return if the level is not high enough - if ($record['level'] < $this->level) { + if ($record->level < $this->level) { return $record; } - $record['extra']['git'] = self::getGitInfo(); + $record->extra['git'] = self::getGitInfo(); return $record; } @@ -60,12 +58,12 @@ class GitProcessor implements ProcessorInterface */ private static function getGitInfo(): array { - if (self::$cache) { + if (self::$cache !== null) { return self::$cache; } - $branches = `git branch -v --no-abbrev`; - if ($branches && preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { + $branches = shell_exec('git branch -v --no-abbrev'); + if (is_string($branches) && 1 === preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { return self::$cache = [ 'branch' => $matches[1], 'commit' => $matches[2], diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php index 91fda7d6..cba6e096 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/HostnameProcessor.php @@ -11,13 +11,14 @@ namespace Monolog\Processor; +use Monolog\LogRecord; + /** * Injects value of gethostname in all records */ class HostnameProcessor implements ProcessorInterface { - /** @var string */ - private static $host; + private static string $host; public function __construct() { @@ -25,11 +26,11 @@ class HostnameProcessor implements ProcessorInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { - $record['extra']['hostname'] = self::$host; + $record->extra['hostname'] = self::$host; return $record; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php index a32e76b2..30e7dfed 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php @@ -11,8 +11,10 @@ namespace Monolog\Processor; +use Monolog\Level; use Monolog\Logger; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Injects line/file:class/function where the log message came from @@ -24,31 +26,28 @@ use Psr\Log\LogLevel; * triggered the FingersCrossedHandler. * * @author Jordi Boggiano - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class IntrospectionProcessor implements ProcessorInterface { - /** @var int */ - private $level; + private Level $level; + /** @var string[] */ - private $skipClassesPartials; - /** @var int */ - private $skipStackFramesCount; - /** @var string[] */ - private $skipFunctions = [ + private array $skipClassesPartials; + + private int $skipStackFramesCount; + + private const SKIP_FUNCTIONS = [ 'call_user_func', 'call_user_func_array', ]; /** - * @param string|int $level The minimum logging level at which this Processor will be triggered - * @param string[] $skipClassesPartials + * @param string|int|Level $level The minimum logging level at which this Processor will be triggered + * @param string[] $skipClassesPartials * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function __construct($level = Logger::DEBUG, array $skipClassesPartials = [], int $skipStackFramesCount = 0) + public function __construct(int|string|Level $level = Level::Debug, array $skipClassesPartials = [], int $skipStackFramesCount = 0) { $this->level = Logger::toMonologLevel($level); $this->skipClassesPartials = array_merge(['Monolog\\'], $skipClassesPartials); @@ -56,12 +55,12 @@ class IntrospectionProcessor implements ProcessorInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { // return if the level is not high enough - if ($record['level'] < $this->level) { + if ($record->level->isLowerThan($this->level)) { return $record; } @@ -83,7 +82,7 @@ class IntrospectionProcessor implements ProcessorInterface continue 2; } } - } elseif (in_array($trace[$i]['function'], $this->skipFunctions)) { + } elseif (in_array($trace[$i]['function'], self::SKIP_FUNCTIONS, true)) { $i++; continue; @@ -95,8 +94,8 @@ class IntrospectionProcessor implements ProcessorInterface $i += $this->skipStackFramesCount; // we should have the call source now - $record['extra'] = array_merge( - $record['extra'], + $record->extra = array_merge( + $record->extra, [ 'file' => isset($trace[$i - 1]['file']) ? $trace[$i - 1]['file'] : null, 'line' => isset($trace[$i - 1]['line']) ? $trace[$i - 1]['line'] : null, @@ -110,7 +109,7 @@ class IntrospectionProcessor implements ProcessorInterface } /** - * @param array[] $trace + * @param array $trace */ private function isTraceClassOrSkippedFunction(array $trace, int $index): bool { @@ -118,6 +117,6 @@ class IntrospectionProcessor implements ProcessorInterface return false; } - return isset($trace[$index]['class']) || in_array($trace[$index]['function'], $this->skipFunctions); + return isset($trace[$index]['class']) || in_array($trace[$index]['function'], self::SKIP_FUNCTIONS, true); } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php index 37c756fc..adc32c65 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php @@ -11,6 +11,8 @@ namespace Monolog\Processor; +use Monolog\LogRecord; + /** * Injects memory_get_peak_usage in all records * @@ -20,9 +22,9 @@ namespace Monolog\Processor; class MemoryPeakUsageProcessor extends MemoryProcessor { /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { $usage = memory_get_peak_usage($this->realUsage); @@ -30,7 +32,7 @@ class MemoryPeakUsageProcessor extends MemoryProcessor $usage = $this->formatBytes($usage); } - $record['extra']['memory_peak_usage'] = $usage; + $record->extra['memory_peak_usage'] = $usage; return $record; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php index 227deb7c..f808e51b 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php @@ -21,12 +21,12 @@ abstract class MemoryProcessor implements ProcessorInterface /** * @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported. */ - protected $realUsage; + protected bool $realUsage; /** * @var bool If true, then format memory size to human readable string (MB, KB, B depending on size) */ - protected $useFormatting; + protected bool $useFormatting; /** * @param bool $realUsage Set this to true to get the real size of memory allocated from system. @@ -41,7 +41,6 @@ abstract class MemoryProcessor implements ProcessorInterface /** * Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is * - * @param int $bytes * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as int */ protected function formatBytes(int $bytes) diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php index e141921e..a814b1df 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php @@ -11,6 +11,8 @@ namespace Monolog\Processor; +use Monolog\LogRecord; + /** * Injects memory_get_usage in all records * @@ -20,9 +22,9 @@ namespace Monolog\Processor; class MemoryUsageProcessor extends MemoryProcessor { /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { $usage = memory_get_usage($this->realUsage); @@ -30,7 +32,7 @@ class MemoryUsageProcessor extends MemoryProcessor $usage = $this->formatBytes($usage); } - $record['extra']['memory_usage'] = $usage; + $record->extra['memory_usage'] = $usage; return $record; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php index d4a628f5..47b1e64f 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php @@ -11,45 +11,43 @@ namespace Monolog\Processor; +use Monolog\Level; use Monolog\Logger; use Psr\Log\LogLevel; +use Monolog\LogRecord; /** * Injects Hg branch and Hg revision number in all records * * @author Jonathan A. Schweder - * - * @phpstan-import-type LevelName from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger */ class MercurialProcessor implements ProcessorInterface { - /** @var Level */ - private $level; + private Level $level; /** @var array{branch: string, revision: string}|array|null */ private static $cache = null; /** - * @param int|string $level The minimum logging level at which this Processor will be triggered + * @param int|string|Level $level The minimum logging level at which this Processor will be triggered * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function __construct($level = Logger::DEBUG) + public function __construct(int|string|Level $level = Level::Debug) { $this->level = Logger::toMonologLevel($level); } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { // return if the level is not high enough - if ($record['level'] < $this->level) { + if ($record->level->isLowerThan($this->level)) { return $record; } - $record['extra']['hg'] = self::getMercurialInfo(); + $record->extra['hg'] = self::getMercurialInfo(); return $record; } @@ -59,11 +57,11 @@ class MercurialProcessor implements ProcessorInterface */ private static function getMercurialInfo(): array { - if (self::$cache) { + if (self::$cache !== null) { return self::$cache; } - $result = explode(' ', trim(`hg id -nb`)); + $result = explode(' ', trim((string) shell_exec('hg id -nb'))); if (count($result) >= 3) { return self::$cache = [ diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php index 3b939a95..bb9a5224 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php @@ -11,6 +11,8 @@ namespace Monolog\Processor; +use Monolog\LogRecord; + /** * Adds value of getmypid into records * @@ -19,11 +21,11 @@ namespace Monolog\Processor; class ProcessIdProcessor implements ProcessorInterface { /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { - $record['extra']['process_id'] = getmypid(); + $record->extra['process_id'] = getmypid(); return $record; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php index 5defb7eb..ebe41fc2 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php @@ -11,20 +11,17 @@ namespace Monolog\Processor; +use Monolog\LogRecord; + /** * An optional interface to allow labelling Monolog processors. * * @author Nicolas Grekas - * - * @phpstan-import-type Record from \Monolog\Logger */ interface ProcessorInterface { /** - * @return array The processed record - * - * @phpstan-param Record $record - * @phpstan-return Record + * @return LogRecord The processed record */ - public function __invoke(array $record); + public function __invoke(LogRecord $record); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php index e7c12176..f2407d56 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php @@ -12,6 +12,7 @@ namespace Monolog\Processor; use Monolog\Utils; +use Monolog\LogRecord; /** * Processes a record's message according to PSR-3 rules @@ -24,11 +25,9 @@ class PsrLogMessageProcessor implements ProcessorInterface { public const SIMPLE_DATE = "Y-m-d\TH:i:s.uP"; - /** @var string|null */ - private $dateFormat; + private ?string $dateFormat; - /** @var bool */ - private $removeUsedContextFields; + private bool $removeUsedContextFields; /** * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format @@ -41,33 +40,33 @@ class PsrLogMessageProcessor implements ProcessorInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { - if (false === strpos($record['message'], '{')) { + if (false === strpos($record->message, '{')) { return $record; } $replacements = []; - foreach ($record['context'] as $key => $val) { + $context = $record->context; + + foreach ($context as $key => $val) { $placeholder = '{' . $key . '}'; - if (strpos($record['message'], $placeholder) === false) { + if (strpos($record->message, $placeholder) === false) { continue; } - if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { + if (null === $val || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { $replacements[$placeholder] = $val; } elseif ($val instanceof \DateTimeInterface) { - if (!$this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) { + if (null === $this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) { // handle monolog dates using __toString if no specific dateFormat was asked for // so that it follows the useMicroseconds flag $replacements[$placeholder] = (string) $val; } else { - $replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE); + $replacements[$placeholder] = $val->format($this->dateFormat ?? static::SIMPLE_DATE); } - } elseif ($val instanceof \UnitEnum) { - $replacements[$placeholder] = $val instanceof \BackedEnum ? $val->value : $val->name; } elseif (is_object($val)) { $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; } elseif (is_array($val)) { @@ -77,12 +76,10 @@ class PsrLogMessageProcessor implements ProcessorInterface } if ($this->removeUsedContextFields) { - unset($record['context'][$key]); + unset($context[$key]); } } - $record['message'] = strtr($record['message'], $replacements); - - return $record; + return $record->with(message: strtr($record->message, $replacements), context: $context); } } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php index 80f18747..4543ccf6 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php @@ -11,6 +11,8 @@ namespace Monolog\Processor; +use Monolog\LogRecord; + /** * Adds a tags array into record * @@ -19,7 +21,7 @@ namespace Monolog\Processor; class TagProcessor implements ProcessorInterface { /** @var string[] */ - private $tags; + private array $tags; /** * @param string[] $tags @@ -50,11 +52,11 @@ class TagProcessor implements ProcessorInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { - $record['extra']['tags'] = $this->tags; + $record->extra['tags'] = $this->tags; return $record; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php index a27b74db..3a0c128c 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php @@ -12,6 +12,7 @@ namespace Monolog\Processor; use Monolog\ResettableInterface; +use Monolog\LogRecord; /** * Adds a unique identifier into records @@ -20,9 +21,12 @@ use Monolog\ResettableInterface; */ class UidProcessor implements ProcessorInterface, ResettableInterface { - /** @var string */ - private $uid; + /** @var non-empty-string */ + private string $uid; + /** + * @param int<1, 32> $length + */ public function __construct(int $length = 7) { if ($length > 32 || $length < 1) { @@ -33,11 +37,11 @@ class UidProcessor implements ProcessorInterface, ResettableInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { - $record['extra']['uid'] = $this->uid; + $record->extra['uid'] = $this->uid; return $record; } @@ -47,11 +51,15 @@ class UidProcessor implements ProcessorInterface, ResettableInterface return $this->uid; } - public function reset() + public function reset(): void { $this->uid = $this->generateUid(strlen($this->uid)); } + /** + * @param positive-int $length + * @return non-empty-string + */ private function generateUid(int $length): string { return substr(bin2hex(random_bytes((int) ceil($length / 2))), 0, $length); diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/monolog/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php index 51850e17..2088b180 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -11,6 +11,9 @@ namespace Monolog\Processor; +use ArrayAccess; +use Monolog\LogRecord; + /** * Injects url/method and remote IP of the current web request in all records * @@ -19,9 +22,9 @@ namespace Monolog\Processor; class WebProcessor implements ProcessorInterface { /** - * @var array|\ArrayAccess + * @var array|ArrayAccess */ - protected $serverData; + protected array|ArrayAccess $serverData; /** * Default fields @@ -30,7 +33,7 @@ class WebProcessor implements ProcessorInterface * * @var array */ - protected $extraFields = [ + protected array $extraFields = [ 'url' => 'REQUEST_URI', 'ip' => 'REMOTE_ADDR', 'http_method' => 'REQUEST_METHOD', @@ -40,17 +43,15 @@ class WebProcessor implements ProcessorInterface ]; /** - * @param array|\ArrayAccess|null $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data - * @param array|array|null $extraFields Field names and the related key inside $serverData to be added (or just a list of field names to use the default configured $serverData mapping). If not provided it defaults to: [url, ip, http_method, server, referrer] + unique_id if present in server data + * @param array|ArrayAccess|null $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data + * @param array|array|null $extraFields Field names and the related key inside $serverData to be added (or just a list of field names to use the default configured $serverData mapping). If not provided it defaults to: [url, ip, http_method, server, referrer] + unique_id if present in server data */ - public function __construct($serverData = null, array $extraFields = null) + public function __construct(array|ArrayAccess|null $serverData = null, array|null $extraFields = null) { if (null === $serverData) { $this->serverData = &$_SERVER; - } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { - $this->serverData = $serverData; } else { - throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); + $this->serverData = $serverData; } $defaultEnabled = ['url', 'ip', 'http_method', 'server', 'referrer']; @@ -64,7 +65,7 @@ class WebProcessor implements ProcessorInterface } if (isset($extraFields[0])) { foreach (array_keys($this->extraFields) as $fieldName) { - if (!in_array($fieldName, $extraFields)) { + if (!in_array($fieldName, $extraFields, true)) { unset($this->extraFields[$fieldName]); } } @@ -74,9 +75,9 @@ class WebProcessor implements ProcessorInterface } /** - * {@inheritDoc} + * @inheritDoc */ - public function __invoke(array $record): array + public function __invoke(LogRecord $record): LogRecord { // skip processing if for some reason request data // is not present (CLI or wonky SAPIs) @@ -84,7 +85,7 @@ class WebProcessor implements ProcessorInterface return $record; } - $record['extra'] = $this->appendExtraFields($record['extra']); + $record->extra = $this->appendExtraFields($record->extra); return $record; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Registry.php b/monolog/vendor/monolog/monolog/src/Monolog/Registry.php index ae94ae6c..2ef2edce 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Registry.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Registry.php @@ -42,7 +42,7 @@ class Registry * * @var Logger[] */ - private static $loggers = []; + private static array $loggers = []; /** * Adds new logging channel to the registry @@ -51,11 +51,10 @@ class Registry * @param string|null $name Name of the logging channel ($logger->getName() by default) * @param bool $overwrite Overwrite instance in the registry if the given name already exists? * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists - * @return void */ - public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false) + public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false): void { - $name = $name ?: $logger->getName(); + $name = $name ?? $logger->getName(); if (isset(self::$loggers[$name]) && !$overwrite) { throw new InvalidArgumentException('Logger with the given name already exists'); @@ -110,7 +109,7 @@ class Registry * @param string $name Name of the requested Logger instance * @throws \InvalidArgumentException If named Logger instance is not in the registry */ - public static function getInstance($name): Logger + public static function getInstance(string $name): Logger { if (!isset(self::$loggers[$name])) { throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name)); @@ -127,7 +126,7 @@ class Registry * @throws \InvalidArgumentException If named Logger instance is not in the registry * @return Logger Requested instance of Logger */ - public static function __callStatic($name, $arguments) + public static function __callStatic(string $name, array $arguments): Logger { return self::getInstance($name); } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/ResettableInterface.php b/monolog/vendor/monolog/monolog/src/Monolog/ResettableInterface.php index 2c5fd785..4983a6b3 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/ResettableInterface.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/ResettableInterface.php @@ -27,8 +27,5 @@ namespace Monolog; */ interface ResettableInterface { - /** - * @return void - */ - public function reset(); + public function reset(): void; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/SignalHandler.php b/monolog/vendor/monolog/monolog/src/Monolog/SignalHandler.php index d730eea3..e6b02b08 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/SignalHandler.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/SignalHandler.php @@ -19,21 +19,17 @@ use ReflectionExtension; * Monolog POSIX signal handler * * @author Robert Gust-Bardon - * - * @phpstan-import-type Level from \Monolog\Logger - * @phpstan-import-type LevelName from \Monolog\Logger */ class SignalHandler { - /** @var LoggerInterface */ - private $logger; + private LoggerInterface $logger; /** @var array SIG_DFL, SIG_IGN or previous callable */ - private $previousSignalHandler = []; - /** @var array */ - private $signalLevelMap = []; + private array $previousSignalHandler = []; + /** @var array */ + private array $signalLevelMap = []; /** @var array */ - private $signalRestartSyscalls = []; + private array $signalRestartSyscalls = []; public function __construct(LoggerInterface $logger) { @@ -41,21 +37,18 @@ class SignalHandler } /** - * @param int|string $level Level or level name - * @param bool $callPrevious - * @param bool $restartSyscalls - * @param bool|null $async + * @param int|string|Level $level Level or level name * @return $this * - * @phpstan-param Level|LevelName|LogLevel::* $level + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - public function registerSignalHandler(int $signo, $level = LogLevel::CRITICAL, bool $callPrevious = true, bool $restartSyscalls = true, ?bool $async = true): self + public function registerSignalHandler(int $signo, int|string|Level $level = LogLevel::CRITICAL, bool $callPrevious = true, bool $restartSyscalls = true, ?bool $async = true): self { if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) { return $this; } - $level = Logger::toMonologLevel($level); + $level = Logger::toMonologLevel($level)->toPsrLogLevel(); if ($callPrevious) { $handler = pcntl_signal_get_handler($signo); @@ -84,8 +77,7 @@ class SignalHandler if (!$signals && extension_loaded('pcntl')) { $pcntl = new ReflectionExtension('pcntl'); - // HHVM 3.24.2 returns an empty array. - foreach ($pcntl->getConstants() ?: get_defined_constants(true)['Core'] as $name => $value) { + foreach ($pcntl->getConstants() as $name => $value) { if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) { $signals[$value] = $name; } diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Test/TestCase.php b/monolog/vendor/monolog/monolog/src/Monolog/Test/TestCase.php index bc0b425e..98204a95 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Test/TestCase.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Test/TestCase.php @@ -11,18 +11,18 @@ namespace Monolog\Test; +use Monolog\Level; use Monolog\Logger; +use Monolog\LogRecord; use Monolog\DateTimeImmutable; use Monolog\Formatter\FormatterInterface; +use Psr\Log\LogLevel; /** * Lets you easily generate log records and a dummy formatter for testing purposes * * @author Jordi Boggiano * - * @phpstan-import-type Record from \Monolog\Logger - * @phpstan-import-type Level from \Monolog\Logger - * * @internal feel free to reuse this to test your own handlers, this is marked internal to avoid issues with PHPStorm https://github.com/Seldaek/monolog/issues/1677 */ class TestCase extends \PHPUnit\Framework\TestCase @@ -37,47 +37,44 @@ class TestCase extends \PHPUnit\Framework\TestCase } /** - * @param mixed[] $context + * @param array $context + * @param array $extra * - * @return array Record - * - * @phpstan-param Level $level - * @phpstan-return Record + * @phpstan-param value-of|value-of|Level|LogLevel::* $level */ - protected function getRecord(int $level = Logger::WARNING, string $message = 'test', array $context = []): array + protected function getRecord(int|string|Level $level = Level::Warning, string|\Stringable $message = 'test', array $context = [], string $channel = 'test', \DateTimeImmutable $datetime = new DateTimeImmutable(true), array $extra = []): LogRecord { - return [ - 'message' => (string) $message, - 'context' => $context, - 'level' => $level, - 'level_name' => Logger::getLevelName($level), - 'channel' => 'test', - 'datetime' => new DateTimeImmutable(true), - 'extra' => [], - ]; + return new LogRecord( + message: (string) $message, + context: $context, + level: Logger::toMonologLevel($level), + channel: $channel, + datetime: $datetime, + extra: $extra, + ); } /** - * @phpstan-return Record[] + * @phpstan-return list */ protected function getMultipleRecords(): array { return [ - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - $this->getRecord(Logger::WARNING, 'warning'), - $this->getRecord(Logger::ERROR, 'error'), + $this->getRecord(Level::Debug, 'debug message 1'), + $this->getRecord(Level::Debug, 'debug message 2'), + $this->getRecord(Level::Info, 'information'), + $this->getRecord(Level::Warning, 'warning'), + $this->getRecord(Level::Error, 'error'), ]; } protected function getIdentityFormatter(): FormatterInterface { $formatter = $this->createMock(FormatterInterface::class); - $formatter->expects($this->any()) + $formatter->expects(self::any()) ->method('format') - ->will($this->returnCallback(function ($record) { - return $record['message']; + ->will(self::returnCallback(function ($record) { + return $record->message; })); return $formatter; diff --git a/monolog/vendor/monolog/monolog/src/Monolog/Utils.php b/monolog/vendor/monolog/monolog/src/Monolog/Utils.php index 360c4219..9dae2535 100644 --- a/monolog/vendor/monolog/monolog/src/Monolog/Utils.php +++ b/monolog/vendor/monolog/monolog/src/Monolog/Utils.php @@ -122,7 +122,7 @@ final class Utils if (is_string($data)) { self::detectAndCleanUtf8($data); } elseif (is_array($data)) { - array_walk_recursive($data, array('Monolog\Utils', 'detectAndCleanUtf8')); + array_walk_recursive($data, ['Monolog\Utils', 'detectAndCleanUtf8']); } else { self::throwEncodeError($code, $data); } @@ -165,27 +165,16 @@ final class Utils * @param int $code return code of json_last_error function * @param mixed $data data that was meant to be encoded * @throws \RuntimeException - * - * @return never */ - private static function throwEncodeError(int $code, $data): void + private static function throwEncodeError(int $code, $data): never { - switch ($code) { - case JSON_ERROR_DEPTH: - $msg = 'Maximum stack depth exceeded'; - break; - case JSON_ERROR_STATE_MISMATCH: - $msg = 'Underflow or the modes mismatch'; - break; - case JSON_ERROR_CTRL_CHAR: - $msg = 'Unexpected control character found'; - break; - case JSON_ERROR_UTF8: - $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; - break; - default: - $msg = 'Unknown error'; - } + $msg = match ($code) { + JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', + JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', + default => 'Unknown error', + }; throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); } @@ -207,7 +196,7 @@ final class Utils */ private static function detectAndCleanUtf8(&$data): void { - if (is_string($data) && !preg_match('//u', $data)) { + if (is_string($data) && preg_match('//u', $data) !== 1) { $data = preg_replace_callback( '/[\x80-\xFF]+/', function ($m) { @@ -217,6 +206,7 @@ final class Utils ); if (!is_string($data)) { $pcreErrorCode = preg_last_error(); + throw new \RuntimeException('Failed to preg_replace_callback: ' . $pcreErrorCode . ' / ' . self::pcreLastErrorMessage($pcreErrorCode)); } $data = str_replace( @@ -230,8 +220,8 @@ final class Utils /** * Converts a string with a valid 'memory_limit' format, to bytes. * - * @param string|false $val - * @return int|false Returns an integer representing bytes. Returns FALSE in case of error. + * @param string|false $val + * @return int|false Returns an integer representing bytes. Returns FALSE in case of error. */ public static function expandIniShorthandBytes($val) { @@ -244,7 +234,7 @@ final class Utils return (int) $val; } - if (!preg_match('/^\s*(?\d+)(?:\.\d+)?\s*(?[gmk]?)\s*$/i', $val, $match)) { + if (preg_match('/^\s*(?\d+)(?:\.\d+)?\s*(?[gmk]?)\s*$/i', $val, $match) !== 1) { return false; } @@ -252,8 +242,10 @@ final class Utils switch (strtolower($match['unit'] ?? '')) { case 'g': $val *= 1024; + // no break case 'm': $val *= 1024; + // no break case 'k': $val *= 1024; } @@ -261,24 +253,22 @@ final class Utils return $val; } - /** - * @param array $record - */ - public static function getRecordMessageForException(array $record): string + public static function getRecordMessageForException(LogRecord $record): string { $context = ''; $extra = ''; + try { - if ($record['context']) { - $context = "\nContext: " . json_encode($record['context']); + if (\count($record->context) > 0) { + $context = "\nContext: " . json_encode($record->context, JSON_THROW_ON_ERROR); } - if ($record['extra']) { - $extra = "\nExtra: " . json_encode($record['extra']); + if (\count($record->extra) > 0) { + $extra = "\nExtra: " . json_encode($record->extra, JSON_THROW_ON_ERROR); } } catch (\Throwable $e) { // noop } - return "\nThe exception occurred while attempting to log: " . $record['message'] . $context . $extra; + return "\nThe exception occurred while attempting to log: " . $record->message . $context . $extra; } } diff --git a/monolog/vendor/psr/log/composer.json b/monolog/vendor/psr/log/composer.json index ca056953..879fc6f5 100644 --- a/monolog/vendor/psr/log/composer.json +++ b/monolog/vendor/psr/log/composer.json @@ -11,16 +11,16 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } } } diff --git a/monolog/vendor/psr/log/src/AbstractLogger.php b/monolog/vendor/psr/log/src/AbstractLogger.php new file mode 100644 index 00000000..d60a091a --- /dev/null +++ b/monolog/vendor/psr/log/src/AbstractLogger.php @@ -0,0 +1,15 @@ +logger = $logger; + } +} diff --git a/monolog/vendor/psr/log/src/LoggerInterface.php b/monolog/vendor/psr/log/src/LoggerInterface.php new file mode 100644 index 00000000..b3a24b5f --- /dev/null +++ b/monolog/vendor/psr/log/src/LoggerInterface.php @@ -0,0 +1,125 @@ +log(LogLevel::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function alert(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function critical(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function error(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function warning(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function notice(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function info(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string|\Stringable $message + * @param array $context + * + * @return void + */ + public function debug(string|\Stringable $message, array $context = []): void + { + $this->log(LogLevel::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string|\Stringable $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + abstract public function log($level, string|\Stringable $message, array $context = []): void; +} diff --git a/monolog/vendor/psr/log/src/NullLogger.php b/monolog/vendor/psr/log/src/NullLogger.php new file mode 100644 index 00000000..c1cc3c06 --- /dev/null +++ b/monolog/vendor/psr/log/src/NullLogger.php @@ -0,0 +1,30 @@ +logger) { }` + * blocks. + */ +class NullLogger extends AbstractLogger +{ + /** + * Logs with an arbitrary level. + * + * @param mixed $level + * @param string|\Stringable $message + * @param array $context + * + * @return void + * + * @throws \Psr\Log\InvalidArgumentException + */ + public function log($level, string|\Stringable $message, array $context = []): void + { + // noop + } +} diff --git a/morechoice/morechoice.php b/morechoice/morechoice.php index fbb88ce1..fe726d27 100644 --- a/morechoice/morechoice.php +++ b/morechoice/morechoice.php @@ -8,6 +8,7 @@ * Status: Deprecated */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; diff --git a/morepokes/morepokes.php b/morepokes/morepokes.php index 2ac09a73..abe59a6e 100644 --- a/morepokes/morepokes.php +++ b/morepokes/morepokes.php @@ -7,6 +7,7 @@ * */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; diff --git a/newmemberwidget/README.md b/newmemberwidget/README.md index e467708e..39522238 100644 --- a/newmemberwidget/README.md +++ b/newmemberwidget/README.md @@ -5,8 +5,8 @@ With this addon you can enable a widget for the sidebar of the network tab, which will be displayed for new members. It contains a linkt to friendicas introduction pages at /newmember and optionally - * a link to the global support group - * a link to an eventually existing local support group + * a link to the global support forum + * a link to an eventually existing local support forum * a welcome message you might want to send to your new members. There is no extra styling added for this added, so it should work with any diff --git a/newmemberwidget/lang/C/messages.po b/newmemberwidget/lang/C/messages.po index 0dc91e13..1e7d608a 100644 --- a/newmemberwidget/lang/C/messages.po +++ b/newmemberwidget/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,48 +26,48 @@ msgid "Tips for New Members" msgstr "" #: newmemberwidget.php:33 -msgid "Global Support Group" +msgid "Global Support Forum" msgstr "" #: newmemberwidget.php:37 -msgid "Local Support Group" +msgid "Local Support Forum" msgstr "" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "" -#: newmemberwidget.php:64 -msgid "Add a link to global support group" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" msgstr "" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" msgstr "" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" msgstr "" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." msgstr "" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support " "group here (i.e. helpers)" diff --git a/newmemberwidget/lang/bg/messages.po b/newmemberwidget/lang/bg/messages.po deleted file mode 100644 index 40cc435e..00000000 --- a/newmemberwidget/lang/bg/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON newmemberwidget -# Copyright (C) -# This file is distributed under the same license as the Friendica newmemberwidget addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: newmemberwidget.php:29 -msgid "New Member" -msgstr "" - -#: newmemberwidget.php:30 -msgid "Tips for New Members" -msgstr "" - -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" - -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" - -#: newmemberwidget.php:62 -msgid "Save Settings" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Message" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Your message for new members. You can use bbcode here." -msgstr "" - -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" - -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" - -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" - -#: newmemberwidget.php:65 -msgid "" -"If you have a local support group and want to have a link displayed in the " -"widget, check this box." -msgstr "" - -#: newmemberwidget.php:66 -msgid "Name of the local support group" -msgstr "" - -#: newmemberwidget.php:66 -msgid "" -"If you checked the above, specify the nickname of the local support" -" group here (i.e. helpers)" -msgstr "" diff --git a/newmemberwidget/lang/bg/strings.php b/newmemberwidget/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/newmemberwidget/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: newmemberwidget.php:29 -msgid "New Member" -msgstr "" - -#: newmemberwidget.php:30 -msgid "Tips for New Members" -msgstr "" - -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" - -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" - -#: newmemberwidget.php:62 -msgid "Save Settings" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Message" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Your message for new members. You can use bbcode here." -msgstr "" - -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" - -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" - -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" - -#: newmemberwidget.php:65 -msgid "" -"If you have a local support group and want to have a link displayed in the " -"widget, check this box." -msgstr "" - -#: newmemberwidget.php:66 -msgid "Name of the local support group" -msgstr "" - -#: newmemberwidget.php:66 -msgid "" -"If you checked the above, specify the nickname of the local support" -" group here (i.e. helpers)" -msgstr "" diff --git a/newmemberwidget/lang/ca/strings.php b/newmemberwidget/lang/ca/strings.php deleted file mode 100644 index d34874f6..00000000 --- a/newmemberwidget/lang/ca/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/cs/strings.php b/newmemberwidget/lang/cs/strings.php index 2f150466..3b6dc272 100644 --- a/newmemberwidget/lang/cs/strings.php +++ b/newmemberwidget/lang/cs/strings.php @@ -7,8 +7,13 @@ function string_plural_select_cs($n){ }} $a->strings['New Member'] = 'Nový člen'; $a->strings['Tips for New Members'] = 'Tipy pro nové členy'; +$a->strings['Global Support Forum'] = 'Globální fórum podpory'; +$a->strings['Local Support Forum'] = 'Místní fórum podpory'; $a->strings['Save Settings'] = 'Uložit nastavení'; $a->strings['Message'] = 'Zpráva'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Vaše zpráva pro nové členy. Zde můžete použít BBCode.'; +$a->strings['Add a link to global support forum'] = 'Přidejte odkaz na globální fórum podpory'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Má být zobrazen odkaz na globální fórum podpory?'; +$a->strings['Add a link to the local support forum'] = 'Přidejte odkaz na místní fórum podpory'; $a->strings['Name of the local support group'] = 'Název místního fóra podpory'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Pokud jste zaškrtl/a výše uvedenou možnost, specifikujte zde přezdívku místní skupiny podpory (např. pomocnici)'; diff --git a/newmemberwidget/lang/de/messages.po b/newmemberwidget/lang/de/messages.po index 87289e3e..851dfdce 100644 --- a/newmemberwidget/lang/de/messages.po +++ b/newmemberwidget/lang/de/messages.po @@ -4,16 +4,15 @@ # # # Translators: -# Raroun, 2023 # Tobias Diekershoff , 2021 # Ulf Rompe , 2019 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: Raroun, 2023\n" +"Last-Translator: Tobias Diekershoff , 2021\n" "Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -30,48 +29,48 @@ msgid "Tips for New Members" msgstr "Tipps für neue Nutzer" #: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "Globale Support-Gruppe" +msgid "Global Support Forum" +msgstr "Globales Forum für Hilfsanfragen" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "Lokale Support-Gruppe" +msgid "Local Support Forum" +msgstr "Lokales Forum für Hilfsanfragen" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "Einstellungen speichern" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Nachricht" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "Deine Nachricht für neue Nutzer. BBCode kann verwendet werden." -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "Fügen Sie einen Link der globalen Support-Gruppe hinzu" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" +msgstr "Link zum globalen Support-Forum anzeigen" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "Soll ein Link zur globalen Support-Gruppe angezeigt werden?" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" +msgstr "Soll ein Link zum globalen Support-Forum angezeigt werden?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "Fügen Sie einen Link der lokalen Support-Gruppe hinzu" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" +msgstr "Link zum lokalen Support-Forum anzeigen" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." -msgstr "Wenn Sie eine lokale Support-Gruppe haben und einen Link im Widget anzeigen lassen möchten, markieren Sie dieses Feld." +msgstr "Wenn du ein lokales Support-Forum eingerichtet hast und ein Link darauf angezeigt werden soll, schalte dies ein." -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "Name des lokalen Support-Forums" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/de/strings.php b/newmemberwidget/lang/de/strings.php index aa3e0f88..c7dc503c 100644 --- a/newmemberwidget/lang/de/strings.php +++ b/newmemberwidget/lang/de/strings.php @@ -7,14 +7,14 @@ function string_plural_select_de($n){ }} $a->strings['New Member'] = 'Neue Nutzer'; $a->strings['Tips for New Members'] = 'Tipps für neue Nutzer'; -$a->strings['Global Support Group'] = 'Globale Support-Gruppe'; -$a->strings['Local Support Group'] = 'Lokale Support-Gruppe'; +$a->strings['Global Support Forum'] = 'Globales Forum für Hilfsanfragen'; +$a->strings['Local Support Forum'] = 'Lokales Forum für Hilfsanfragen'; $a->strings['Save Settings'] = 'Einstellungen speichern'; $a->strings['Message'] = 'Nachricht'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Deine Nachricht für neue Nutzer. BBCode kann verwendet werden.'; -$a->strings['Add a link to global support group'] = 'Fügen Sie einen Link der globalen Support-Gruppe hinzu'; -$a->strings['Should a link to the global support group be displayed?'] = 'Soll ein Link zur globalen Support-Gruppe angezeigt werden?'; -$a->strings['Add a link to the local support group'] = 'Fügen Sie einen Link der lokalen Support-Gruppe hinzu'; -$a->strings['If you have a local support group and want to have a link displayed in the widget, check this box.'] = 'Wenn Sie eine lokale Support-Gruppe haben und einen Link im Widget anzeigen lassen möchten, markieren Sie dieses Feld.'; +$a->strings['Add a link to global support forum'] = 'Link zum globalen Support-Forum anzeigen'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Soll ein Link zum globalen Support-Forum angezeigt werden?'; +$a->strings['Add a link to the local support forum'] = 'Link zum lokalen Support-Forum anzeigen'; +$a->strings['If you have a local support forum and want to have a link displayed in the widget, check this box.'] = 'Wenn du ein lokales Support-Forum eingerichtet hast und ein Link darauf angezeigt werden soll, schalte dies ein.'; $a->strings['Name of the local support group'] = 'Name des lokalen Support-Forums'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Wenn der Link angezeigt werden soll, dann trage hier den Spitznamen des Forums ein (z.B. helpers)'; diff --git a/newmemberwidget/lang/eo/messages.po b/newmemberwidget/lang/eo/messages.po deleted file mode 100644 index 5619131c..00000000 --- a/newmemberwidget/lang/eo/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON newmemberwidget -# Copyright (C) -# This file is distributed under the same license as the Friendica newmemberwidget addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: newmemberwidget.php:29 -msgid "New Member" -msgstr "" - -#: newmemberwidget.php:30 -msgid "Tips for New Members" -msgstr "" - -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" - -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" - -#: newmemberwidget.php:62 -msgid "Save Settings" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Message" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Your message for new members. You can use bbcode here." -msgstr "" - -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" - -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" - -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" - -#: newmemberwidget.php:65 -msgid "" -"If you have a local support group and want to have a link displayed in the " -"widget, check this box." -msgstr "" - -#: newmemberwidget.php:66 -msgid "Name of the local support group" -msgstr "" - -#: newmemberwidget.php:66 -msgid "" -"If you checked the above, specify the nickname of the local support" -" group here (i.e. helpers)" -msgstr "" diff --git a/newmemberwidget/lang/eo/strings.php b/newmemberwidget/lang/eo/strings.php deleted file mode 100644 index 68e8a64c..00000000 --- a/newmemberwidget/lang/eo/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2021\n" -"Language-Team: Spanish (http://app.transifex.com/Friendica/friendica/language/es/)\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"PO-Revision-Date: 2021-04-06 01:46+0000\n" +"Last-Translator: Senex Petrovic \n" +"Language-Team: Spanish (http://www.transifex.com/Friendica/friendica/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: es\n" -"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: newmemberwidget.php:29 msgid "New Member" @@ -29,48 +29,48 @@ msgid "Tips for New Members" msgstr "Consejos para Nuevos Miembros" #: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" +msgid "Global Support Forum" +msgstr "Foro de Soporte Global" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" +msgid "Local Support Forum" +msgstr "Foro de Soporte Local" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "Guardar Ajustes" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Mensaje" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "Su mensaje para los nuevos miembros. Puede usar bbcode aquí" -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" +msgstr "Añadir un enlace al foro de soporte global" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" +msgstr "¿Debería mostrarse un enlace al foro de soporte global?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" +msgstr "Añadir un enlace al foro de soporte local" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." -msgstr "" +msgstr "Si tiene foro de soporte local y desea que se muestre un enlace en el widget, marque esta casilla." -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "Nombre del grupo de soporte local" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/es/strings.php b/newmemberwidget/lang/es/strings.php index 8798813a..28253b73 100644 --- a/newmemberwidget/lang/es/strings.php +++ b/newmemberwidget/lang/es/strings.php @@ -3,12 +3,18 @@ if(! function_exists("string_plural_select_es")) { function string_plural_select_es($n){ $n = intval($n); - if ($n == 1) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } + return intval($n != 1); }} $a->strings['New Member'] = 'Nuevo Miembro'; $a->strings['Tips for New Members'] = 'Consejos para Nuevos Miembros'; +$a->strings['Global Support Forum'] = 'Foro de Soporte Global'; +$a->strings['Local Support Forum'] = 'Foro de Soporte Local'; $a->strings['Save Settings'] = 'Guardar Ajustes'; $a->strings['Message'] = 'Mensaje'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Su mensaje para los nuevos miembros. Puede usar bbcode aquí'; +$a->strings['Add a link to global support forum'] = 'Añadir un enlace al foro de soporte global'; +$a->strings['Should a link to the global support forum be displayed?'] = '¿Debería mostrarse un enlace al foro de soporte global?'; +$a->strings['Add a link to the local support forum'] = 'Añadir un enlace al foro de soporte local'; +$a->strings['If you have a local support forum and want to have a link displayed in the widget, check this box.'] = 'Si tiene foro de soporte local y desea que se muestre un enlace en el widget, marque esta casilla.'; $a->strings['Name of the local support group'] = 'Nombre del grupo de soporte local'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Si chequeó arriba, especifique el apodo del grupo de soporte local aquí (asistentes)'; diff --git a/newmemberwidget/lang/et/messages.po b/newmemberwidget/lang/et/messages.po index 6f52dff8..969efad9 100644 --- a/newmemberwidget/lang/et/messages.po +++ b/newmemberwidget/lang/et/messages.po @@ -9,67 +9,67 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: Rain Hawk, 2019\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" +"POT-Creation-Date: 2014-06-01 14:12+0200\n" +"PO-Revision-Date: 2019-04-16 05:07+0000\n" +"Last-Translator: Rain Hawk\n" +"Language-Team: Estonian (http://www.transifex.com/Friendica/friendica/language/et/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: et\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: newmemberwidget.php:29 +#: newmemberwidget.php:21 msgid "New Member" msgstr "Uus liige" -#: newmemberwidget.php:30 +#: newmemberwidget.php:22 msgid "Tips for New Members" msgstr "Nippe uutele liikmetele" -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" +#: newmemberwidget.php:24 +msgid "Global Support Forum" +msgstr "Globaalne tugifoorum" -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" +#: newmemberwidget.php:26 +msgid "Local Support Forum" +msgstr "Lokaalne tugifoorum" -#: newmemberwidget.php:62 +#: newmemberwidget.php:49 msgid "Save Settings" msgstr "Salvesta sätted" -#: newmemberwidget.php:63 +#: newmemberwidget.php:50 msgid "Message" msgstr "Sõnum" -#: newmemberwidget.php:63 +#: newmemberwidget.php:50 msgid "Your message for new members. You can use bbcode here." msgstr "" -#: newmemberwidget.php:64 -msgid "Add a link to global support group" +#: newmemberwidget.php:51 +msgid "Add a link to global support forum" msgstr "" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" +#: newmemberwidget.php:51 +msgid "Should a link to the global support forum be displayed?" msgstr "" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" +#: newmemberwidget.php:52 +msgid "Add a link to the local support forum" msgstr "" -#: newmemberwidget.php:65 +#: newmemberwidget.php:52 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and wand to have a link displayed in the " "widget, check this box." msgstr "" -#: newmemberwidget.php:66 +#: newmemberwidget.php:53 msgid "Name of the local support group" msgstr "" -#: newmemberwidget.php:66 +#: newmemberwidget.php:53 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/et/strings.php b/newmemberwidget/lang/et/strings.php index e4465d99..3d4f8167 100644 --- a/newmemberwidget/lang/et/strings.php +++ b/newmemberwidget/lang/et/strings.php @@ -7,5 +7,7 @@ function string_plural_select_et($n){ }} $a->strings['New Member'] = 'Uus liige'; $a->strings['Tips for New Members'] = 'Nippe uutele liikmetele'; +$a->strings['Global Support Forum'] = 'Globaalne tugifoorum'; +$a->strings['Local Support Forum'] = 'Lokaalne tugifoorum'; $a->strings['Save Settings'] = 'Salvesta sätted'; $a->strings['Message'] = 'Sõnum'; diff --git a/newmemberwidget/lang/fr/messages.po b/newmemberwidget/lang/fr/messages.po index fe50a027..296c2755 100644 --- a/newmemberwidget/lang/fr/messages.po +++ b/newmemberwidget/lang/fr/messages.po @@ -4,8 +4,6 @@ # # # Translators: -# cracrayol, 2025 -# cracrayol, 2023 # Hypolite Petovan , 2022 # Nicolas Derive, 2022 # StefOfficiel , 2015 @@ -13,10 +11,10 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: cracrayol, 2025\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: Nicolas Derive, 2022\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -32,48 +30,48 @@ msgid "Tips for New Members" msgstr "Conseils aux nouveaux venus" #: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "Groupe de support global" +msgid "Global Support Forum" +msgstr "Forum de support global" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "Groupe de support local" +msgid "Local Support Forum" +msgstr "Forum de support local" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" -msgstr "Sauvegarder les paramètres" +msgstr "Enregistrer les paramètres" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Message" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "Votre messages aux nouveaux venus. Vous pouvez utiliser des BBCodes." -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "Ajouter un lien vers le groupe de support global" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" +msgstr "Ajouter un lien vers le forum de support global" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "Montrer un lien vers le groupe de support global ?" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" +msgstr "Montrer un lien vers le forum de support global?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "Ajouter un lien vers le groupe de support local" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" +msgstr "Ajouter un lien vers le forum de support local" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." -msgstr "Si vous avez un groupe de support local et désirez avoir un lien affiché dans l'appliquette/widget, cochez cette case." +msgstr "Si vous avez un forum d'assistance local et désirez avoir un lien affiché dans l'appliquette/widget, cochez cette case." -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "Nom du groupe de support local" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/fr/strings.php b/newmemberwidget/lang/fr/strings.php index ce6d6598..8de178f2 100644 --- a/newmemberwidget/lang/fr/strings.php +++ b/newmemberwidget/lang/fr/strings.php @@ -7,14 +7,14 @@ function string_plural_select_fr($n){ }} $a->strings['New Member'] = 'Nouveau Membre'; $a->strings['Tips for New Members'] = 'Conseils aux nouveaux venus'; -$a->strings['Global Support Group'] = 'Groupe de support global'; -$a->strings['Local Support Group'] = 'Groupe de support local'; -$a->strings['Save Settings'] = 'Sauvegarder les paramètres'; +$a->strings['Global Support Forum'] = 'Forum de support global'; +$a->strings['Local Support Forum'] = 'Forum de support local'; +$a->strings['Save Settings'] = 'Enregistrer les paramètres'; $a->strings['Message'] = 'Message'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Votre messages aux nouveaux venus. Vous pouvez utiliser des BBCodes.'; -$a->strings['Add a link to global support group'] = 'Ajouter un lien vers le groupe de support global'; -$a->strings['Should a link to the global support group be displayed?'] = 'Montrer un lien vers le groupe de support global ?'; -$a->strings['Add a link to the local support group'] = 'Ajouter un lien vers le groupe de support local'; -$a->strings['If you have a local support group and want to have a link displayed in the widget, check this box.'] = 'Si vous avez un groupe de support local et désirez avoir un lien affiché dans l\'appliquette/widget, cochez cette case.'; +$a->strings['Add a link to global support forum'] = 'Ajouter un lien vers le forum de support global'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Montrer un lien vers le forum de support global?'; +$a->strings['Add a link to the local support forum'] = 'Ajouter un lien vers le forum de support local'; +$a->strings['If you have a local support forum and want to have a link displayed in the widget, check this box.'] = 'Si vous avez un forum d\'assistance local et désirez avoir un lien affiché dans l\'appliquette/widget, cochez cette case.'; $a->strings['Name of the local support group'] = 'Nom du groupe de support local'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Si vous avez coché la case ci-dessus, spécifiez le nom d\'utilisateur du groupe de support local (par ex. "helpers")'; diff --git a/newmemberwidget/lang/gd/messages.po b/newmemberwidget/lang/gd/messages.po deleted file mode 100644 index aa34a3ca..00000000 --- a/newmemberwidget/lang/gd/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON newmemberwidget -# Copyright (C) -# This file is distributed under the same license as the Friendica newmemberwidget addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: newmemberwidget.php:29 -msgid "New Member" -msgstr "" - -#: newmemberwidget.php:30 -msgid "Tips for New Members" -msgstr "" - -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" - -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" - -#: newmemberwidget.php:62 -msgid "Save Settings" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Message" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Your message for new members. You can use bbcode here." -msgstr "" - -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" - -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" - -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" - -#: newmemberwidget.php:65 -msgid "" -"If you have a local support group and want to have a link displayed in the " -"widget, check this box." -msgstr "" - -#: newmemberwidget.php:66 -msgid "Name of the local support group" -msgstr "" - -#: newmemberwidget.php:66 -msgid "" -"If you checked the above, specify the nickname of the local support" -" group here (i.e. helpers)" -msgstr "" diff --git a/newmemberwidget/lang/gd/strings.php b/newmemberwidget/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/newmemberwidget/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/newmemberwidget/lang/hu/messages.po b/newmemberwidget/lang/hu/messages.po index f3babd21..41453463 100644 --- a/newmemberwidget/lang/hu/messages.po +++ b/newmemberwidget/lang/hu/messages.po @@ -4,15 +4,15 @@ # # # Translators: -# Balázs Úr, 2020-2021,2023 +# Balázs Úr, 2020-2021 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: Balázs Úr, 2020-2021,2023\n" -"Language-Team: Hungarian (http://app.transifex.com/Friendica/friendica/language/hu/)\n" +"Last-Translator: Balázs Úr, 2020-2021\n" +"Language-Team: Hungarian (http://www.transifex.com/Friendica/friendica/language/hu/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -28,48 +28,48 @@ msgid "Tips for New Members" msgstr "Tippek új tagoknak" #: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "Globális támogatási csoport" +msgid "Global Support Forum" +msgstr "Globális támogató fórum" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "Helyi támogatási csoport" +msgid "Local Support Forum" +msgstr "Helyi támogató fórum" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "Beállítások mentése" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Üzenet" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "Az Ön üzenete az új tagoknak. Itt használhat BBCode-ot." -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "A globális támogatási csoportra mutató hivatkozás hozzáadása" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" +msgstr "A globális támogató fórumra mutató hivatkozás hozzáadása" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "Meg kell jeleníteni a globális támogatási csoportra mutató hivatkozást?" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" +msgstr "Meg kell jeleníteni a globális támogató fórumra mutató hivatkozást?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "A helyi támogatási csoportra mutató hivatkozás hozzáadása" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" +msgstr "A helyi támogató fórumra mutató hivatkozás hozzáadása" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." -msgstr "Ha van helyi támogatási csoportja és meg szeretne jeleníteni egy hivatkozást a felületi elemben, akkor jelölje be ezt a négyzetet." +msgstr "Ha van helyi támogató fóruma és szeretne egy hivatkozást megjeleníteni a felületi elemben, akkor jelölje be azt a négyzetet." -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "A helyi támogató csoport neve" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/hu/strings.php b/newmemberwidget/lang/hu/strings.php index 2f0066cd..edf2a003 100644 --- a/newmemberwidget/lang/hu/strings.php +++ b/newmemberwidget/lang/hu/strings.php @@ -7,14 +7,14 @@ function string_plural_select_hu($n){ }} $a->strings['New Member'] = 'Új tag'; $a->strings['Tips for New Members'] = 'Tippek új tagoknak'; -$a->strings['Global Support Group'] = 'Globális támogatási csoport'; -$a->strings['Local Support Group'] = 'Helyi támogatási csoport'; +$a->strings['Global Support Forum'] = 'Globális támogató fórum'; +$a->strings['Local Support Forum'] = 'Helyi támogató fórum'; $a->strings['Save Settings'] = 'Beállítások mentése'; $a->strings['Message'] = 'Üzenet'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Az Ön üzenete az új tagoknak. Itt használhat BBCode-ot.'; -$a->strings['Add a link to global support group'] = 'A globális támogatási csoportra mutató hivatkozás hozzáadása'; -$a->strings['Should a link to the global support group be displayed?'] = 'Meg kell jeleníteni a globális támogatási csoportra mutató hivatkozást?'; -$a->strings['Add a link to the local support group'] = 'A helyi támogatási csoportra mutató hivatkozás hozzáadása'; -$a->strings['If you have a local support group and want to have a link displayed in the widget, check this box.'] = 'Ha van helyi támogatási csoportja és meg szeretne jeleníteni egy hivatkozást a felületi elemben, akkor jelölje be ezt a négyzetet.'; +$a->strings['Add a link to global support forum'] = 'A globális támogató fórumra mutató hivatkozás hozzáadása'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Meg kell jeleníteni a globális támogató fórumra mutató hivatkozást?'; +$a->strings['Add a link to the local support forum'] = 'A helyi támogató fórumra mutató hivatkozás hozzáadása'; +$a->strings['If you have a local support forum and want to have a link displayed in the widget, check this box.'] = 'Ha van helyi támogató fóruma és szeretne egy hivatkozást megjeleníteni a felületi elemben, akkor jelölje be azt a négyzetet.'; $a->strings['Name of the local support group'] = 'A helyi támogató csoport neve'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Ha bejelölte a fentit, akkor itt adja meg a helyi támogató csoport becenevét (például segítők)'; diff --git a/newmemberwidget/lang/is/messages.po b/newmemberwidget/lang/is/messages.po deleted file mode 100644 index c740a42b..00000000 --- a/newmemberwidget/lang/is/messages.po +++ /dev/null @@ -1,75 +0,0 @@ -# ADDON newmemberwidget -# Copyright (C) -# This file is distributed under the same license as the Friendica newmemberwidget addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: newmemberwidget.php:29 -msgid "New Member" -msgstr "" - -#: newmemberwidget.php:30 -msgid "Tips for New Members" -msgstr "" - -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" - -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" - -#: newmemberwidget.php:62 -msgid "Save Settings" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Message" -msgstr "" - -#: newmemberwidget.php:63 -msgid "Your message for new members. You can use bbcode here." -msgstr "" - -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" - -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" - -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" - -#: newmemberwidget.php:65 -msgid "" -"If you have a local support group and want to have a link displayed in the " -"widget, check this box." -msgstr "" - -#: newmemberwidget.php:66 -msgid "Name of the local support group" -msgstr "" - -#: newmemberwidget.php:66 -msgid "" -"If you checked the above, specify the nickname of the local support" -" group here (i.e. helpers)" -msgstr "" diff --git a/newmemberwidget/lang/is/strings.php b/newmemberwidget/lang/is/strings.php deleted file mode 100644 index 975c341e..00000000 --- a/newmemberwidget/lang/is/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2020-2021\n" "Language-Team: Italian (http://app.transifex.com/Friendica/friendica/language/it/)\n" @@ -29,48 +29,48 @@ msgid "Tips for New Members" msgstr "Consigli per i Nuovi Utenti" #: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" +msgid "Global Support Forum" +msgstr "Forum Globale di Supporto" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" +msgid "Local Support Forum" +msgstr "Forum Locale di Supporto" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "Salva Impostazioni" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Messaggio" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "Il tuo messaggio per i nuovi utenti. Puoi usare BBCode" -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" +msgstr "Aggiunge un collegamento al forum di supporto globale" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" +msgstr "Mostrare il collegamento al forum di supporto globale?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" +msgstr "Aggiunge un collegamento al forum di supporto locale" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." -msgstr "" +msgstr "Se hai un forum di supporto locale e vuoi che sia mostrato il collegamento nel widget, seleziona questo box." -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "Nome del gruppo locale di supporto" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/it/strings.php b/newmemberwidget/lang/it/strings.php index 56798c2a..f459f79e 100644 --- a/newmemberwidget/lang/it/strings.php +++ b/newmemberwidget/lang/it/strings.php @@ -7,8 +7,14 @@ function string_plural_select_it($n){ }} $a->strings['New Member'] = 'Nuovi Utenti'; $a->strings['Tips for New Members'] = 'Consigli per i Nuovi Utenti'; +$a->strings['Global Support Forum'] = 'Forum Globale di Supporto'; +$a->strings['Local Support Forum'] = 'Forum Locale di Supporto'; $a->strings['Save Settings'] = 'Salva Impostazioni'; $a->strings['Message'] = 'Messaggio'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Il tuo messaggio per i nuovi utenti. Puoi usare BBCode'; +$a->strings['Add a link to global support forum'] = 'Aggiunge un collegamento al forum di supporto globale'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Mostrare il collegamento al forum di supporto globale?'; +$a->strings['Add a link to the local support forum'] = 'Aggiunge un collegamento al forum di supporto locale'; +$a->strings['If you have a local support forum and want to have a link displayed in the widget, check this box.'] = 'Se hai un forum di supporto locale e vuoi che sia mostrato il collegamento nel widget, seleziona questo box.'; $a->strings['Name of the local support group'] = 'Nome del gruppo locale di supporto'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Se hai selezionato il box sopra, specifica qui il nome utente del gruppo locale di supporto (e.s. \'supporto\')'; diff --git a/newmemberwidget/lang/pl/messages.po b/newmemberwidget/lang/pl/messages.po index 4d95d214..3f1838b5 100644 --- a/newmemberwidget/lang/pl/messages.po +++ b/newmemberwidget/lang/pl/messages.po @@ -4,17 +4,16 @@ # # # Translators: -# Bartosz Kozień, 2025 -# Piotr Strebski , 2022 +# Piotr Strębski , 2022 # Waldemar Stoczkowski, 2018 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: Bartosz Kozień, 2025\n" -"Language-Team: Polish (http://app.transifex.com/Friendica/friendica/language/pl/)\n" +"Last-Translator: Piotr Strębski , 2022\n" +"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -30,49 +29,49 @@ msgid "Tips for New Members" msgstr "Wskazówki dla nowych użytkowników" #: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "Globalna Grupa Pomocy" +msgid "Global Support Forum" +msgstr "Globalne forum pomocy technicznej" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "Lokalna Grupa Pomocy" +msgid "Local Support Forum" +msgstr "Lokalne Forum Wsparcia" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "Zapisz ustawienia" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Wiadomość" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "Twoja wiadomość dla nowych członków. Możesz tutaj użyć bbcode." -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "Dodaj link do globalnej grupy pomocy" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" +msgstr "Dodaj odnośnik do globalnego forum pomocy technicznej" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "Czy link do globalnej grupy pomocy powinien być wyświetlany?" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" +msgstr "Czy powinien być wyświetlany odnośnik do globalnego forum pomocy technicznej?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "Dodaj link do lokalnej grupy pomocy" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" +msgstr "Dodaj odnośnik do lokalnego forum pomocy technicznej" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." -msgstr "Jeśli posiadasz lokalną grupę pomocy i chcesz wyświetlać link do niej na widżecie, zaznacz tę opcję." +msgstr "Jeżeli masz lokalne wsparcie forum i chcesz mieć łącze wyświetlane w widżecie, zaznacz to pole wyboru." -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" -msgstr "Alias lokalnej grupy pomocy" +msgstr "Nazwa grupy lokalnej pomocy technicznej" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" -msgstr "Jeśli zaznaczyłeś powyższe, podaj tutaj alias lokalnej grupy pomocy (np. pomocnicy)" +msgstr "Jeśli zaznaczyłeś powyższe, określ tutaj pseudonim lokalnej grupy wsparcia (np. Pomocnicy)" diff --git a/newmemberwidget/lang/pl/strings.php b/newmemberwidget/lang/pl/strings.php index d46c671e..97103add 100644 --- a/newmemberwidget/lang/pl/strings.php +++ b/newmemberwidget/lang/pl/strings.php @@ -7,14 +7,14 @@ function string_plural_select_pl($n){ }} $a->strings['New Member'] = 'Nowy użytkownik'; $a->strings['Tips for New Members'] = 'Wskazówki dla nowych użytkowników'; -$a->strings['Global Support Group'] = 'Globalna Grupa Pomocy'; -$a->strings['Local Support Group'] = 'Lokalna Grupa Pomocy'; +$a->strings['Global Support Forum'] = 'Globalne forum pomocy technicznej'; +$a->strings['Local Support Forum'] = 'Lokalne Forum Wsparcia'; $a->strings['Save Settings'] = 'Zapisz ustawienia'; $a->strings['Message'] = 'Wiadomość'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Twoja wiadomość dla nowych członków. Możesz tutaj użyć bbcode.'; -$a->strings['Add a link to global support group'] = 'Dodaj link do globalnej grupy pomocy'; -$a->strings['Should a link to the global support group be displayed?'] = 'Czy link do globalnej grupy pomocy powinien być wyświetlany?'; -$a->strings['Add a link to the local support group'] = 'Dodaj link do lokalnej grupy pomocy'; -$a->strings['If you have a local support group and want to have a link displayed in the widget, check this box.'] = 'Jeśli posiadasz lokalną grupę pomocy i chcesz wyświetlać link do niej na widżecie, zaznacz tę opcję.'; -$a->strings['Name of the local support group'] = 'Alias lokalnej grupy pomocy'; -$a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Jeśli zaznaczyłeś powyższe, podaj tutaj alias lokalnej grupy pomocy (np. pomocnicy)'; +$a->strings['Add a link to global support forum'] = 'Dodaj odnośnik do globalnego forum pomocy technicznej'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Czy powinien być wyświetlany odnośnik do globalnego forum pomocy technicznej?'; +$a->strings['Add a link to the local support forum'] = 'Dodaj odnośnik do lokalnego forum pomocy technicznej'; +$a->strings['If you have a local support forum and want to have a link displayed in the widget, check this box.'] = 'Jeżeli masz lokalne wsparcie forum i chcesz mieć łącze wyświetlane w widżecie, zaznacz to pole wyboru.'; +$a->strings['Name of the local support group'] = 'Nazwa grupy lokalnej pomocy technicznej'; +$a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Jeśli zaznaczyłeś powyższe, określ tutaj pseudonim lokalnej grupy wsparcia (np. Pomocnicy)'; diff --git a/newmemberwidget/lang/ru/messages.po b/newmemberwidget/lang/ru/messages.po index 1fe611e9..94d61e3f 100644 --- a/newmemberwidget/lang/ru/messages.po +++ b/newmemberwidget/lang/ru/messages.po @@ -9,67 +9,67 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: Alexander An , 2020\n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" +"POT-Creation-Date: 2014-06-01 14:12+0200\n" +"PO-Revision-Date: 2020-04-23 14:23+0000\n" +"Last-Translator: Alexander An \n" +"Language-Team: Russian (http://www.transifex.com/Friendica/friendica/language/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ru\n" "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" -#: newmemberwidget.php:29 +#: newmemberwidget.php:21 msgid "New Member" msgstr "Новичок" -#: newmemberwidget.php:30 +#: newmemberwidget.php:22 msgid "Tips for New Members" msgstr "Советы новичкам" -#: newmemberwidget.php:33 -msgid "Global Support Group" -msgstr "" +#: newmemberwidget.php:24 +msgid "Global Support Forum" +msgstr "Общий форум поддержки" -#: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" +#: newmemberwidget.php:26 +msgid "Local Support Forum" +msgstr "Местный форум поддержки" -#: newmemberwidget.php:62 +#: newmemberwidget.php:49 msgid "Save Settings" msgstr "Сохранить настройки" -#: newmemberwidget.php:63 +#: newmemberwidget.php:50 msgid "Message" msgstr "Сообщение" -#: newmemberwidget.php:63 +#: newmemberwidget.php:50 msgid "Your message for new members. You can use bbcode here." msgstr "Ваше сообщение новичкам. Вы можете использовать BBCode." -#: newmemberwidget.php:64 -msgid "Add a link to global support group" -msgstr "" +#: newmemberwidget.php:51 +msgid "Add a link to global support forum" +msgstr "Добавить ссылку на общий форум поддержки" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" -msgstr "" +#: newmemberwidget.php:51 +msgid "Should a link to the global support forum be displayed?" +msgstr "Показывать ссылку на общий форум поддержки?" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" -msgstr "" +#: newmemberwidget.php:52 +msgid "Add a link to the local support forum" +msgstr "Добавить ссылку на местный форум поддержки" -#: newmemberwidget.php:65 +#: newmemberwidget.php:52 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and wand to have a link displayed in the " "widget, check this box." -msgstr "" +msgstr "Если у вас есть местный форум поддержки и вы хотите добавить ссылку на него, включите это." -#: newmemberwidget.php:66 +#: newmemberwidget.php:53 msgid "Name of the local support group" msgstr "Название местной группы поддержки" -#: newmemberwidget.php:66 +#: newmemberwidget.php:53 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/ru/strings.php b/newmemberwidget/lang/ru/strings.php index 6f27bb1a..7992e64b 100644 --- a/newmemberwidget/lang/ru/strings.php +++ b/newmemberwidget/lang/ru/strings.php @@ -7,8 +7,14 @@ function string_plural_select_ru($n){ }} $a->strings['New Member'] = 'Новичок'; $a->strings['Tips for New Members'] = 'Советы новичкам'; +$a->strings['Global Support Forum'] = 'Общий форум поддержки'; +$a->strings['Local Support Forum'] = 'Местный форум поддержки'; $a->strings['Save Settings'] = 'Сохранить настройки'; $a->strings['Message'] = 'Сообщение'; $a->strings['Your message for new members. You can use bbcode here.'] = 'Ваше сообщение новичкам. Вы можете использовать BBCode.'; +$a->strings['Add a link to global support forum'] = 'Добавить ссылку на общий форум поддержки'; +$a->strings['Should a link to the global support forum be displayed?'] = 'Показывать ссылку на общий форум поддержки?'; +$a->strings['Add a link to the local support forum'] = 'Добавить ссылку на местный форум поддержки'; +$a->strings['If you have a local support forum and wand to have a link displayed in the widget, check this box.'] = 'Если у вас есть местный форум поддержки и вы хотите добавить ссылку на него, включите это.'; $a->strings['Name of the local support group'] = 'Название местной группы поддержки'; $a->strings['If you checked the above, specify the nickname of the local support group here (i.e. helpers)'] = 'Если вы включили настройку выше, укажите никместной группы поддержки пользователей.'; diff --git a/newmemberwidget/lang/sv/messages.po b/newmemberwidget/lang/sv/messages.po index a1a6167a..0d6171b2 100644 --- a/newmemberwidget/lang/sv/messages.po +++ b/newmemberwidget/lang/sv/messages.po @@ -9,10 +9,10 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 10:26+0000\n" -"Last-Translator: Kristoffer Grundström , 2022\n" -"Language-Team: Swedish (http://app.transifex.com/Friendica/friendica/language/sv/)\n" +"POT-Creation-Date: 2021-02-01 18:15+0100\n" +"PO-Revision-Date: 2022-01-16 00:48+0000\n" +"Last-Translator: Kristoffer Grundström \n" +"Language-Team: Swedish (http://www.transifex.com/Friendica/friendica/language/sv/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -28,48 +28,48 @@ msgid "Tips for New Members" msgstr "Tips för nya medlemmar" #: newmemberwidget.php:33 -msgid "Global Support Group" +msgid "Global Support Forum" msgstr "" #: newmemberwidget.php:37 -msgid "Local Support Group" -msgstr "" +msgid "Local Support Forum" +msgstr "Lokalt hjälpforum" -#: newmemberwidget.php:62 +#: newmemberwidget.php:65 msgid "Save Settings" msgstr "Spara inställningar" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Message" msgstr "Meddelande" -#: newmemberwidget.php:63 +#: newmemberwidget.php:66 msgid "Your message for new members. You can use bbcode here." msgstr "" -#: newmemberwidget.php:64 -msgid "Add a link to global support group" +#: newmemberwidget.php:67 +msgid "Add a link to global support forum" msgstr "" -#: newmemberwidget.php:64 -msgid "Should a link to the global support group be displayed?" +#: newmemberwidget.php:67 +msgid "Should a link to the global support forum be displayed?" msgstr "" -#: newmemberwidget.php:65 -msgid "Add a link to the local support group" +#: newmemberwidget.php:68 +msgid "Add a link to the local support forum" msgstr "" -#: newmemberwidget.php:65 +#: newmemberwidget.php:68 msgid "" -"If you have a local support group and want to have a link displayed in the " +"If you have a local support forum and want to have a link displayed in the " "widget, check this box." msgstr "" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "Name of the local support group" msgstr "" -#: newmemberwidget.php:66 +#: newmemberwidget.php:69 msgid "" "If you checked the above, specify the nickname of the local support" " group here (i.e. helpers)" diff --git a/newmemberwidget/lang/sv/strings.php b/newmemberwidget/lang/sv/strings.php index e92a428f..38292306 100644 --- a/newmemberwidget/lang/sv/strings.php +++ b/newmemberwidget/lang/sv/strings.php @@ -7,5 +7,6 @@ function string_plural_select_sv($n){ }} $a->strings['New Member'] = 'Ny medlem'; $a->strings['Tips for New Members'] = 'Tips för nya medlemmar'; +$a->strings['Local Support Forum'] = 'Lokalt hjälpforum'; $a->strings['Save Settings'] = 'Spara inställningar'; $a->strings['Message'] = 'Meddelande'; diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index ba7dfb39..356597b7 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -6,16 +6,17 @@ * Author: Tobias Diekershoff ***/ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; -use Friendica\Model\User; function newmemberwidget_install() { Hook::register( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); - DI::logger()->notice('newmemberwidget installed'); + Logger::notice('newmemberwidget installed'); } function newmemberwidget_network_mod_init ($b) @@ -29,16 +30,16 @@ function newmemberwidget_network_mod_init ($b) $t .= '' . DI::l10n()->t('Tips for New Members') . '
'; if (DI::config()->get('newmemberwidget','linkglobalsupport', false)) { - $t .= '' . DI::l10n()->t('Global Support Group') . '
'; + $t .= ''.DI::l10n()->t('Global Support Forum').'
'; } if (DI::config()->get('newmemberwidget','linklocalsupport', false)) { - $t .= '' . DI::l10n()->t('Local Support Group') . '
'; + $t .= ''.DI::l10n()->t('Local Support Forum').'
'; } $ft = DI::config()->get('newmemberwidget','freetext', ''); if (!empty($ft)) { - $t .= '

'.BBCode::convertForUriId(User::getSystemUriId(), trim($ft)).'

'; + $t .= '

'.BBCode::convert(trim($ft)).'

'; } $t .= '
'; @@ -60,8 +61,8 @@ function newmemberwidget_addon_admin(string &$o) $o = Renderer::replaceMacros($t, [ '$submit' => DI::l10n()->t('Save Settings'), '$freetext' => ["freetext", DI::l10n()->t("Message"), DI::config()->get("newmemberwidget", "freetext"), DI::l10n()->t("Your message for new members. You can use bbcode here.")], - '$linkglobalsupport' => ["linkglobalsupport", DI::l10n()->t('Add a link to global support group'), DI::config()->get('newmemberwidget', 'linkglobalsupport'), DI::l10n()->t('Should a link to the global support group be displayed?')." (@helpers)"], - '$linklocalsupport' => ["linklocalsupport", DI::l10n()->t('Add a link to the local support group'), DI::config()->get('newmemberwidget', 'linklocalsupport'), DI::l10n()->t('If you have a local support group and want to have a link displayed in the widget, check this box.')], + '$linkglobalsupport' => ["linkglobalsupport", DI::l10n()->t('Add a link to global support forum'), DI::config()->get('newmemberwidget', 'linkglobalsupport'), DI::l10n()->t('Should a link to the global support forum be displayed?')." (@helpers)"], + '$linklocalsupport' => ["linklocalsupport", DI::l10n()->t('Add a link to the local support forum'), DI::config()->get('newmemberwidget', 'linklocalsupport'), DI::l10n()->t('If you have a local support forum and want to have a link displayed in the widget, check this box.')], '$localsupportname' => ["localsupportname", DI::l10n()->t('Name of the local support group'), DI::config()->get('newmemberwidget', 'localsupport'), DI::l10n()->t('If you checked the above, specify the nickname of the local support group here (i.e. helpers)')], ]); } diff --git a/nitter/nitter.php b/nitter/nitter.php index adbfd6b0..e9454c5d 100644 --- a/nitter/nitter.php +++ b/nitter/nitter.php @@ -4,20 +4,18 @@ * Description: Replaces links to twitter.com to a nitter server in all displays of postings on a node. * Version: 2.0 * Author: Tobias Diekershoff - * Status: Unsupported - * Note: Please use the URL Replace addon instead * * Copyright (c) 2020 Tobias Diekershoff * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included in all copies or substantial * portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, @@ -25,6 +23,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; @@ -50,7 +49,7 @@ function nitter_addon_admin(string &$o) $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/nitter/'); $o = Renderer::replaceMacros($t, [ '$settingdescription' => DI::l10n()->t('Which nitter server shall be used for the replacements in the post bodies? Use the URL with servername and protocol. See %s for a list of available public Nitter servers.', 'https://github.com/zedeus/nitter/wiki/Instances'), - '$nitterserver' => ['nitterserver', DI::l10n()->t('Nitter server'), $nitterserver, 'https://example.com'], + '$nitterserver' => ['nitterserver', DI::l10n()->t('Nitter server'), $nitterserver, 'https://example.com'], '$submit' => DI::l10n()->t('Save Settings'), ]); } diff --git a/nominatim/nominatim.php b/nominatim/nominatim.php index 3a567b7b..6ad4a8a3 100644 --- a/nominatim/nominatim.php +++ b/nominatim/nominatim.php @@ -6,7 +6,9 @@ * Author: Michael Vogel */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; @@ -44,19 +46,19 @@ function nominatim_resolve_item(array &$item) $s = DI::httpClient()->fetch('https://nominatim.openstreetmap.org/reverse?lat=' . $coords[0] . '&lon=' . $coords[1] . '&format=json&addressdetails=0&accept-language=' . $language); if (empty($s)) { - DI::logger()->info('API could not be queried'); + Logger::info('API could not be queried'); return; } $data = json_decode($s, true); if (empty($data['display_name'])) { - DI::logger()->info('No results found for coordinates', ['coordinates' => $item['coord'], 'data' => $data]); + Logger::info('No results found for coordinates', ['coordinates' => $item['coord'], 'data' => $data]); return; } $item['location'] = $data['display_name']; - DI::logger()->info('Got location', ['lat' => $coords[0], 'long' => $coords[1], 'location' => $item['location']]); + Logger::info('Got location', ['lat' => $coords[0], 'long' => $coords[1], 'location' => $item['location']]); if (!empty($item['location'])) { DI::cache()->set('nominatim:' . $language . ':' . $coords[0] . '-' . $coords[1], $item['location']); diff --git a/notifyall/NotifyAllEmail.php b/notifyall/NotifyAllEmail.php index 7a00a2c9..3bb16f27 100644 --- a/notifyall/NotifyAllEmail.php +++ b/notifyall/NotifyAllEmail.php @@ -25,7 +25,6 @@ use Friendica\App\BaseURL; use Friendica\Content\Text\BBCode; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; -use Friendica\Model\User; use Friendica\Object\Email; /** @@ -51,9 +50,9 @@ class NotifyAllEmail extends Email $subject = $_REQUEST['subject']; - $textversion = strip_tags(html_entity_decode(BBCode::convertForUriId(User::getSystemUriId(), stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8')); + $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8')); - $htmlversion = BBCode::convertForUriId(User::getSystemUriId(), stripslashes(str_replace(["\\r", "\\n"], ["", "
\n"], $text))); + $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "
\n"], $text))); parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion); } diff --git a/notifyall/lang/bg/messages.po b/notifyall/lang/bg/messages.po deleted file mode 100644 index fcb0ddec..00000000 --- a/notifyall/lang/bg/messages.po +++ /dev/null @@ -1,56 +0,0 @@ -# ADDON notifyall -# Copyright (C) -# This file is distributed under the same license as the Friendica notifyall addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2016-08-14 19:29+0000\n" -"Language-Team: Bulgarian (https://app.transifex.com/Friendica/teams/12172/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: NotifyAllEmail.php:40 -#, php-format -msgid "%s Administrator" -msgstr "" - -#: NotifyAllEmail.php:42 -#, php-format -msgid "%1$s, %2$s Administrator" -msgstr "" - -#: notifyall.php:22 -msgid "Send email to all members" -msgstr "" - -#: notifyall.php:49 -msgid "No recipients found." -msgstr "" - -#: notifyall.php:59 -msgid "Emails sent" -msgstr "" - -#: notifyall.php:69 -msgid "Send email to all members of this Friendica instance." -msgstr "" - -#: notifyall.php:74 -msgid "Message subject" -msgstr "" - -#: notifyall.php:75 -msgid "Test mode (only send to administrator)" -msgstr "" - -#: notifyall.php:76 -msgid "Submit" -msgstr "" diff --git a/notifyall/lang/bg/strings.php b/notifyall/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/notifyall/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -strings['Submit'] = 'Saada'; diff --git a/notifyall/lang/gd/messages.po b/notifyall/lang/gd/messages.po deleted file mode 100644 index e4b216b4..00000000 --- a/notifyall/lang/gd/messages.po +++ /dev/null @@ -1,56 +0,0 @@ -# ADDON notifyall -# Copyright (C) -# This file is distributed under the same license as the Friendica notifyall addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2016-08-14 19:29+0000\n" -"Language-Team: Gaelic, Scottish (https://app.transifex.com/Friendica/teams/12172/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: NotifyAllEmail.php:40 -#, php-format -msgid "%s Administrator" -msgstr "" - -#: NotifyAllEmail.php:42 -#, php-format -msgid "%1$s, %2$s Administrator" -msgstr "" - -#: notifyall.php:22 -msgid "Send email to all members" -msgstr "" - -#: notifyall.php:49 -msgid "No recipients found." -msgstr "" - -#: notifyall.php:59 -msgid "Emails sent" -msgstr "" - -#: notifyall.php:69 -msgid "Send email to all members of this Friendica instance." -msgstr "" - -#: notifyall.php:74 -msgid "Message subject" -msgstr "" - -#: notifyall.php:75 -msgid "Test mode (only send to administrator)" -msgstr "" - -#: notifyall.php:76 -msgid "Submit" -msgstr "" diff --git a/notifyall/lang/gd/strings.php b/notifyall/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/notifyall/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/notifyall/lang/is/messages.po b/notifyall/lang/is/messages.po deleted file mode 100644 index bfe6c822..00000000 --- a/notifyall/lang/is/messages.po +++ /dev/null @@ -1,56 +0,0 @@ -# ADDON notifyall -# Copyright (C) -# This file is distributed under the same license as the Friendica notifyall addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2016-08-14 19:29+0000\n" -"Language-Team: Icelandic (https://app.transifex.com/Friendica/teams/12172/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: NotifyAllEmail.php:40 -#, php-format -msgid "%s Administrator" -msgstr "" - -#: NotifyAllEmail.php:42 -#, php-format -msgid "%1$s, %2$s Administrator" -msgstr "" - -#: notifyall.php:22 -msgid "Send email to all members" -msgstr "" - -#: notifyall.php:49 -msgid "No recipients found." -msgstr "" - -#: notifyall.php:59 -msgid "Emails sent" -msgstr "" - -#: notifyall.php:69 -msgid "Send email to all members of this Friendica instance." -msgstr "" - -#: notifyall.php:74 -msgid "Message subject" -msgstr "" - -#: notifyall.php:75 -msgid "Test mode (only send to administrator)" -msgstr "" - -#: notifyall.php:76 -msgid "Submit" -msgstr "" diff --git a/notifyall/lang/is/strings.php b/notifyall/lang/is/strings.php deleted file mode 100644 index 975c341e..00000000 --- a/notifyall/lang/is/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -send($notifyEmail->withRecipient($recipient['email'])); } diff --git a/nsfw/lang/bg/messages.po b/nsfw/lang/bg/messages.po deleted file mode 100644 index e53d0c5f..00000000 --- a/nsfw/lang/bg/messages.po +++ /dev/null @@ -1,60 +0,0 @@ -# ADDON nsfw -# Copyright (C) -# This file is distributed under the same license as the Friendica nsfw addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-10 14:42-0500\n" -"PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: nsfw.php:65 -msgid "" -"This addon searches for specified words/text in posts and collapses them. It" -" can be used to filter content tagged with for instance #NSFW that may be " -"deemed inappropriate at certain times or places, such as being at work. It " -"is also useful for hiding irrelevant or annoying content from direct view." -msgstr "" - -#: nsfw.php:66 -msgid "Enable Content filter" -msgstr "" - -#: nsfw.php:67 -msgid "Comma separated list of keywords to hide" -msgstr "" - -#: nsfw.php:67 -msgid "" -"Use /expression/ to provide regular expressions, #tag to specfically match " -"hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "" - -#: nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "" - -#: nsfw.php:154 -#, php-format -msgid "Filtered tag: %s" -msgstr "" - -#: nsfw.php:156 -#, php-format -msgid "Filtered word: %s" -msgstr "" diff --git a/nsfw/lang/bg/strings.php b/nsfw/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/nsfw/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: nsfw.php:65 -msgid "" -"This addon searches for specified words/text in posts and collapses them. It" -" can be used to filter content tagged with for instance #NSFW that may be " -"deemed inappropriate at certain times or places, such as being at work. It " -"is also useful for hiding irrelevant or annoying content from direct view." -msgstr "" - -#: nsfw.php:66 -msgid "Enable Content filter" -msgstr "" - -#: nsfw.php:67 -msgid "Comma separated list of keywords to hide" -msgstr "" - -#: nsfw.php:67 -msgid "" -"Use /expression/ to provide regular expressions, #tag to specfically match " -"hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "" - -#: nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "" - -#: nsfw.php:154 -#, php-format -msgid "Filtered tag: %s" -msgstr "" - -#: nsfw.php:156 -#, php-format -msgid "Filtered word: %s" -msgstr "" diff --git a/nsfw/lang/ca/strings.php b/nsfw/lang/ca/strings.php index d34874f6..349ffefd 100644 --- a/nsfw/lang/ca/strings.php +++ b/nsfw/lang/ca/strings.php @@ -1,7 +1,10 @@ -strings["Not Safe For Work (General Purpose Content Filter) settings"] = "Ajustos, Not Safe For Work (Filtre de Contingut de Propòsit General)"; +$a->strings["This addon looks in posts for the words/text you specify below, and collapses any content containing those keywords so it is not displayed at inappropriate times, such as sexual innuendo that may be improper in a work setting. It is polite and recommended to tag any content containing nudity with #NSFW. This filter can also match any other word/text you specify, and can thereby be used as a general purpose content filter."] = "Aquest addon es veu en enviaments amb les paraules/text que s'especifiquen a continuació , i amagarà qualsevol contingut que contingui les paraules clau de manera que no apareguin en moments inapropiats, com ara insinuacions sexuals que poden ser inadequades en un entorn de treball. És de bona educació i es recomana etiquetar qualsevol contingut que contingui nus amb #NSFW. Aquest filtre també es pot fer coincidir amb qualsevol paraula/text que especifiqueu, i per tant pot ser utilitzat com un filtre general de contingut."; +$a->strings["Enable Content filter"] = "Activat el filtre de Contingut"; +$a->strings["Comma separated list of keywords to hide"] = "Llista separada per comes de paraules clau per ocultar"; +$a->strings["Submit"] = "Enviar"; +$a->strings["Use /expression/ to provide regular expressions"] = "Emprar /expressió/ per a proporcionar expressions regulars"; +$a->strings["NSFW Settings saved."] = "Configuració NSFW guardada."; +$a->strings["%s - Click to open/close"] = "%s - Clicar per obrir/tancar"; diff --git a/nsfw/lang/eo/messages.po b/nsfw/lang/eo/messages.po deleted file mode 100644 index fd026e43..00000000 --- a/nsfw/lang/eo/messages.po +++ /dev/null @@ -1,60 +0,0 @@ -# ADDON nsfw -# Copyright (C) -# This file is distributed under the same license as the Friendica nsfw addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-10 14:42-0500\n" -"PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: nsfw.php:65 -msgid "" -"This addon searches for specified words/text in posts and collapses them. It" -" can be used to filter content tagged with for instance #NSFW that may be " -"deemed inappropriate at certain times or places, such as being at work. It " -"is also useful for hiding irrelevant or annoying content from direct view." -msgstr "" - -#: nsfw.php:66 -msgid "Enable Content filter" -msgstr "" - -#: nsfw.php:67 -msgid "Comma separated list of keywords to hide" -msgstr "" - -#: nsfw.php:67 -msgid "" -"Use /expression/ to provide regular expressions, #tag to specfically match " -"hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "" - -#: nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "" - -#: nsfw.php:154 -#, php-format -msgid "Filtered tag: %s" -msgstr "" - -#: nsfw.php:156 -#, php-format -msgid "Filtered word: %s" -msgstr "" diff --git a/nsfw/lang/eo/strings.php b/nsfw/lang/eo/strings.php index 68e8a64c..13da052a 100644 --- a/nsfw/lang/eo/strings.php +++ b/nsfw/lang/eo/strings.php @@ -1,7 +1,10 @@ -strings["Not Safe For Work (General Purpose Content Filter) settings"] = "Not Safe For Work (ĝenerala filtrilo por enhavoj) agordoj"; +$a->strings["This addon looks in posts for the words/text you specify below, and collapses any content containing those keywords so it is not displayed at inappropriate times, such as sexual innuendo that may be improper in a work setting. It is polite and recommended to tag any content containing nudity with #NSFW. This filter can also match any other word/text you specify, and can thereby be used as a general purpose content filter."] = "Tiu kromprogramo serĉas la malsupre agordatajn vortojn en afiŝoj kaj malvidebligis ilin se ili enhavas iun vorton. Tiel, afiŝoj ne montriĝis kiuj enhavas maladekvatan enhavon, ekzemple seksumaj aferoj, kiuj ne estas adekvata, ekzemple en la laborejo. En la reto, oni kutime markas tiajn afiŝojn #NSFW - Not Safe For Work - ne adekvata por la laborejo. La filtrilo ankaŭ serĉas ĉiujn vortojn kiujn vi agordas kaj tial funkcias kiel ĝenerala filtrilo."; +$a->strings["Enable Content filter"] = "Ŝalti la filtrilo por la enhavo"; +$a->strings["Comma separated list of keywords to hide"] = "Perkome disigita listo da kaŝontaj ŝlosilvortoj"; +$a->strings["Submit"] = "Sendi"; +$a->strings["Use /expression/ to provide regular expressions"] = "Uzu /expr/ por provizi regulajn esprimojn."; +$a->strings["NSFW Settings saved."] = "NSFW agordoj konservitaj."; +$a->strings["%s - Click to open/close"] = "%s - Klaku por malfermi/fermi"; diff --git a/nsfw/lang/et/messages.po b/nsfw/lang/et/messages.po deleted file mode 100644 index 78be66df..00000000 --- a/nsfw/lang/et/messages.po +++ /dev/null @@ -1,60 +0,0 @@ -# ADDON nsfw -# Copyright (C) -# This file is distributed under the same license as the Friendica nsfw addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-10 14:42-0500\n" -"PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: nsfw.php:65 -msgid "" -"This addon searches for specified words/text in posts and collapses them. It" -" can be used to filter content tagged with for instance #NSFW that may be " -"deemed inappropriate at certain times or places, such as being at work. It " -"is also useful for hiding irrelevant or annoying content from direct view." -msgstr "" - -#: nsfw.php:66 -msgid "Enable Content filter" -msgstr "" - -#: nsfw.php:67 -msgid "Comma separated list of keywords to hide" -msgstr "" - -#: nsfw.php:67 -msgid "" -"Use /expression/ to provide regular expressions, #tag to specfically match " -"hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "" - -#: nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "" - -#: nsfw.php:154 -#, php-format -msgid "Filtered tag: %s" -msgstr "" - -#: nsfw.php:156 -#, php-format -msgid "Filtered word: %s" -msgstr "" diff --git a/nsfw/lang/et/strings.php b/nsfw/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/nsfw/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2015 # Vincent Vindarel , 2018 @@ -14,7 +13,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-10 14:42-0500\n" "PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: cracrayol, 2023-2024\n" +"Last-Translator: Nicolas Derive, 2022-2023\n" "Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -42,7 +41,7 @@ msgstr "Liste de mots-clés - séparés par des virgules - à cacher" msgid "" "Use /expression/ to provide regular expressions, #tag to specfically match " "hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "Utiliser /expression/ pour fournir des expressions régulières, #etiquette pour correspondre à une étiquette (insensible à la casse), ou des mots classiques (sensible à la casse)" +msgstr "Utiliser /expression/ pour fournir des expressions régulières, #tag pour correspondre à un mot-dièse (hashtag, insensible à la casse), ou des mots classiques (sensible à la casse)" #: nsfw.php:72 msgid "Content Filter (NSFW and more)" @@ -56,7 +55,7 @@ msgstr "La compilation de l'expression régulière \"%s\" a échoué" #: nsfw.php:154 #, php-format msgid "Filtered tag: %s" -msgstr "Tag filtré : %s" +msgstr "Tag filtré: %s" #: nsfw.php:156 #, php-format diff --git a/nsfw/lang/fr/strings.php b/nsfw/lang/fr/strings.php index 0f717797..ee3734ec 100644 --- a/nsfw/lang/fr/strings.php +++ b/nsfw/lang/fr/strings.php @@ -8,8 +8,8 @@ function string_plural_select_fr($n){ $a->strings['This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.'] = 'Cette extension recherche des mots/textes spécifiés dans les publications et les masque. Elle peut être utilisée pour filtrer le contenu étiqueté par exemple avec #NSFW qui peut être considéré comme inapproprié à certains moments ou endroits, comme par exemple au travail. Elle est aussi utile pour cacher du contenu non pertinent ou ennuyeux d\'une vue directe.'; $a->strings['Enable Content filter'] = 'Activer le filtrage de contenu'; $a->strings['Comma separated list of keywords to hide'] = 'Liste de mots-clés - séparés par des virgules - à cacher'; -$a->strings['Use /expression/ to provide regular expressions, #tag to specfically match hashtags (case-insensitive), or regular words (case-sensitive)'] = 'Utiliser /expression/ pour fournir des expressions régulières, #etiquette pour correspondre à une étiquette (insensible à la casse), ou des mots classiques (sensible à la casse)'; +$a->strings['Use /expression/ to provide regular expressions, #tag to specfically match hashtags (case-insensitive), or regular words (case-sensitive)'] = 'Utiliser /expression/ pour fournir des expressions régulières, #tag pour correspondre à un mot-dièse (hashtag, insensible à la casse), ou des mots classiques (sensible à la casse)'; $a->strings['Content Filter (NSFW and more)'] = 'Filtre de contenu (NSFW et autres)'; $a->strings['Regular expression "%s" fails to compile'] = 'La compilation de l\'expression régulière "%s" a échoué'; -$a->strings['Filtered tag: %s'] = 'Tag filtré : %s'; +$a->strings['Filtered tag: %s'] = 'Tag filtré: %s'; $a->strings['Filtered word: %s'] = 'Mot filtré: %s'; diff --git a/nsfw/lang/gd/messages.po b/nsfw/lang/gd/messages.po deleted file mode 100644 index a6f6691e..00000000 --- a/nsfw/lang/gd/messages.po +++ /dev/null @@ -1,60 +0,0 @@ -# ADDON nsfw -# Copyright (C) -# This file is distributed under the same license as the Friendica nsfw addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-10 14:42-0500\n" -"PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: nsfw.php:65 -msgid "" -"This addon searches for specified words/text in posts and collapses them. It" -" can be used to filter content tagged with for instance #NSFW that may be " -"deemed inappropriate at certain times or places, such as being at work. It " -"is also useful for hiding irrelevant or annoying content from direct view." -msgstr "" - -#: nsfw.php:66 -msgid "Enable Content filter" -msgstr "" - -#: nsfw.php:67 -msgid "Comma separated list of keywords to hide" -msgstr "" - -#: nsfw.php:67 -msgid "" -"Use /expression/ to provide regular expressions, #tag to specfically match " -"hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "" - -#: nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "" - -#: nsfw.php:154 -#, php-format -msgid "Filtered tag: %s" -msgstr "" - -#: nsfw.php:156 -#, php-format -msgid "Filtered word: %s" -msgstr "" diff --git a/nsfw/lang/gd/strings.php b/nsfw/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/nsfw/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/nsfw/lang/is/messages.po b/nsfw/lang/is/messages.po deleted file mode 100644 index 56c26ced..00000000 --- a/nsfw/lang/is/messages.po +++ /dev/null @@ -1,60 +0,0 @@ -# ADDON nsfw -# Copyright (C) -# This file is distributed under the same license as the Friendica nsfw addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-10 14:42-0500\n" -"PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: nsfw.php:65 -msgid "" -"This addon searches for specified words/text in posts and collapses them. It" -" can be used to filter content tagged with for instance #NSFW that may be " -"deemed inappropriate at certain times or places, such as being at work. It " -"is also useful for hiding irrelevant or annoying content from direct view." -msgstr "" - -#: nsfw.php:66 -msgid "Enable Content filter" -msgstr "" - -#: nsfw.php:67 -msgid "Comma separated list of keywords to hide" -msgstr "" - -#: nsfw.php:67 -msgid "" -"Use /expression/ to provide regular expressions, #tag to specfically match " -"hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "" - -#: nsfw.php:72 -msgid "Content Filter (NSFW and more)" -msgstr "" - -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "" - -#: nsfw.php:154 -#, php-format -msgid "Filtered tag: %s" -msgstr "" - -#: nsfw.php:156 -#, php-format -msgid "Filtered word: %s" -msgstr "" diff --git a/nsfw/lang/is/strings.php b/nsfw/lang/is/strings.php index 975c341e..534f19c2 100644 --- a/nsfw/lang/is/strings.php +++ b/nsfw/lang/is/strings.php @@ -1,7 +1,10 @@ -strings["Not Safe For Work (General Purpose Content Filter) settings"] = ""; +$a->strings["This addon looks in posts for the words/text you specify below, and collapses any content containing those keywords so it is not displayed at inappropriate times, such as sexual innuendo that may be improper in a work setting. It is polite and recommended to tag any content containing nudity with #NSFW. This filter can also match any other word/text you specify, and can thereby be used as a general purpose content filter."] = ""; +$a->strings["Enable Content filter"] = ""; +$a->strings["Comma separated list of keywords to hide"] = ""; +$a->strings["Submit"] = "Senda inn"; +$a->strings["Use /expression/ to provide regular expressions"] = ""; +$a->strings["NSFW Settings saved."] = "NSFW stillingar vistað."; +$a->strings["%s - Click to open/close"] = "%s - Smelltu til að opna/loka"; diff --git a/nsfw/lang/pl/messages.po b/nsfw/lang/pl/messages.po index 84d42415..67de5248 100644 --- a/nsfw/lang/pl/messages.po +++ b/nsfw/lang/pl/messages.po @@ -4,17 +4,16 @@ # # # Translators: -# Bartosz Kozień, 2025 -# Piotr Strebski , 2022 +# Piotr Strębski , 2022 # Waldemar Stoczkowski, 2018 msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-10 14:42-0500\n" +"POT-Creation-Date: 2022-11-18 11:57-0500\n" "PO-Revision-Date: 2014-06-23 10:34+0000\n" -"Last-Translator: Bartosz Kozień, 2025\n" -"Language-Team: Polish (http://app.transifex.com/Friendica/friendica/language/pl/)\n" +"Last-Translator: Piotr Strębski , 2022\n" +"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -41,23 +40,18 @@ msgstr "Rozdzielana przecinkami lista słów kluczowych do ukrycia" msgid "" "Use /expression/ to provide regular expressions, #tag to specfically match " "hashtags (case-insensitive), or regular words (case-sensitive)" -msgstr "Użyj /wyrażenie/ dla wyrażenia regularnego, #tag by dopasować konkretne tagi (bez rozróżniania wielkości liter), lub zwykłych słów (z rozróżnianiem wielkości liter)" +msgstr "" #: nsfw.php:72 msgid "Content Filter (NSFW and more)" msgstr "Filtr zawartości (NSFW i więcej)" -#: nsfw.php:96 -#, php-format -msgid "Regular expression \"%s\" fails to compile" -msgstr "Błąd kompilacji wyrażenia regularnego \"%s\"" - -#: nsfw.php:154 +#: nsfw.php:140 #, php-format msgid "Filtered tag: %s" msgstr "Filtrowane znaczników: %s" -#: nsfw.php:156 +#: nsfw.php:142 #, php-format msgid "Filtered word: %s" msgstr "Filtrowane słowo: %s" diff --git a/nsfw/lang/pl/strings.php b/nsfw/lang/pl/strings.php index 6e6124f6..3fc65a76 100644 --- a/nsfw/lang/pl/strings.php +++ b/nsfw/lang/pl/strings.php @@ -8,8 +8,6 @@ function string_plural_select_pl($n){ $a->strings['This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.'] = 'Ten dodatek szuka określonych słów/tekstów w postach i zwija je. Może służyć do filtrowania treści oznaczonych np. NSFW, które mogą zostać uznane za nieodpowiednie w określonych momentach lub miejscach, na przykład w pracy. Jest to również przydatne do ukrywania nieistotnych lub irytujących treści z bezpośredniego widoku.'; $a->strings['Enable Content filter'] = 'Włącz filtr treści'; $a->strings['Comma separated list of keywords to hide'] = 'Rozdzielana przecinkami lista słów kluczowych do ukrycia'; -$a->strings['Use /expression/ to provide regular expressions, #tag to specfically match hashtags (case-insensitive), or regular words (case-sensitive)'] = 'Użyj /wyrażenie/ dla wyrażenia regularnego, #tag by dopasować konkretne tagi (bez rozróżniania wielkości liter), lub zwykłych słów (z rozróżnianiem wielkości liter)'; $a->strings['Content Filter (NSFW and more)'] = 'Filtr zawartości (NSFW i więcej)'; -$a->strings['Regular expression "%s" fails to compile'] = 'Błąd kompilacji wyrażenia regularnego "%s"'; $a->strings['Filtered tag: %s'] = 'Filtrowane znaczników: %s'; $a->strings['Filtered word: %s'] = 'Filtrowane słowo: %s'; diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 37d34d7d..2c8235dd 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -8,6 +8,7 @@ * */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; @@ -87,7 +88,7 @@ function nsfw_addon_settings_post(array &$b) $word_list = explode(',', $words); foreach ($word_list as $word) { $word = trim($word); - if (!$words || strpos($word, '/') !== 0) { + if (!$words || $word[0] != '/') { continue; } @@ -104,13 +105,12 @@ function nsfw_addon_settings_post(array &$b) function nsfw_prepare_body_content_filter(&$hook_data) { $words = null; - $uid = $hook_data['uid'] ?? DI::userSession()->getLocalUserId(); - if (DI::pConfig()->get($uid, 'nsfw', 'disable')) { + if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'nsfw', 'disable')) { return; } - if ($uid) { - $words = DI::pConfig()->get($uid, 'nsfw', 'words'); + if (DI::userSession()->getLocalUserId()) { + $words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'nsfw', 'words'); } if ($words) { @@ -119,9 +119,7 @@ function nsfw_prepare_body_content_filter(&$hook_data) $word_list = ['nsfw']; } - $found = false; - $tag_search = false; - + $found = false; if (count($word_list)) { $body = $hook_data['item']['title'] . "\n" . nsfw_extract_photos($hook_data['item']['body']); @@ -131,16 +129,17 @@ function nsfw_prepare_body_content_filter(&$hook_data) continue; } + $tag_search = false; switch ($word[0]) { case '/'; // Regular expression $found = @preg_match($word, $body); break; case '#': // Hashtag-only search $tag_search = true; - $found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'] ?? [], substr($word, 1)); + $found = nsfw_find_word_in_item_tags($hook_data['item']['hashtags'], substr($word, 1)); break; default: - $found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'] ?? [], $word); + $found = strpos($body, $word) !== false || nsfw_find_word_in_item_tags($hook_data['item']['tags'], $word); break; } diff --git a/numfriends/lang/bg/messages.po b/numfriends/lang/bg/messages.po deleted file mode 100644 index 19f86de0..00000000 --- a/numfriends/lang/bg/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON numfriends -# Copyright (C) -# This file is distributed under the same license as the Friendica numfriends addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 10:58+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: numfriends.php:55 -msgid "How many contacts to display on profile sidebar" -msgstr "" - -#: numfriends.php:60 -msgid "Numfriends Settings" -msgstr "" diff --git a/numfriends/lang/bg/strings.php b/numfriends/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/numfriends/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: numfriends.php:55 -msgid "How many contacts to display on profile sidebar" -msgstr "" - -#: numfriends.php:60 -msgid "Numfriends Settings" -msgstr "" diff --git a/numfriends/lang/ca/strings.php b/numfriends/lang/ca/strings.php index d34874f6..6e4bea3c 100644 --- a/numfriends/lang/ca/strings.php +++ b/numfriends/lang/ca/strings.php @@ -1,7 +1,6 @@ -strings["Numfriends settings updated."] = "Actualitzar la configuració de Numfriends."; +$a->strings["Numfriends Settings"] = "Configuració de Numfriends"; +$a->strings["How many contacts to display on profile sidebar"] = "Quants contactes per mostrar a la barra lateral el perfil"; +$a->strings["Submit"] = "Enviar"; diff --git a/numfriends/lang/eo/messages.po b/numfriends/lang/eo/messages.po deleted file mode 100644 index 0a8b36a9..00000000 --- a/numfriends/lang/eo/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON numfriends -# Copyright (C) -# This file is distributed under the same license as the Friendica numfriends addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 10:58+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: numfriends.php:55 -msgid "How many contacts to display on profile sidebar" -msgstr "" - -#: numfriends.php:60 -msgid "Numfriends Settings" -msgstr "" diff --git a/numfriends/lang/eo/strings.php b/numfriends/lang/eo/strings.php index 68e8a64c..6ad728c1 100644 --- a/numfriends/lang/eo/strings.php +++ b/numfriends/lang/eo/strings.php @@ -1,7 +1,6 @@ -strings["Numfriends settings updated."] = "Ĝisdatigis agordojn por Numfriends."; +$a->strings["Numfriends Settings"] = "Agordoj por Numfriends"; +$a->strings["How many contacts to display on profile sidebar"] = "Kiom da kontaktoj mi montru en la flanka strio"; +$a->strings["Submit"] = "Sendi"; diff --git a/numfriends/lang/et/messages.po b/numfriends/lang/et/messages.po deleted file mode 100644 index b1494fd4..00000000 --- a/numfriends/lang/et/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON numfriends -# Copyright (C) -# This file is distributed under the same license as the Friendica numfriends addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 10:58+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: numfriends.php:55 -msgid "How many contacts to display on profile sidebar" -msgstr "" - -#: numfriends.php:60 -msgid "Numfriends Settings" -msgstr "" diff --git a/numfriends/lang/et/strings.php b/numfriends/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/numfriends/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: numfriends.php:55 -msgid "How many contacts to display on profile sidebar" -msgstr "" - -#: numfriends.php:60 -msgid "Numfriends Settings" -msgstr "" diff --git a/numfriends/lang/gd/strings.php b/numfriends/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/numfriends/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/numfriends/lang/is/messages.po b/numfriends/lang/is/messages.po deleted file mode 100644 index 3fb035b4..00000000 --- a/numfriends/lang/is/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON numfriends -# Copyright (C) -# This file is distributed under the same license as the Friendica numfriends addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 10:58+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: numfriends.php:55 -msgid "How many contacts to display on profile sidebar" -msgstr "" - -#: numfriends.php:60 -msgid "Numfriends Settings" -msgstr "" diff --git a/numfriends/lang/is/strings.php b/numfriends/lang/is/strings.php index 975c341e..ea23b9d5 100644 --- a/numfriends/lang/is/strings.php +++ b/numfriends/lang/is/strings.php @@ -1,7 +1,6 @@ -strings["Numfriends settings updated."] = ""; +$a->strings["Numfriends Settings"] = ""; +$a->strings["How many contacts to display on profile sidebar"] = ""; +$a->strings["Submit"] = "Senda inn"; diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php index 5652c8f0..538a4a3e 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -6,7 +6,9 @@ * Author: Mike Macgirvin */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; @@ -15,7 +17,7 @@ function numfriends_install() { Hook::register('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); Hook::register('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); - DI::logger()->notice("installed numfriends"); + Logger::notice("installed numfriends"); } /** @@ -37,7 +39,7 @@ function numfriends_settings_post($post) { /** * - * Called from the Addon Setting form. + * Called from the Addon Setting form. * Add our own settings info to the page. * */ @@ -48,7 +50,7 @@ function numfriends_settings(array &$data) } $numfriends = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'display_friend_count', 24); - + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/numfriends/'); $html = Renderer::replaceMacros($t, [ '$numfriends' => ['numfriends', DI::l10n()->t('How many contacts to display on profile sidebar'), $numfriends], diff --git a/openstreetmap/config/openstreetmap.config.php b/openstreetmap/config/openstreetmap.config.php index d633fd26..c649da5f 100644 --- a/openstreetmap/config/openstreetmap.config.php +++ b/openstreetmap/config/openstreetmap.config.php @@ -10,7 +10,7 @@ return [ 'tmsserver' => 'https://www.openstreetmap.org', // nomserver (String) - 'nomserver' => 'https://nominatim.openstreetmap.org/search', + 'nomserver' => 'https://nominatim.openstreetmap.org/search.php', // zoom (Integer) // The default zoom level on the map. diff --git a/openstreetmap/lang/bg/messages.po b/openstreetmap/lang/bg/messages.po deleted file mode 100644 index e04a56f5..00000000 --- a/openstreetmap/lang/bg/messages.po +++ /dev/null @@ -1,64 +0,0 @@ -# ADDON openstreetmap -# Copyright (C) -# This file is distributed under the same license as the Friendica openstreetmap addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:01+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: openstreetmap.php:167 -msgid "View Larger" -msgstr "" - -#: openstreetmap.php:194 -msgid "Submit" -msgstr "" - -#: openstreetmap.php:195 -msgid "Tile Server URL" -msgstr "" - -#: openstreetmap.php:195 -msgid "" -"A list of public tile servers" -msgstr "" - -#: openstreetmap.php:196 -msgid "Nominatim (reverse geocoding) Server URL" -msgstr "" - -#: openstreetmap.php:196 -msgid "" -"A list of Nominatim servers" -msgstr "" - -#: openstreetmap.php:197 -msgid "Default zoom" -msgstr "" - -#: openstreetmap.php:197 -msgid "" -"The default zoom level. (1:world, 18:highest, also depends on tile server)" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include marker on map" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include a marker on the map." -msgstr "" diff --git a/openstreetmap/lang/bg/strings.php b/openstreetmap/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/openstreetmap/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: openstreetmap.php:167 -msgid "View Larger" -msgstr "" - -#: openstreetmap.php:194 -msgid "Submit" -msgstr "" - -#: openstreetmap.php:195 -msgid "Tile Server URL" -msgstr "" - -#: openstreetmap.php:195 -msgid "" -"A list of public tile servers" -msgstr "" - -#: openstreetmap.php:196 -msgid "Nominatim (reverse geocoding) Server URL" -msgstr "" - -#: openstreetmap.php:196 -msgid "" -"A list of Nominatim servers" -msgstr "" - -#: openstreetmap.php:197 -msgid "Default zoom" -msgstr "" - -#: openstreetmap.php:197 -msgid "" -"The default zoom level. (1:world, 18:highest, also depends on tile server)" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include marker on map" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include a marker on the map." -msgstr "" diff --git a/openstreetmap/lang/ca/strings.php b/openstreetmap/lang/ca/strings.php index d34874f6..3c7eeee2 100644 --- a/openstreetmap/lang/ca/strings.php +++ b/openstreetmap/lang/ca/strings.php @@ -1,7 +1,8 @@ -strings["Submit"] = "Enviar"; +$a->strings["Tile Server URL"] = "URL del servidor, del mosaico de servidores"; +$a->strings["A list of public tile servers"] = "Una llista de un mosaic de servidors públics"; +$a->strings["Default zoom"] = "Zoom per defecte"; +$a->strings["The default zoom level. (1:world, 18:highest)"] = "Nivell de zoom per defecte. (1: el món, 18: el més alt)"; +$a->strings["Settings updated."] = "Ajustos actualitzats."; diff --git a/openstreetmap/lang/eo/messages.po b/openstreetmap/lang/eo/messages.po deleted file mode 100644 index 9811fde4..00000000 --- a/openstreetmap/lang/eo/messages.po +++ /dev/null @@ -1,64 +0,0 @@ -# ADDON openstreetmap -# Copyright (C) -# This file is distributed under the same license as the Friendica openstreetmap addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:01+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: openstreetmap.php:167 -msgid "View Larger" -msgstr "" - -#: openstreetmap.php:194 -msgid "Submit" -msgstr "" - -#: openstreetmap.php:195 -msgid "Tile Server URL" -msgstr "" - -#: openstreetmap.php:195 -msgid "" -"A list of public tile servers" -msgstr "" - -#: openstreetmap.php:196 -msgid "Nominatim (reverse geocoding) Server URL" -msgstr "" - -#: openstreetmap.php:196 -msgid "" -"A list of Nominatim servers" -msgstr "" - -#: openstreetmap.php:197 -msgid "Default zoom" -msgstr "" - -#: openstreetmap.php:197 -msgid "" -"The default zoom level. (1:world, 18:highest, also depends on tile server)" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include marker on map" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include a marker on the map." -msgstr "" diff --git a/openstreetmap/lang/eo/strings.php b/openstreetmap/lang/eo/strings.php index 68e8a64c..5f256dd6 100644 --- a/openstreetmap/lang/eo/strings.php +++ b/openstreetmap/lang/eo/strings.php @@ -1,7 +1,8 @@ -strings["Submit"] = "Sendi"; +$a->strings["Tile Server URL"] = "Adreso de Kahelservilo"; +$a->strings["A list of public tile servers"] = "Listo de publikaj kahelserviloj"; +$a->strings["Default zoom"] = "Defaŭlta zoma faktoro"; +$a->strings["The default zoom level. (1:world, 18:highest)"] = "La defaŭlta zoma faktoro. (1:tutmonda, 18:plej proksima)"; +$a->strings["Settings updated."] = "Agordoj ĝisdatigita."; diff --git a/openstreetmap/lang/et/messages.po b/openstreetmap/lang/et/messages.po deleted file mode 100644 index c6654a5f..00000000 --- a/openstreetmap/lang/et/messages.po +++ /dev/null @@ -1,65 +0,0 @@ -# ADDON openstreetmap -# Copyright (C) -# This file is distributed under the same license as the Friendica openstreetmap addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:01+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: openstreetmap.php:167 -msgid "View Larger" -msgstr "" - -#: openstreetmap.php:194 -msgid "Submit" -msgstr "Saada" - -#: openstreetmap.php:195 -msgid "Tile Server URL" -msgstr "" - -#: openstreetmap.php:195 -msgid "" -"A list of public tile servers" -msgstr "" - -#: openstreetmap.php:196 -msgid "Nominatim (reverse geocoding) Server URL" -msgstr "" - -#: openstreetmap.php:196 -msgid "" -"A list of Nominatim servers" -msgstr "" - -#: openstreetmap.php:197 -msgid "Default zoom" -msgstr "" - -#: openstreetmap.php:197 -msgid "" -"The default zoom level. (1:world, 18:highest, also depends on tile server)" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include marker on map" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include a marker on the map." -msgstr "" diff --git a/openstreetmap/lang/et/strings.php b/openstreetmap/lang/et/strings.php deleted file mode 100644 index 04ee22e7..00000000 --- a/openstreetmap/lang/et/strings.php +++ /dev/null @@ -1,8 +0,0 @@ -strings['Submit'] = 'Saada'; diff --git a/openstreetmap/lang/gd/messages.po b/openstreetmap/lang/gd/messages.po deleted file mode 100644 index 2800943e..00000000 --- a/openstreetmap/lang/gd/messages.po +++ /dev/null @@ -1,64 +0,0 @@ -# ADDON openstreetmap -# Copyright (C) -# This file is distributed under the same license as the Friendica openstreetmap addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:01+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: openstreetmap.php:167 -msgid "View Larger" -msgstr "" - -#: openstreetmap.php:194 -msgid "Submit" -msgstr "" - -#: openstreetmap.php:195 -msgid "Tile Server URL" -msgstr "" - -#: openstreetmap.php:195 -msgid "" -"A list of public tile servers" -msgstr "" - -#: openstreetmap.php:196 -msgid "Nominatim (reverse geocoding) Server URL" -msgstr "" - -#: openstreetmap.php:196 -msgid "" -"A list of Nominatim servers" -msgstr "" - -#: openstreetmap.php:197 -msgid "Default zoom" -msgstr "" - -#: openstreetmap.php:197 -msgid "" -"The default zoom level. (1:world, 18:highest, also depends on tile server)" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include marker on map" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include a marker on the map." -msgstr "" diff --git a/openstreetmap/lang/gd/strings.php b/openstreetmap/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/openstreetmap/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/openstreetmap/lang/ru/messages.po b/openstreetmap/lang/ru/messages.po deleted file mode 100644 index 3dc8cc2a..00000000 --- a/openstreetmap/lang/ru/messages.po +++ /dev/null @@ -1,64 +0,0 @@ -# ADDON openstreetmap -# Copyright (C) -# This file is distributed under the same license as the Friendica openstreetmap addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:01+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: openstreetmap.php:167 -msgid "View Larger" -msgstr "" - -#: openstreetmap.php:194 -msgid "Submit" -msgstr "Добавить" - -#: openstreetmap.php:195 -msgid "Tile Server URL" -msgstr "" - -#: openstreetmap.php:195 -msgid "" -"A list of public tile servers" -msgstr "" - -#: openstreetmap.php:196 -msgid "Nominatim (reverse geocoding) Server URL" -msgstr "" - -#: openstreetmap.php:196 -msgid "" -"A list of Nominatim servers" -msgstr "" - -#: openstreetmap.php:197 -msgid "Default zoom" -msgstr "" - -#: openstreetmap.php:197 -msgid "" -"The default zoom level. (1:world, 18:highest, also depends on tile server)" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include marker on map" -msgstr "" - -#: openstreetmap.php:198 -msgid "Include a marker on the map." -msgstr "" diff --git a/openstreetmap/lang/ru/strings.php b/openstreetmap/lang/ru/strings.php index 0b7afb84..e249d2dc 100644 --- a/openstreetmap/lang/ru/strings.php +++ b/openstreetmap/lang/ru/strings.php @@ -1,8 +1,8 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} -$a->strings['Submit'] = 'Добавить'; +strings["Submit"] = "Подтвердить"; +$a->strings["Tile Server URL"] = ""; +$a->strings["A list of public tile servers"] = "Список общедоступных серверов"; +$a->strings["Default zoom"] = "zoom по умолчанию"; +$a->strings["The default zoom level. (1:world, 18:highest)"] = ""; +$a->strings["Settings updated."] = "Настройки обновлены."; diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index bf0f54b6..3b7c4a58 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -9,8 +9,10 @@ * */ +use Friendica\App; use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; use Friendica\Core\Config\Util\ConfigFileManager; @@ -30,12 +32,12 @@ function openstreetmap_install() Hook::register('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); Hook::register('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); - DI::logger()->notice("installed openstreetmap"); + Logger::notice("installed openstreetmap"); } function openstreetmap_load_config(ConfigFileManager $loader) { - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('openstreetmap'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); + DI::app()->getConfigCache()->load($loader->loadAddonConfig('openstreetmap'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); } function openstreetmap_alterheader(&$navHtml) @@ -119,7 +121,7 @@ function openstreetmap_get_coordinates(array &$b) if (is_null($j)) { $curlResult = DI::httpClient()->get($nomserver . $args); if ($curlResult->isSuccess()) { - $j = json_decode($curlResult->getBodyString(), true); + $j = json_decode($curlResult->getBody(), true); DI::cache()->set($cachekey, $j, Duration::MONTH); } } @@ -153,8 +155,8 @@ function openstreetmap_generate_map(array &$b) $lat = $b['lat']; // round($b['lat'], 5); $lon = $b['lon']; // round($b['lon'], 5); - DI::logger()->debug('lat: ' . $lat); - DI::logger()->debug('lon: ' . $lon); + Logger::debug('lat: ' . $lat); + Logger::debug('lon: ' . $lon); $cardlink = '\n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pageheader.php:36 -msgid "\"pageheader\" Settings" -msgstr "" - -#: pageheader.php:37 -msgid "Message" -msgstr "" - -#: pageheader.php:37 -msgid "" -"Message to display on every page on this server (or put a pageheader.html " -"file in your docroot)" -msgstr "" - -#: pageheader.php:38 -msgid "Save Settings" -msgstr "" diff --git a/pageheader/lang/bg/strings.php b/pageheader/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/pageheader/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pageheader.php:36 -msgid "\"pageheader\" Settings" -msgstr "" - -#: pageheader.php:37 -msgid "Message" -msgstr "" - -#: pageheader.php:37 -msgid "" -"Message to display on every page on this server (or put a pageheader.html " -"file in your docroot)" -msgstr "" - -#: pageheader.php:38 -msgid "Save Settings" -msgstr "" diff --git a/pageheader/lang/ca/strings.php b/pageheader/lang/ca/strings.php index d34874f6..389bdc27 100644 --- a/pageheader/lang/ca/strings.php +++ b/pageheader/lang/ca/strings.php @@ -1,7 +1,5 @@ -strings["\"pageheader\" Settings"] = "Configuració de la capçalera de pàgina."; +$a->strings["Submit"] = "Enviar"; +$a->strings["pageheader Settings saved."] = "guardada la configuració de la capçalera de pàgina."; diff --git a/pageheader/lang/eo/messages.po b/pageheader/lang/eo/messages.po deleted file mode 100644 index cba09466..00000000 --- a/pageheader/lang/eo/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON pageheader -# Copyright (C) -# This file is distributed under the same license as the Friendica pageheader addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:17+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pageheader.php:36 -msgid "\"pageheader\" Settings" -msgstr "" - -#: pageheader.php:37 -msgid "Message" -msgstr "" - -#: pageheader.php:37 -msgid "" -"Message to display on every page on this server (or put a pageheader.html " -"file in your docroot)" -msgstr "" - -#: pageheader.php:38 -msgid "Save Settings" -msgstr "" diff --git a/pageheader/lang/eo/strings.php b/pageheader/lang/eo/strings.php index 68e8a64c..5a23c2af 100644 --- a/pageheader/lang/eo/strings.php +++ b/pageheader/lang/eo/strings.php @@ -1,7 +1,5 @@ -strings["\"pageheader\" Settings"] = "\"pageheader\" Agordoj"; +$a->strings["Submit"] = "Sendi"; +$a->strings["pageheader Settings saved."] = "Konservis Agordojn de pageheader."; diff --git a/pageheader/lang/et/messages.po b/pageheader/lang/et/messages.po deleted file mode 100644 index bb50926a..00000000 --- a/pageheader/lang/et/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON pageheader -# Copyright (C) -# This file is distributed under the same license as the Friendica pageheader addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:17+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pageheader.php:36 -msgid "\"pageheader\" Settings" -msgstr "" - -#: pageheader.php:37 -msgid "Message" -msgstr "" - -#: pageheader.php:37 -msgid "" -"Message to display on every page on this server (or put a pageheader.html " -"file in your docroot)" -msgstr "" - -#: pageheader.php:38 -msgid "Save Settings" -msgstr "" diff --git a/pageheader/lang/et/strings.php b/pageheader/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/pageheader/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: pageheader.php:36 -msgid "\"pageheader\" Settings" -msgstr "" - -#: pageheader.php:37 -msgid "Message" -msgstr "" - -#: pageheader.php:37 -msgid "" -"Message to display on every page on this server (or put a pageheader.html " -"file in your docroot)" -msgstr "" - -#: pageheader.php:38 -msgid "Save Settings" -msgstr "" diff --git a/pageheader/lang/gd/strings.php b/pageheader/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/pageheader/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/pageheader/lang/is/messages.po b/pageheader/lang/is/messages.po deleted file mode 100644 index c2eb5d5c..00000000 --- a/pageheader/lang/is/messages.po +++ /dev/null @@ -1,37 +0,0 @@ -# ADDON pageheader -# Copyright (C) -# This file is distributed under the same license as the Friendica pageheader addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:17+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: pageheader.php:36 -msgid "\"pageheader\" Settings" -msgstr "" - -#: pageheader.php:37 -msgid "Message" -msgstr "" - -#: pageheader.php:37 -msgid "" -"Message to display on every page on this server (or put a pageheader.html " -"file in your docroot)" -msgstr "" - -#: pageheader.php:38 -msgid "Save Settings" -msgstr "" diff --git a/pageheader/lang/is/strings.php b/pageheader/lang/is/strings.php index 975c341e..86c571ee 100644 --- a/pageheader/lang/is/strings.php +++ b/pageheader/lang/is/strings.php @@ -1,7 +1,5 @@ -strings["\"pageheader\" Settings"] = "Stillingar \"pageheader\""; +$a->strings["Submit"] = "Senda inn"; +$a->strings["pageheader Settings saved."] = "Stillingar pageheader vistaðar."; diff --git a/pageheader/pageheader.css b/pageheader/pageheader.css index f6c28fbf..8b3282fb 100644 --- a/pageheader/pageheader.css +++ b/pageheader/pageheader.css @@ -20,9 +20,4 @@ width: 100%; margin-top: 25px; font-size: 20px; - /* The pageheader box */ - padding: 20px; - border: 1px solid transparent; - border-radius: 2px; - margin-bottom: 15px; } diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index d729acc1..057bb863 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -5,9 +5,10 @@ * Version: 1.1 * Author: Keith Fernie * Hauke Altmann - * + * */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; diff --git a/phpmailer/composer.json b/phpmailer/composer.json index 84d18543..5779773a 100644 --- a/phpmailer/composer.json +++ b/phpmailer/composer.json @@ -1,22 +1,22 @@ { - "name": "friendica-addons/phpmailer", - "description": "Replaces the default `mail()` function by the `PHPMailer` library", - "type": "friendica-addon", - "authors": [ - { - "name": "Marcus Mueller", - "role": "Developer" - } - ], - "require": { - "php": ">=7.0", - "phpmailer/phpmailer": "^6.1" - }, - "license": "3-clause BSD license", - "minimum-stability": "stable", - "config": { - "optimize-autoloader": true, - "autoloader-suffix": "PhpMailerAddon", - "preferred-install": "dist" - } + "name": "friendica-addons/phpmailer", + "description": "Replaces the default `mail()` function by the `PHPMailer` library", + "type": "friendica-addon", + "authors": [ + { + "name": "Marcus Mueller", + "role": "Developer" + } + ], + "require": { + "php": ">=7.0", + "phpmailer/phpmailer": "^6.1" + }, + "license": "3-clause BSD license", + "minimum-stability": "stable", + "config": { + "optimize-autoloader": true, + "autoloader-suffix": "PhpMailerAddon", + "preferred-install": "dist" + } } diff --git a/phpmailer/composer.lock b/phpmailer/composer.lock index 7cd1afd5..b1f2a5d9 100644 --- a/phpmailer/composer.lock +++ b/phpmailer/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "phpmailer/phpmailer", - "version": "v6.10.0", + "version": "v6.5.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144" + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", - "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", "shasum": "" }, "require": { @@ -27,25 +27,20 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "doctrine/annotations": "^1.2.6 || ^1.13.3", - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.7.2", - "yoast/phpunit-polyfills": "^1.0.4" + "squizlabs/php_codesniffer": "^3.5.6", + "yoast/phpunit-polyfills": "^0.2.0" }, "suggest": { - "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", - "ext-openssl": "Needed for secure SMTP sending and DKIM signing", - "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", - "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, "type": "library", "autoload": { @@ -77,7 +72,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" }, "funding": [ { @@ -85,18 +80,18 @@ "type": "github" } ], - "time": "2025-04-24T15:19:31+00:00" + "time": "2021-06-16T14:33:43+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, - "platform-dev": {}, - "plugin-api-version": "2.6.0" + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/phpmailer/phpmailer.php b/phpmailer/phpmailer.php index 10287a04..4c12709d 100644 --- a/phpmailer/phpmailer.php +++ b/phpmailer/phpmailer.php @@ -7,6 +7,7 @@ * Maintainer: Hypolite Petovan */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; use Friendica\Object\EMail\IEmail; @@ -24,18 +25,14 @@ function phpmailer_install() function phpmailer_load_config(ConfigFileManager $loader) { - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('phpmailer'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); + DI::app()->getConfigCache()->load($loader->loadAddonConfig('phpmailer'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); } /** - * @param null|IEmail $email + * @param IEmail $email */ -function phpmailer_emailer_send_prepare(?IEmail &$email) +function phpmailer_emailer_send_prepare(IEmail &$email) { - if ($email === null) { - return; - } - // Passing `true` enables exceptions $mailer = new PHPMailer(true); try { diff --git a/phpmailer/vendor/autoload.php b/phpmailer/vendor/autoload.php index 1d45b283..60925835 100644 --- a/phpmailer/vendor/autoload.php +++ b/phpmailer/vendor/autoload.php @@ -2,24 +2,6 @@ // autoload.php @generated by Composer -if (PHP_VERSION_ID < 50600) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, $err); - } elseif (!headers_sent()) { - echo $err; - } - } - trigger_error( - $err, - E_USER_ERROR - ); -} - require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitPhpMailerAddon::getLoader(); diff --git a/phpmailer/vendor/composer/ClassLoader.php b/phpmailer/vendor/composer/ClassLoader.php index 7824d8f7..03b9bb9c 100644 --- a/phpmailer/vendor/composer/ClassLoader.php +++ b/phpmailer/vendor/composer/ClassLoader.php @@ -37,81 +37,26 @@ namespace Composer\Autoload; * * @author Fabien Potencier * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ */ class ClassLoader { - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var string|null */ - private $vendorDir; - // PSR-4 - /** - * @var array> - */ private $prefixLengthsPsr4 = array(); - /** - * @var array> - */ private $prefixDirsPsr4 = array(); - /** - * @var list - */ private $fallbackDirsPsr4 = array(); // PSR-0 - /** - * List of PSR-0 prefixes - * - * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) - * - * @var array>> - */ private $prefixesPsr0 = array(); - /** - * @var list - */ private $fallbackDirsPsr0 = array(); - /** @var bool */ private $useIncludePath = false; - - /** - * @var array - */ private $classMap = array(); - - /** @var bool */ private $classMapAuthoritative = false; - - /** - * @var array - */ private $missingClasses = array(); - - /** @var string|null */ private $apcuPrefix; - /** - * @var array - */ - private static $registeredLoaders = array(); - - /** - * @param string|null $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return array> - */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -121,42 +66,28 @@ class ClassLoader return array(); } - /** - * @return array> - */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } - /** - * @return list - */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } - /** - * @return list - */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } - /** - * @return array Array of classname => path - */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map - * - * @return void + * @param array $classMap Class to filename map */ public function addClassMap(array $classMap) { @@ -171,25 +102,22 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories */ public function add($prefix, $paths, $prepend = false) { - $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - $paths, + (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - $paths + (array) $paths ); } @@ -198,19 +126,19 @@ class ClassLoader $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = $paths; + $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - $paths, + (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - $paths + (array) $paths ); } } @@ -219,28 +147,25 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException - * - * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { - $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - $paths, + (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - $paths + (array) $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -250,18 +175,18 @@ class ClassLoader throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = $paths; + $this->prefixDirsPsr4[$prefix] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - $paths, + (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - $paths + (array) $paths ); } } @@ -270,10 +195,8 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 base directories - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories */ public function set($prefix, $paths) { @@ -288,12 +211,10 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException - * - * @return void */ public function setPsr4($prefix, $paths) { @@ -313,8 +234,6 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath - * - * @return void */ public function setUseIncludePath($useIncludePath) { @@ -337,8 +256,6 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative - * - * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -359,8 +276,6 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix - * - * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -381,55 +296,33 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } } /** * Unregisters this instance as an autoloader. - * - * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return true|null True if loaded, null otherwise + * @return bool|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); + includeFile($file); return true; } - - return null; } /** @@ -474,21 +367,6 @@ class ClassLoader return $file; } - /** - * Returns the currently registered loaders keyed by their corresponding vendor directories. - * - * @return array - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -554,26 +432,14 @@ class ClassLoader return false; } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; } diff --git a/phpmailer/vendor/composer/InstalledVersions.php b/phpmailer/vendor/composer/InstalledVersions.php deleted file mode 100644 index 51e734a7..00000000 --- a/phpmailer/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints((string) $constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; - } else { - self::$installed = array(); - } - } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } - - return $installed; - } -} diff --git a/phpmailer/vendor/composer/autoload_classmap.php b/phpmailer/vendor/composer/autoload_classmap.php index c20440c1..6000382d 100644 --- a/phpmailer/vendor/composer/autoload_classmap.php +++ b/phpmailer/vendor/composer/autoload_classmap.php @@ -2,15 +2,12 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'PHPMailer\\PHPMailer\\DSNConfigurator' => $vendorDir . '/phpmailer/phpmailer/src/DSNConfigurator.php', 'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php', 'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php', - 'PHPMailer\\PHPMailer\\OAuthTokenProvider' => $vendorDir . '/phpmailer/phpmailer/src/OAuthTokenProvider.php', 'PHPMailer\\PHPMailer\\PHPMailer' => $vendorDir . '/phpmailer/phpmailer/src/PHPMailer.php', 'PHPMailer\\PHPMailer\\POP3' => $vendorDir . '/phpmailer/phpmailer/src/POP3.php', 'PHPMailer\\PHPMailer\\SMTP' => $vendorDir . '/phpmailer/phpmailer/src/SMTP.php', diff --git a/phpmailer/vendor/composer/autoload_namespaces.php b/phpmailer/vendor/composer/autoload_namespaces.php index 15a2ff3a..b7fc0125 100644 --- a/phpmailer/vendor/composer/autoload_namespaces.php +++ b/phpmailer/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( diff --git a/phpmailer/vendor/composer/autoload_psr4.php b/phpmailer/vendor/composer/autoload_psr4.php index 28567a00..0706da6f 100644 --- a/phpmailer/vendor/composer/autoload_psr4.php +++ b/phpmailer/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( diff --git a/phpmailer/vendor/composer/autoload_real.php b/phpmailer/vendor/composer/autoload_real.php index 65adf3da..e7e97ae8 100644 --- a/phpmailer/vendor/composer/autoload_real.php +++ b/phpmailer/vendor/composer/autoload_real.php @@ -22,14 +22,31 @@ class ComposerAutoloaderInitPhpMailerAddon return self::$loader; } - require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInitPhpMailerAddon', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitPhpMailerAddon', 'loadClassLoader')); - require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitPhpMailerAddon::getInitializer($loader)); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInitPhpMailerAddon::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } $loader->register(true); diff --git a/phpmailer/vendor/composer/autoload_static.php b/phpmailer/vendor/composer/autoload_static.php index 8fc70b40..20cd9684 100644 --- a/phpmailer/vendor/composer/autoload_static.php +++ b/phpmailer/vendor/composer/autoload_static.php @@ -21,11 +21,8 @@ class ComposerStaticInitPhpMailerAddon ); public static $classMap = array ( - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'PHPMailer\\PHPMailer\\DSNConfigurator' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/DSNConfigurator.php', 'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php', 'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php', - 'PHPMailer\\PHPMailer\\OAuthTokenProvider' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuthTokenProvider.php', 'PHPMailer\\PHPMailer\\PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/PHPMailer.php', 'PHPMailer\\PHPMailer\\POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/POP3.php', 'PHPMailer\\PHPMailer\\SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/SMTP.php', diff --git a/phpmailer/vendor/composer/installed.json b/phpmailer/vendor/composer/installed.json index 142a295b..20714abc 100644 --- a/phpmailer/vendor/composer/installed.json +++ b/phpmailer/vendor/composer/installed.json @@ -1,90 +1,80 @@ -{ - "packages": [ - { - "name": "phpmailer/phpmailer", - "version": "v6.10.0", - "version_normalized": "6.10.0.0", - "source": { - "type": "git", - "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", - "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-filter": "*", - "ext-hash": "*", - "php": ">=5.5.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "doctrine/annotations": "^1.2.6 || ^1.13.3", - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcompatibility/php-compatibility": "^9.3.5", - "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.7.2", - "yoast/phpunit-polyfills": "^1.0.4" - }, - "suggest": { - "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", - "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", - "ext-openssl": "Needed for secure SMTP sending and DKIM signing", - "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", - "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", - "league/oauth2-google": "Needed for Google XOAUTH2 authentication", - "psr/log": "For optional PSR-3 debug logging", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", - "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" - }, - "time": "2025-04-24T15:19:31+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "PHPMailer\\PHPMailer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Marcus Bointon", - "email": "phpmailer@synchromedia.co.uk" - }, - { - "name": "Jim Jagielski", - "email": "jimjag@gmail.com" - }, - { - "name": "Andy Prevost", - "email": "codeworxtech@users.sourceforge.net" - }, - { - "name": "Brent R. Matzelle" - } - ], - "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "support": { - "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0" - }, - "funding": [ - { - "url": "https://github.com/Synchro", - "type": "github" - } - ], - "install-path": "../phpmailer/phpmailer" - } +[ + { + "name": "phpmailer/phpmailer", + "version": "v6.5.0", + "version_normalized": "6.5.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.5.6", + "yoast/phpunit-polyfills": "^0.2.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "time": "2021-06-16T14:33:43+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" ], - "dev": true, - "dev-package-names": [] -} + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ] + } +] diff --git a/phpmailer/vendor/composer/installed.php b/phpmailer/vendor/composer/installed.php deleted file mode 100644 index 554d2c40..00000000 --- a/phpmailer/vendor/composer/installed.php +++ /dev/null @@ -1,32 +0,0 @@ - array( - 'name' => 'friendica-addons/phpmailer', - 'pretty_version' => 'dev-2025.07-rc', - 'version' => 'dev-2025.07-rc', - 'reference' => '715f70032330ad14f710284104c8593c7800e125', - 'type' => 'friendica-addon', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => true, - ), - 'versions' => array( - 'friendica-addons/phpmailer' => array( - 'pretty_version' => 'dev-2025.07-rc', - 'version' => 'dev-2025.07-rc', - 'reference' => '715f70032330ad14f710284104c8593c7800e125', - 'type' => 'friendica-addon', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.10.0', - 'version' => '6.10.0.0', - 'reference' => 'bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpmailer/phpmailer', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/phpmailer/vendor/composer/platform_check.php b/phpmailer/vendor/composer/platform_check.php deleted file mode 100644 index f79e574b..00000000 --- a/phpmailer/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 70000)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/phpmailer/vendor/phpmailer/phpmailer/README.md b/phpmailer/vendor/phpmailer/phpmailer/README.md index 862a4e1a..fa27d2f6 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/README.md +++ b/phpmailer/vendor/phpmailer/phpmailer/README.md @@ -1,54 +1,45 @@ -[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/) - ![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) # PHPMailer – A full-featured email creation and transfer class for PHP -[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) -[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer) -[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) -[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) -[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) -[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer) +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) [![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) ## Features - Probably the world's most popular code for sending email from PHP! - Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more - Integrated SMTP support – send without a local mail server -- Send emails with multiple To, CC, BCC, and Reply-to addresses +- Send emails with multiple To, CC, BCC and Reply-to addresses - Multipart/alternative emails for mail clients that do not read HTML email - Add attachments, including inline - Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings -- Full UTF-8 support when using servers that support `SMTPUTF8`. -- Support for iCal events in multiparts and attachments -- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports +- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SMTPS and SMTP+STARTTLS transports - Validates email addresses automatically - Protects against header injection attacks - Error messages in over 50 languages! - DKIM and S/MIME signing support -- Compatible with PHP 5.5 and later, including PHP 8.4 +- Compatible with PHP 5.5 and later, including PHP 8.0 - Namespaced to prevent name clashes - Much more! ## Why you might need it -Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments. +Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe! The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost. *Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that -you should look at before rolling your own. Try [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc. +you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/) +, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc. ## License -This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. +This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. ## Installation & loading PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "^6.10.0" +"phpmailer/phpmailer": "^6.2" ``` or run @@ -59,8 +50,7 @@ composer require phpmailer/phpmailer Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer. -If you want to use XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at -by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services. +If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. Alternatively, if you're not using Composer, you can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: @@ -75,7 +65,7 @@ require 'path/to/PHPMailer/src/PHPMailer.php'; require 'path/to/PHPMailer/src/SMTP.php'; ``` -If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for it. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally. +If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally. ## Legacy versions PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases. @@ -96,10 +86,10 @@ use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; -//Load Composer's autoloader (created by composer, not included with PHPMailer) +//Load Composer's autoloader require 'vendor/autoload.php'; -//Create an instance; passing `true` enables exceptions +//Instantiation and passing `true` enables exceptions $mail = new PHPMailer(true); try { @@ -110,8 +100,8 @@ try { $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'user@example.com'; //SMTP username $mail->Password = 'secret'; //SMTP password - $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption - $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` + $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged + $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above //Recipients $mail->setFrom('from@example.com', 'Mailer'); @@ -138,21 +128,21 @@ try { } ``` -You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more. +You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through gmail, building contact forms, sending to mailing lists, and more. If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. That's it. You should now be ready to use PHPMailer! ## Localization -PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: ```php //To load the French version $mail->setLanguage('fr', '/optional/path/to/language/directory/'); ``` -We welcome corrections and new languages – if you're looking for corrections, run the [Language/TranslationCompletenessTest.php](https://github.com/PHPMailer/PHPMailer/blob/master/test/Language/TranslationCompletenessTest.php) script in the tests folder and it will show any missing translations. +We welcome corrections and new languages – if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. ## Documentation Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated. @@ -163,9 +153,9 @@ To reduce PHPMailer's deployed code footprint, examples are not included if you Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/). -You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailer/PHPMailerTest.php) a good reference for how to do various operations such as encryption. +You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good reference for how to do various operations such as encryption. -If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](https://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). +If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). ## Tests [PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions. @@ -180,9 +170,9 @@ Please disclose any vulnerabilities found responsibly – report security issues See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). ## Contributing -Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). +Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). -We're particularly interested in fixing edge cases, expanding test coverage, and updating translations. +We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it. @@ -206,7 +196,7 @@ Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard c Available as part of the Tidelift Subscription. The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial -support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and +support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) @@ -214,7 +204,7 @@ use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-php See [changelog](changelog.md). ## History -- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](https://sourceforge.net/projects/phpmailer/). +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). - [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004. - Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. - Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008. @@ -224,9 +214,9 @@ See [changelog](changelog.md). ### What's changed since moving from SourceForge? - Official successor to the SourceForge and Google Code projects. - Test suite. -- Continuous integration with GitHub Actions. +- Continuous integration with Github Actions. - Composer support. - Public development. - Additional languages and language strings. - CRAM-MD5 authentication support. -- Preserves full repo history of authors, commits, and branches from the original SourceForge project. +- Preserves full repo history of authors, commits and branches from the original SourceForge project. diff --git a/phpmailer/vendor/phpmailer/phpmailer/SECURITY.md b/phpmailer/vendor/phpmailer/phpmailer/SECURITY.md index 4f34026d..035a87f7 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/SECURITY.md +++ b/phpmailer/vendor/phpmailer/phpmailer/SECURITY.md @@ -13,13 +13,13 @@ PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. -PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). -PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. diff --git a/phpmailer/vendor/phpmailer/phpmailer/SMTPUTF8.md b/phpmailer/vendor/phpmailer/phpmailer/SMTPUTF8.md deleted file mode 100644 index ca284ee2..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/SMTPUTF8.md +++ /dev/null @@ -1,48 +0,0 @@ -# A short history of UTF-8 in email - -## Background - -For most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds. - -The first major improvement, introduced in 1994 in [RFC 1652](https://www.rfc-editor.org/rfc/rfc1652) and extended in 2011 in [RFC 6152](https://www.rfc-editor.org/rfc/rfc6152), was the addition of the `8BITMIME` SMTP extension, which allowed raw 8-bit data to be included in message bodies sent over SMTP. -This allowed the message *contents* to contain 8-bit data, including things like UTF-8 text, even though the SMTP protocol itself was still firmly 7-bit. This worked by having the server switch to 8-bit after the headers, and then back to 7-bit after the completion of a `DATA` command. - -From 1996, messages could support [RFC 2047 encoding](https://www.rfc-editor.org/rfc/rfc2047), which permitted inserting characters from any character set into header *values* (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be: - -``` -Subject: =?utf-8?Q=Schr=C3=B6dinger=92s_Cat?= -``` - -Here the accented `ö` is encoded as `=C3=B6`, which is the UTF-8 encoding of the 2-byte character, and the whole thing is wrapped in `=?utf-8?Q?` to indicate that it uses the UTF-8 charset and `quoted-printable` encoding. This is a bit of a hack, and not very human-friendly, but it works. - -Similarly, 8-bit message bodies could be encoded using the same `quoted-printable` and `base64` content transfer encoding (CTE) schemes, which preserved the 8-bit content while encoding it in a format that could survive transmission through a 7-bit channel. - -Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in [RFC 3492](https://www.rfc-editor.org/rfc/rfc3492). This finally allowed the domain part (after the `@`) of email addresses to contain UTF-8, though it was actually an illusion preserved by email client applications. For example, an address of -`user@café.example.com` translates to -`user@xn--caf-dma.example.com` in punycode, rendering it mostly unreadable, but 7-bit friendly, and remaining compatible with email clients that don't know about IDN. - -The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the `@`). - -I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as [the ISO-8859 family](https://en.wikipedia.org/wiki/ISO/IEC_8859). However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages. - -This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess. - -## SMTPUTF8 - -`SMTPUTF8` is another SMTP extension, defined in [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531) in 2012. This essentially solves the whole problem, allowing the entire SMTP conversation — commands, headers, and message bodies — to be sent in raw, unencoded UTF-8. - -But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of `SMTPUTF8` in PHPMailer for many years, but in that time the *de facto* approach has become to simply fail in that situation, and tell the recipient it's time they upgraded their mail server 😅. - -The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was. - -## SMTPUTF8 in PHPMailer - -Several other PHP email libraries have implemented a halfway solution to `SMTPUTF8`, adding only the ability to support UTF-8 in email addresses, not elsewhere in the protocol. I wanted PHPMailer to do it "the right way", and this has taken much longer. PHPMailer now supports UTF-8 everywhere, and does not need to use transfer or header encodings for UTF-8 text when connecting to an `SMTPUTF8`-capable mail server. - -This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary. - -The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in `filter_var` validator, which does not allow UTF-8 email addresses. When PHPMailer spots that you have submitted a UTF-8 address, but have not altered the default validator, it will automatically switch to using a UTF-8-compatible validator. As soon as you do this, any SMTP connection you make will *require* that the server you connect to supports `SMTPUTF8`. You can select this validator explicitly by setting `PHPMailer::$validator = 'eai'` (an acronym for Email Address Internationalization). - -### Postfix gotcha - -Postfix has supported `SMTPUTF8` for a long time, but it has a peculiarity that it does not always advertise that it does so. However, rather surprisingly, if you use UTF-8 in the conversation, it will work anyway. diff --git a/phpmailer/vendor/phpmailer/phpmailer/VERSION b/phpmailer/vendor/phpmailer/phpmailer/VERSION index cf79bf90..4be2c727 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/VERSION +++ b/phpmailer/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.10.0 +6.5.0 \ No newline at end of file diff --git a/phpmailer/vendor/phpmailer/phpmailer/composer.json b/phpmailer/vendor/phpmailer/phpmailer/composer.json index 7b008b7c..58393b2c 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/composer.json +++ b/phpmailer/vendor/phpmailer/phpmailer/composer.json @@ -25,12 +25,6 @@ "type": "github" } ], - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - }, - "lock": false - }, "require": { "php": ">=5.5.0", "ext-ctype": "*", @@ -38,24 +32,19 @@ "ext-hash": "*" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "doctrine/annotations": "^1.2.6 || ^1.13.3", - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.7.2", - "yoast/phpunit-polyfills": "^1.0.4" + "squizlabs/php_codesniffer": "^3.5.6", + "yoast/phpunit-polyfills": "^0.2.0" }, "suggest": { - "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", - "ext-openssl": "Needed for secure SMTP sending and DKIM signing", - "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, "autoload": { @@ -71,10 +60,6 @@ "license": "LGPL-2.1-only", "scripts": { "check": "./vendor/bin/phpcs", - "test": "./vendor/bin/phpunit --no-coverage", - "coverage": "./vendor/bin/phpunit", - "lint": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build" - ] + "test": "./vendor/bin/phpunit" } } diff --git a/phpmailer/vendor/phpmailer/phpmailer/get_oauth_token.php b/phpmailer/vendor/phpmailer/phpmailer/get_oauth_token.php index 0e54a00b..befdc34a 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/phpmailer/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -12,7 +12,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -36,7 +36,7 @@ namespace PHPMailer\PHPMailer; * Aliases for League Provider Classes * Make sure you have added these to your composer.json and run `composer install` * Plenty to choose from here: - * @see https://oauth2-client.thephpleague.com/providers/thirdparty/ + * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ */ //@see https://github.com/thephpleague/oauth2-google use League\OAuth2\Client\Provider\Google; @@ -44,31 +44,14 @@ use League\OAuth2\Client\Provider\Google; use Hayageek\OAuth2\Client\Provider\Yahoo; //@see https://github.com/stevenmaguire/oauth2-microsoft use Stevenmaguire\OAuth2\Client\Provider\Microsoft; -//@see https://github.com/greew/oauth2-azure-provider -use Greew\OAuth2\Client\Provider\Azure; -if (!isset($_GET['code']) && !isset($_POST['provider'])) { +if (!isset($_GET['code']) && !isset($_GET['provider'])) { ?> - -
-

Select Provider

- -
- -
- -
- -
-

Enter id and secret

-

These details are obtained by setting up an app in your provider's developer console. -

-

ClientId:

-

ClientSecret:

-

TenantID (only relevant for Azure):

- -
+Select Provider:
+
Google
+Yahoo
+Microsoft/Outlook/Hotmail/Live/Office365
[ - 'https://outlook.office.com/SMTP.Send', - 'offline_access' - ] - ]; - break; } if (null === $provider) { @@ -178,5 +142,5 @@ if (!isset($_GET['code'])) { ); //Use this to interact with an API on the users behalf //Use this to get a new access token if the old one expires - echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken()); + echo 'Refresh Token: ', $token->getRefreshToken(); } diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php deleted file mode 100644 index 327dfbaf..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP ত্ৰুটি: প্ৰমাণীকৰণ কৰিব নোৱাৰি'; -$PHPMAILER_LANG['buggy_php'] = 'আপোনাৰ PHP সংস্কৰণ এটা বাগৰ দ্বাৰা প্ৰভাৱিত হয় যাৰ ফলত নষ্ট বাৰ্তা হব পাৰে । ইয়াক সমাধান কৰিবলে, প্ৰেৰণ কৰিবলে SMTP ব্যৱহাৰ কৰক, আপোনাৰ php.ini ত mail.add_x_header বিকল্প নিষ্ক্ৰিয় কৰক, MacOS বা Linux লৈ সলনি কৰক, বা আপোনাৰ PHP সংস্কৰণ 7.0.17+ বা 7.1.3+ লৈ সলনি কৰক ।'; -$PHPMAILER_LANG['connect_host'] = 'SMTP ত্ৰুটি: SMTP চাৰ্ভাৰৰ সৈতে সংযোগ কৰিবলে অক্ষম'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্ৰুটি: তথ্য গ্ৰহণ কৰা হোৱা নাই'; -$PHPMAILER_LANG['empty_message'] = 'বাৰ্তাৰ মূখ্য অংশ খালী।'; -$PHPMAILER_LANG['encoding'] = 'অজ্ঞাত এনকোডিং: '; -$PHPMAILER_LANG['execute'] = 'এক্সিকিউট কৰিব নোৱাৰি: '; -$PHPMAILER_LANG['extension_missing'] = 'সম্প্ৰসাৰণ নোহোৱা হৈছে: '; -$PHPMAILER_LANG['file_access'] = 'ফাইল অভিগম কৰিবলে অক্ষম: '; -$PHPMAILER_LANG['file_open'] = 'ফাইল ত্ৰুটি: ফাইল খোলিবলৈ অক্ষম: '; -$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্ৰেৰকৰ ঠিকনা(সমূহ) ব্যৰ্থ: '; -$PHPMAILER_LANG['instantiate'] = 'মেইল ফাংচনৰ এটা উদাহৰণ সৃষ্টি কৰিবলে অক্ষম'; -$PHPMAILER_LANG['invalid_address'] = 'প্ৰেৰণ কৰিব নোৱাৰি: অবৈধ ইমেইল ঠিকনা: '; -$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডাৰৰ নাম বা মান'; -$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোষ্টেন্ট্ৰি: '; -$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হস্ট:'; -$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলাৰ সমৰ্থিত নহয়।'; -$PHPMAILER_LANG['provide_address'] = 'আপুনি অন্ততঃ এটা গন্তব্য ইমেইল ঠিকনা দিব লাগিব'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্ৰুটি: নিম্নলিখিত গন্তব্যস্থানসমূহ ব্যৰ্থ: '; -$PHPMAILER_LANG['signing'] = 'স্বাক্ষৰ কৰাত ব্যৰ্থ: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP কড: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'অতিৰিক্ত SMTP তথ্য: '; -$PHPMAILER_LANG['smtp_detail'] = 'বিৱৰণ:'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যৰ্থ'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP চাৰ্ভাৰৰ ত্ৰুটি: '; -$PHPMAILER_LANG['variable_set'] = 'চলক নিৰ্ধাৰণ কৰিব পৰা নগল: '; -$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত সম্প্ৰসাৰণ: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php deleted file mode 100644 index 47365108..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP ত্রুটি: প্রমাণীকরণ করতে অক্ষম৷'; -$PHPMAILER_LANG['buggy_php'] = 'আপনার PHP সংস্করণ একটি বাগ দ্বারা প্রভাবিত হয় যার ফলে দূষিত বার্তা হতে পারে। এটি ঠিক করতে, পাঠাতে SMTP ব্যবহার করুন, আপনার php.ini এ mail.add_x_header বিকল্পটি নিষ্ক্রিয় করুন, MacOS বা Linux-এ স্যুইচ করুন, অথবা আপনার PHP সংস্করণকে 7.0.17+ বা 7.1.3+ এ পরিবর্তন করুন।'; -$PHPMAILER_LANG['connect_host'] = 'SMTP ত্রুটি: SMTP সার্ভারের সাথে সংযোগ করতে অক্ষম৷'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্রুটি: ডেটা গ্রহণ করা হয়নি৷'; -$PHPMAILER_LANG['empty_message'] = 'বার্তার অংশটি খালি।'; -$PHPMAILER_LANG['encoding'] = 'অজানা এনকোডিং: '; -$PHPMAILER_LANG['execute'] = 'নির্বাহ করতে অক্ষম: '; -$PHPMAILER_LANG['extension_missing'] = 'এক্সটেনশন অনুপস্থিত:'; -$PHPMAILER_LANG['file_access'] = 'ফাইল অ্যাক্সেস করতে অক্ষম: '; -$PHPMAILER_LANG['file_open'] = 'ফাইল ত্রুটি: ফাইল খুলতে অক্ষম: '; -$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্রেরকের ঠিকানা(গুলি) ব্যর্থ হয়েছে: '; -$PHPMAILER_LANG['instantiate'] = 'মেল ফাংশনের একটি উদাহরণ তৈরি করতে অক্ষম৷'; -$PHPMAILER_LANG['invalid_address'] = 'পাঠাতে অক্ষম: অবৈধ ইমেল ঠিকানা: '; -$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডার নাম বা মান'; -$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোস্টেন্ট্রি: '; -$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হোস্ট:'; -$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলার সমর্থিত নয়।'; -$PHPMAILER_LANG['provide_address'] = 'আপনাকে অবশ্যই অন্তত একটি গন্তব্য ইমেল ঠিকানা প্রদান করতে হবে৷'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্রুটি: নিম্নলিখিত গন্তব্যগুলি ব্যর্থ হয়েছে: '; -$PHPMAILER_LANG['signing'] = 'স্বাক্ষর করতে ব্যর্থ হয়েছে: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP কোড: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'অতিরিক্ত SMTP তথ্য:'; -$PHPMAILER_LANG['smtp_detail'] = 'বর্ণনা: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যর্থ হয়েছে৷'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP সার্ভার ত্রুটি: '; -$PHPMAILER_LANG['variable_set'] = 'পরিবর্তনশীল সেট করা যায়নি: '; -$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত এক্সটেনশন: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php new file mode 100644 index 00000000..500c9526 --- /dev/null +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php @@ -0,0 +1,27 @@ + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验证失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: 数据不可接受。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = '未知编码:'; +$PHPMAILER_LANG['execute'] = '不能执行: '; +$PHPMAILER_LANG['file_access'] = '不能访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; +$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; +$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; +$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下面的 收件人失败了: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php index db9a1ef5..1edba1d7 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php @@ -9,28 +9,21 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; -$PHPMAILER_LANG['buggy_php'] = 'Din version af PHP er berørt af en fejl, som gør at dine beskeder muligvis vises forkert. For at rette dette kan du skifte til SMTP, slå mail.add_x_header headeren i din php.ini fil fra, skifte til MacOS eller Linux eller opgradere din version af PHP til 7.0.17+ eller 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; $PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; $PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; -$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; -$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; $PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; -$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; $PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php index 339ee575..b3d5ca94 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php @@ -5,29 +5,22 @@ * @package PHPMailer */ -$PHPMAILER_LANG['authenticate'] = 'Σφάλμα SMTP: Αδυναμία πιστοποίησης.'; -$PHPMAILER_LANG['buggy_php'] = 'Η έκδοση PHP που χρησιμοποιείτε παρουσιάζει σφάλμα που μπορεί να έχει ως αποτέλεσμα κατεστραμένα μηνύματα. Για να το διορθώσετε, αλλάξτε τον τρόπο αποστολής σε SMTP, απενεργοποιήστε την επιλογή mail.add_x_header στο αρχείο php.ini, αλλάξτε λειτουργικό σε MacOS ή Linux ή αναβαθμίστε την PHP σε έκδοση 7.0.17+ ή 7.1.3+.'; -$PHPMAILER_LANG['connect_host'] = 'Σφάλμα SMTP: Αδυναμία σύνδεσης με τον φιλοξενητή SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Σφάλμα SMTP: Μη αποδεκτά δεδομένα.'; -$PHPMAILER_LANG['empty_message'] = 'Η ηλεκτρονική επιστολή δεν έχει περιεχόμενο.'; -$PHPMAILER_LANG['encoding'] = 'Άγνωστη μορφή κωδικοποίησης: '; -$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης: '; -$PHPMAILER_LANG['extension_missing'] = 'Απουσία επέκτασης: '; -$PHPMAILER_LANG['file_access'] = 'Αδυναμία πρόσβασης στο αρχείο: '; -$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Αδυναμία ανοίγματος αρχείου: '; -$PHPMAILER_LANG['from_failed'] = 'Η ακόλουθη διεύθυνση αποστολέα δεν είναι σωστή: '; -$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης συνάρτησης Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Μη έγκυρη διεύθυνση: '; -$PHPMAILER_LANG['invalid_header'] = 'Μη έγκυρο όνομα κεφαλίδας ή τιμή'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Μη έγκυρη εισαγωγή φιλοξενητή: '; -$PHPMAILER_LANG['invalid_host'] = 'Μη έγκυρος φιλοξενητής: '; +$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.'; +$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει περιεχόμενο .'; +$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: '; +$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: '; +$PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλασης του αρχείου: '; +$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: '; +$PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: '; +$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.'; +$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.'; -$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτρονική διεύθυνση παραλήπτη.'; -$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: '; +$PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: '; $PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: '; -$PHPMAILER_LANG['smtp_code'] = 'Κώδικάς SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Πρόσθετες πληροφορίες SMTP: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης SMTP.'; -$PHPMAILER_LANG['smtp_detail'] = 'Λεπτομέρεια: '; -$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα με τον διακομιστή SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή επαναφοράς μεταβλητής: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.'; +$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: '; +$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php index 4e74bfb7..6ba74627 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php @@ -4,33 +4,24 @@ * Spanish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Matt Sturdy - * @author Crystopher Glodzienski Cardoso - * @author Daniel Cruz */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; -$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP está afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; $PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; $PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; $PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; $PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; $PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; $PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; $PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; $PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; -$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: '; -$PHPMAILER_LANG['invalid_host'] = 'Host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; $PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; $PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; $PHPMAILER_LANG['signing'] = 'Error al firmar: '; -$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; -$PHPMAILER_LANG['smtp_detail'] = 'Detalle: '; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php index 6d1e6373..243c0548 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php @@ -20,6 +20,7 @@ $PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.'; $PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.'; $PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.'; +$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index a6d582d8..b57f0ec6 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -6,31 +6,27 @@ * Some French punctuation requires a thin non-breaking space (U+202F) character before it, * for example before a colon or exclamation mark. * There is one of these characters between these quotes: " " + * @see http://unicode.org/udhr/n/notes_fra.html */ -$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.'; -$PHPMAILER_LANG['buggy_php'] = 'Votre version de PHP est affectée par un bug qui peut entraîner des messages corrompus. Pour résoudre ce problème, passez à l’envoi par SMTP, désactivez l’option mail.add_x_header dans le fichier php.ini, passez à MacOS ou Linux, ou passez PHP à la version 7.0.17+ ou 7.1.3+.'; +$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l\'authentification.'; $PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.'; $PHPMAILER_LANG['empty_message'] = 'Corps du message vide.'; $PHPMAILER_LANG['encoding'] = 'Encodage inconnu : '; -$PHPMAILER_LANG['execute'] = 'Impossible de lancer l’exécution : '; -$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; -$PHPMAILER_LANG['file_access'] = 'Impossible d’accéder au fichier : '; +$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : '; +$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : '; $PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : '; -$PHPMAILER_LANG['from_failed'] = 'L’adresse d’expéditeur suivante a échoué : '; -$PHPMAILER_LANG['instantiate'] = 'Impossible d’instancier la fonction mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Adresse courriel non valide : '; -$PHPMAILER_LANG['invalid_header'] = 'Nom ou valeur de l’en-tête non valide'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Entrée d’hôte non valide : '; -$PHPMAILER_LANG['invalid_host'] = 'Hôte non valide : '; +$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué : '; +$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; +$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : '; +$PHPMAILER_LANG['invalid_hostentry'] = 'L\'entrée hôte n\'est pas valide : '; +$PHPMAILER_LANG['invalid_host'] = 'L\'hôte n\'est pas valide : '; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; $PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants ont échoué : '; +$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants sont en erreur : '; $PHPMAILER_LANG['signing'] = 'Erreur de signature : '; -$PHPMAILER_LANG['smtp_code'] = 'Code SMTP : '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué.'; -$PHPMAILER_LANG['smtp_detail'] = 'Détails : '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Échec de la connexion SMTP.'; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; -$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : '; +$PHPMAILER_LANG['variable_set'] = 'Impossible d\'initialiser ou de réinitialiser une variable : '; +$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php index d2856e05..d973a359 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -4,32 +4,24 @@ * Hindi PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Yash Karanke - * Rewrite and extension of the work by Jayanti Suthar */ $PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; -$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.'; $PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; $PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; $PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; $PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; -$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; $PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; $PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; $PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; $PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; $PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; -$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान'; -$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: '; -$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: '; $PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; $PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; -$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; $PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index d01869ce..eee79898 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -3,35 +3,26 @@ /** * Japanese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Mitsuhiro Yoshida + * @author Mitsuhiro Yoshida * @author Yoshi Sakai - * @author Arisophy - * @author ARAKI Musashi */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; -$PHPMAILER_LANG['buggy_php'] = 'ご利用のバージョンのPHPには不具合があり、メッセージが破損するおそれがあります。問題の解決は以下のいずれかを行ってください。SMTPでの送信に切り替える。php.iniのmail.add_x_headerをoffにする。MacOSまたはLinuxに切り替える。PHPバージョン7.0.17以降または7.1.3以降にアップグレードする。'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; -$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; -$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; -$PHPMAILER_LANG['invalid_header'] = '不正なヘッダー名またはその内容'; -$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: '; -$PHPMAILER_LANG['invalid_host'] = '不正なホスト: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; $PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; -$PHPMAILER_LANG['signing'] = '署名エラー: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; -$PHPMAILER_LANG['smtp_detail'] = '詳細: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; -$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php deleted file mode 100644 index cf3bda69..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'هەڵەی SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە '; -$PHPMAILER_LANG['connect_host'] = 'هەڵەی SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'هەڵەی SMTP: ئەو زانیاریانە قبوڵ نەکرا.'; -$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە'; -$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : '; -$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: '; -$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە فایلەکە: '; -$PHPMAILER_LANG['file_open'] = 'هەڵەی پەڕگە(فایل): ناتوانرێت بکرێتەوە: '; -$PHPMAILER_LANG['from_failed'] = 'هەڵە لە ئاستی ناونیشانی نێرەر: '; -$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە پێشکەش بکرێت.'; -$PHPMAILER_LANG['invalid_address'] = 'نەتوانرا بنێردرێت ، چونکە ناونیشانی ئیمەیڵەکە نادروستە: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' مەیلەر پشتگیری ناکات'; -$PHPMAILER_LANG['provide_address'] = 'دەبێت ناونیشانی ئیمەیڵی لانیکەم یەک وەرگر دابین بکرێت.'; -$PHPMAILER_LANG['recipients_failed'] = ' هەڵەی SMTP: ئەم هەڵانەی خوارەوەشکستی هێنا لە ناردن بۆ هەردووکیان: '; -$PHPMAILER_LANG['signing'] = 'هەڵەی واژۆ: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect()پەیوەندی شکستی هێنا .'; -$PHPMAILER_LANG['smtp_error'] = 'هەڵەی ئاستی سێرڤەری SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: '; -$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php deleted file mode 100644 index 04d262c7..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php +++ /dev/null @@ -1,27 +0,0 @@ - + * @author Jonadabe */ -$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Falha na autenticação.'; -$PHPMAILER_LANG['buggy_php'] = 'A sua versão do PHP tem um bug que pode causar mensagens corrompidas. Para resolver, utilize o envio por SMTP, desative a opção mail.add_x_header no ficheiro php.ini, mude para MacOS ou Linux, ou atualize o PHP para a versão 7.0.17+ ou 7.1.3+.'; -$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Não foi possível ligar ao servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Dados não aceites.'; -$PHPMAILER_LANG['empty_message'] = 'A mensagem de e-mail está vazia.'; +$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; +$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder ao ficheiro: '; -$PHPMAILER_LANG['file_open'] = 'Erro ao abrir o ficheiro: '; -$PHPMAILER_LANG['from_failed'] = 'O envio falhou para o seguinte endereço do remetente: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; -$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor do cabeçalho inválido.'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Entrada de host inválida: '; -$PHPMAILER_LANG['invalid_host'] = 'Host inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = 'O cliente de e-mail não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Deve fornecer pelo menos um endereço de destinatário.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Falha no envio para os seguintes destinatários: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; +$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; +$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; $PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; -$PHPMAILER_LANG['smtp_code'] = 'Código SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais SMTP: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Falha na função SMTP connect().'; -$PHPMAILER_LANG['smtp_detail'] = 'Detalhes: '; -$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php index 5239865a..d8638098 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php @@ -7,32 +7,24 @@ * @author Lucas Guimarães * @author Phelipe Alves * @author Fabio Beneditto - * @author Geidson Benício Coelho */ $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; -$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ '; $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; $PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; $PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; $PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; $PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; -$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido'; -$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: '; -$PHPMAILER_LANG['invalid_host'] = 'host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; $PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; $PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: '; -$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php index 45bef915..292ec1e4 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -3,31 +3,25 @@ /** * Romanian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer + * @author Alex Florea */ $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; -$PHPMAILER_LANG['buggy_php'] = 'Versiunea instalată de PHP este afectată de o problemă care poate duce la coruperea mesajelor Pentru a preveni această problemă, folosiți SMTP, dezactivați opțiunea mail.add_x_header din php.ini, folosiți MacOS/Linux sau actualizați versiunea de PHP la 7.0.17+ sau 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.'; $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; $PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; $PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; $PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; -$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; $PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: '; $PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: '; $PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; $PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.'; $PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; -$PHPMAILER_LANG['invalid_header'] = 'Numele sau valoarea header-ului nu este validă: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry invalid: '; -$PHPMAILER_LANG['invalid_host'] = 'Host invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; $PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.'; $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: '; $PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; -$PHPMAILER_LANG['smtp_code'] = 'Cod SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Informații SMTP adiționale: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; -$PHPMAILER_LANG['smtp_detail'] = 'Detalii SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; +$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php index 8013f37c..8c8c5e81 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -5,32 +5,24 @@ * @package PHPMailer * @author Alexey Chumakov * @author Foster Snowhill - * @author ProjectSoft */ -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалось пройти аутентификацию.'; -$PHPMAILER_LANG['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.'; +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; $PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; -$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; $PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; $PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; -$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; $PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; $PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; $PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; -$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; -$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: '; -$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: '; +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; $PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: '; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; +$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; +$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; $PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; -$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Дополнительная информация SMTP: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером.'; -$PHPMAILER_LANG['smtp_detail'] = 'Детали: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; $PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; +$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php deleted file mode 100644 index dce502aa..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP දෝෂය: සත්‍යාපනය අසාර්ථක විය.'; -$PHPMAILER_LANG['buggy_php'] = 'ඔබගේ PHP version එකෙහි පවතින දෝෂයක් නිසා email පණිවිඩ දෝෂ සහගත වීමේ හැකියාවක් ඇත. මෙය විසදීම සදහා SMTP භාවිතා කිරීම, mail.add_x_header INI setting එක අක්‍රීය කිරීම, MacOS හෝ Linux වලට මාරු වීම, හෝ ඔබගේ PHP version එක 7.0.17+ හෝ 7.1.3+ වලට අලුත් කිරීම කරගන්න.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP දෝෂය: සම්බන්ධ වීමට නොහැකි විය.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP දෝෂය: දත්ත පිළිගනු නොලැබේ.'; -$PHPMAILER_LANG['empty_message'] = 'පණිවිඩ අන්තර්ගතය හිස්'; -$PHPMAILER_LANG['encoding'] = 'නොදන්නා කේතනය: '; -$PHPMAILER_LANG['execute'] = 'ක්‍රියාත්මක කළ නොහැකි විය: '; -$PHPMAILER_LANG['extension_missing'] = 'Extension එක නොමැත: '; -$PHPMAILER_LANG['file_access'] = 'File එකට ප්‍රවේශ විය නොහැකි විය: '; -$PHPMAILER_LANG['file_open'] = 'File දෝෂය: File එක විවෘත කළ නොහැක: '; -$PHPMAILER_LANG['from_failed'] = 'පහත From ලිපිනයන් අසාර්ථක විය: '; -$PHPMAILER_LANG['instantiate'] = 'mail function එක ක්‍රියාත්මක කළ නොහැක.'; -$PHPMAILER_LANG['invalid_address'] = 'වලංගු නොවන ලිපිනය: '; -$PHPMAILER_LANG['invalid_header'] = 'වලංගු නොවන header නාමයක් හෝ අගයක්'; -$PHPMAILER_LANG['invalid_hostentry'] = 'වලංගු නොවන hostentry එකක්: '; -$PHPMAILER_LANG['invalid_host'] = 'වලංගු නොවන host එකක්: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer සහාය නොදක්වයි.'; -$PHPMAILER_LANG['provide_address'] = 'ඔබ අවම වශයෙන් එක් ලබන්නෙකුගේ ඊමේල් ලිපිනයක් සැපයිය යුතුය.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP දෝෂය: පහත ලබන්නන් අසමත් විය: '; -$PHPMAILER_LANG['signing'] = 'Sign කිරීමේ දෝෂය: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP කේතය: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'අමතර SMTP තොරතුරු: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP සම්බන්ධය අසාර්ථක විය.'; -$PHPMAILER_LANG['smtp_detail'] = 'තොරතුරු: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP දෝෂය: '; -$PHPMAILER_LANG['variable_set'] = 'Variable එක සැකසීමට හෝ නැවත සැකසීමට නොහැක: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php index 3e00c259..c437a886 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -9,28 +9,23 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; -$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; $PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; $PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; $PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; -$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; $PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; $PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; $PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; $PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; $PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; -$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave'; $PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; $PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; $PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; $PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; -$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: '; $PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; $PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; +$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php index 3c45bc1c..f938f802 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -11,28 +11,21 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.'; -$PHPMAILER_LANG['buggy_php'] = 'PHP sürümünüz iletilerin bozulmasına neden olabilecek bir hatadan etkileniyor. Bunu düzeltmek için, SMTP kullanarak göndermeye geçin, mail.add_x_header seçeneğini devre dışı bırakın php.ini dosyanızdaki mail.add_x_header seçeneğini devre dışı bırakın, MacOS veya Linux geçin veya PHP sürümünü 7.0.17+ veya 7.1.3+ sürümüne yükseltin,'; $PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna bağlanılamadı.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.'; $PHPMAILER_LANG['empty_message'] = 'Mesajın içeriği boş'; $PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: '; $PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: '; -$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; $PHPMAILER_LANG['file_access'] = 'Dosyaya erişilemedi: '; $PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: '; $PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme başarısız: '; $PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluşturulamadı.'; $PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: '; -$PHPMAILER_LANG['invalid_header'] = 'Geçersiz başlık adı veya değeri: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Geçersiz ana bilgisayar girişi: '; -$PHPMAILER_LANG['invalid_host'] = 'Geçersiz ana bilgisayar: '; $PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.'; $PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: '; $PHPMAILER_LANG['signing'] = 'İmzalama hatası: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP kodu: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'ek SMTP bilgileri: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu başarısız.'; -$PHPMAILER_LANG['smtp_detail'] = 'SMTP SMTP Detayı: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: '; $PHPMAILER_LANG['variable_set'] = 'Değişken ayarlanamadı ya da sıfırlanamadı: '; +$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php deleted file mode 100644 index 0b9de0f1..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔'; -$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک ہونے سے قاصر۔'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول نہیں کیا گیا۔'; -$PHPMAILER_LANG['empty_message'] = 'پیغام کی باڈی خالی ہے۔'; -$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: '; -$PHPMAILER_LANG['execute'] = 'عمل کرنے کے قابل نہیں '; -$PHPMAILER_LANG['file_access'] = 'فائل تک رسائی سے قاصر:'; -$PHPMAILER_LANG['file_open'] = 'فائل کی خرابی: فائل کو کھولنے سے قاصر:'; -$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا پتہ ناکام ہو گیا:'; -$PHPMAILER_LANG['instantiate'] = 'میل فنکشن کی مثال بنانے سے قاصر۔'; -$PHPMAILER_LANG['invalid_address'] = 'بھیجنے سے قاصر: غلط ای میل پتہ:'; -$PHPMAILER_LANG['mailer_not_supported'] = ' میلر تعاون یافتہ نہیں ہے۔'; -$PHPMAILER_LANG['provide_address'] = 'آپ کو کم از کم ایک منزل کا ای میل پتہ فراہم کرنا چاہیے۔'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP خرابی: درج ذیل پتہ پر نہیں بھیجا جاسکا: '; -$PHPMAILER_LANG['signing'] = 'دستخط کی خرابی: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ملنا ناکام ہوا'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP سرور کی خرابی: '; -$PHPMAILER_LANG['variable_set'] = 'متغیر سیٹ نہیں کیا جا سکا: '; -$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود نہیں ہے۔ '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور کوڈ: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'اضافی SMTP سرور کی معلومات:'; -$PHPMAILER_LANG['invalid_header'] = 'غلط ہیڈر کا نام یا قدر'; diff --git a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php index 03d49116..728a4994 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +++ b/phpmailer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -9,13 +9,11 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; -$PHPMAILER_LANG['buggy_php'] = '您的 PHP 版本存在漏洞,可能会导致消息损坏。为修复此问题,请切换到使用 SMTP 发送,在您的 php.ini 中禁用 mail.add_x_header 选项。切换到 MacOS 或 Linux,或将您的 PHP 升级到 7.0.17+ 或 7.1.3+ 版本。'; $PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; $PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; $PHPMAILER_LANG['encoding'] = '未知编码:'; $PHPMAILER_LANG['execute'] = '无法执行:'; -$PHPMAILER_LANG['extension_missing'] = '缺少扩展名:'; $PHPMAILER_LANG['file_access'] = '无法访问文件:'; $PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; $PHPMAILER_LANG['from_failed'] = '发送地址错误:'; @@ -24,13 +22,8 @@ $PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是 $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; $PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; +$PHPMAILER_LANG['signing'] = '登录失败:'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; $PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; $PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; -$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值'; -$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: '; -$PHPMAILER_LANG['invalid_host'] = '无效的主机:'; -$PHPMAILER_LANG['signing'] = '签名错误:'; -$PHPMAILER_LANG['smtp_code'] = 'SMTP代码: '; -$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息: '; -$PHPMAILER_LANG['smtp_detail'] = '详情:'; +$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:'; diff --git a/phpmailer/vendor/phpmailer/phpmailer/phpunit.xml.dist b/phpmailer/vendor/phpmailer/phpmailer/phpunit.xml.dist new file mode 100644 index 00000000..c68df965 --- /dev/null +++ b/phpmailer/vendor/phpmailer/phpmailer/phpunit.xml.dist @@ -0,0 +1,35 @@ + + + + + ./test/ + + + + + + + + languages + pop3 + + + + + ./src + + + + + + + + diff --git a/phpmailer/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/phpmailer/vendor/phpmailer/phpmailer/src/DSNConfigurator.php deleted file mode 100644 index 7058c1f0..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +++ /dev/null @@ -1,245 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2023 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -/** - * Configure PHPMailer with DSN string. - * - * @see https://en.wikipedia.org/wiki/Data_source_name - * - * @author Oleg Voronkovich - */ -class DSNConfigurator -{ - /** - * Create new PHPMailer instance configured by DSN. - * - * @param string $dsn DSN - * @param bool $exceptions Should we throw external exceptions? - * - * @return PHPMailer - */ - public static function mailer($dsn, $exceptions = null) - { - static $configurator = null; - - if (null === $configurator) { - $configurator = new DSNConfigurator(); - } - - return $configurator->configure(new PHPMailer($exceptions), $dsn); - } - - /** - * Configure PHPMailer instance with DSN string. - * - * @param PHPMailer $mailer PHPMailer instance - * @param string $dsn DSN - * - * @return PHPMailer - */ - public function configure(PHPMailer $mailer, $dsn) - { - $config = $this->parseDSN($dsn); - - $this->applyConfig($mailer, $config); - - return $mailer; - } - - /** - * Parse DSN string. - * - * @param string $dsn DSN - * - * @throws Exception If DSN is malformed - * - * @return array Configuration - */ - private function parseDSN($dsn) - { - $config = $this->parseUrl($dsn); - - if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { - throw new Exception('Malformed DSN'); - } - - if (isset($config['query'])) { - parse_str($config['query'], $config['query']); - } - - return $config; - } - - /** - * Apply configuration to mailer. - * - * @param PHPMailer $mailer PHPMailer instance - * @param array $config Configuration - * - * @throws Exception If scheme is invalid - */ - private function applyConfig(PHPMailer $mailer, $config) - { - switch ($config['scheme']) { - case 'mail': - $mailer->isMail(); - break; - case 'sendmail': - $mailer->isSendmail(); - break; - case 'qmail': - $mailer->isQmail(); - break; - case 'smtp': - case 'smtps': - $mailer->isSMTP(); - $this->configureSMTP($mailer, $config); - break; - default: - throw new Exception( - sprintf( - 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', - $config['scheme'] - ) - ); - } - - if (isset($config['query'])) { - $this->configureOptions($mailer, $config['query']); - } - } - - /** - * Configure SMTP. - * - * @param PHPMailer $mailer PHPMailer instance - * @param array $config Configuration - */ - private function configureSMTP($mailer, $config) - { - $isSMTPS = 'smtps' === $config['scheme']; - - if ($isSMTPS) { - $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; - } - - $mailer->Host = $config['host']; - - if (isset($config['port'])) { - $mailer->Port = $config['port']; - } elseif ($isSMTPS) { - $mailer->Port = SMTP::DEFAULT_SECURE_PORT; - } - - $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); - - if (isset($config['user'])) { - $mailer->Username = $config['user']; - } - - if (isset($config['pass'])) { - $mailer->Password = $config['pass']; - } - } - - /** - * Configure options. - * - * @param PHPMailer $mailer PHPMailer instance - * @param array $options Options - * - * @throws Exception If option is unknown - */ - private function configureOptions(PHPMailer $mailer, $options) - { - $allowedOptions = get_object_vars($mailer); - - unset($allowedOptions['Mailer']); - unset($allowedOptions['SMTPAuth']); - unset($allowedOptions['Username']); - unset($allowedOptions['Password']); - unset($allowedOptions['Hostname']); - unset($allowedOptions['Port']); - unset($allowedOptions['ErrorInfo']); - - $allowedOptions = \array_keys($allowedOptions); - - foreach ($options as $key => $value) { - if (!in_array($key, $allowedOptions)) { - throw new Exception( - sprintf( - 'Unknown option: "%s". Allowed values: "%s"', - $key, - implode('", "', $allowedOptions) - ) - ); - } - - switch ($key) { - case 'AllowEmpty': - case 'SMTPAutoTLS': - case 'SMTPKeepAlive': - case 'SingleTo': - case 'UseSendmailOptions': - case 'do_verp': - case 'DKIM_copyHeaderFields': - $mailer->$key = (bool) $value; - break; - case 'Priority': - case 'SMTPDebug': - case 'WordWrap': - $mailer->$key = (int) $value; - break; - default: - $mailer->$key = $value; - break; - } - } - } - - /** - * Parse a URL. - * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. - * - * @param string $url URL - * - * @return array|false - */ - protected function parseUrl($url) - { - if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { - return parse_url($url); - } - - $chunks = explode('?', $url); - if (is_array($chunks)) { - $result = parse_url($chunks[0]); - if (is_array($result)) { - $result['query'] = $chunks[1]; - } - return $result; - } - - return false; - } -} diff --git a/phpmailer/vendor/phpmailer/phpmailer/src/Exception.php b/phpmailer/vendor/phpmailer/phpmailer/src/Exception.php index 09c1a2cf..a50a8991 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/src/Exception.php +++ b/phpmailer/vendor/phpmailer/phpmailer/src/Exception.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -35,6 +35,6 @@ class Exception extends \Exception */ public function errorMessage() { - return '' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "
\n"; + return '' . htmlspecialchars($this->getMessage()) . "
\n"; } } diff --git a/phpmailer/vendor/phpmailer/phpmailer/src/OAuth.php b/phpmailer/vendor/phpmailer/phpmailer/src/OAuth.php index a7e95886..c93d0be1 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/src/OAuth.php +++ b/phpmailer/vendor/phpmailer/phpmailer/src/OAuth.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -29,11 +29,11 @@ use League\OAuth2\Client\Token\AccessToken; * OAuth - OAuth2 authentication wrapper class. * Uses the oauth2-client package from the League of Extraordinary Packages. * - * @see https://oauth2-client.thephpleague.com + * @see http://oauth2-client.thephpleague.com * * @author Marcus Bointon (Synchro/coolbru) */ -class OAuth implements OAuthTokenProvider +class OAuth { /** * An instance of the League OAuth Client Provider. diff --git a/phpmailer/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/phpmailer/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php deleted file mode 100644 index cbda1a12..00000000 --- a/phpmailer/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 Marcus Bointon - * @copyright 2010 - 2012 Jim Jagielski - * @copyright 2004 - 2009 Andy Prevost - * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License - * @note This program is distributed in the hope that it will be useful - WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - */ - -namespace PHPMailer\PHPMailer; - -/** - * OAuthTokenProvider - OAuth2 token provider interface. - * Provides base64 encoded OAuth2 auth strings for SMTP authentication. - * - * @see OAuth - * @see SMTP::authenticate() - * - * @author Peter Scopes (pdscopes) - * @author Marcus Bointon (Synchro/coolbru) - */ -interface OAuthTokenProvider -{ - /** - * Generate a base64-encoded OAuth token ensuring that the access token has not expired. - * The string to be base 64 encoded should be in the form: - * "user=\001auth=Bearer \001\001" - * - * @return string - */ - public function getOauth64(); -} diff --git a/phpmailer/vendor/phpmailer/phpmailer/src/PHPMailer.php b/phpmailer/vendor/phpmailer/phpmailer/src/PHPMailer.php index 2444bcf3..eb4b742b 100644 --- a/phpmailer/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/phpmailer/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -13,7 +13,7 @@ * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -103,14 +103,14 @@ class PHPMailer * * @var string */ - public $From = ''; + public $From = 'root@localhost'; /** * The From name of the message. * * @var string */ - public $FromName = ''; + public $FromName = 'Root User'; /** * The envelope sender of the message. @@ -152,7 +152,8 @@ class PHPMailer * Only supported in simple alt or alt_inline message types * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. * - * @see https://kigkonsult.se/iCalcreator/ + * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @see http://kigkonsult.se/iCalcreator/ * * @var string */ @@ -253,7 +254,7 @@ class PHPMailer * You can set your own, but it must be in the format "", * as defined in RFC5322 section 3.6.4 or it will be ignored. * - * @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4 + * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 * * @var string */ @@ -349,24 +350,17 @@ class PHPMailer public $Password = ''; /** - * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. - * If not specified, the first one from that list that the server supports will be selected. + * SMTP auth type. + * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified. * * @var string */ public $AuthType = ''; /** - * SMTP SMTPXClient command attributes + * An instance of the PHPMailer OAuth class. * - * @var array - */ - protected $SMTPXClient = []; - - /** - * An implementation of the PHPMailer OAuthTokenProvider interface. - * - * @var OAuthTokenProvider + * @var OAuth */ protected $oauth; @@ -387,7 +381,7 @@ class PHPMailer * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual * delivery's outcome (success or failure) is not yet decided. * - * @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY + * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY */ public $dsn = ''; @@ -467,7 +461,7 @@ class PHPMailer * Only applicable when sending via SMTP. * * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see https://www.postfix.org/VERP_README.html Postfix VERP info + * @see http://www.postfix.org/VERP_README.html Postfix VERP info * * @var bool */ @@ -550,10 +544,10 @@ class PHPMailer * The function that handles the result of the send email action. * It is called out by send() for each email sent. * - * Value can be any php callable: https://www.php.net/is_callable + * Value can be any php callable: http://www.php.net/is_callable * * Parameters: - * bool $result result of the send action + * bool $result result of the send action * array $to email addresses of the recipients * array $cc cc email addresses * array $bcc bcc email addresses @@ -580,10 +574,6 @@ class PHPMailer * May be a callable to inject your own validator, but there are several built-in validators. * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. * - * If CharSet is UTF8, the validator is left at the default value, - * and you send to addresses that use non-ASCII local parts, then - * PHPMailer automatically changes to the 'eai' validator. - * * @see PHPMailer::validateAddress() * * @var string|callable @@ -663,14 +653,6 @@ class PHPMailer */ protected $ReplyToQueue = []; - /** - * Whether the need for SMTPUTF8 has been detected. Set by - * preSend() if necessary. - * - * @var bool - */ - public $UseSMTPUTF8 = false; - /** * The array of attachments. * @@ -707,7 +689,7 @@ class PHPMailer protected $boundary = []; /** - * The array of available text strings for the current language. + * The array of available languages. * * @var array */ @@ -768,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.10.0'; + const VERSION = '6.5.0'; /** * Error severity: message only, continue processing. @@ -813,7 +795,7 @@ class PHPMailer * The maximum line length supported by mail(). * * Background: mail() will sometimes corrupt messages - * with headers longer than 65 chars, see #818. + * with headers headers longer than 65 chars, see #818. * * @var int */ @@ -876,7 +858,7 @@ class PHPMailer private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding - if ((int)ini_get('mbstring.func_overload') & 1) { + if (ini_get('mbstring.func_overload') & 1) { $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); @@ -914,7 +896,7 @@ class PHPMailer } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug(rtrim($str, "\r\n")); + $this->Debugoutput->debug($str); return; } @@ -1083,9 +1065,9 @@ class PHPMailer * be modified after calling this function), addition of such addresses is delayed until send(). * Addresses that have been added already return false, but do not throw exceptions. * - * @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To' - * @param string $address The email address - * @param string $name An optional username associated with the address + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name * * @throws Exception * @@ -1093,11 +1075,9 @@ class PHPMailer */ protected function addOrEnqueueAnAddress($kind, $address, $name) { - $pos = false; - if ($address !== null) { - $address = trim($address); - $pos = strrpos($address, '@'); - } + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + $pos = strrpos($address, '@'); if (false === $pos) { //At-sign is missing. $error_message = sprintf( @@ -1114,30 +1094,21 @@ class PHPMailer return false; } - if ($name !== null && is_string($name)) { - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - } else { - $name = ''; - } $params = [$kind, $address, $name]; //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. - //Domain is assumed to be whatever is after the last @ symbol in the address - if ($this->has8bitChars(substr($address, ++$pos))) { - if (static::idnSupported()) { - if ('Reply-To' !== $kind) { - if (!array_key_exists($address, $this->RecipientsQueue)) { - $this->RecipientsQueue[$address] = $params; - - return true; - } - } elseif (!array_key_exists($address, $this->ReplyToQueue)) { - $this->ReplyToQueue[$address] = $params; + if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { + if ('Reply-To' !== $kind) { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; return true; } + } elseif (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; + + return true; } - //We have an 8-bit domain, but we are missing the necessary extensions to support it - //Or we are already sending to this address + return false; } @@ -1145,22 +1116,6 @@ class PHPMailer return call_user_func_array([$this, 'addAnAddress'], $params); } - /** - * Set the boundaries to use for delimiting MIME parts. - * If you override this, ensure you set all 3 boundaries to unique values. - * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, - * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 - * - * @return void - */ - public function setBoundaries() - { - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1=_' . $this->uniqueid; - $this->boundary[2] = 'b2=_' . $this->uniqueid; - $this->boundary[3] = 'b3=_' . $this->uniqueid; - } - /** * Add an address to one of the recipient arrays or to the ReplyTo array. * Addresses that have been added already return false, but do not throw exceptions. @@ -1175,15 +1130,6 @@ class PHPMailer */ protected function addAnAddress($kind, $address, $name = '') { - if ( - self::$validator === 'php' && - ((bool) preg_match('/[\x80-\xFF]/', $address)) - ) { - //The caller has not altered the validator and is sending to an address - //with UTF-8, so assume that they want UTF-8 support instead of failing - $this->CharSet = self::CHARSET_UTF8; - self::$validator = 'eai'; - } if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { $error_message = sprintf( '%s: %s', @@ -1235,41 +1181,32 @@ class PHPMailer * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. * Note that quotes in the name part are removed. * - * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation * * @param string $addrstr The address list string * @param bool $useimap Whether to use the IMAP extension to parse the list - * @param string $charset The charset to use when decoding the address list string. * * @return array */ - public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) + public static function parseAddresses($addrstr, $useimap = true) { $addresses = []; if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { //Use this built-in parser if it's available $list = imap_rfc822_parse_adrlist($addrstr, ''); - // Clear any potential IMAP errors to get rid of notices being thrown at end of script. - imap_errors(); foreach ($list as $address) { if ( - '.SYNTAX-ERROR.' !== $address->host && - static::validateAddress($address->mailbox . '@' . $address->host) + ('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( + $address->mailbox . '@' . $address->host + ) ) { //Decode the name part if it's present and encoded if ( property_exists($address, 'personal') && - //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled - defined('MB_CASE_UPPER') && - preg_match('/^=\?.*\?=$/s', $address->personal) + extension_loaded('mbstring') && + preg_match('/^=\?.*\?=$/', $address->personal) ) { - $origCharset = mb_internal_encoding(); - mb_internal_encoding($charset); - //Undo any RFC2047-encoded spaces-as-underscores - $address->personal = str_replace('_', '=20', $address->personal); - //Decode the name $address->personal = mb_decode_mimeheader($address->personal); - mb_internal_encoding($origCharset); } $addresses[] = [ @@ -1297,16 +1234,9 @@ class PHPMailer $email = trim(str_replace('>', '', $email)); $name = trim($name); if (static::validateAddress($email)) { - //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled //If this name is encoded, decode it - if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { - $origCharset = mb_internal_encoding(); - mb_internal_encoding($charset); - //Undo any RFC2047-encoded spaces-as-underscores - $name = str_replace('_', '=20', $name); - //Decode the name + if (preg_match('/^=\?.*\?=$/', $name)) { $name = mb_decode_mimeheader($name); - mb_internal_encoding($origCharset); } $addresses[] = [ //Remove any surrounding quotes and spaces from the name @@ -1334,7 +1264,7 @@ class PHPMailer */ public function setFrom($address, $name = '', $auto = true) { - $address = trim((string)$address); + $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim //Don't validate now addresses with IDN. Will be done in send(). $pos = strrpos($address, '@'); @@ -1386,7 +1316,6 @@ class PHPMailer * * `pcre` Use old PCRE implementation; * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. - * * `eai` Use a pattern similar to the HTML5 spec for 'email' and to firefox, extended to support EAI (RFC6530). * * `noregex` Don't use a regex: super fast, really dumb. * Alternatively you may pass in a callable to inject your own validator, for example: * @@ -1431,6 +1360,7 @@ class PHPMailer * * IPv6 literals: 'first.last@[IPv6:a1::]' * Not all of these will necessarily work for sending! * + * @see http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. */ @@ -1457,24 +1387,6 @@ class PHPMailer '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', $address ); - case 'eai': - /* - * This is the pattern used in the HTML5 spec for validation of 'email' type - * form input elements (as above), modified to accept Unicode email addresses. - * This is also more lenient than Firefox' html5 spec, in order to make the regex faster. - * 'eai' is an acronym for Email Address Internationalization. - * This validator is selected automatically if you attempt to use recipient addresses - * that contain Unicode characters in the local part. - * - * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) - * @see https://en.wikipedia.org/wiki/International_email - */ - return (bool) preg_match( - '/^[-\p{L}\p{N}\p{M}.!#$%&\'*+\/=?^_`{|}~]+@[\p{L}\p{N}\p{M}](?:[\p{L}\p{N}\p{M}-]{0,61}' . - '[\p{L}\p{N}\p{M}])?(?:\.[\p{L}\p{N}\p{M}]' . - '(?:[-\p{L}\p{N}\p{M}]{0,61}[\p{L}\p{N}\p{M}])?)*$/usD', - $address - ); case 'php': default: return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; @@ -1524,12 +1436,7 @@ class PHPMailer $errorcode = 0; if (defined('INTL_IDNA_VARIANT_UTS46')) { //Use the current punycode standard (appeared in PHP 7.2) - $punycode = idn_to_ascii( - $domain, - \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | - \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, - \INTL_IDNA_VARIANT_UTS46 - ); + $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46); } elseif (defined('INTL_IDNA_VARIANT_2003')) { //Fall back to this old, deprecated/removed encoding $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); @@ -1601,33 +1508,21 @@ class PHPMailer && ini_get('mail.add_x_header') === '1' && stripos(PHP_OS, 'WIN') === 0 ) { - trigger_error($this->lang('buggy_php'), E_USER_WARNING); + trigger_error( + 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', + E_USER_WARNING + ); } try { $this->error_count = 0; //Reset errors $this->mailHeader = ''; - //The code below tries to support full use of Unicode, - //while remaining compatible with legacy SMTP servers to - //the greatest degree possible: If the message uses - //Unicode in the local parts of any addresses, it is sent - //using SMTPUTF8. If not, it it sent using - //punycode-encoded domains and plain SMTP. - if ( - static::CHARSET_UTF8 === strtolower($this->CharSet) && - ($this->anyAddressHasUnicodeLocalPart($this->RecipientsQueue) || - $this->anyAddressHasUnicodeLocalPart(array_keys($this->all_recipients)) || - $this->anyAddressHasUnicodeLocalPart($this->ReplyToQueue) || - $this->addressHasUnicodeLocalPart($this->From)) - ) { - $this->UseSMTPUTF8 = true; - } //Dequeue recipient and Reply-To addresses with IDN foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { - if (!$this->UseSMTPUTF8) { - $params[1] = $this->punyencodeAddress($params[1]); - } + $params[1] = $this->punyencodeAddress($params[1]); call_user_func_array([$this, 'addAnAddress'], $params); } if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { @@ -1636,21 +1531,17 @@ class PHPMailer //Validate From, Sender, and ConfirmReadingTo addresses foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { - if ($this->{$address_kind} === null) { - $this->{$address_kind} = ''; + $this->$address_kind = trim($this->$address_kind); + if (empty($this->$address_kind)) { continue; } - $this->{$address_kind} = trim($this->{$address_kind}); - if (empty($this->{$address_kind})) { - continue; - } - $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind}); - if (!static::validateAddress($this->{$address_kind})) { + $this->$address_kind = $this->punyencodeAddress($this->$address_kind); + if (!static::validateAddress($this->$address_kind)) { $error_message = sprintf( '%s (%s): %s', $this->lang('invalid_address'), $address_kind, - $this->{$address_kind} + $this->$address_kind ); $this->setError($error_message); $this->edebug($error_message); @@ -1750,17 +1641,17 @@ class PHPMailer default: $sendMethod = $this->Mailer . 'Send'; if (method_exists($this, $sendMethod)) { - return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody); + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); } return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) { $this->smtp->reset(); } + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); if ($this->exceptions) { throw $exc; } @@ -1792,13 +1683,11 @@ class PHPMailer //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html //Example problem: https://www.drupal.org/node/1057954 - - //PHP 5.6 workaround - $sendmail_from_value = ini_get('sendmail_from'); - if (empty($this->Sender) && !empty($sendmail_from_value)) { + if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { //PHP config has a sender address we can use $this->Sender = ini_get('sendmail_from'); } @@ -1835,7 +1724,7 @@ class PHPMailer fwrite($mail, $header); fwrite($mail, $body); $result = pclose($mail); - $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $addrinfo = static::parseAddresses($toAddr); $this->doCallback( ($result === 0), [[$addrinfo['address'], $addrinfo['name']]], @@ -1890,13 +1779,7 @@ class PHPMailer */ protected static function isShellSafe($string) { - //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg, - //but some hosting providers disable it, creating a security problem that we don't want to have to deal with, - //so we don't. - if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) { - return false; - } - + //Future-proof if ( escapeshellcmd($string) !== $string || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) @@ -1931,7 +1814,7 @@ class PHPMailer */ protected static function isPermittedPath($path) { - //Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1 + //Matches scheme definition from https://tools.ietf.org/html/rfc3986#section-3.1 return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); } @@ -1947,7 +1830,7 @@ class PHPMailer if (!static::isPermittedPath($path)) { return false; } - $readable = is_file($path); + $readable = file_exists($path); //If not a UNC path (expected to start with \\), check read permission, see #2069 if (strpos($path, '\\\\') !== 0) { $readable = $readable && is_readable($path); @@ -1958,7 +1841,7 @@ class PHPMailer /** * Send mail using the PHP mail() function. * - * @see https://www.php.net/manual/en/book.mail.php + * @see http://www.php.net/manual/en/book.mail.php * * @param string $header The message headers * @param string $body The message body @@ -1975,27 +1858,18 @@ class PHPMailer foreach ($this->to as $toaddr) { $toArr[] = $this->addrFormat($toaddr); } - $to = trim(implode(', ', $toArr)); - - //If there are no To-addresses (e.g. when sending only to BCC-addresses) - //the following should be added to get a correct DKIM-signature. - //Compare with $this->preSend() - if ($to === '') { - $to = 'undisclosed-recipients:;'; - } + $to = implode(', ', $toArr); $params = null; //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html + //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html + //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html //Example problem: https://www.drupal.org/node/1057954 //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - - //PHP 5.6 workaround - $sendmail_from_value = ini_get('sendmail_from'); - if (empty($this->Sender) && !empty($sendmail_from_value)) { + if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { //PHP config has a sender address we can use $this->Sender = ini_get('sendmail_from'); } @@ -2010,7 +1884,7 @@ class PHPMailer if ($this->SingleTo && count($toArr) > 1) { foreach ($toArr as $toAddr) { $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $addrinfo = static::parseAddresses($toAddr); $this->doCallback( $result, [[$addrinfo['address'], $addrinfo['name']]], @@ -2064,38 +1938,6 @@ class PHPMailer return $this->smtp; } - /** - * Provide SMTP XCLIENT attributes - * - * @param string $name Attribute name - * @param ?string $value Attribute value - * - * @return bool - */ - public function setSMTPXclientAttribute($name, $value) - { - if (!in_array($name, SMTP::$xclient_allowed_attributes)) { - return false; - } - if (isset($this->SMTPXClient[$name]) && $value === null) { - unset($this->SMTPXClient[$name]); - } elseif ($value !== null) { - $this->SMTPXClient[$name] = $value; - } - - return true; - } - - /** - * Get SMTP XCLIENT attributes - * - * @return array - */ - public function getSMTPXclientAttributes() - { - return $this->SMTPXClient; - } - /** * Send mail via SMTP. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. @@ -2118,20 +1960,12 @@ class PHPMailer if (!$this->smtpConnect($this->SMTPOptions)) { throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); } - //If we have recipient addresses that need Unicode support, - //but the server doesn't support it, stop here - if ($this->UseSMTPUTF8 && !$this->smtp->getServerExt('SMTPUTF8')) { - throw new Exception($this->lang('no_smtputf8'), self::STOP_CRITICAL); - } //Sender already validated in preSend() if ('' === $this->Sender) { $smtp_from = $this->From; } else { $smtp_from = $this->Sender; } - if (count($this->SMTPXClient)) { - $this->smtp->xclient($this->SMTPXClient); - } if (!$this->smtp->mail($smtp_from)) { $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); @@ -2224,10 +2058,6 @@ class PHPMailer $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); - $this->smtp->setSMTPUTF8($this->UseSMTPUTF8); - if ($this->Host === null) { - $this->Host = 'localhost'; - } $hosts = explode(';', $this->Host); $lastexception = null; @@ -2295,23 +2125,15 @@ class PHPMailer $this->smtp->hello($hello); //Automatically enable TLS encryption if: //* it's not disabled - //* we are not connecting to localhost //* we have openssl extension //* we are not already using SSL //* the server offers STARTTLS - if ( - $this->SMTPAutoTLS && - $this->Host !== 'localhost' && - $sslext && - $secure !== 'ssl' && - $this->smtp->getServerExt('STARTTLS') - ) { + if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { $tls = true; } if ($tls) { if (!$this->smtp->startTLS()) { - $message = $this->getSmtpErrorMessage('connect_host'); - throw new Exception($message); + throw new Exception($this->lang('connect_host')); } //We must resend EHLO after TLS negotiation $this->smtp->hello($hello); @@ -2342,11 +2164,6 @@ class PHPMailer if ($this->exceptions && null !== $lastexception) { throw $lastexception; } - if ($this->exceptions) { - // no exception was thrown, likely $this->smtp->connect() failed - $message = $this->getSmtpErrorMessage('connect_host'); - throw new Exception($message); - } return false; } @@ -2364,15 +2181,14 @@ class PHPMailer /** * Set the language for error messages. + * Returns false if it cannot load the language file. * The default language is English. * * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") - * Optionally, the language code can be enhanced with a 4-character - * script annotation and/or a 2-character country annotation. - * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * @param string $lang_path Path to the language file directory, with trailing separator (slash).D * Do not set this from user input! * - * @return bool Returns true if the requested language was loaded, false otherwise. + * @return bool */ public function setLanguage($langcode = 'en', $lang_path = '') { @@ -2395,78 +2211,44 @@ class PHPMailer //Define full set of translatable strings in English $PHPMAILER_LANG = [ 'authenticate' => 'SMTP Error: Could not authenticate.', - 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . - ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . - ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', - 'extension_missing' => 'Extension missing: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address: ', - 'invalid_header' => 'Invalid header name or value', 'invalid_hostentry' => 'Invalid hostentry: ', 'invalid_host' => 'Invalid host: ', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', - 'smtp_code' => 'SMTP code: ', - 'smtp_code_ex' => 'Additional SMTP info: ', 'smtp_connect_failed' => 'SMTP connect() failed.', - 'smtp_detail' => 'Detail: ', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ', - 'no_smtputf8' => 'Server does not support SMTPUTF8 needed to send to Unicode addresses', + 'extension_missing' => 'Extension missing: ', ]; if (empty($lang_path)) { //Calculate an absolute path so it can work if CWD is not here $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; } - //Validate $langcode - $foundlang = true; - $langcode = strtolower($langcode); - if ( - !preg_match('/^(?P[a-z]{2})(?P \r\n"; - if ($async) { - $b .= "
\r\n\r\n
"; + $b .= " \r\n"; + $b .= "
\r\n\r\n
"; + } else { + $b .= " \r\n"; } /* @@ -93,7 +89,7 @@ function piwik_analytics(string &$b) $b .= ""; } @@ -108,7 +104,6 @@ function piwik_addon_admin (string &$o) '$siteid' => ['siteid', DI::l10n()->t('Site ID'), DI::config()->get('piwik','siteid' ), ''], '$optout' => ['optout', DI::l10n()->t('Show opt-out cookie link?'), DI::config()->get('piwik','optout' ), ''], '$async' => ['async', DI::l10n()->t('Asynchronous tracking'), DI::config()->get('piwik','async' ), ''], - '$shortendpoint' => ['shortendpoint', DI::l10n()->t("Shortcut path to the script ('/js/' instead of '/piwik.js')"), DI::config()->get('piwik','shortendpoint' ), ''], ]); } @@ -118,5 +113,4 @@ function piwik_addon_admin_post() DI::config()->set('piwik', 'siteid', trim($_POST['siteid'] ?? '')); DI::config()->set('piwik', 'optout', trim($_POST['optout'] ?? '')); DI::config()->set('piwik', 'async', trim($_POST['async'] ?? '')); - DI::config()->set('piwik', 'shortendpoint', trim($_POST['shortendpoint'] ?? '')); } diff --git a/piwik/templates/admin.tpl b/piwik/templates/admin.tpl index 7a9b5d71..2ab1869b 100644 --- a/piwik/templates/admin.tpl +++ b/piwik/templates/admin.tpl @@ -2,5 +2,4 @@ {{include file="field_input.tpl" field=$siteid}} {{include file="field_checkbox.tpl" field=$optout}} {{include file="field_checkbox.tpl" field=$async}} -{{include file="field_checkbox.tpl" field=$shortendpoint}}
diff --git a/planets/lang/bg/messages.po b/planets/lang/bg/messages.po deleted file mode 100644 index d4e30492..00000000 --- a/planets/lang/bg/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON planets -# Copyright (C) -# This file is distributed under the same license as the Friendica planets addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 11:19+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: planets.php:126 -msgid "Enable Planets Addon" -msgstr "" - -#: planets.php:131 -msgid "Planets Settings" -msgstr "" diff --git a/planets/lang/bg/strings.php b/planets/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/planets/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: planets.php:126 -msgid "Enable Planets Addon" -msgstr "" - -#: planets.php:131 -msgid "Planets Settings" -msgstr "" diff --git a/planets/lang/ca/strings.php b/planets/lang/ca/strings.php index d34874f6..625dcab9 100644 --- a/planets/lang/ca/strings.php +++ b/planets/lang/ca/strings.php @@ -1,7 +1,5 @@ -strings["Planets Settings"] = "Ajustos de Planet"; +$a->strings["Enable Planets Addon"] = "Activa Addon de Planet"; +$a->strings["Submit"] = "Enviar"; diff --git a/planets/lang/eo/messages.po b/planets/lang/eo/messages.po deleted file mode 100644 index 9b8c31a5..00000000 --- a/planets/lang/eo/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON planets -# Copyright (C) -# This file is distributed under the same license as the Friendica planets addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 11:19+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: planets.php:126 -msgid "Enable Planets Addon" -msgstr "" - -#: planets.php:131 -msgid "Planets Settings" -msgstr "" diff --git a/planets/lang/eo/strings.php b/planets/lang/eo/strings.php index 68e8a64c..c6b6d413 100644 --- a/planets/lang/eo/strings.php +++ b/planets/lang/eo/strings.php @@ -1,7 +1,5 @@ -strings["Planets Settings"] = "Agordo pri Planets"; +$a->strings["Enable Planets Addon"] = "Ŝalti la Planets kromprogamon"; +$a->strings["Submit"] = "Sendi"; diff --git a/planets/lang/et/messages.po b/planets/lang/et/messages.po deleted file mode 100644 index 062c6de0..00000000 --- a/planets/lang/et/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON planets -# Copyright (C) -# This file is distributed under the same license as the Friendica planets addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 11:19+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: planets.php:126 -msgid "Enable Planets Addon" -msgstr "" - -#: planets.php:131 -msgid "Planets Settings" -msgstr "" diff --git a/planets/lang/et/strings.php b/planets/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/planets/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: planets.php:126 -msgid "Enable Planets Addon" -msgstr "" - -#: planets.php:131 -msgid "Planets Settings" -msgstr "" diff --git a/planets/lang/gd/strings.php b/planets/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/planets/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/planets/lang/is/messages.po b/planets/lang/is/messages.po deleted file mode 100644 index 9a82e125..00000000 --- a/planets/lang/is/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON planets -# Copyright (C) -# This file is distributed under the same license as the Friendica planets addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:15-0500\n" -"PO-Revision-Date: 2014-06-23 11:19+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: planets.php:126 -msgid "Enable Planets Addon" -msgstr "" - -#: planets.php:131 -msgid "Planets Settings" -msgstr "" diff --git a/planets/lang/is/strings.php b/planets/lang/is/strings.php index 975c341e..82f8b728 100644 --- a/planets/lang/is/strings.php +++ b/planets/lang/is/strings.php @@ -1,7 +1,5 @@ -strings["Planets Settings"] = ""; +$a->strings["Enable Planets Addon"] = ""; +$a->strings["Submit"] = "Senda inn"; diff --git a/planets/planets.php b/planets/planets.php index 8849010a..8a206fb5 100644 --- a/planets/planets.php +++ b/planets/planets.php @@ -7,7 +7,9 @@ * Author: Tony Baldwin */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; @@ -27,7 +29,7 @@ function planets_install() Hook::register('addon_settings', 'addon/planets/planets.php', 'planets_settings'); Hook::register('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); - DI::logger()->notice("installed planets"); + Logger::notice("installed planets"); } /** @@ -38,7 +40,7 @@ function planets_install() */ function planets_post_hook(&$item) { - DI::logger()->notice('planets invoked'); + Logger::notice('planets invoked'); if (!DI::userSession()->getLocalUserId()) { /* non-zero if this is a logged in user of this system */ diff --git a/pnut/README.md b/pnut/README.md deleted file mode 100644 index 798174b8..00000000 --- a/pnut/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Pnut connector - -With this addon to friendica you can give your users the possibility to post their *public* messages to pnut.io. - -No setup is needed for the admins to make it work for their users, however it is possible for the admin to create a client, so that the users don't have to. - -To do so, go to https://pnut.io/dev and scroll down to "Create New Client". -Enter a name of your choice and enter your Friendica host name as the website. -Use https://(yourhost.name)/pnut/connect as a redirect url, replace "(yourhost.name)" with the host name of your system. -Limit the scope to "basic,files,follow,polls,presence,stream,update_profile,write_post" \ No newline at end of file diff --git a/pnut/lang/C/messages.po b/pnut/lang/C/messages.po deleted file mode 100644 index 89b065fd..00000000 --- a/pnut/lang/C/messages.po +++ /dev/null @@ -1,74 +0,0 @@ -# ADDON pnut -# Copyright (C) -# This file is distributed under the same license as the Friendica pnut addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-03 11:53+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: pnut.php:42 -msgid "Permission denied." -msgstr "" - -#: pnut.php:79 -msgid "You are now authenticated with pnut.io." -msgstr "" - -#: pnut.php:82 -msgid "Error fetching token. Please try again." -msgstr "" - -#: pnut.php:85 -msgid "return to the connector page" -msgstr "" - -#: pnut.php:103 -msgid "Save Settings" -msgstr "" - -#: pnut.php:104 pnut.php:150 -msgid "Client ID" -msgstr "" - -#: pnut.php:105 pnut.php:151 -msgid "Client Secret" -msgstr "" - -#: pnut.php:139 -msgid "Authenticate with pnut.io" -msgstr "" - -#: pnut.php:143 -msgid "Disconnect" -msgstr "" - -#: pnut.php:148 -msgid "Enable Pnut Post Addon" -msgstr "" - -#: pnut.php:149 -msgid "Post to Pnut by default" -msgstr "" - -#: pnut.php:152 -msgid "Access Token" -msgstr "" - -#: pnut.php:161 -msgid "Pnut Export" -msgstr "" - -#: pnut.php:203 -msgid "Post to Pnut" -msgstr "" diff --git a/pnut/lib/LICENSE b/pnut/lib/LICENSE deleted file mode 100644 index 579599a8..00000000 --- a/pnut/lib/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2013, Josh Dolitsky -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Josh Dolitsky nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL TRAVIS RICHARDSON BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/pnut/lib/phpnut.php b/pnut/lib/phpnut.php deleted file mode 100644 index 716945ed..00000000 --- a/pnut/lib/phpnut.php +++ /dev/null @@ -1,2512 +0,0 @@ -_clientId = $client_id_or_token; - $this->_clientSecret = $client_secret; - } else { - $this->_accessToken = $client_id_or_token; - } - - // if the digicert certificate exists in the same folder as this file, - // remember that fact for later - if (file_exists(__DIR__ . '/DigiCertHighAssuranceEVRootCA.pem')) { - $this->_sslCA = __DIR__ . '/DigiCertHighAssuranceEVRootCA.pem'; - } - } - - /** - * Set whether or not to strip Envelope Response (meta) information - * This option will be deprecated in the future. Is it to allow - * a stepped migration path between code expecting the old behavior - * and new behavior. When not stripped, you still can use the proper - * method to pull the meta information. Please start converting your code ASAP - */ - public function includeResponseEnvelope(): void - { - $this->_stripResponseEnvelope = false; - } - - /** - * Construct the proper Auth URL for the user to visit and either grant - * or not access to your app. Usually you would place this as a link for - * the user to client, or a redirect to send them to the auth URL. - * Also can be called after authentication for additional scopes - * @param string $callback_uri Where you want the user to be directed - * after authenticating with pnut.io. This must be one of the URIs - * allowed by your pnut.io application settings. - * @param array $scope An array of scopes (permissions) you wish to obtain - * from the user. If you don't specify anything, you'll only receive - * access to the user's basic profile (the default). - */ - public function getAuthUrl(?string $callback_uri=null, array $scope=null): string - { - if (empty($this->_clientId)) { - throw new phpnutException('You must specify your pnut client ID'); - } - - if (is_null($callback_uri)) { - if (defined('PNUT_REDIRECT_URI')) { - $callback_uri = PNUT_REDIRECT_URI; - } elseif (isset($_ENV['PNUT_REDIRECT_URI'])) { - $callback_uri = $_ENV['PNUT_REDIRECT_URI']; - } else { - throw new phpnutException('You must specify your pnut callback URI'); - } - } - - if (is_null($scope)) { - if (defined('PNUT_APP_SCOPE')) { - $scope = PNUT_APP_SCOPE; - } elseif (isset($_ENV['PNUT_APP_SCOPE'])) { - $scope = $_ENV['PNUT_APP_SCOPE']; - } else { - $scope = 'basic'; - } - } - - if (is_array($scope)) { - $scope = implode(',', $scope); - } - - // construct an authorization url based on our client id and other data - $data = [ - 'client_id'=>$this->_clientId, - 'response_type'=>'code', - 'redirect_uri'=>$callback_uri, - 'scope'=>$scope, - ]; - - $url = $this->_authUrl; - if ($this->_accessToken) { - $url .= 'authorize?'; - } else { - $url .= 'authenticate?'; - } - $url .= $this->buildQueryString($data); - - // return the constructed url - return $url; - } - - /** - * Call this after they return from the auth page, or anytime you need the - * token. For example, you could store it in a database and use - * setAccessToken() later on to return on behalf of the user. - */ - public function getAccessToken(string $callback_uri) - { - // if there's no access token set, and they're returning from - // the auth page with a code, use the code to get a token - if (!$this->_accessToken && isset($_GET['code']) && $_GET['code'] !== '') { - - if (empty($this->_clientId) || empty($this->_clientSecret)) { - throw new phpnutException('You must specify your Pnut client ID and client secret'); - } - - // construct the necessary elements to get a token - $data = [ - 'client_id'=>$this->_clientId, - 'client_secret'=>$this->_clientSecret, - 'grant_type'=>'authorization_code', - 'redirect_uri'=>$callback_uri, - 'code'=>$_GET['code'], - ]; - - // try and fetch the token with the above data - $res = $this->httpReq( - 'post', - "{$this->_baseUrl}oauth/access_token", - $data - ); - - // store it for later - $this->_accessToken = $res['access_token']; - $this->_username = $res['username']; - $this->_user_id = $res['user_id']; - } - - // return what we have (this may be a token, or it may be nothing) - return $this->_accessToken; - } - - /** - * Check the scope of current token to see if it has required scopes - * has to be done after a check - * - * @return int|array - */ - public function checkScopes(array $app_scopes) - { - if (count($this->_scopes) === 0) { - return -1; // _scope is empty - } - $missing = []; - foreach($app_scopes as $scope) { - if (!in_array($scope, $this->_scopes)) { - if ($scope === 'public_messages') { - // messages works for public_messages - if (in_array('messages', $this->_scopes)) { - // if we have messages in our scopes - continue; - } - } - $missing[] = $scope; - } - } - // identify the ones missing - if (count($missing) !== 0) { - // do something - return $missing; - } - return 0; // 0 missing - } - - /** - * Set the access token (eg: after retrieving it from offline storage) - * @param string $token A valid access token you're previously received - * from calling getAccessToken(). - */ - public function setAccessToken(?string $token=null): void - { - $this->_accessToken = $token; - } - - /** - * Deauthorize the current token (delete your authorization from the API) - * Generally this is useful for logging users out from a web app, so they - * don't get automatically logged back in the next time you redirect them - * to the authorization URL. - */ - public function deauthorizeToken() - { - return $this->httpReq('delete', "{$this->_baseUrl}token"); - } - - /** - * Retrieve an app access token from the app.net API. This allows you - * to access the API without going through the user access flow if you - * just want to (eg) consume global. App access tokens are required for - * some actions (like streaming global). DO NOT share the return value - * of this function with any user (or save it in a cookie, etc). This - * is considered secret info for your app only. - * @return string The app access token - */ - public function getAppAccessToken() - { - if (empty($this->_clientId) || empty($this->_clientSecret)) { - throw new phpnutException('You must specify your Pnut client ID and client secret'); - } - - // construct the necessary elements to get a token - $data = [ - 'client_id'=>$this->_clientId, - 'client_secret'=>$this->_clientSecret, - 'grant_type'=>'client_credentials', - ]; - // try and fetch the token with the above data - $res = $this->httpReq( - 'post', - "{$this->_baseUrl}oauth/access_token", - $data - ); - // store it for later - $this->_appAccessToken = $res['access_token']; - $this->_accessToken = $res['access_token']; - $this->_username = null; - $this->_user_id = null; - return $this->_accessToken; - } - - /** - * Returns the total number of requests you're allowed within the - * alloted time period. - * @see getRateLimitReset() - */ - public function getRateLimit() - { - return $this->_rateLimit; - } - - /** - * The number of requests you have remaining within the alloted time period - * @see getRateLimitReset() - */ - public function getRateLimitRemaining() - { - return $this->_rateLimitRemaining; - } - - /** - * The number of seconds remaining in the alloted time period. - * When this time is up you'll have getRateLimit() available again. - */ - public function getRateLimitReset() - { - return $this->_rateLimitReset; - } - - /** - * The scope the user has - */ - public function getScope() - { - return $this->_scope; - } - - /** - * Internal function, parses out important information pnut.io adds - * to the headers. - */ - protected function parseHeaders(string $response) - { - // take out the headers - // set internal variables - // return the body/content - $this->_rateLimit = null; - $this->_rateLimitRemaining = null; - $this->_rateLimitReset = null; - $this->_scope = null; - - $response = explode("\r\n\r\n", $response, 2); - $headers = $response[0]; - - if ($headers === 'HTTP/1.1 100 Continue') { - $response = explode("\r\n\r\n", $response[1], 2); - $headers = $response[0]; - } - - // this is not a good way to parse http headers - // it will not (for example) take into account multiline headers - // but what we're looking for is pretty basic, so we can ignore those shortcomings - $headers = explode("\r\n", $headers); - foreach ($headers as $header) { - $header = explode(': ', $header, 2); - if (count($header) < 2) { - continue; - } - list($k, $v) = $header; - switch ($k) { - case 'X-RateLimit-Remaining': - $this->_rateLimitRemaining = $v; - break; - case 'X-RateLimit-Limit': - $this->_rateLimit = $v; - break; - case 'X-RateLimit-Reset': - $this->_rateLimitReset = $v; - break; - case 'X-OAuth-Scopes': - $this->_scope = $v; - $this->_scopes = explode(',', $v); - break; - } - } - return $response[1] ?? null; - } - - /** - * Internal function. Used to turn things like TRUE into 1, and then - * calls http_build_query. - */ - protected function buildQueryString(array $array): string - { - foreach ($array as $k => &$v) { - if (is_array($v)) { - $v = implode(',', $v); - } elseif ($v === true) { - $v = '1'; - } - elseif ($v === false) { - $v = '0'; - } - unset($v); - } - return http_build_query($array); - } - - - /** - * Internal function to handle all - * HTTP requests (POST,PUT,GET,DELETE) - * - * @param string|array $params - */ - protected function httpReq(string $act, string $req, $params = [], string $contentType='application/x-www-form-urlencoded') - { - $ch = curl_init($req); - $headers = []; - if($act !== 'get') { - curl_setopt($ch, CURLOPT_POST, true); - // if they passed an array, build a list of parameters from it - if (is_array($params) && $act !== 'post-raw') { - $params = $this->buildQueryString($params); - } - curl_setopt($ch, CURLOPT_POSTFIELDS, $params); - $headers[] = "Content-Type: {$contentType}"; - } - if($act !== 'post' && $act !== 'post-raw') { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($act)); - } - if($act === 'get' && isset($params['access_token'])) { - $headers[] = "Authorization: Bearer {$params['access_token']}"; - } elseif ($this->_accessToken) { - $headers[] = "Authorization: Bearer {$this->_accessToken}"; - } - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLINFO_HEADER_OUT, true); - curl_setopt($ch, CURLOPT_HEADER, true); - if ($this->_sslCA) { - curl_setopt($ch, CURLOPT_CAINFO, $this->_sslCA); - } - $this->_last_response = curl_exec($ch); - $this->_last_request = curl_getinfo($ch, CURLINFO_HEADER_OUT); - $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($http_status === 0) { - throw new phpnutException("Unable to connect to {$req}"); - } - if ($this->_last_request === false) { - if (!curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT)) { - throw new phpnutException('SSL verification failed, connection terminated.'); - } - } - if ($this->_last_response) { - $response = $this->parseHeaders($this->_last_response); - if ($response) { - $response = json_decode($response, true); - - if (isset($response['meta'])) { - if (isset($response['meta']['max_id'])) { - $this->_maxid = $response['meta']['max_id']; - $this->_minid = $response['meta']['min_id']; - } - if (isset($response['meta']['more'])) { - $this->_more = $response['meta']['more']; - } - if (isset($response['meta']['marker'])) { - $this->_last_marker = $response['meta']['marker']; - } - } - - // look for errors - if (isset($response['error'])) { - if (is_array($response['error'])) { - throw new phpnutException( - $response['error']['message'], - $response['error']['code'] - ); - } else { - throw new phpnutException($response['error']); - } - } - - // look for response migration errors - elseif (isset($response['meta'], $response['meta']['error_message'])) { - throw new phpnutException( - $response['meta']['error_message'], - $response['meta']['code'] - ); - } - } - } - - if ($http_status < 200 || $http_status >= 300) { - throw new phpnutException("HTTP error {$http_status}"); - } - - // if we've received a migration response, handle it and return data only - elseif ($this->_stripResponseEnvelope && isset($response['meta'], $response['data'])) { - return $response['data']; - } - - // else non response migration response, just return it - elseif (isset($response)) { - return $response; - } - - else { - throw new phpnutException('No response'); - } - } - - - /** - * Get max_id from last meta response data envelope - */ - public function getResponseMaxID() - { - return $this->_maxid; - } - - /** - * Get min_id from last meta response data envelope - */ - public function getResponseMinID() - { - return $this->_minid; - } - - /** - * Get more from last meta response data envelope - */ - public function getResponseMore() - { - return $this->_more; - } - - /** - * Get marker from last meta response data envelope - */ - public function getResponseMarker() - { - return $this->_last_marker; - } - - public function getLastRequest() - { - return $this->_last_request; - } - - public function getLastResponse() - { - return $this->_last_response; - } - - /** - * Fetch API configuration object - * @return array - */ - public function getConfig() - { - return $this->httpReq('get', "{$this->_baseUrl}sys/config"); - } - - /** - * Fetch basic API statistics - * @return array - */ - public function getStats() - { - return $this->httpReq('get', "{$this->_baseUrl}sys/stats"); - } - - /** - * Process user content, message or post text. - * Mentions and hashtags will be parsed out of the - * text, as will bare URLs. To create a link in the text without using a - * bare URL, include the anchor text in the object text and include a link - * entity in the function call. - * @param string $text The text of the user/message/post - * @param array $data An associative array of optional post data. This - * will likely change as the API evolves, as of this writing allowed keys are: - * reply_to, and raw. "raw" may be a complex object represented - * by an associative array. - * @param array $params An associative array of optional data to be included - * in the URL (such as 'include_raw') - * @return array An associative array representing the post. - */ - public function processText(string $text, array $data=[], array $params=[]) - { - $data['text'] = $text; - $json = json_encode($data); - $qs = ''; - if (!empty($params)) { - $qs = '?' . $this->buildQueryString($params); - } - return $this->httpReq( - 'post', - $this->_baseUrl . 'text/process' . $qs, - $json, - 'application/json' - ); - } - - /** - * Create a new Post object. Mentions and hashtags will be parsed out of the - * post text, as will bare URLs. To create a link in a post without using a - * bare URL, include the anchor text in the post's text and include a link - * entity in the post creation call. - * @param string $text The text of the post - * @param array $data An associative array of optional post data. This - * will likely change as the API evolves, as of this writing allowed keys are: - * reply_to, is_nsfw, and raw. "raw" may be a complex object represented - * by an associative array. - * @param array $params An associative array of optional data to be included - * in the URL (such as 'include_raw') - * @return array An associative array representing the post. - */ - public function createPost(string $text, array $data=[], array $params=[]) - { - $data['text'] = $text; - $json = json_encode($data); - $qs = ''; - if (!empty($params)) { - $qs = '?' . $this->buildQueryString($params); - } - return $this->httpReq( - 'post', - $this->_baseUrl . 'posts' . $qs, - $json, - 'application/json' - ); - } - - /** - * Create a new Post object. Mentions and hashtags will be parsed out of the - * post text, as will bare URLs. To create a link in a post without using a - * bare URL, include the anchor text in the post's text and include a link - * entity in the post creation call. - * @param integer $post_id The ID of the post to revise - * @param string $text The new text of the post - * @param array $data An associative array of optional post data. This - * will likely change as the API evolves, as of this writing allowed keys are: - * is_nsfw. - * @param array $params An associative array of optional data to be included - * in the URL (such as 'include_raw') - * @return array An associative array representing the post. - */ - public function revisePost(int $post_id, string $text, array $data=[], array $params=[]) - { - $data['text'] = $text; - $json = json_encode($data); - $qs = ''; - if (!empty($params)) { - $qs = '?' . $this->buildQueryString($params); - } - return $this->httpReq( - 'put', - $this->_baseUrl . 'posts/' . urlencode($post_id) . $qs, - $json, - 'application/json' - ); - } - - /** - * Returns a specific Post. - * @param integer $post_id The ID of the post to retrieve - * @param array $params An associative array of optional general parameters. - * @return array An associative array representing the post - */ - public function getPost(int $post_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns a list of Posts. - * @param array $post_ids The list of post IDs to retrieve - * @param array $params An associative array of optional general parameters. - * @return array An array of arrays representing the posts - */ - public function getMultiplePosts(array $post_ids, array $params=[]) - { - $params['ids'] = $post_ids; - - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts?' . $this->buildQueryString($params) - ); - } - - /** - * Delete a Post. The current user must be the same user who created the Post. - * It returns the deleted Post on success. - * @param integer $post_id The ID of the post to delete - * @return array An associative array representing the post that was deleted - */ - public function deletePost(int $post_id) - { - return $this->httpReq( - 'delete', - $this->_baseUrl . 'posts/' . urlencode($post_id) - ); - } - - /** - * Retrieve the Posts that are 'in reply to' a specific Post. - * @param integer $post_id The ID of the post you want to retrieve replies for. - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getPostThread(int $post_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/thread?' - . $this->buildQueryString($params) - ); - } - - /** - * Retrieve revisions of a post. Currently only one can be created. - * @param integer $post_id The ID of the post you want to retrieve previous revisions of. - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getPostRevisions(int $post_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/revisions?' - . $this->buildQueryString($params) - ); - } - - /** - * Get the most recent Posts created by a specific User in reverse - * chronological order (most recent first). - * @param string|int $user_id $user_id Either the ID of the user you wish to retrieve posts by, - * or the string "me", which will retrieve posts for the user you're authenticated - * as. - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getUserPosts($user_id = 'me', array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/posts?' - . $this->buildQueryString($params) - ); - } - - /** - * Get the most recent Posts mentioning by a specific User in reverse - * chronological order (newest first). - * @param string|int $user_id Either the ID of the user who is being mentioned, or - * the string "me", which will retrieve posts for the user you're authenticated - * as. - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getUserMentions($user_id='me', array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/mentions?' - . $this->buildQueryString($params) - ); - } - - /** - * Get the currently authenticated user's recent messages - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getUserMessages(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/me/messages?' - . $this->buildQueryString($params) - ); - } - - /** - * Return the 20 most recent posts from the current User and - * the Users they follow. - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getUserStream(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/me?' - . $this->buildQueryString($params) - ); - } - - /** - * Retrieve a list of all public Posts on pnut.io, often referred to as the - * global stream. - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getPublicPosts(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/global?' - . $this->buildQueryString($params) - ); - } - - /** - * Retrieve a list of "explore" streams - * @return array An array of associative arrays, each representing a single explore stream. - */ - public function getPostExploreStreams() - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/explore' - ); - } - - /** - * Retrieve a list of posts from an "explore" stream on pnut.io. - * @param string $slug [] - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single post. - */ - public function getPostExploreStream(string $slug, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/explore/' . urlencode($slug) . '?' - . $this->buildQueryString($params) - ); - } - - /** - * Bookmark a post - * @param integer $post_id The post ID to bookmark - */ - public function bookmarkPost(int $post_id) - { - return $this->httpReq( - 'put', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/bookmark' - ); - } - - /** - * Unbookmark a post - * @param integer $post_id The post ID to unbookmark - */ - public function unbookmarkPost(int $post_id) - { - return $this->httpReq( - 'delete', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/bookmark' - ); - } - - /** - * List the posts bookmarked by the current user - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: count, before_id, since_id, include_muted, include_deleted, - * and include_post_raw. - * See https://github.com/phpnut/api-spec/blob/master/resources/posts.md#general-parameters - * @param string|int $user_id - * @return array An array of associative arrays, each representing a single - * user who has bookmarked a post - */ - public function getBookmarked($user_id='me', array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/bookmarks?' - . $this->buildQueryString($params) - ); - } - - /** - * List the interactions with a post (bookmark, repost, reply) - * @param integer $post_id the post ID to get interactions from - * @param array $params optional parameters like filters or excludes - * @return array An array of associative arrays, each representing one post interaction. - */ - public function getPostInteractions(int $post_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/interactions?' - . $this->buildQueryString($params) - ); - } - - /** - * List the bookmarks of a post - * @param integer $post_id the post ID to get stars from - * @return array An array of associative arrays, each representing one bookmark action. - */ - public function getPostBookmarks(int $post_id) - { - return $this->getPostInteractions($post_id, ['filters'=>['bookmark']]); - } - - /** - * Returns an array of User objects of users who reposted the specified post. - * @param integer $post_id the post ID to - * @return array An array of associative arrays, each representing a single - * user who reposted $post_id - */ - public function getPostReposts(int $post_id) - { - return $this->getPostInteractions($post_id, ['filters'=>['repost']]); - } - - /** - * Repost an existing Post object. - * @param integer $post_id The id of the post - * @return mixed the reposted post - */ - public function repost(int $post_id) - { - return $this->httpReq( - 'put', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/repost' - ); - } - - /** - * Delete a post that the user has reposted. - * @param integer $post_id The id of the post - * @return mixed the un-reposted post - */ - public function deleteRepost(int $post_id) - { - return $this->httpReq( - 'delete', - $this->_baseUrl . 'posts/' . urlencode($post_id) . '/repost' - ); - } - - /** - * Return Posts matching a specific #hashtag. - * @param string $hashtag The hashtag you're looking for. - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: count, before_id, since_id, include_muted, include_deleted, - * include_directed_posts, and include_raw. - * @return array An array of associative arrays, each representing a single post. - */ - public function searchHashtags(string $hashtag, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/tags/' . urlencode($hashtag) . '?' - . $this->buildQueryString($params) - ); - } - - /** - * List the posts who match a specific search term - * @param array $params a list of filter, search query, and general Post parameters - * see: https://docs.pnut.io/resources/posts/search - * @param string $query The search query. Supports - * normal search terms. Searches post text. - * @return string|array|false An array of associative arrays, each representing one post. - * or false on error - */ - public function searchPosts(array $params=[], string $query='', string $order='default') - { - if (!is_array($params)) { - return false; - } - if (!empty($query)) { - $params['q'] = $query; - } - if ($order === 'default') { - if (!empty($query)) { - $params['order'] = 'relevance'; - } else { - $params['order'] = 'id'; - } - } - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/search?' . $this->buildQueryString($params) - ); - } - - /** - * Return the 20 most recent posts for a stream using a valid Token - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: count, before_id, since_id, include_muted, include_deleted, - * and include_post_raw. - * @return array An array of associative arrays, each representing a single post. - */ - public function getUserPersonalStream(array $params=[]) - { - if ($params['access_token']) { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/me?' - . $this->buildQueryString($params), - $params - ); - } else { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/me?' - . $this->buildQueryString($params) - ); - } - } - - /** - * Return the 20 most recent Posts from the current User's personalized stream - * and mentions stream merged into one stream. - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: count, before_id, since_id, include_muted, include_deleted, - * include_directed_posts, and include_raw. - * @return array An array of associative arrays, each representing a single post. - */ - public function getUserUnifiedStream(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'posts/streams/unified?' - . $this->buildQueryString($params) - ); - } - - /** - * List User interactions - */ - public function getMyActions(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/me/interactions?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns a specific user object. - * @param string|int $user_id The ID of the user you want to retrieve, or the string "@-username", or the string - * "me" to retrieve data for the users you're currently authenticated as. - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: include_raw|include_user_raw. - * @return array An associative array representing the user data. - */ - public function getUser($user_id='me', array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns multiple users request by an array of user ids - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: include_raw|include_user_raw. - * @return array An associative array representing the users data. - */ - public function getUsers(array $user_arr, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users?ids=' . implode(',', $user_arr) - . '&' . $this->buildQueryString($params) - ); - } - - /** - * Add the specified user ID to the list of users followed. - * Returns the User object of the user being followed. - * @param string|int $user_id The user ID of the user to follow. - * @return array An associative array representing the user you just followed. - */ - public function followUser($user_id) - { - return $this->httpReq( - 'put', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/follow' - ); - } - - /** - * Removes the specified user ID to the list of users followed. - * Returns the User object of the user being unfollowed. - * @param string|int $user_id The user ID of the user to unfollow. - * @return array An associative array representing the user you just unfollowed. - */ - public function unfollowUser($user_id) - { - return $this->httpReq( - 'delete', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/follow' - ); - } - - /** - * Returns an array of User objects the specified user is following. - * @param string|int $user_id Either the ID of the user being followed, or - * the string "me", which will retrieve posts for the user you're authenticated - * as. - * @return array An array of associative arrays, each representing a single - * user following $user_id - */ - public function getFollowing($user_id='me', array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/following?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns an array of User ids the specified user is following. - * @param string|int $user_id Either the ID of the user being followed, or - * the string "me", which will retrieve posts for the user you're authenticated - * as. - * @return array user ids the specified user is following. - */ - public function getFollowingIDs($user_id='me') - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}users/{$user_id}/following?include_user=0" - ); - } - - /** - * Returns an array of User objects for users following the specified user. - * @param string|int $user_id Either the ID of the user being followed, or - * the string "me", which will retrieve posts for the user you're authenticated - * as. - * @return array An array of associative arrays, each representing a single - * user following $user_id - */ - public function getFollowers($user_id='me', array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/followers?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns an array of User ids for users following the specified user. - * @param string|int $user_id Either the ID of the user being followed, or - * the string "me", which will retrieve posts for the user you're authenticated - * as. - * @return array user ids for users following the specified user - */ - public function getFollowersIDs($user_id='me') - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}users/{$user_id}/followers?include_user=0" - ); - } - - /** - * Retrieve a user's user ID by specifying their username. - * @param string $username The username of the user you want the ID of, without - * an @ symbol at the beginning. - * @return integer The user's user ID - */ - public function getIdByUsername(string $username) - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}users/@{$username}?include_user=0" - ); - } - - /** - * Mute a user - * @param string|int $user_id The user ID to mute - */ - public function muteUser($user_id) - { - return $this->httpReq( - 'put', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/mute' - ); - } - - /** - * Unmute a user - * @param string|int $user_id The user ID to unmute - */ - public function unmuteUser($user_id) - { - return $this->httpReq( - 'delete', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/mute' - ); - } - - /** - * List the users muted by the current user - * @return array An array of associative arrays, each representing one muted user. - */ - public function getMuted() - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}users/me/muted" - ); - } - - /** - * Get a user object by username - * @param string $name the @name to get - * @return array representing one user - */ - public function getUserByName(string $name) - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}users/@{$name}" - ); - } - - /** - * List the users who match a specific search term - * @param string $query The search query. Supports @username or #tag searches as - * well as normal search terms. Searches username, display name, bio information. - * Does not search posts. - * @return array|false An array of associative arrays, each representing one user. - */ - public function searchUsers(array $params=[], string $query='') - { - if (!is_array($params)) { - return false; - } - if ($query === '') { - return false; - } - $params['q'] = $query; - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/search?q=' . $this->buildQueryString($params) - ); - } - - /** - * Update Profile Data via JSON - * @data array containing user descriptors - */ - public function updateUserData(array $data=[], array $params=[]) - { - $json = json_encode($data); - return $this->httpReq( - 'put', - $this->_baseUrl . 'users/me?' - . $this->buildQueryString($params), - $json, - 'application/json' - ); - } - - /** - * Update a user image - * @image path reference to image - * @which avatar|cover - */ - protected function updateUserImage(string $image, string $which='avatar') - { - $mimeType = ''; - - $test = @getimagesize($image); - if ($test && array_key_exists('mime', $test)) { - $mimeType = $test['mime']; - } - $data = [ - $which => new CURLFile($image, $mimeType) - ]; - return $this->httpReq( - 'post-raw', - "{$this->_baseUrl}users/me/{$which}", - $data, - 'multipart/form-data' - ); - } - - public function updateUserAvatar($avatar) - { - return $this->updateUserImage('avatar', $avatar); - } - - public function updateUserCover($cover) - { - return $this->updateUserImage('cover', $cover); - } - - /** - * Returns a Client object - * @param string $client_id - * @return array An array representing the client - */ - public function getClient(string $client_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'clients/' . urlencode($client_id) . '?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns a list of truncated client details made by a user - * @param string $user_id - * @return array A list of arrays representing clients - */ - public function getUserClients(string $user_id) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/' . urlencode($user_id) . '/clients' - ); - } - - /** - * update stream marker - */ - public function updateStreamMarker(array $data=[]) - { - $json = json_encode($data); - return $this->httpReq( - 'post', - "{$this->_baseUrl}markers", - $json, - 'application/json' - ); - } - - /** - * get a page of current user subscribed channels - */ - public function getMyChannelSubscriptions(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/me/channels/subscribed?' . $this->buildQueryString($params) - ); - } - - /** - * get user channels - */ - public function getMyChannels(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/me/channels?' . $this->buildQueryString($params) - ); - } - - /** - * create a channel - * note: you cannot create a channel with type=io.pnut.core.pm (see createMessage) - */ - public function createChannel(array $data=[]) - { - $json = json_encode($data); - return $this->httpReq( - 'post', - "{$this->_baseUrl}channels", - $json, - 'application/json' - ); - } - - /** - * get channelid info - */ - public function getChannel(int $channelid, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels/' . $channelid . '?' - . $this->buildQueryString($params) - ); - } - - /** - * get an existing private message channel between multiple users - * @param string|array $users Can be a comma- or space-separated string, or an array. - * Usernames with @-symbol, or user ids. - */ - public function getExistingPM($users, array $params=[]) - { - if (is_string($users)) { - $users = explode(',', str_replace(' ', ',', $users)); - } - foreach($users as $key=>$user) { - if (!is_numeric($user) && substr($user, 0, 1) !== '@') { - $users[$key] = "@{$user}"; - } - } - $params['ids'] = $users; - return $this->httpReq( - 'get', - $this->_baseUrl . 'users/me/channels/existing_pm?' - . $this->buildQueryString($params) - ); - } - - /** - * get multiple channels' info by an array of channelids - */ - public function getChannels(array $channels, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels?ids=' . implode(',', $channels) . '&' - . $this->buildQueryString($params) - ); - } - - /** - * update channelid - */ - public function updateChannel(int $channelid, array $data=[]) - { - $json = json_encode($data); - return $this->httpReq( - 'put', - "{$this->_baseUrl}channels/{$channelid}", - $json, - 'application/json' - ); - } - - /** - * subscribe from channelid - */ - public function channelSubscribe(int $channelid) - { - return $this->httpReq( - 'put', - $this->_baseUrl.'channels/'.$channelid.'/subscribe' - ); - } - - /** - * unsubscribe from channelid - */ - public function channelUnsubscribe(int $channelid) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'channels/'.$channelid.'/subscribe' - ); - } - - /** - * mute channelid - */ - public function channelMute(int $channelid) - { - return $this->httpReq( - 'put', - $this->_baseUrl.'channels/'.$channelid.'/mute' - ); - } - - /** - * unmute channelid - */ - public function channelUnmute(int $channelid) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'channels/'.$channelid.'/mute' - ); - } - - /** - * get all user objects subscribed to channelid - */ - public function getChannelSubscriptions(int $channelid, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'channels/'.$channelid.'/subscribers?' - . $this->buildQueryString($params) - ); - } - - /** - * get all user IDs subscribed to channelid - */ - public function getChannelSubscriptionsById(int $channelid) - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}channels/{$channelid}/subscribers?include_user=0" - ); - } - - /** - * Retrieve a list of "explore" streams - * @return array An array of associative arrays, each representing a single explore stream. - */ - public function getChannelExploreStreams() - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels/streams/explore' - ); - } - - /** - * Retrieve a list of channels from an "explore" stream on pnut.io. - * @param string $slug [] - * @param array $params An associative array of optional general parameters. - * @return array An array of associative arrays, each representing a single channel. - */ - public function getChannelExploreStream(string $slug, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels/streams/explore/' . urlencode($slug) . '?' - . $this->buildQueryString($params) - ); - } - - /** - * mark channel inactive - */ - public function deleteChannel(int $channelid) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'channels/'.$channelid - ); - } - - /** - * List the channels that match a specific search term - * @param array $params a list of filter, search query, and general Channel parameters - * see: https://docs.pnut.io/resources/channels/search - * @param string $query The search query. Supports - * normal search terms. Searches common channel raw. - * @return array An array of associative arrays, each representing one channel. - * or false on error - */ - public function searchChannels(array $params=[], string $query='', string $order='default') - { - if (!empty($query)) { - $params['q'] = $query; - } - if ($order === 'default') { - if (!empty($query)) { - $params['order'] = 'id'; - } else { - $params['order'] = 'activity'; - } - } - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels/search?' . $this->buildQueryString($params) - ); - } - - - /** - * get a page of messages in channelid - */ - public function getMessages(int $channelid, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'channels/'.$channelid.'/messages?' - . $this->buildQueryString($params) - ); - } - - /** - * get a page of messages in channelid in a thread - */ - public function getMessageThread(int $channelid, int $messageid, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid.'/thread?' - . $this->buildQueryString($params) - ); - } - - /** - * get a page of sticky messages in channelid - */ - public function getStickyMessages(int $channelid, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'channels/'.$channelid.'/sticky_messages?' - . $this->buildQueryString($params) - ); - } - - /** - * sticky messsage - */ - public function stickyMessage(int $channelid, int $messageid) - { - return $this->httpReq( - 'put', - $this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid.'/sticky' - ); - } - - /** - * unsticky messsage - */ - public function unstickyMessage(int $channelid, int $messageid) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid.'/sticky' - ); - } - - /** - * create message - * @param string|int $channelid numeric or "pm" for auto-channel (type=io.pnut.core.pm) - * @param array $data array('text'=>'YOUR_MESSAGE') If a type=io.pnut.core.pm, then "destinations" key can be set to address as an array of people to send this PM too - * @param array $params query parameters - */ - public function createMessage($channelid, array $data, array $params=[]) - { - if (isset($data['destinations'])) { - if (is_string($data['destinations'])) { - $data['destinations'] = explode(',', str_replace(' ', ',', $data['destinations'])); - } - foreach($data['destinations'] as $key=>$user) { - if (!is_numeric($user) && substr($user, 0,1 ) !== '@') { - $data['destinations'][$key] = "@{$user}"; - } - } - } - $json = json_encode($data); - return $this->httpReq( - 'post', - $this->_baseUrl.'channels/'.$channelid.'/messages?' - . $this->buildQueryString($params), - $json, - 'application/json' - ); - } - - /** - * get message - */ - public function getMessage(int $channelid, int $messageid, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid.'?' - . $this->buildQueryString($params) - ); - } - - /** - * Returns a list of Messages. - * @param array $message_ids The list of message IDs to retrieve - * @param array $params An associative array of optional general parameters. - * @return array An array of arrays representing the messages - */ - public function getMultipleMessages(array $message_ids, array $params=[]) - { - $params['ids'] = $message_ids; - - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels/messages?' . $this->buildQueryString($params) - ); - } - - /** - * delete messsage - */ - public function deleteMessage(int $channelid, int $messageid) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'channels/'.$channelid.'/messages/'.$messageid - ); - } - - /** - * List the messages that match a specific search term - * @param array $params a list of filter, search query, and general Message parameters - * see: https://docs.pnut.io/resources/messages/search - * @param string $query The search query. Supports - * normal search terms. Searches common channel raw. - * @return string|array|false An array of associative arrays, each representing one channel. - * or false on error - */ - public function searchMessages(array $params=[], string $query='', string $order='default') - { - if (!is_array($params)) { - return false; - } - if (!empty($query)) { - $params['q'] = $query; - } - if ($order === 'default') { - if (!empty($query)) { - $params['order'] = 'id'; - } else { - $params['order'] = 'relevance'; - } - } - return $this->httpReq( - 'get', - $this->_baseUrl . 'channels/messages/search?' - . $this->buildQueryString($params) - ); - } - - /** - * Upload a file to a user's file store - * @param string $file A string containing the path of the file to upload. - * @param array $data Additional data about the file you're uploading. At the - * moment accepted keys are: mime-type, kind, type, name, public and raw. - * - If you don't specify mime-type, phpnut will attempt to guess the mime type - * based on the file, however this isn't always reliable. - * - If you don't specify kind phpnut will attempt to determine if the file is - * an image or not. - * - If you don't specify name, phpnut will use the filename of the first - * parameter. - * - If you don't specify is_public, your file will be uploaded as a private file. - * - Type is REQUIRED. - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: include_raw|include_file_raw. - * @return array An associative array representing the file - */ - public function createFile($file, array $data, array $params=[]) - { - if (!$file) { - throw new phpnutException('You must specify a path to a file'); - } - if (!file_exists($file)) { - throw new phpnutException('File path specified does not exist'); - } - if (!is_readable($file)) { - throw new phpnutException('File path specified is not readable'); - } - if (!array_key_exists('type', $data) || !$data['type']) { - throw new phpnutException('Type is required when creating a file'); - } - if (!array_key_exists('name', $data)) { - $data['name'] = basename($file); - } - if (array_key_exists('mime-type', $data)) { - $mimeType = $data['mime-type']; - unset($data['mime-type']); - } else { - $mimeType = null; - } - if (!array_key_exists('kind', $data)) { - $test = @getimagesize($file); - if ($test && array_key_exists('mime', $test)) { - $data['kind'] = 'image'; - if (!$mimeType) { - $mimeType = $test['mime']; - } - } - else { - $data['kind'] = 'other'; - } - } - if (!$mimeType) { - $finfo = finfo_open(FILEINFO_MIME_TYPE); - $mimeType = finfo_file($finfo, $file); - finfo_close($finfo); - } - if (!$mimeType) { - throw new phpnutException('Unable to determine mime type of file, try specifying it explicitly'); - } - $data['content'] = new \CurlFile($file, $mimeType); - return $this->httpReq( - 'post-raw', - "{$this->_baseUrl}files", - $data, - 'multipart/form-data' - ); - } - - public function createFilePlaceholder($file, array $params=[]) - { - $name = basename($file); - $data = [ - 'raw' => $params['raw'], - 'kind' => $params['kind'], - 'name' => $name, - 'type' => $params['metadata'] - ]; - $json = json_encode($data); - return $this->httpReq( - 'post', - $this->_baseUrl.'files', - $json, - 'application/json' - ); - } - - public function updateFileContent(int $fileid, string $file) - { - $data = file_get_contents($file); - $finfo = finfo_open(FILEINFO_MIME_TYPE); - $mime = finfo_file($finfo, $file); - finfo_close($finfo); - return $this->httpReq( - 'put', - $this->_baseUrl.'files/'.$fileid.'/content', - $data, - $mime - ); - } - - /** - * Allows for file rename and annotation changes. - * @param integer $file_id The ID of the file to update - * @param array $params An associative array of file parameters. - * @return array An associative array representing the updated file - */ - public function updateFile(int $file_id, array $params=[]) - { - $data = [ - 'raw' => $params['raw'], - 'name' => $params['name'], - ]; - $json = json_encode($data); - return $this->httpReq( - 'put', - $this->_baseUrl.'files/'.urlencode($file_id), - $json, - 'application/json' - ); - } - - /** - * Returns a specific File. - * @param integer $file_id The ID of the file to retrieve - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: include_raw|include_file_raw. - * @return array An associative array representing the file - */ - public function getFile(int $file_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'files/'.urlencode($file_id).'?' - . $this->buildQueryString($params) - ); - } - - public function getFileContent(int $file_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'files/'.urlencode($file_id).'/content?' - . $this->buildQueryString($params) - ); - } - - /** $file_key : derived_file_key */ - public function getDerivedFileContent(int $file_id, string $file_key, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'files/'.urlencode($file_id).'/content/'.urlencode($file_key).'?'.$this->buildQueryString($params) - ); - } - - /** - * Returns file objects. - * @param array $file_ids The IDs of the files to retrieve - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: include_raw|include_file_raw. - * @return array An associative array representing the file data. - */ - public function getFiles(array $file_ids, array $params=[]) - { - $ids = ''; - foreach($file_ids as $id) { - $ids .= $id . ','; - } - $params['ids'] = substr($ids, 0, -1); - return $this->httpReq( - 'get', - $this->_baseUrl.'files?'.$this->buildQueryString($params) - ); - } - - /** - * Returns a user's file objects. - * @param array $params An associative array of optional general parameters. - * This will likely change as the API evolves, as of this writing allowed keys - * are: include_raw|include_file_raw|include_user_raw. - * @return array An associative array representing the file data. - */ - public function getUserFiles(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'users/me/files?'.$this->buildQueryString($params) - ); - } - - /** - * Delete a File. The current user must be the same user who created the File. - * It returns the deleted File on success. - * @param integer $file_id The ID of the file to delete - * @return array An associative array representing the file that was deleted - */ - public function deleteFile(int $file_id) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'files/'.urlencode($file_id) - ); - } - - /** - * Create a poll - * @param array $data An associative array of the required parameters. - * @param array $params An associative array of optional general parameters. - * Allowed keys: include_raw,include_poll_raw, ... - * @return array An associative array representing the poll - */ - public function createPoll(array $data, array $params=[]) - { - $json = json_encode($data); - return $this->httpReq( - 'post', - $this->_baseUrl.'polls?'.$this->buildQueryString($params), - $json, - 'application/json' - ); - } - - /** - * Responds to a poll. - * @param integer $poll_id The ID of the poll to respond to - * @param array $positions list of positions for the poll response - * @param array $params An associative array of optional general parameters. - */ - public function respondToPoll(int $poll_id, array $positions, array $params=[]) - { - $json = json_encode(['positions' => $positions]); - return $this->httpReq( - 'put', - $this->_baseUrl.'polls/'.urlencode($poll_id).'/response?'.$this->buildQueryString($params), - $json, - 'application/json' - ); - } - - /** - * Returns a specific Poll. - * @param integer $poll_id The ID of the poll to retrieve - * @param array $params An associative array of optional general parameters. - * @return array An associative array representing the poll - */ - public function getPoll(int $poll_id, array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'polls/'.urlencode($poll_id).'?'.$this->buildQueryString($params) - ); - } - - /** - * Returns a list of Polls. - * @param array $poll_ids The list of poll IDs to retrieve - * @param array $params An associative array of optional general parameters. - * @return array An array of arrays representing the polls - */ - public function getMultiplePolls(array $poll_ids, array $params=[]) - { - $params['ids'] = $poll_ids; - - return $this->httpReq( - 'get', - $this->_baseUrl . 'polls?' . $this->buildQueryString($params) - ); - } - - /** - * Returns a user's poll objects. - * @param array $params An associative array of optional general parameters. - * @return array An associative array representing the poll data. - */ - public function getUserPolls(array $params=[]) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'users/me/polls?'.$this->buildQueryString($params) - ); - } - - /** - * Delete a Poll. The current user must be the same user who created the Poll. - * @param integer $poll_id The ID of the poll to delete - * @param array $params An associative array of optional general parameters. - * @return array An associative array representing the poll that was deleted - */ - public function deletePoll(int $poll_id, array $params=[]) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'polls/'.urlencode($poll_id).'?'.$this->buildQueryString($params) - ); - } - - /** - * List the polls that match a specific search term - * @param array $params a list of filter, search query, and general Poll parameters - * see: https://docs.pnut.io/resources/channels/search - * @return array An array of associative arrays, each representing one poll. - * or false on error - */ - public function searchPolls(array $params=[], string $order='id') - { - $params['order'] = $order; - - return $this->httpReq( - 'get', - $this->_baseUrl . 'polls/search?' . $this->buildQueryString($params) - ); - } - - - /** - * Get Application Information - */ - public function getAppTokenInfo() - { - // requires appAccessToken - if (!$this->_appAccessToken) { - $this->getAppAccessToken(); - } - // ensure request is made with our appAccessToken - $params['access_token'] = $this->_appAccessToken; - return $this->httpReq( - 'get', - "{$this->_baseUrl}token", - $params - ); - } - - /** - * Get User Information - */ - public function getUserTokenInfo() - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}token" - ); - } - - /** - * Get Application Authorized User IDs - */ - public function getAppUserIDs() - { - // requires appAccessToken - if (!$this->_appAccessToken) { - $this->getAppAccessToken(); - } - // ensure request is made with our appAccessToken - $params['access_token'] = $this->_appAccessToken; - return $this->httpReq( - 'get', - "{$this->_baseUrl}apps/me/users/ids", - $params - ); - } - - /** - * Get Application Authorized User Tokens - */ - public function getAppUserTokens() - { - // requires appAccessToken - if (!$this->_appAccessToken) { - $this->getAppAccessToken(); - } - // ensure request is made with our appAccessToken - $params['access_token'] = $this->_appAccessToken; - return $this->httpReq( - 'get', - "{$this->_baseUrl}apps/me/users/tokens", - $params - ); - } - - /** - * Registers your function (or an array of object and method) to be called - * whenever an event is received via an open pnut.io stream. Your function - * will receive a single parameter, which is the object wrapper containing - * the meta and data. - * @param mixed $function A PHP callback (either a string containing the function name, - * or an array where the first element is the class/object and the second - * is the method). - */ - public function registerStreamFunction($function): void - { - $this->_streamCallback = $function; - } - - /** - * Opens a stream that's been created for this user/app and starts sending - * events/objects to your defined callback functions. You must define at - * least one callback function before opening a stream. - * @param mixed $stream Either a stream ID or the endpoint of a stream - * you've already created. This stream must exist and must be valid for - * your current access token. If you pass a stream ID, the library will - * make an API call to get the endpoint. - * - * This function will return immediately, but your callback functions - * will continue to receive events until you call closeStream() or until - * pnut.io terminates the stream from their end with an error. - * - * If you're disconnected due to a network error, the library will - * automatically attempt to reconnect you to the same stream, no action - * on your part is necessary for this. However if the pnut.io API returns - * an error, a reconnection attempt will not be made. - * - * Note there is no closeStream, because once you open a stream you - * can't stop it (unless you exit() or die() or throw an uncaught - * exception, or something else that terminates the script). - * @return boolean True - * @see createStream() - */ - public function openStream($stream): bool - { - // if there's already a stream running, don't allow another - if ($this->_currentStream) { - throw new phpnutException('There is already a stream being consumed, only one stream can be consumed per phpnutStream instance'); - } - // must register a callback (or the exercise is pointless) - if (!$this->_streamCallback) { - throw new phpnutException('You must define your callback function using registerStreamFunction() before calling openStream'); - } - // if the stream is a numeric value, get the stream info from the api - if (is_numeric($stream)) { - $stream = $this->getStream($stream); - $this->_streamUrl = $stream['endpoint']; - } - else { - $this->_streamUrl = $stream; - } - // continue doing this until we get an error back or something...? - $this->httpStream( - 'get', - $this->_streamUrl - ); - return true; - } - - /** - * Close the currently open stream. - */ - public function closeStream(): void - { - if (!$this->_lastStreamActivity) { - // never opened - return; - } - if (!$this->_multiStream) { - throw new phpnutException('You must open a stream before calling closeStream()'); - } - curl_close($this->_currentStream); - curl_multi_remove_handle($this->_multiStream, $this->_currentStream); - curl_multi_close($this->_multiStream); - $this->_currentStream = null; - $this->_multiStream = null; - } - - /** - * Retrieve all streams for the current access token. - * @return array An array of stream definitions. - */ - public function getAllStreams() - { - return $this->httpReq( - 'get', - "{$this->_baseUrl}streams" - ); - } - - /** - * Returns a single stream specified by a stream ID. The stream must have been - * created with the current access token. - * @return array A stream definition - */ - public function getStream(string $streamId) - { - return $this->httpReq( - 'get', - $this->_baseUrl.'streams/'.urlencode($streamId) - ); - } - - /** - * Creates a stream for the current app access token. - * - * @param array $objectTypes The objects you want to retrieve data for from the - * stream. At time of writing these can be 'post', 'bookmark', 'user_follow', 'mute', 'block', 'stream_marker', 'message', 'channel', 'channel_subscription', 'token', and/or 'user'. - * If you don't specify, a few standard events will be retrieved. - */ - public function createStream(?array $objectTypes=null) - { - // default object types to everything - if (is_null($objectTypes)) { - $objectTypes = [ - 'post', - 'bookmark', - 'user_follow', - ]; - } - $data = [ - 'object_types'=>$objectTypes, - 'type'=>'long_poll', - ]; - $data = json_encode($data); - $response = $this->httpReq( - 'post', - "{$this->_baseUrl}streams", - $data, - 'application/json' - ); - return $response; - } - - /** - * Update stream for the current app access token - * - * @param string $streamId The stream ID to update. This stream must have been - * created by the current access token. - * @param array $data allows object_types, type, filter_id and key to be updated. filter_id/key can be omitted - */ - public function updateStream(string $streamId, array $data) - { - // objectTypes is likely required - if (is_null($data['object_types'])) { - $data['object_types'] = [ - 'post', - 'bookmark', - 'user_follow', - ]; - } - // type can still only be long_poll - if (is_null($data['type'])) { - $data['type'] = 'long_poll'; - } - $data = json_encode($data); - $response = $this->httpReq( - 'put', - $this->_baseUrl.'streams/'.urlencode($streamId), - $data, - 'application/json' - ); - return $response; - } - - /** - * Deletes a stream if you no longer need it. - * - * @param string $streamId The stream ID to delete. This stream must have been - * created by the current access token. - */ - public function deleteStream(string $streamId) - { - return $this->httpReq( - 'delete', - $this->_baseUrl.'streams/'.urlencode($streamId) - ); - } - - /** - * Deletes all streams created by the current access token. - */ - public function deleteAllStreams() - { - return $this->httpReq( - 'delete', - "{$this->_baseUrl}streams" - ); - } - - /** - * Internal function used to process incoming chunks from the stream. This is only - * public because it needs to be accessed by CURL. Do not call or use this function - * in your own code. - * @ignore - */ - public function httpStreamReceive($ch, $data) - { - $this->_lastStreamActivity = time(); - $this->_streamBuffer .= $data; - if (!$this->_streamHeaders) { - $pos = strpos($this->_streamBuffer, "\r\n\r\n"); - if ($pos !== false) { - $this->_streamHeaders = substr($this->_streamBuffer, 0, $pos); - $this->_streamBuffer = substr($this->_streamBuffer, $pos+4); - } - } else { - $pos = strpos($this->_streamBuffer, "\r\n"); - while ($pos !== false) { - $command = substr($this->_streamBuffer, 0, $pos); - $this->_streamBuffer = substr($this->_streamBuffer, $pos+2); - $command = json_decode($command, true); - if ($command) { - call_user_func($this->_streamCallback, $command); - } - $pos = strpos($this->_streamBuffer, "\r\n"); - } - } - return strlen($data); - } - - /** - * Opens a long lived HTTP connection to the pnut.io servers, and sends data - * received to the httpStreamReceive function. As a general rule you should not - * directly call this method, it's used by openStream(). - */ - protected function httpStream(string $act, $req, array $params=[], string $contentType='application/x-www-form-urlencoded'): void - { - if ($this->_currentStream) { - throw new phpnutException('There is already an open stream, you must close the existing one before opening a new one'); - } - $headers = []; - $this->_streamBuffer = ''; - if ($this->_accessToken) { - $headers[] = "Authorization: Bearer {$this->_accessToken}"; - } - $this->_currentStream = curl_init($req); - curl_setopt($this->_currentStream, CURLOPT_HTTPHEADER, $headers); - curl_setopt($this->_currentStream, CURLOPT_RETURNTRANSFER, true); - curl_setopt($this->_currentStream, CURLINFO_HEADER_OUT, true); - curl_setopt($this->_currentStream, CURLOPT_HEADER, true); - if ($this->_sslCA) { - curl_setopt($this->_currentStream, CURLOPT_CAINFO, $this->_sslCA); - } - // every time we receive a chunk of data, forward it to httpStreamReceive - curl_setopt($this->_currentStream, CURLOPT_WRITEFUNCTION, array($this, 'httpStreamReceive')); - // curl_exec($ch); - // return; - $this->_multiStream = curl_multi_init(); - $this->_lastStreamActivity = time(); - curl_multi_add_handle($this->_multiStream, $this->_currentStream); - } - - public function reconnectStream(): void - { - $this->closeStream(); - $this->_connectFailCounter++; - // if we've failed a few times, back off - if ($this->_connectFailCounter > 1) { - $sleepTime = pow(2, $this->_connectFailCounter); - // don't sleep more than 60 seconds - if ($sleepTime > 60) { - $sleepTime = 60; - } - sleep($sleepTime); - } - $this->httpStream('get', $this->_streamUrl); - } - - /** - * Process an open stream for x microseconds, then return. This is useful if you want - * to be doing other things while processing the stream. If you just want to - * consume the stream without other actions, you can call processForever() instead. - * @param null|float $microseconds The number of microseconds to process for before - * returning. There are 1,000,000 microseconds in a second. - * - * @return void - */ - public function processStream($microseconds=null): void - { - if (!$this->_multiStream) { - throw new phpnutException('You must open a stream before calling processStream()'); - } - $start = microtime(true); - $active = null; - $inQueue = null; - $sleepFor = 0; - do { - // if we haven't received anything within 5.5 minutes, reconnect - // keepalives are sent every 5 minutes (measured on 2013-3-12 by @ryantharp) - if (time()-$this->_lastStreamActivity >= 330) { - $this->reconnectStream(); - } - curl_multi_exec($this->_multiStream, $active); - if (!$active) { - $httpCode = curl_getinfo($this->_currentStream, CURLINFO_HTTP_CODE); - // don't reconnect on 400 errors - if ($httpCode >= 400 && $httpCode <= 499) { - throw new phpnutException("Received HTTP error {$httpCode} check your URL and credentials before reconnecting"); - } - $this->reconnectStream(); - } - // sleep for a max of 2/10 of a second - $timeSoFar = (microtime(true)-$start)*1000000; - $sleepFor = $this->streamingSleepFor; - if ($timeSoFar+$sleepFor > $microseconds) { - $sleepFor = $microseconds - $timeSoFar; - } - if ($sleepFor > 0) { - usleep($sleepFor); - } - } while ($timeSoFar+$sleepFor < $microseconds); - } - - /** - * Process an open stream forever. This function will never return, if you - * want to perform other actions while consuming the stream, you should use - * processFor() instead. - * @return void This function will never return - * @see processFor(); - */ - public function processStreamForever(): void - { - while (true) { - $this->processStream(600); - } - } -} diff --git a/pnut/lib/phpnutException.php b/pnut/lib/phpnutException.php deleted file mode 100644 index 77e768fe..00000000 --- a/pnut/lib/phpnutException.php +++ /dev/null @@ -1,5 +0,0 @@ - - * Status: In Development - */ - -require_once 'addon/pnut/lib/phpnut.php'; -require_once 'addon/pnut/lib/phpnutException.php'; - -use Friendica\Content\Text\BBCode; -use Friendica\Content\Text\Plaintext; -use Friendica\Core\Config\Util\ConfigFileManager; -use Friendica\Core\Hook; -use Friendica\Core\Renderer; -use Friendica\Core\System; -use Friendica\DI; -use Friendica\Model\Item; -use Friendica\Model\Photo; -use phpnut\phpnutException; - -const PNUT_LIMIT = 256; - -function pnut_install() -{ - Hook::register('load_config', __FILE__, 'pnut_load_config'); - Hook::register('hook_fork', __FILE__, 'pnut_hook_fork'); - Hook::register('post_local', __FILE__, 'pnut_post_local'); - Hook::register('notifier_normal', __FILE__, 'pnut_post_hook'); - Hook::register('jot_networks', __FILE__, 'pnut_jot_nets'); - Hook::register('connector_settings', __FILE__, 'pnut_settings'); - Hook::register('connector_settings_post', __FILE__, 'pnut_settings_post'); -} - -function pnut_module() {} - -function pnut_content() -{ - if (!DI::userSession()->getLocalUserId()) { - DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); - return ''; - } - - if (isset(DI::args()->getArgv()[1])) { - switch (DI::args()->getArgv()[1]) { - case 'connect': - $o = pnut_connect(); - break; - - default: - $o = print_r(DI::args()->getArgv(), true); - break; - } - } else { - $o = pnut_connect(); - } - return $o; -} - -function pnut_connect() -{ - $client_id = DI::config()->get('pnut', 'client_id'); - $client_secret = DI::config()->get('pnut', 'client_secret'); - - if (empty($client_id) || empty($client_secret)) { - $client_id = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'client_id'); - $client_secret = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'client_secret'); - } - - $callback_url = DI::baseUrl() . '/pnut/connect'; - - $nut = new phpnut\phpnut($client_id, $client_secret); - - try { - $token = $nut->getAccessToken($callback_url); - DI::logger()->debug('Got Token', [$token]); - $o = DI::l10n()->t('You are now authenticated with pnut.io.'); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pnut', 'access_token', $token); - } catch (phpnutException $e) { - $o = DI::l10n()->t('Error fetching token. Please try again.', ['code' => $e->getCode(), 'message' => $e->getMessage()]); - } - - $o .= '
' . DI::l10n()->t("return to the connector page") . ''; - - return $o; -} - -function pnut_load_config(ConfigFileManager $loader) -{ - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('pnut'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); -} - -function pnut_addon_admin(string &$o) -{ - $client_id = DI::config()->get('pnut', 'client_id'); - $client_secret = DI::config()->get('pnut', 'client_secret'); - - $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/pnut/'); - - $o = Renderer::replaceMacros($t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$client_id' => ['pnut_client_id', DI::l10n()->t('Client ID'), $client_id], - '$client_secret' => ['pnut_client_secret', DI::l10n()->t('Client Secret'), $client_secret], - ]); -} - -function pnut_addon_admin_post() -{ - DI::config()->set('pnut', 'client_id', $_POST['pnut_client_id']); - DI::config()->set('pnut', 'client_secret', $_POST['pnut_client_secret']); -} - -function pnut_settings(array &$data) -{ - if (!DI::userSession()->getLocalUserId()) { - return; - } - - $redirectUri = DI::baseUrl() . '/pnut/connect'; - $scope = ['write_post', 'files']; - - $enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'post') ?? false; - $def_enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'post_by_default') ?? false; - $client_id = DI::config()->get('pnut', 'client_id'); - $client_secret = DI::config()->get('pnut', 'client_secret'); - $token = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'access_token'); - - $user_client = empty($client_id) || empty($client_secret); - if ($user_client) { - $client_id = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'client_id'); - $client_secret = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'client_secret'); - } - - if (!empty($client_id) && !empty($client_secret) && empty($token)) { - $nut = new phpnut\phpnut($client_id, $client_secret); - $authorize_url = $nut->getAuthUrl($redirectUri, $scope); - $authorize_text = DI::l10n()->t('Authenticate with pnut.io'); - } - - if (!empty($token)) { - $disconn_btn = DI::l10n()->t('Disconnect'); - } - - $t = Renderer::getMarkupTemplate('connector_settings.tpl', 'addon/pnut/'); - $html = Renderer::replaceMacros($t, [ - '$enable' => ['pnut', DI::l10n()->t('Enable Pnut Post Addon'), $enabled], - '$bydefault' => ['pnut_bydefault', DI::l10n()->t('Post to Pnut by default'), $def_enabled], - '$client_id' => ['pnut_client_id', DI::l10n()->t('Client ID'), $client_id], - '$client_secret' => ['pnut_client_secret', DI::l10n()->t('Client Secret'), $client_secret], - '$access_token' => ['pnut_access_token', DI::l10n()->t('Access Token'), $token, '', '', 'readonly'], - '$authorize_url' => $authorize_url ?? '', - '$authorize_text' => $authorize_text ?? '', - '$disconn_btn' => $disconn_btn ?? '', - 'user_client' => $user_client, - ]); - - $data = [ - 'connector' => 'pnut', - 'title' => DI::l10n()->t('Pnut Export'), - 'image' => 'addon/pnut/pnut.svg', - 'enabled' => $enabled, - 'html' => $html, - ]; -} - -function pnut_settings_post(array &$b) -{ - if (empty($_POST['pnut-submit']) && empty($_POST['pnut-disconnect'])) { - return; - } - - if (!empty($_POST['pnut-disconnect'])) { - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'pnut', 'post'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'pnut', 'post_by_default'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'pnut', 'client_id'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'pnut', 'client_secret'); - DI::pConfig()->delete(DI::userSession()->getLocalUserId(), 'pnut', 'access_token'); - } else { - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pnut', 'post', intval($_POST['pnut'])); - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pnut', 'post_by_default', intval($_POST['pnut_bydefault'])); - if (!empty($_POST['pnut_client_id'])) { - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pnut', 'client_id', $_POST['pnut_client_id']); - } - if (!empty($_POST['pnut_client_secret'])) { - DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pnut', 'client_secret', $_POST['pnut_client_secret']); - } - } -} - -function pnut_jot_nets(array &$jotnets_fields) -{ - if (!DI::userSession()->getLocalUserId()) { - return; - } - - if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'post')) { - $jotnets_fields[] = [ - 'type' => 'checkbox', - 'field' => [ - 'pnut_enable', - DI::l10n()->t('Post to Pnut'), - DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'post_by_default') - ] - ]; - } -} - -function pnut_hook_fork(array &$b) -{ - if ($b['name'] != 'notifier_normal') { - return; - } - - $post = $b['data']; - - if (($post['created'] !== $post['edited']) && !$post['deleted']) { - DI::logger()->info('Editing is not supported by the addon'); - $b['execute'] = false; - return; - } - - if (!strstr($post['postopts'] ?? '', 'pnut') || ($post['gravity'] != Item::GRAVITY_PARENT) || ($post['private'] == Item::PRIVATE)) { - $b['execute'] = false; - return; - } -} - -function pnut_post_local(array &$b) -{ - if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) { - return; - } - - if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) { - return; - } - - $pnut_post = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'post')); - $pnut_enable = (($pnut_post && !empty($_REQUEST['pnut_enable'])) ? intval($_REQUEST['pnut_enable']) : 0); - - // if API is used, default to the chosen settings - if ($b['api_source'] && intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pnut', 'post_by_default'))) { - $pnut_enable = 1; - } - - if (!$pnut_enable) { - return; - } - - if (strlen($b['postopts'])) { - $b['postopts'] .= ','; - } - - $b['postopts'] .= 'pnut'; -} - -function pnut_post_hook(array &$b) -{ - /** - * Post to pnut.io - */ - if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) { - return; - } - - if (Item::isGroupPost($b['uri-id'])) { - return; - } - - DI::logger()->notice('PNUT post invoked', ['id' => $b['id'], 'guid' => $b['guid'], 'plink' => $b['plink']]); - DI::logger()->debug('PNUT array', $b); - - $token = DI::pConfig()->get($b['uid'], 'pnut', 'access_token'); - $nut = new phpnut\phpnut($token); - - $msgarr = Plaintext::getPost($b, PNUT_LIMIT, true, BBCode::EXTERNAL); - $text = $msgarr['text']; - $raw = []; - - DI::logger()->debug('PNUT msgarr', $msgarr); - - if (count($msgarr['parts']) > 1) { - $tstamp = time(); - $raw['nl.chimpnut.blog.post'][] = ['body' => $b['body'], 'tstamp' => $tstamp]; - $text = Plaintext::shorten($text, 252 - strlen($b['plink']), $b['uid']); - $text .= "\n" . $b['plink']; - } - - if ($msgarr['type'] == 'link') { - $text .= "\n[" . $msgarr['title'] . "](" . $msgarr['url'] . ")"; - } - - if ($msgarr['type'] == 'photo') { - $fileraw = ['type' => 'dev.mcmillian.friendica.image', 'kind' => 'image', 'is_public' => true]; - foreach ($msgarr['images'] as $image) { - DI::logger()->debug('PNUT image', $image); - - if (!empty($image['id'])) { - $photo = Photo::selectFirst([], ['id' => $image['id']]); - DI::logger()->debug('PNUT selectFirst'); - } else { - $photo = Photo::createPhotoForExternalResource($image['url']); - DI::logger()->debug('PNUT createPhotoForExternalResource'); - } - $picturedata = Photo::getImageForPhoto($photo); - - DI::logger()->debug('PNUT photo', $photo); - $picurefile = tempnam(System::getTempPath(), 'pnut'); - file_put_contents($picurefile, $picturedata); - DI::logger()->debug('PNUT got file?', ['filename' => $picurefile]); - $imagefile = $nut->createFile($picurefile, $fileraw); - DI::logger()->debug('PNUT file', ['pnutimagefile' => $imagefile]); - unlink($picurefile); - - $raw['io.pnut.core.oembed'][] = ['+io.pnut.core.file' => ['file_id' => $imagefile['id'], 'file_token' => $imagefile['file_token'], 'format' => 'oembed']]; - } - } - - $raw['io.pnut.core.crosspost'][] = ['canonical_url' => $b['plink']]; - $nut->createPost($text, ['raw' => $raw]); - - DI::logger()->debug('PNUT post complete', ['id' => $b['id'], 'text' => $text, 'raw' => $raw]); -} diff --git a/pnut/pnut.svg b/pnut/pnut.svg deleted file mode 100644 index 6cc64b01..00000000 --- a/pnut/pnut.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/pnut/templates/admin.tpl b/pnut/templates/admin.tpl deleted file mode 100644 index b4cc3651..00000000 --- a/pnut/templates/admin.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{{include file="field_input.tpl" field=$client_id}} -{{include file="field_input.tpl" field=$client_secret}} -
diff --git a/pnut/templates/connector_settings.tpl b/pnut/templates/connector_settings.tpl deleted file mode 100644 index 6662a5ae..00000000 --- a/pnut/templates/connector_settings.tpl +++ /dev/null @@ -1,14 +0,0 @@ -

{{$status}}

-{{include file="field_checkbox.tpl" field=$enable}} -{{include file="field_checkbox.tpl" field=$bydefault}} -{{if $user_client}} - {{include file="field_input.tpl" field=$client_id}} - {{include file="field_input.tpl" field=$client_secret}} - {{include file="field_input.tpl" field=$access_token}} -{{/if}} -{{if $authorize_url}} - {{$authorize_text}} -{{/if}} -{{if $disconn_btn}} -
-{{/if}} diff --git a/public_server/lang/bg/messages.po b/public_server/lang/bg/messages.po deleted file mode 100644 index c0091e35..00000000 --- a/public_server/lang/bg/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON public_server -# Copyright (C) -# This file is distributed under the same license as the Friendica public_server addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/bg/strings.php b/public_server/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/public_server/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/ca/strings.php b/public_server/lang/ca/strings.php index d34874f6..ead9e954 100644 --- a/public_server/lang/ca/strings.php +++ b/public_server/lang/ca/strings.php @@ -1,7 +1,5 @@ -strings["Administrator"] = "Administrador"; +$a->strings["Your account on %s will expire in a few days."] = "El teu compte en %s expirarà en pocs dies."; +$a->strings["Your Friendica account is about to expire."] = "El teu compte de Friendica està a punt de caducar."; diff --git a/public_server/lang/eo/messages.po b/public_server/lang/eo/messages.po deleted file mode 100644 index 12293a21..00000000 --- a/public_server/lang/eo/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON public_server -# Copyright (C) -# This file is distributed under the same license as the Friendica public_server addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/eo/strings.php b/public_server/lang/eo/strings.php index 68e8a64c..91fc41f6 100644 --- a/public_server/lang/eo/strings.php +++ b/public_server/lang/eo/strings.php @@ -1,7 +1,5 @@ -strings["Administrator"] = "Administranto"; +$a->strings["Your account on %s will expire in a few days."] = "Via konto ĉe %s senvalidiĝos post kelkaj tagoj."; +$a->strings["Your Friendica account is about to expire."] = "Via konto ĉe Friendica baldaŭ senvalidiĝos."; diff --git a/public_server/lang/et/messages.po b/public_server/lang/et/messages.po deleted file mode 100644 index 932807e7..00000000 --- a/public_server/lang/et/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON public_server -# Copyright (C) -# This file is distributed under the same license as the Friendica public_server addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/et/strings.php b/public_server/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/public_server/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2022 # StefOfficiel , 2015 msgid "" @@ -13,8 +12,8 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-02-01 18:15+0100\n" "PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: cracrayol, 2025\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: Hypolite Petovan , 2022\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -44,7 +43,7 @@ msgstr "%1$s,\n\nVotre compte sur %2$s va expirer dans moins de 5 jours. Vous po #: public_server.php:158 msgid "Save Settings" -msgstr "Sauvegarder les paramètres" +msgstr "Enregistrer les paramètres" #: public_server.php:160 msgid "Set any of these options to 0 to deactivate it." diff --git a/public_server/lang/fr/strings.php b/public_server/lang/fr/strings.php index 0ac61152..add86c16 100644 --- a/public_server/lang/fr/strings.php +++ b/public_server/lang/fr/strings.php @@ -13,5 +13,5 @@ $a->strings['Hi %1$s, Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days'] = '%1$s, Votre compte sur %2$s va expirer dans moins de 5 jours. Vous pouvez conserver votre compte en vous identifiant au moins une fois tous les 30 jours'; -$a->strings['Save Settings'] = 'Sauvegarder les paramètres'; +$a->strings['Save Settings'] = 'Enregistrer les paramètres'; $a->strings['Set any of these options to 0 to deactivate it.'] = 'Entrez 0 comme valeur pour n\'importe quelle de ces options pour la désactiver.'; diff --git a/public_server/lang/gd/messages.po b/public_server/lang/gd/messages.po deleted file mode 100644 index c716b211..00000000 --- a/public_server/lang/gd/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON public_server -# Copyright (C) -# This file is distributed under the same license as the Friendica public_server addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/gd/strings.php b/public_server/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/public_server/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/public_server/lang/is/messages.po b/public_server/lang/is/messages.po deleted file mode 100644 index b41a4e10..00000000 --- a/public_server/lang/is/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON public_server -# Copyright (C) -# This file is distributed under the same license as the Friendica public_server addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/is/strings.php b/public_server/lang/is/strings.php index 975c341e..fc5424b3 100644 --- a/public_server/lang/is/strings.php +++ b/public_server/lang/is/strings.php @@ -1,7 +1,5 @@ -strings["Administrator"] = "Kerfisstjóri"; +$a->strings["Your account on %s will expire in a few days."] = ""; +$a->strings["Your Friendica account is about to expire."] = ""; diff --git a/public_server/lang/ru/messages.po b/public_server/lang/ru/messages.po deleted file mode 100644 index 00898802..00000000 --- a/public_server/lang/ru/messages.po +++ /dev/null @@ -1,48 +0,0 @@ -# ADDON public_server -# Copyright (C) -# This file is distributed under the same license as the Friendica public_server addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-01 18:15+0100\n" -"PO-Revision-Date: 2014-06-23 11:24+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: public_server.php:64 -msgid "Administrator" -msgstr "" - -#: public_server.php:118 -#, php-format -msgid "Your account on %s will expire in a few days." -msgstr "" - -#: public_server.php:119 -msgid "Your Friendica account is about to expire." -msgstr "" - -#: public_server.php:120 -#, php-format -msgid "" -"Hi %1$s,\n" -"\n" -"Your account on %2$s will expire in less than five days. You may keep your account by logging in at least once every 30 days" -msgstr "" - -#: public_server.php:158 -msgid "Save Settings" -msgstr "" - -#: public_server.php:160 -msgid "Set any of these options to 0 to deactivate it." -msgstr "" diff --git a/public_server/lang/ru/strings.php b/public_server/lang/ru/strings.php index 0579fc21..405a408f 100644 --- a/public_server/lang/ru/strings.php +++ b/public_server/lang/ru/strings.php @@ -1,7 +1,5 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} +strings["Administrator"] = "Администратор"; +$a->strings["Your account on %s will expire in a few days."] = ""; +$a->strings["Your Friendica account is about to expire."] = ""; diff --git a/public_server/public_server.php b/public_server/public_server.php index 9cd0f667..7591c7d0 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -6,8 +6,10 @@ * Author: Keith Fernie */ +use Friendica\App; use Friendica\BaseModule; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; @@ -27,7 +29,7 @@ function public_server_install() function public_server_load_config(ConfigFileManager $loader) { - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('public_server'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); + DI::app()->getConfigCache()->load($loader->loadAddonConfig('public_server'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); } function public_server_register_account($b) @@ -46,7 +48,7 @@ function public_server_register_account($b) function public_server_cron($b) { - DI::logger()->notice("public_server: cron start"); + Logger::notice("public_server: cron start"); $users = DBA::selectToArray('user', [], ["`account_expires_on` > ? AND `account_expires_on` < ? AND `expire_notification_sent` <= ?", DBA::NULL_DATETIME, DateTimeFormat::utc('now + 5 days'), DBA::NULL_DATETIME]); @@ -95,7 +97,7 @@ function public_server_cron($b) } } - DI::logger()->notice("public_server: cron end"); + Logger::notice("public_server: cron end"); } function public_server_enotify(array &$b) diff --git a/pumpio/lang/C/messages.po b/pumpio/lang/C/messages.po index 7e14cd79..baac56e6 100644 --- a/pumpio/lang/C/messages.po +++ b/pumpio/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-11-21 19:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,76 +17,76 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: pumpio.php:62 +#: pumpio.php:57 msgid "Permission denied." msgstr "" -#: pumpio.php:156 +#: pumpio.php:152 #, php-format msgid "Unable to register the client at the pump.io server '%s'." msgstr "" -#: pumpio.php:196 +#: pumpio.php:192 msgid "You are now authenticated to pumpio." msgstr "" -#: pumpio.php:197 +#: pumpio.php:193 msgid "return to the connector page" msgstr "" -#: pumpio.php:217 +#: pumpio.php:213 msgid "Post to pumpio" msgstr "" -#: pumpio.php:241 +#: pumpio.php:237 msgid "Save Settings" msgstr "" -#: pumpio.php:243 +#: pumpio.php:239 msgid "Delete this preset" msgstr "" -#: pumpio.php:249 +#: pumpio.php:245 msgid "Authenticate your pump.io connection" msgstr "" -#: pumpio.php:256 +#: pumpio.php:252 msgid "Pump.io servername (without \"http://\" or \"https://\" )" msgstr "" -#: pumpio.php:257 +#: pumpio.php:253 msgid "Pump.io username (without the servername)" msgstr "" -#: pumpio.php:258 +#: pumpio.php:254 msgid "Import the remote timeline" msgstr "" -#: pumpio.php:259 +#: pumpio.php:255 msgid "Enable Pump.io Post Addon" msgstr "" -#: pumpio.php:260 +#: pumpio.php:256 msgid "Post to Pump.io by default" msgstr "" -#: pumpio.php:261 +#: pumpio.php:257 msgid "Should posts be public?" msgstr "" -#: pumpio.php:262 +#: pumpio.php:258 msgid "Mirror all public posts" msgstr "" -#: pumpio.php:267 +#: pumpio.php:263 msgid "Pump.io Import/Export/Mirror" msgstr "" -#: pumpio.php:924 +#: pumpio.php:920 msgid "status" msgstr "" -#: pumpio.php:928 +#: pumpio.php:924 #, php-format msgid "%1$s likes %2$s's %3$s" msgstr "" diff --git a/pumpio/lang/bg/messages.po b/pumpio/lang/bg/messages.po deleted file mode 100644 index d8cbfb7d..00000000 --- a/pumpio/lang/bg/messages.po +++ /dev/null @@ -1,93 +0,0 @@ -# ADDON pumpio -# Copyright (C) -# This file is distributed under the same license as the Friendica pumpio addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 11:30+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/bg/strings.php b/pumpio/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/pumpio/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/ca/strings.php b/pumpio/lang/ca/strings.php deleted file mode 100644 index d34874f6..00000000 --- a/pumpio/lang/ca/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/eo/strings.php b/pumpio/lang/eo/strings.php deleted file mode 100644 index 68e8a64c..00000000 --- a/pumpio/lang/eo/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/et/strings.php b/pumpio/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/pumpio/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2022 # ea1cd8241cb389ffb6f92bc6891eff5d_dc12308 <70dced5587d47e18d88f9298024d96f8_93383>, 2015 # StefOfficiel , 2015 @@ -12,86 +11,86 @@ msgid "" msgstr "" "Project-Id-Version: friendica\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" +"POT-Creation-Date: 2021-11-21 19:17-0500\n" "PO-Revision-Date: 2014-06-23 11:30+0000\n" -"Last-Translator: Florent C., 2023\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: Hypolite Petovan , 2022\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" -#: pumpio.php:62 +#: pumpio.php:57 msgid "Permission denied." msgstr "Permission refusée." -#: pumpio.php:156 +#: pumpio.php:152 #, php-format msgid "Unable to register the client at the pump.io server '%s'." msgstr "Impossible d'enregistrer le client sur le serveur pump.io \"%s\"." -#: pumpio.php:196 +#: pumpio.php:192 msgid "You are now authenticated to pumpio." msgstr "Vous êtes maintenant authentifié sur pump.io." -#: pumpio.php:197 +#: pumpio.php:193 msgid "return to the connector page" msgstr "Retourner à la page du connecteur" -#: pumpio.php:217 +#: pumpio.php:213 msgid "Post to pumpio" msgstr "Publier sur pump.io" -#: pumpio.php:241 +#: pumpio.php:237 msgid "Save Settings" msgstr "Sauvegarder les paramètres" -#: pumpio.php:243 +#: pumpio.php:239 msgid "Delete this preset" msgstr "Supprimer ce préréglage" -#: pumpio.php:249 +#: pumpio.php:245 msgid "Authenticate your pump.io connection" msgstr "Identifiez votre connexion à pump.io" -#: pumpio.php:256 +#: pumpio.php:252 msgid "Pump.io servername (without \"http://\" or \"https://\" )" msgstr "Domaine du serveur Pump.io (sans \"http://\" ou \"https://\")" -#: pumpio.php:257 +#: pumpio.php:253 msgid "Pump.io username (without the servername)" msgstr "Nom d'utilisateur Pump.io (sans le domaine de serveur)" -#: pumpio.php:258 +#: pumpio.php:254 msgid "Import the remote timeline" -msgstr "Importer le flux distant" +msgstr "Importer la timeline distante" -#: pumpio.php:259 +#: pumpio.php:255 msgid "Enable Pump.io Post Addon" msgstr "Activer l'extension Pump.io" -#: pumpio.php:260 +#: pumpio.php:256 msgid "Post to Pump.io by default" msgstr "Publier sur Pump.io par défaut" -#: pumpio.php:261 +#: pumpio.php:257 msgid "Should posts be public?" msgstr "Les messages devraient être publiques ?" -#: pumpio.php:262 +#: pumpio.php:258 msgid "Mirror all public posts" msgstr "Refléter toutes les publications publiques" -#: pumpio.php:267 +#: pumpio.php:263 msgid "Pump.io Import/Export/Mirror" msgstr "Import/Export/Miroir Pump.io" -#: pumpio.php:924 +#: pumpio.php:920 msgid "status" msgstr "statut" -#: pumpio.php:928 +#: pumpio.php:924 #, php-format msgid "%1$s likes %2$s's %3$s" msgstr "%1$s aime lea %3$s de %2$s" diff --git a/pumpio/lang/fr/strings.php b/pumpio/lang/fr/strings.php index 14ddade1..bdbbc462 100644 --- a/pumpio/lang/fr/strings.php +++ b/pumpio/lang/fr/strings.php @@ -15,7 +15,7 @@ $a->strings['Delete this preset'] = 'Supprimer ce préréglage'; $a->strings['Authenticate your pump.io connection'] = 'Identifiez votre connexion à pump.io'; $a->strings['Pump.io servername (without "http://" or "https://" )'] = 'Domaine du serveur Pump.io (sans "http://" ou "https://")'; $a->strings['Pump.io username (without the servername)'] = 'Nom d\'utilisateur Pump.io (sans le domaine de serveur)'; -$a->strings['Import the remote timeline'] = 'Importer le flux distant'; +$a->strings['Import the remote timeline'] = 'Importer la timeline distante'; $a->strings['Enable Pump.io Post Addon'] = 'Activer l\'extension Pump.io'; $a->strings['Post to Pump.io by default'] = 'Publier sur Pump.io par défaut'; $a->strings['Should posts be public?'] = 'Les messages devraient être publiques ?'; diff --git a/pumpio/lang/gd/messages.po b/pumpio/lang/gd/messages.po deleted file mode 100644 index 0cefa2cd..00000000 --- a/pumpio/lang/gd/messages.po +++ /dev/null @@ -1,93 +0,0 @@ -# ADDON pumpio -# Copyright (C) -# This file is distributed under the same license as the Friendica pumpio addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 11:30+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/gd/strings.php b/pumpio/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/pumpio/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/pumpio/lang/is/messages.po b/pumpio/lang/is/messages.po deleted file mode 100644 index a1c9b37d..00000000 --- a/pumpio/lang/is/messages.po +++ /dev/null @@ -1,93 +0,0 @@ -# ADDON pumpio -# Copyright (C) -# This file is distributed under the same license as the Friendica pumpio addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-03 15:50-0400\n" -"PO-Revision-Date: 2014-06-23 11:30+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/is/strings.php b/pumpio/lang/is/strings.php deleted file mode 100644 index 975c341e..00000000 --- a/pumpio/lang/is/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: pumpio.php:62 -msgid "Permission denied." -msgstr "" - -#: pumpio.php:156 -#, php-format -msgid "Unable to register the client at the pump.io server '%s'." -msgstr "" - -#: pumpio.php:196 -msgid "You are now authenticated to pumpio." -msgstr "" - -#: pumpio.php:197 -msgid "return to the connector page" -msgstr "" - -#: pumpio.php:217 -msgid "Post to pumpio" -msgstr "" - -#: pumpio.php:241 -msgid "Save Settings" -msgstr "" - -#: pumpio.php:243 -msgid "Delete this preset" -msgstr "" - -#: pumpio.php:249 -msgid "Authenticate your pump.io connection" -msgstr "" - -#: pumpio.php:256 -msgid "Pump.io servername (without \"http://\" or \"https://\" )" -msgstr "" - -#: pumpio.php:257 -msgid "Pump.io username (without the servername)" -msgstr "" - -#: pumpio.php:258 -msgid "Import the remote timeline" -msgstr "" - -#: pumpio.php:259 -msgid "Enable Pump.io Post Addon" -msgstr "" - -#: pumpio.php:260 -msgid "Post to Pump.io by default" -msgstr "" - -#: pumpio.php:261 -msgid "Should posts be public?" -msgstr "" - -#: pumpio.php:262 -msgid "Mirror all public posts" -msgstr "" - -#: pumpio.php:267 -msgid "Pump.io Import/Export/Mirror" -msgstr "" - -#: pumpio.php:924 -msgid "status" -msgstr "" - -#: pumpio.php:928 -#, php-format -msgid "%1$s likes %2$s's %3$s" -msgstr "" diff --git a/pumpio/lang/ru/strings.php b/pumpio/lang/ru/strings.php deleted file mode 100644 index 0579fc21..00000000 --- a/pumpio/lang/ru/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} diff --git a/pumpio/oauth/http.php b/pumpio/oauth/http.php index 3045e509..5d5e23f0 100644 --- a/pumpio/oauth/http.php +++ b/pumpio/oauth/http.php @@ -109,11 +109,9 @@ class http_class var $connected_port = -1; var $connected_ssl = 0; - private $content_length_set; - /* Private methods - DO NOT CALL */ - private function Tokenize($string,$separator="") + Function Tokenize($string,$separator="") { if(!strcmp($separator,"")) { @@ -137,18 +135,18 @@ class http_class } } - private function CookieEncode($value, $name) + Function CookieEncode($value, $name) { return($name ? str_replace("=", "%25", $value) : str_replace(";", "%3B", $value)); } - private function SetError($error, $error_code = HTTP_CLIENT_ERROR_UNSPECIFIED_ERROR) + Function SetError($error, $error_code = HTTP_CLIENT_ERROR_UNSPECIFIED_ERROR) { $this->error_code = $error_code; return($this->error=$error); } - private function SetPHPError($error, &$php_error_message, $error_code = HTTP_CLIENT_ERROR_UNSPECIFIED_ERROR) + Function SetPHPError($error, &$php_error_message, $error_code = HTTP_CLIENT_ERROR_UNSPECIFIED_ERROR) { if(IsSet($php_error_message) && strlen($php_error_message)) @@ -156,7 +154,7 @@ class http_class return($this->SetError($error, $error_code)); } - private function SetDataAccessError($error,$check_connection=0) + Function SetDataAccessError($error,$check_connection=0) { $this->error=$error; $this->error_code = HTTP_CLIENT_ERROR_COMMUNICATION_FAILURE; @@ -176,7 +174,7 @@ class http_class } } - private function OutputDebug($message) + Function OutputDebug($message) { if($this->log_debug) error_log($message); @@ -190,7 +188,7 @@ class http_class } } - private function GetLine() + Function GetLine() { for($line="";;) { @@ -229,7 +227,7 @@ class http_class } } - private function PutLine($line) + Function PutLine($line) { if($this->debug) $this->OutputDebug("C $line"); @@ -241,7 +239,7 @@ class http_class return(1); } - private function PutData($data) + Function PutData($data) { if(strlen($data)) { @@ -256,7 +254,7 @@ class http_class return(1); } - private function FlushData() + Function FlushData() { if(!fflush($this->connection)) { @@ -266,7 +264,7 @@ class http_class return(1); } - private function ReadChunkSize() + Function ReadChunkSize() { if($this->remaining_chunk==0) { @@ -291,7 +289,7 @@ class http_class return(""); } - private function ReadBytes($length) + Function ReadBytes($length) { if($this->use_curl) { @@ -358,7 +356,7 @@ class http_class return($bytes); } - private function EndOfInput() + Function EndOfInput() { if($this->use_curl) return($this->read_response>=strlen($this->response)); @@ -369,7 +367,7 @@ class http_class return(feof($this->connection)); } - private function Resolve($domain, &$ip, $server_type) + Function Resolve($domain, &$ip, $server_type) { if(preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/',$domain)) $ip=$domain; @@ -387,7 +385,7 @@ class http_class return(''); } - private function Connect($host_name, $host_port, $ssl, $server_type = 'HTTP') + Function Connect($host_name, $host_port, $ssl, $server_type = 'HTTP') { $domain=$host_name; $port = $host_port; @@ -554,7 +552,7 @@ class http_class } } - private function Disconnect() + Function Disconnect() { if($this->debug) $this->OutputDebug("Disconnected from ".$this->connected_host); @@ -571,7 +569,7 @@ class http_class /* Public methods */ - public function GetRequestArguments($url, &$arguments) + Function GetRequestArguments($url, &$arguments) { $this->error = ''; $this->error_code = HTTP_CLIENT_ERROR_NO_ERROR; @@ -623,7 +621,7 @@ class http_class return(""); } - public function Open($arguments) + Function Open($arguments) { if(strlen($this->error)) return($this->error); @@ -752,7 +750,7 @@ class http_class return(""); } - public function Close($force = 0) + Function Close($force = 0) { if($this->state=="Disconnected") return("1 already disconnected"); @@ -769,7 +767,7 @@ class http_class return($this->Disconnect()); } - private function PickCookies(&$cookies,$secure) + Function PickCookies(&$cookies,$secure) { if(IsSet($this->cookies[$secure])) { @@ -805,7 +803,7 @@ class http_class } } - private function GetFileDefinition($file, &$definition) + Function GetFileDefinition($file, &$definition) { $name=""; if(IsSet($file["FileName"])) @@ -992,6 +990,9 @@ class http_class if(GetType($length=@filesize($file["FileName"]))!="integer") { $error="it was not possible to determine the length of the file ".$file["FileName"]; + if(IsSet($php_errormsg) + && strlen($php_errormsg)) + $error.=": ".$php_errormsg; if(!file_exists($file["FileName"])) $error="it was not possible to access the file ".$file["FileName"]; return($error); @@ -1006,7 +1007,7 @@ class http_class return(""); } - private function ConnectFromProxy($arguments, &$headers) + Function ConnectFromProxy($arguments, &$headers) { if(!$this->PutLine('CONNECT '.$this->host_name.':'.($this->host_port ? $this->host_port : 443).' HTTP/1.0') || (strlen($this->user_agent) @@ -1051,7 +1052,7 @@ class http_class return(""); } - public function SendRequest($arguments) + Function SendRequest($arguments) { if(strlen($this->error)) return($this->error); @@ -1439,7 +1440,7 @@ class http_class return(""); } - private function SetCookie($name, $value, $expires="" , $path="/" , $domain="" , $secure=0, $verbatim=0) + Function SetCookie($name, $value, $expires="" , $path="/" , $domain="" , $secure=0, $verbatim=0) { if(strlen($this->error)) return($this->error); @@ -1471,7 +1472,7 @@ class http_class return(""); } - private function SendRequestBody($data, $end_of_data) + Function SendRequestBody($data, $end_of_data) { if(strlen($this->error)) return($this->error); @@ -1507,7 +1508,7 @@ class http_class return(""); } - private function ReadReplyHeadersResponse(&$headers) + Function ReadReplyHeadersResponse(&$headers) { $headers=array(); if(strlen($this->error)) @@ -1634,7 +1635,7 @@ class http_class return(""); } - private function Redirect(&$headers) + Function Redirect(&$headers) { if($this->follow_redirect) { @@ -1677,7 +1678,7 @@ class http_class return(""); } - private function Authenticate(&$headers, $proxy, &$proxy_authorization, &$user, &$password, &$realm, &$workstation) + Function Authenticate(&$headers, $proxy, &$proxy_authorization, &$user, &$password, &$realm, &$workstation) { if($proxy) { @@ -1696,10 +1697,9 @@ class http_class if(IsSet($headers[$authenticate_header]) && $this->sasl_authenticate) { - if(!class_exists('sasl_client_class')) - { + if(function_exists("class_exists") + && !class_exists("sasl_client_class")) return($this->SetError("the SASL client class needs to be loaded to be able to authenticate".($proxy ? " with the proxy server" : "")." and access this site", HTTP_CLIENT_ERROR_INVALID_PARAMETERS)); - } if(GetType($headers[$authenticate_header])=="array") $authenticate=$headers[$authenticate_header]; else @@ -1719,7 +1719,7 @@ class http_class else $mechanisms[]=$mechanism; } - $sasl=new \sasl_client_class(); + $sasl=new sasl_client_class; if(IsSet($user)) $sasl->SetCredential("user",$user); if(IsSet($password)) @@ -1731,8 +1731,6 @@ class http_class $sasl->SetCredential("uri",$this->request_uri); $sasl->SetCredential("method",$this->request_method); $sasl->SetCredential("session",$this->session); - $message = ''; - $interactions = []; do { $status=$sasl->Start($mechanisms,$message,$interactions); @@ -1908,8 +1906,8 @@ class http_class } return(""); } - - public function ReadReplyHeaders(&$headers) + + Function ReadReplyHeaders(&$headers) { if(strlen($error=$this->ReadReplyHeadersResponse($headers))) return($error); @@ -1940,7 +1938,7 @@ class http_class return(""); } - private function ReadReplyBody(&$body,$length) + Function ReadReplyBody(&$body,$length) { $body=""; if(strlen($this->error)) @@ -1982,7 +1980,7 @@ class http_class return(""); } - public function ReadWholeReplyBody(&$body) + Function ReadWholeReplyBody(&$body) { $body = ''; for(;;) @@ -1995,7 +1993,7 @@ class http_class } } - private function SaveCookies(&$cookies, $domain='', $secure_only=0, $persistent_only=0) + Function SaveCookies(&$cookies, $domain='', $secure_only=0, $persistent_only=0) { $now=gmdate("Y-m-d H-i-s"); $cookies=array(); @@ -2036,17 +2034,17 @@ class http_class } } - private function SavePersistentCookies(&$cookies, $domain='', $secure_only=0) + Function SavePersistentCookies(&$cookies, $domain='', $secure_only=0) { $this->SaveCookies($cookies, $domain, $secure_only, 1); } - private function GetPersistentCookies(&$cookies, $domain='', $secure_only=0) + Function GetPersistentCookies(&$cookies, $domain='', $secure_only=0) { $this->SavePersistentCookies($cookies, $domain, $secure_only); } - private function RestoreCookies($cookies, $clear=1) + Function RestoreCookies($cookies, $clear=1) { $new_cookies=($clear ? array() : $this->cookies); for($secure_cookies=0, Reset($cookies); $secure_cookies */ +use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; +use Friendica\Core\Addon; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; -use Friendica\Model\Circle; +use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\Post; use Friendica\Model\User; @@ -105,7 +108,7 @@ function pumpio_registerclient($host) $params['logo_url'] = DI::baseUrl() . '/images/friendica-256.png'; $params['redirect_uris'] = DI::baseUrl() . '/pumpio/connect'; - DI::logger()->info('pumpio_registerclient: ' . $url . ' parameters', $params); + Logger::info('pumpio_registerclient: ' . $url . ' parameters', $params); // @TODO Rewrite this to our own HTTP client $ch = curl_init($url); @@ -120,10 +123,10 @@ function pumpio_registerclient($host) if ($curl_info['http_code'] == '200') { $values = json_decode($s); - DI::logger()->info('pumpio_registerclient: success ', (array)$values); + Logger::info('pumpio_registerclient: success ', (array)$values); return $values; } - DI::logger()->info('pumpio_registerclient: failed: ', $curl_info); + Logger::info('pumpio_registerclient: failed: ', $curl_info); return false; } @@ -136,7 +139,7 @@ function pumpio_connect() $hostname = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pumpio', 'host'); if ((($consumer_key == '') || ($consumer_secret == '')) && ($hostname != '')) { - DI::logger()->notice('pumpio_connect: register client'); + Logger::notice('pumpio_connect: register client'); $clientdata = pumpio_registerclient($hostname); DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pumpio', 'consumer_key', $clientdata->client_id); DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pumpio', 'consumer_secret', $clientdata->client_secret); @@ -144,11 +147,11 @@ function pumpio_connect() $consumer_key = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pumpio', 'consumer_key'); $consumer_secret = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'pumpio', 'consumer_secret'); - DI::logger()->info('pumpio_connect: ckey: ' . $consumer_key . ' csecrect: ' . $consumer_secret); + Logger::info('pumpio_connect: ckey: ' . $consumer_key . ' csecrect: ' . $consumer_secret); } if (($consumer_key == '') || ($consumer_secret == '')) { - DI::logger()->notice('pumpio_connect: '.sprintf('Unable to register the client at the pump.io server "%s".', $hostname)); + Logger::notice('pumpio_connect: '.sprintf('Unable to register the client at the pump.io server "%s".', $hostname)); return DI::l10n()->t("Unable to register the client at the pump.io server '%s'.", $hostname); } @@ -177,7 +180,7 @@ function pumpio_connect() if (($success = $client->Initialize())) { if (($success = $client->Process())) { if (strlen($client->access_token)) { - DI::logger()->info('pumpio_connect: otoken: ' . $client->access_token . ', osecrect: ' . $client->access_token_secret); + Logger::info('pumpio_connect: otoken: ' . $client->access_token . ', osecrect: ' . $client->access_token_secret); DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pumpio', 'oauth_token', $client->access_token); DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'pumpio', 'oauth_token_secret', $client->access_token_secret); } @@ -189,11 +192,11 @@ function pumpio_connect() } if ($success) { - DI::logger()->notice('pumpio_connect: authenticated'); + Logger::notice('pumpio_connect: authenticated'); $o = DI::l10n()->t('You are now authenticated to pumpio.'); $o .= '
' . DI::l10n()->t('return to the connector page') . ''; } else { - DI::logger()->notice('pumpio_connect: could not connect'); + Logger::notice('pumpio_connect: could not connect'); $o = 'Could not connect to pumpio. Refresh the page or try again later.'; } @@ -317,7 +320,7 @@ function pumpio_settings_post(array &$b) function pumpio_load_config(ConfigFileManager $loader) { - DI::appHelper()->getConfigCache()->load($loader->loadAddonConfig('pumpio'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); + DI::app()->getConfigCache()->load($loader->loadAddonConfig('pumpio'), \Friendica\Core\Config\ValueObject\Cache::SOURCE_STATIC); } function pumpio_hook_fork(array &$b) @@ -342,14 +345,14 @@ function pumpio_hook_fork(array &$b) if (DI::pConfig()->get($post['uid'], 'pumpio', 'import')) { // Don't fork if it isn't a reply to a pump.io post - if (($post['gravity'] != Item::GRAVITY_PARENT) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) { - DI::logger()->notice('No pump.io parent found for item ' . $post['id']); + if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) { + Logger::notice('No pump.io parent found for item ' . $post['id']); $b['execute'] = false; return; } } else { // Comments are never exported when we don't import the pumpio timeline - if (!strstr($post['postopts'], 'pumpio') || ($post['gravity'] != Item::GRAVITY_PARENT)|| ($post['private'] == Item::PRIVATE)) { + if (!strstr($post['postopts'], 'pumpio') || ($post['parent'] != $post['id']) || $post['private']) { $b['execute'] = false; return; } @@ -387,11 +390,7 @@ function pumpio_send(array &$b) return; } - if (Item::isGroupPost($b['uri-id'])) { - return; - } - - DI::logger()->debug('pumpio_send: parameter ', $b); + Logger::debug('pumpio_send: parameter ', $b); $b['body'] = Post\Media::addAttachmentsToBody($b['uri-id'], DI::contentItem()->addSharedPost($b)); @@ -401,7 +400,7 @@ function pumpio_send(array &$b) $orig_post = Post::selectFirst([], $condition); if (!DBA::isResult($orig_post)) { - DI::logger()->notice('pumpio_send: no pumpio post ' . $b['parent']); + Logger::notice('pumpio_send: no pumpio post ' . $b['parent']); return; } else { $iscomment = true; @@ -411,14 +410,14 @@ function pumpio_send(array &$b) $receiver = pumpio_getreceiver($b); - DI::logger()->notice('pumpio_send: receiver ', $receiver); + Logger::notice('pumpio_send: receiver ', $receiver); - if (!count($receiver) && ($b['private'] == Item::PRIVATE) || !strstr($b['postopts'], 'pumpio')) { + if (!count($receiver) && ($b['private'] || !strstr($b['postopts'], 'pumpio'))) { return; } // Dont't post if the post doesn't belong to us. - // This is a check for group postings + // This is a check for forum postings $self = User::getOwnerDataById($b['uid']); if ($b['contact-id'] != $self['id']) { return; @@ -545,13 +544,13 @@ function pumpio_send(array &$b) } $post_id = $user->object->id; - DI::logger()->notice('pumpio_send ' . $username . ': success ' . $post_id); + Logger::notice('pumpio_send ' . $username . ': success ' . $post_id); if ($post_id && $iscomment) { - DI::logger()->notice('pumpio_send ' . $username . ': Update extid ' . $post_id . ' for post id ' . $b['id']); + Logger::notice('pumpio_send ' . $username . ': Update extid ' . $post_id . ' for post id ' . $b['id']); Item::update(['extid' => $post_id], ['id' => $b['id']]); } } else { - DI::logger()->notice('pumpio_send '.$username.': '.$url.' general error: ' . print_r($user, true)); + Logger::notice('pumpio_send '.$username.': '.$url.' general error: ' . print_r($user, true)); Worker::defer(); } } @@ -583,8 +582,6 @@ function pumpio_action(int $uid, string $uri, string $action, string $content = $uri = $orig_post['uri']; } - $objectType = ''; - if (($orig_post['object-type'] != '') && (strstr($orig_post['object-type'], ActivityNamespace::ACTIVITY_SCHEMA))) { $objectType = str_replace(ActivityNamespace::ACTIVITY_SCHEMA, '', $orig_post['object-type']); } elseif (strstr($uri, '/api/comment/')) { @@ -621,18 +618,16 @@ function pumpio_action(int $uid, string $uri, string $action, string $content = } if ($success) { - DI::logger()->notice('pumpio_action '.$username.' '.$action.': success '.$uri); + Logger::notice('pumpio_action '.$username.' '.$action.': success '.$uri); } else { - DI::logger()->notice('pumpio_action '.$username.' '.$action.': general error: '.$uri); + Logger::notice('pumpio_action '.$username.' '.$action.': general error: '.$uri); Worker::defer(); } } function pumpio_sync() { - $addonHelper = DI::addonHelper(); - - if (!$addonHelper->isAddonEnabled('pumpio')) { + if (!Addon::isEnabled('pumpio')) { return; } @@ -643,15 +638,15 @@ function pumpio_sync() if ($last) { $next = $last + ($poll_interval * 60); if ($next > time()) { - DI::logger()->notice('pumpio: poll intervall not reached'); + Logger::notice('pumpio: poll intervall not reached'); return; } } - DI::logger()->notice('pumpio: cron_start'); + Logger::notice('pumpio: cron_start'); $pconfigs = DBA::selectToArray('pconfig', ['uid'], ['cat' => 'pumpio', 'k' => 'mirror', 'v' => '1']); foreach ($pconfigs as $rr) { - DI::logger()->notice('pumpio: mirroring user '.$rr['uid']); + Logger::notice('pumpio: mirroring user '.$rr['uid']); pumpio_fetchtimeline($rr['uid']); } @@ -666,12 +661,12 @@ function pumpio_sync() foreach ($pconfigs as $rr) { if ($abandon_days != 0) { if (DBA::exists('user', ["uid = ? AND `login_date` >= ?", $rr['uid'], $abandon_limit])) { - DI::logger()->notice('abandoned account: timeline from user '.$rr['uid'].' will not be imported'); + Logger::notice('abandoned account: timeline from user '.$rr['uid'].' will not be imported'); continue; } } - DI::logger()->notice('pumpio: importing timeline from user '.$rr['uid']); + Logger::notice('pumpio: importing timeline from user '.$rr['uid']); pumpio_fetchinbox($rr['uid']); // check for new contacts once a day @@ -688,7 +683,7 @@ function pumpio_sync() } } - DI::logger()->notice('pumpio: cron_end'); + Logger::notice('pumpio: cron_end'); DI::keyValue()->set('pumpio_last_poll', time()); } @@ -733,7 +728,7 @@ function pumpio_fetchtimeline(int $uid) $url = 'https://'.$hostname.'/api/user/'.$username.'/feed/major'; - DI::logger()->notice('pumpio: fetching for user ' . $uid . ' ' . $url . ' C:' . $client->client_id . ' CS:' . $client->client_secret . ' T:' . $client->access_token . ' TS:' . $client->access_token_secret); + Logger::notice('pumpio: fetching for user ' . $uid . ' ' . $url . ' C:' . $client->client_id . ' CS:' . $client->client_secret . ' T:' . $client->access_token . ' TS:' . $client->access_token_secret); $useraddr = $username.'@'.$hostname; @@ -745,7 +740,7 @@ function pumpio_fetchtimeline(int $uid) } if (!$success) { - DI::logger()->notice('pumpio: error fetching posts for user ' . $uid . ' ' . $useraddr . ' ', $user); + Logger::notice('pumpio: error fetching posts for user ' . $uid . ' ' . $useraddr . ' ', $user); return; } @@ -805,11 +800,11 @@ function pumpio_fetchtimeline(int $uid) } } - DI::logger()->notice('pumpio: posting for user ' . $uid); + Logger::notice('pumpio: posting for user ' . $uid); Item::insert($postarray, true); - DI::logger()->notice('pumpio: posting done - user ' . $uid); + Logger::notice('pumpio: posting done - user ' . $uid); } } } @@ -832,7 +827,6 @@ function pumpio_dounlike(int $uid, array $self, $post, string $own_id) } $contactid = 0; - $contact = []; if (Strings::compareLink($post->actor->url, $own_id)) { $contactid = $self['id']; @@ -850,16 +844,16 @@ function pumpio_dounlike(int $uid, array $self, $post, string $own_id) Item::markForDeletion(['verb' => Activity::LIKE, 'uid' => $uid, 'contact-id' => $contactid, 'thr-parent' => $orig_post['uri']]); if (DBA::isResult($contact)) { - DI::logger()->notice('pumpio_dounlike: unliked existing like. User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' URI ' . $orig_post['uri']); + Logger::notice('pumpio_dounlike: unliked existing like. User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' URI ' . $orig_post['uri']); } else { - DI::logger()->notice('pumpio_dounlike: not found. User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' Url ' . $orig_post['uri']); + Logger::notice('pumpio_dounlike: not found. User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' Url ' . $orig_post['uri']); } } function pumpio_dolike(int $uid, array $self, $post, string $own_id, $threadcompletion = true) { if (empty($post->object->id)) { - DI::logger()->info('Got empty like: '.print_r($post, true)); + Logger::info('Got empty like: '.print_r($post, true)); return; } @@ -904,7 +898,7 @@ function pumpio_dolike(int $uid, array $self, $post, string $own_id, $threadcomp ]; if (Post::exists($condition)) { - DI::logger()->notice('pumpio_dolike: found existing like. User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' URI ' . $orig_post['uri']); + Logger::notice('pumpio_dolike: found existing like. User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' URI ' . $orig_post['uri']); return; } @@ -938,7 +932,7 @@ function pumpio_dolike(int $uid, array $self, $post, string $own_id, $threadcomp $ret = Item::insert($likedata); - DI::logger()->notice('pumpio_dolike: ' . $ret . ' User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' URI ' . $orig_post['uri']); + Logger::notice('pumpio_dolike: ' . $ret . ' User ' . $own_id . ' ' . $uid . ' Contact: ' . $contactid . ' URI ' . $orig_post['uri']); } function pumpio_get_contact($uid, $contact, $no_insert = false) @@ -982,7 +976,7 @@ function pumpio_get_contact($uid, $contact, $no_insert = false) $contact_id = $r['id']; - Circle::addMember(User::getDefaultCircle($uid), $contact_id); + Group::addMember(User::getDefaultGroup($uid), $contact_id); } else { $contact_id = $r['id']; } @@ -1325,7 +1319,7 @@ function pumpio_getreceiver(array $b) { $receiver = []; - if ($b['private'] != Item::PRIVATE) { + if (!$b['private']) { if (!strstr($b['postopts'], 'pumpio')) { return $receiver; } @@ -1359,8 +1353,8 @@ function pumpio_getreceiver(array $b) $gid = trim($gid, ' <>'); $contacts = DBA::p("SELECT `contact`.`name`, `contact`.`nick`, `contact`.`url`, `contact`.`network` - FROM `group_member` AS `circle_member`, `contact` WHERE `circle_member`.`gid` = ? - AND `contact`.`id` = `circle_member`.`contact-id` AND `contact`.`network` = ?", + FROM `group_member`, `contact` WHERE `group_member`.`gid` = ? + AND `contact`.`id` = `group_member`.`contact-id` AND `contact`.`network` = ?", $gid, Protocol::PUMPIO); while ($row = DBA::fetch($contacts)) { @@ -1409,7 +1403,7 @@ function pumpio_fetchallcomments($uid, $id) $hostname = DI::pConfig()->get($uid, 'pumpio', 'host'); $username = DI::pConfig()->get($uid, 'pumpio', 'user'); - DI::logger()->notice('pumpio_fetchallcomments: completing comment for user ' . $uid . ' post id ' . $id); + Logger::notice('pumpio_fetchallcomments: completing comment for user ' . $uid . ' post id ' . $id); $own_id = 'https://' . $hostname . '/' . $username; @@ -1434,9 +1428,7 @@ function pumpio_fetchallcomments($uid, $id) $client->access_token = $otoken; $client->access_token_secret = $osecret; - DI::logger()->notice('pumpio_fetchallcomments: fetching comment for user ' . $uid . ', URL ' . $url); - - $item = new \stdClass(); + Logger::notice('pumpio_fetchallcomments: fetching comment for user ' . $uid . ', URL ' . $url); if (pumpio_reachable($url)) { $success = $client->CallAPI($url, 'GET', [], ['FailOnAccessError' => true], $item); @@ -1499,7 +1491,7 @@ function pumpio_fetchallcomments($uid, $id) $post->object = $item; - DI::logger()->notice('pumpio_fetchallcomments: posting comment ' . $post->object->id . ' ', json_decode(json_encode($post), true)); + Logger::notice('pumpio_fetchallcomments: posting comment ' . $post->object->id . ' ', json_decode(json_encode($post), true)); pumpio_dopost($client, $uid, $self, $post, $own_id, false); } } diff --git a/pumpio/pumpio_sync.php b/pumpio/pumpio_sync.php index 09548c6d..beaf6e81 100644 --- a/pumpio/pumpio_sync.php +++ b/pumpio/pumpio_sync.php @@ -1,5 +1,5 @@ DI::config()->get('system', 'maxloadavg', 50)) { - DI::logger()->notice('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.'); + Logger::notice('system: load ' . $load[0] . ' too high. Pumpio sync deferred to next scheduled run.'); return; } } diff --git a/qcomment/lang/bg/messages.po b/qcomment/lang/bg/messages.po deleted file mode 100644 index d0b6c4b7..00000000 --- a/qcomment/lang/bg/messages.po +++ /dev/null @@ -1,45 +0,0 @@ -# ADDON qcomment -# Copyright (C) -# This file is distributed under the same license as the Friendica qcomment addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:30+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: qcomment.php:45 -msgid ":-)" -msgstr "" - -#: qcomment.php:45 -msgid ":-(" -msgstr "" - -#: qcomment.php:45 -msgid "lol" -msgstr "" - -#: qcomment.php:49 -msgid "" -"Quick comments are found near comment boxes, sometimes hidden. Click them to" -" provide simple replies." -msgstr "" - -#: qcomment.php:50 -msgid "Enter quick comments, one per line" -msgstr "" - -#: qcomment.php:55 -msgid "Quick Comment Settings" -msgstr "" diff --git a/qcomment/lang/bg/strings.php b/qcomment/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/qcomment/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: qcomment.php:45 -msgid ":-)" -msgstr "" - -#: qcomment.php:45 -msgid ":-(" -msgstr "" - -#: qcomment.php:45 -msgid "lol" -msgstr "" - -#: qcomment.php:49 -msgid "" -"Quick comments are found near comment boxes, sometimes hidden. Click them to" -" provide simple replies." -msgstr "" - -#: qcomment.php:50 -msgid "Enter quick comments, one per line" -msgstr "" - -#: qcomment.php:55 -msgid "Quick Comment Settings" -msgstr "" diff --git a/qcomment/lang/ca/strings.php b/qcomment/lang/ca/strings.php index d34874f6..257e9fe3 100644 --- a/qcomment/lang/ca/strings.php +++ b/qcomment/lang/ca/strings.php @@ -1,7 +1,10 @@ -strings[":-)"] = ":-)"; +$a->strings[":-("] = ":-("; +$a->strings["lol"] = "lol"; +$a->strings["Quick Comment Settings"] = "Configuració Ràpida dels Comentaris"; +$a->strings["Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies."] = "Comentaris ràpids es troben prop de les caixes de comentaris, de vegades ocults. Feu clic a ells per donar respostes simples."; +$a->strings["Enter quick comments, one per line"] = "Introduïu els comentaris ràpids, un per línia"; +$a->strings["Submit"] = "Enviar"; +$a->strings["Quick Comment settings saved."] = "Guardada la configuració de comentaris ràpids."; diff --git a/qcomment/lang/eo/messages.po b/qcomment/lang/eo/messages.po deleted file mode 100644 index 4e071e53..00000000 --- a/qcomment/lang/eo/messages.po +++ /dev/null @@ -1,45 +0,0 @@ -# ADDON qcomment -# Copyright (C) -# This file is distributed under the same license as the Friendica qcomment addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:30+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: qcomment.php:45 -msgid ":-)" -msgstr "" - -#: qcomment.php:45 -msgid ":-(" -msgstr "" - -#: qcomment.php:45 -msgid "lol" -msgstr "" - -#: qcomment.php:49 -msgid "" -"Quick comments are found near comment boxes, sometimes hidden. Click them to" -" provide simple replies." -msgstr "" - -#: qcomment.php:50 -msgid "Enter quick comments, one per line" -msgstr "" - -#: qcomment.php:55 -msgid "Quick Comment Settings" -msgstr "" diff --git a/qcomment/lang/eo/strings.php b/qcomment/lang/eo/strings.php index 68e8a64c..2c88b15f 100644 --- a/qcomment/lang/eo/strings.php +++ b/qcomment/lang/eo/strings.php @@ -1,7 +1,10 @@ -strings[":-)"] = ":-)"; +$a->strings[":-("] = ":-("; +$a->strings["lol"] = "lol"; +$a->strings["Quick Comment Settings"] = "Agordoj pri Rapidaj Komentoj"; +$a->strings["Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies."] = "Rapidaj komentoj troviĝas apud komentkampoj, kelkfoje kaŝita. Klaku ilin por provizi simplajn rispondojn."; +$a->strings["Enter quick comments, one per line"] = "Entajpu rapidaj komentoj, po unu je linio."; +$a->strings["Submit"] = "Sendi"; +$a->strings["Quick Comment settings saved."] = "Konservis agordojn pri rapidaj komentoj."; diff --git a/qcomment/lang/et/messages.po b/qcomment/lang/et/messages.po deleted file mode 100644 index df161a8c..00000000 --- a/qcomment/lang/et/messages.po +++ /dev/null @@ -1,46 +0,0 @@ -# ADDON qcomment -# Copyright (C) -# This file is distributed under the same license as the Friendica qcomment addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:30+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: qcomment.php:45 -msgid ":-)" -msgstr "" - -#: qcomment.php:45 -msgid ":-(" -msgstr "" - -#: qcomment.php:45 -msgid "lol" -msgstr "" - -#: qcomment.php:49 -msgid "" -"Quick comments are found near comment boxes, sometimes hidden. Click them to" -" provide simple replies." -msgstr "" - -#: qcomment.php:50 -msgid "Enter quick comments, one per line" -msgstr "" - -#: qcomment.php:55 -msgid "Quick Comment Settings" -msgstr "" diff --git a/qcomment/lang/et/strings.php b/qcomment/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/qcomment/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: qcomment.php:45 -msgid ":-)" -msgstr "" - -#: qcomment.php:45 -msgid ":-(" -msgstr "" - -#: qcomment.php:45 -msgid "lol" -msgstr "" - -#: qcomment.php:49 -msgid "" -"Quick comments are found near comment boxes, sometimes hidden. Click them to" -" provide simple replies." -msgstr "" - -#: qcomment.php:50 -msgid "Enter quick comments, one per line" -msgstr "" - -#: qcomment.php:55 -msgid "Quick Comment Settings" -msgstr "" diff --git a/qcomment/lang/gd/strings.php b/qcomment/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/qcomment/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/qcomment/lang/is/messages.po b/qcomment/lang/is/messages.po deleted file mode 100644 index 40e125c8..00000000 --- a/qcomment/lang/is/messages.po +++ /dev/null @@ -1,45 +0,0 @@ -# ADDON qcomment -# Copyright (C) -# This file is distributed under the same license as the Friendica qcomment addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:30+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: qcomment.php:45 -msgid ":-)" -msgstr "" - -#: qcomment.php:45 -msgid ":-(" -msgstr "" - -#: qcomment.php:45 -msgid "lol" -msgstr "" - -#: qcomment.php:49 -msgid "" -"Quick comments are found near comment boxes, sometimes hidden. Click them to" -" provide simple replies." -msgstr "" - -#: qcomment.php:50 -msgid "Enter quick comments, one per line" -msgstr "" - -#: qcomment.php:55 -msgid "Quick Comment Settings" -msgstr "" diff --git a/qcomment/lang/is/strings.php b/qcomment/lang/is/strings.php index 975c341e..b0d3fd28 100644 --- a/qcomment/lang/is/strings.php +++ b/qcomment/lang/is/strings.php @@ -1,7 +1,10 @@ -strings[":-)"] = ":-)"; +$a->strings[":-("] = ":-("; +$a->strings["lol"] = "lol"; +$a->strings["Quick Comment Settings"] = ""; +$a->strings["Quick comments are found near comment boxes, sometimes hidden. Click them to provide simple replies."] = ""; +$a->strings["Enter quick comments, one per line"] = ""; +$a->strings["Submit"] = "Senda inn"; +$a->strings["Quick Comment settings saved."] = ""; diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index f7126531..1b8bfcbf 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -18,6 +18,7 @@ * */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\DI; diff --git a/quickphoto/README.md b/quickphoto/README.md deleted file mode 100644 index 34af0e71..00000000 --- a/quickphoto/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# QuickPhoto Addon for Friendica - -QuickPhoto is a Friendica addon that simplifies working with images in the editor. It automatically replaces long, cumbersome BBCode structures with a compact shorthand notation, without affecting functionality or compatibility. - ---- - -## Features - -- **Automatic Simplification:** Converts "monster BBCodes" like `[url=...][img=...]...[/img][/url]` instantly into the handy format `[img]|filename description[/img]`. -- **Intelligent Reconstruction:** Before submitting or previewing, the shorthand code is quickly converted back into the original, valid Friendica BBCode. -- **Real-Time Processing:** Responds immediately to drag & drop, copy & paste, and inserting images via editor buttons. -- **Focus Safety:** Cursor management ensures the focus remains stable during automatic conversion while typing. -- **Maximum Compatibility:** Supports both the standard Jot editor and the Compose module, as well as reply fields. -- **Local Cache:** Image data is securely stored in the browser's localStorage and automatically cleared after 12 hours. - ---- - -## How It Works - -The addon operates in a hybrid manner: - -- **Frontend:** A JavaScript watcher scans textareas and simplifies complex image links for better readability while writing. -- **Interface:** It integrates deeply with Friendica's jQuery functions to ensure that preview and save functions always receive the correct original data. -- **Events:** By intercepting submit and preview clicks, it guarantees that shorthand codes are never sent to the server in a format it cannot interpret. - ---- - -## Installation - -1. Create a folder named `quickphoto` in the `addon/` directory of your Friendica installation. -2. Place the file `quickphoto.php` in this folder. -3. Place the file `quickphoto.js` in the same folder. -4. Enable the addon in the Friendica administration area under **Addons**. - - --- - -MIT License - -Copyright (c) 2024-2026 Friendica Project & Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/quickphoto/lang/C/messages.po b/quickphoto/lang/C/messages.po deleted file mode 100644 index 75476018..00000000 --- a/quickphoto/lang/C/messages.po +++ /dev/null @@ -1,22 +0,0 @@ -# ADDON quickphoto -# Copyright (C) -# This file is distributed under the same license as the Friendica quickphoto addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-07 10:18+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: quickphoto.php:18 -msgid "Image description" -msgstr "" diff --git a/quickphoto/quickphoto.js b/quickphoto/quickphoto.js deleted file mode 100644 index f8dc2294..00000000 --- a/quickphoto/quickphoto.js +++ /dev/null @@ -1,126 +0,0 @@ -(function() { - const monsterPattern = /\[url=(.*?)\]\[img=(.*?)\](.*?)\[\/img\]\[\/url\]/gi; - let throttleTimer; - - const i18nDesc = (window.qp_i18n && window.qp_i18n.imageDesc) ? window.qp_i18n.imageDesc : "Image description"; - - const cleanupOldEntries = () => { - const now = Date.now(); - const twelveHours = 12 * 60 * 60 * 1000; - for (let i = 0; i < localStorage.length; i++) { - const key = localStorage.key(i); - if (key && key.startsWith('qp_')) { - try { - const data = JSON.parse(localStorage.getItem(key)); - if (data && data.timestamp && (now - data.timestamp > twelveHours)) { - localStorage.removeItem(key); - } - } catch (e) { localStorage.removeItem(key); } - } - } - }; - - const simplify = (text) => { - if (!text || !text.includes('[url=')) return text; - return text.replace(monsterPattern, (match, urlPart, imgPart, existingDesc) => { - const fileName = imgPart.split('/').pop(); - const storageKey = `qp_${fileName}`; - - localStorage.setItem(storageKey, JSON.stringify({ - url: urlPart, - img: imgPart, - timestamp: Date.now() - })); - - let userDesc = existingDesc.trim() || i18nDesc; - return `[img]${fileName}|${userDesc}[/img]`; - }); - }; - - const reconstruct = (text) => { - if (!text || !text.includes('[img]')) return text; - return text.replace(/\[img\](.*?)\|(.*?)\[\/img\]/g, (match, fileName, desc) => { - const data = localStorage.getItem(`qp_${fileName}`); - if (data) { - const parsed = JSON.parse(data); - const finalDesc = (desc === i18nDesc) ? "" : desc; - return `[url=${parsed.url}][img=${parsed.img}]${finalDesc}[/img][/url]`; - } - return match; - }); - }; - - const applySimplify = (textarea) => { - if (!textarea || !textarea.value || !textarea.value.includes('[/img]')) return; - - (window.requestIdleCallback || function(cb) { return setTimeout(cb, 1); })(() => { - const current = textarea.value; - const simple = simplify(current); - if (current !== simple) { - const start = textarea.selectionStart; - const end = textarea.selectionEnd; - textarea.value = simple; - textarea.setSelectionRange(start, end); - } - }); - }; - - if (typeof jQuery !== 'undefined') { - const originalVal = jQuery.fn.val; - jQuery.fn.val = function(value) { - if (arguments.length === 0 && this.is('textarea')) { - return reconstruct(originalVal.call(this)); - } - if (arguments.length > 0 && this.is('textarea')) { - return originalVal.call(this, simplify(value)); - } - return originalVal.apply(this, arguments); - }; - } - - document.addEventListener('drop', (e) => { - if (e.target.tagName === 'TEXTAREA') { - setTimeout(() => applySimplify(e.target), 150); - } - }, true); - - document.addEventListener('input', (e) => { - if (e.target.tagName === 'TEXTAREA') { - clearTimeout(throttleTimer); - throttleTimer = setTimeout(() => applySimplify(e.target), 500); - } - }); - - document.addEventListener('click', (e) => { - const btn = e.target.closest( - '#wall-submit-preview, #profile-jot-submit, #wall-submit-submit, #jot-submit, ' + - '[id^="comment-edit-submit-"], [id^="comment-edit-preview-link-"]' - ); - - if (btn) { - const textareas = document.querySelectorAll('textarea'); - if (textareas.length > 0) { - textareas.forEach(textarea => { - textarea.value = reconstruct(textarea.value); - if (btn.id.includes('preview')) { - setTimeout(() => applySimplify(textarea), 1000); - } - }); - } - } - }, true); - - setInterval(() => { - if (document.hidden) return; - const textareas = document.querySelectorAll('textarea'); - if (textareas.length === 0) return; - - textareas.forEach(textarea => { - if (textarea.offsetParent !== null) { - applySimplify(textarea); - } - }); - }, 2500); - - cleanupOldEntries(); -})(); diff --git a/quickphoto/quickphoto.php b/quickphoto/quickphoto.php deleted file mode 100644 index 185665a6..00000000 --- a/quickphoto/quickphoto.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -use Friendica\Core\Hook; -use Friendica\DI; - -function quickphoto_install() { - Hook::register('page_header', 'addon/quickphoto/quickphoto.php', 'quickphoto_header'); - Hook::register('post_post', 'addon/quickphoto/quickphoto.php', 'quickphoto_post_hook'); -} - -function quickphoto_header(&$header) { - $desc_label = DI::l10n()->t('Image description'); - - $js_label = addslashes($desc_label); - - $header .= "\n" . ''; - $header .= "\n" . '' . "\n"; -} - -function quickphoto_post_hook(&$item) { - // Placeholder -} \ No newline at end of file diff --git a/randplace/lang/bg/messages.po b/randplace/lang/bg/messages.po deleted file mode 100644 index 3fad2546..00000000 --- a/randplace/lang/bg/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON randplace -# Copyright (C) -# This file is distributed under the same license as the Friendica randplace addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: randplace.php:161 -msgid "Enable Randplace Addon" -msgstr "" - -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" diff --git a/randplace/lang/bg/strings.php b/randplace/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/randplace/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: randplace.php:161 -msgid "Enable Randplace Addon" -msgstr "" - -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" diff --git a/randplace/lang/ca/strings.php b/randplace/lang/ca/strings.php index d34874f6..120fab8c 100644 --- a/randplace/lang/ca/strings.php +++ b/randplace/lang/ca/strings.php @@ -1,7 +1,5 @@ -strings["Randplace Settings"] = "Configuració de Randplace"; +$a->strings["Enable Randplace Addon"] = "Habilitar el Addon de Randplace"; +$a->strings["Submit"] = "Enviar"; diff --git a/randplace/lang/eo/messages.po b/randplace/lang/eo/messages.po deleted file mode 100644 index 7ed15c2b..00000000 --- a/randplace/lang/eo/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON randplace -# Copyright (C) -# This file is distributed under the same license as the Friendica randplace addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: randplace.php:161 -msgid "Enable Randplace Addon" -msgstr "" - -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" diff --git a/randplace/lang/eo/strings.php b/randplace/lang/eo/strings.php index 68e8a64c..38e6ebfa 100644 --- a/randplace/lang/eo/strings.php +++ b/randplace/lang/eo/strings.php @@ -1,7 +1,5 @@ -strings["Randplace Settings"] = "Randplace agordoj."; +$a->strings["Enable Randplace Addon"] = "Aktivigi la Randplace kromprogramon."; +$a->strings["Submit"] = "Sendi"; diff --git a/randplace/lang/et/messages.po b/randplace/lang/et/messages.po deleted file mode 100644 index ad70f2e6..00000000 --- a/randplace/lang/et/messages.po +++ /dev/null @@ -1,28 +0,0 @@ -# ADDON randplace -# Copyright (C) -# This file is distributed under the same license as the Friendica randplace addon package. -# -# -# Translators: -# Rain Hawk, 2020 -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:34+0000\n" -"Last-Translator: Rain Hawk, 2020\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: randplace.php:161 -msgid "Enable Randplace Addon" -msgstr "" - -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" diff --git a/randplace/lang/et/strings.php b/randplace/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/randplace/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: randplace.php:161 -msgid "Enable Randplace Addon" -msgstr "" - -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" diff --git a/randplace/lang/is/strings.php b/randplace/lang/is/strings.php index 975c341e..85e49238 100644 --- a/randplace/lang/is/strings.php +++ b/randplace/lang/is/strings.php @@ -1,7 +1,5 @@ -strings["Randplace Settings"] = "Stilla Randplace"; +$a->strings["Enable Randplace Addon"] = "Kveikja á Randplace einingu"; +$a->strings["Submit"] = "Senda inn"; diff --git a/randplace/lang/ru/messages.po b/randplace/lang/ru/messages.po deleted file mode 100644 index 31b44e86..00000000 --- a/randplace/lang/ru/messages.po +++ /dev/null @@ -1,27 +0,0 @@ -# ADDON randplace -# Copyright (C) -# This file is distributed under the same license as the Friendica randplace addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-21 19:16-0500\n" -"PO-Revision-Date: 2014-06-23 12:34+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: randplace.php:161 -msgid "Enable Randplace Addon" -msgstr "" - -#: randplace.php:166 -msgid "Randplace Settings" -msgstr "" diff --git a/randplace/lang/ru/strings.php b/randplace/lang/ru/strings.php index 0579fc21..46733dc6 100644 --- a/randplace/lang/ru/strings.php +++ b/randplace/lang/ru/strings.php @@ -1,7 +1,5 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} +strings["Randplace Settings"] = "Настройки Случайного места"; +$a->strings["Enable Randplace Addon"] = "Включить Randplace плагин"; +$a->strings["Submit"] = "Подтвердить"; diff --git a/randplace/randplace.php b/randplace/randplace.php index 89a75f98..34f48c6c 100644 --- a/randplace/randplace.php +++ b/randplace/randplace.php @@ -19,7 +19,9 @@ * */ +use Friendica\App; use Friendica\Core\Hook; +use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; @@ -39,7 +41,7 @@ function randplace_install() Hook::register('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); Hook::register('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); - DI::logger()->notice("installed randplace"); + Logger::notice("installed randplace"); } function randplace_uninstall() @@ -49,7 +51,7 @@ function randplace_uninstall() * * Except hooks, they are all unregistered automatically and don't need to be unregistered manually. */ - DI::logger()->notice("removed randplace"); + Logger::notice("removed randplace"); } function randplace_post_hook(&$item) @@ -60,7 +62,7 @@ function randplace_post_hook(&$item) * - A status post by a profile owner * - The profile owner must have allowed our addon */ - DI::logger()->notice('randplace invoked'); + Logger::notice('randplace invoked'); if (!DI::userSession()->getLocalUserId()) { /* non-zero if this is a logged in user of this system */ diff --git a/ratioed/RatioedPanel.php b/ratioed/RatioedPanel.php deleted file mode 100644 index 37e692a5..00000000 --- a/ratioed/RatioedPanel.php +++ /dev/null @@ -1,323 +0,0 @@ -getArgv()[1]) and DI::args()->getArgv()[1] === 'help') { - $template = Renderer::getMarkupTemplate('/help.tpl', 'addon/ratioed/'); - return Renderer::replaceMacros($template, array('$config' => DI::baseUrl() . '/settings/addon')); - } - - $uid = $this->parameters['uid'] ?? 0; - $user = []; - - if ($uid) { - $user = User::getById($uid, ['username', 'blocked']); - if (!$user) { - $this->systemMessages->addNotice($this->t('User not found')); - $this->baseUrl->redirect('ratioed'); - } - } - - $pager = new Pager($this->l10n, $this->args->getQueryString(), 100); - - $valid_orders = [ - 'name', - 'email', - 'register_date', - 'last-activity', - 'last-item', - 'page-flags', - ]; - - $order = 'last-item'; - $order_direction = '-'; - if (!empty($_REQUEST['o'])) { - $new_order = $_REQUEST['o']; - if ($new_order[0] !== '-') { - $order_direction = '+'; - $new_order = substr($new_order, 1); - } - - if (in_array($new_order, $valid_orders)) { - $order = $new_order; - } - } - - $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'active', $order, ($order_direction == '-')); - - $users = array_map($this->setupUserCallback(), $users); - - $header_titles = [ - $this->t('Name'), - $this->t('Email'), - $this->t('Register date'), - $this->t('Last login'), - $this->t('Last public item'), - $this->t('Type'), - $this->t('Blocked by'), - $this->t('Comments last 24h'), - $this->t('Reactions last 24h'), - $this->t('Ratio last 24h'), - $this->t('Replies last month'), - $this->t('Reply likes'), - $this->t('Respondee likes'), - $this->t('OP likes'), - $this->t('Reply guy score'), - ]; - $field_names = [ - 'name', - 'email', - 'register_date', - 'login_date', - 'lastitem_date', - 'page_flags', - 'blocked_by', - 'comments', - 'reactions', - 'ratio', - 'reply_count', - 'reply_likes', - 'reply_respondee_likes', - 'reply_op_likes', - 'reply_guy_score', - ]; - $th_users = array_map(null, $header_titles, $valid_orders, $field_names); - - $count = $this->database->count('user', ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` != ?", 0]); - - $t = Renderer::getMarkupTemplate('ratioed.tpl', 'addon/ratioed'); - return self::getTabsHTML('ratioed') . Renderer::replaceMacros($t, [ - // strings // - '$title' => $this->t('Moderation'), - '$help_url' => $this->baseUrl . '/ratioed/help', - '$page' => $this->t('Behaviour'), - '$select_all' => $this->t('select all'), - '$delete' => $this->t('Delete'), - '$block' => $this->t('Block'), - '$blocked' => $this->t('User blocked'), - '$siteadmin' => $this->t('Site admin'), - '$accountexpired' => $this->t('Account expired'), - '$h_newuser' => $this->t('Create a new user'), - - '$th_users' => $th_users, - '$order_users' => $order, - '$order_direction_users' => $order_direction, - - '$confirm_delete_multi' => $this->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'), - '$confirm_delete' => $this->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'), - - '$form_security_token' => self::getFormSecurityToken('moderation_users_active'), - - // values // - '$baseurl' => $this->baseUrl, - '$query_string' => $this->args->getQueryString(), - - '$users' => $users, - '$count' => $count, - '$pager' => $pager->renderFull($count), - ]); - } - - protected function getReplyGuyRow($contact_uid) - { - $like_vid = Verb::getID(Activity::LIKE); - $post_vid = Verb::getID(Activity::POST); - - /* - * This is a complicated query. - * - * The innermost select retrieves a chain of four posts: an - * original post, a target comment (possibly deep down in the - * thread), a reply from our user, and a like for that reply. - * If there's no like, we still want to count the reply, so we - * use an outer join. - * - * The second select adds "points" for different kinds of - * likes. The outermost select then counts up these points, - * and the number of distinct replies. - */ - $reply_guy_result = DBA::p(' -SELECT - COUNT(distinct reply_id) AS replies_total, - SUM(like_point) AS like_total, - SUM(target_like_point) AS target_like_total, - SUM(original_like_point) AS original_like_total -FROM ( - SELECT - reply_id, - like_date, - like_date IS NOT NULL AS like_point, - like_author = target_author AS target_like_point, - like_author = original_author AS original_like_point - FROM ( - SELECT - original_post.`uri-id` AS original_id, - original_post.`author-id` AS original_author, - original_post.created AS original_date, - target_post.`uri-id` AS target_id, - target_post.`author-id` AS target_author, - target_post.created AS target_date, - reply_post.`uri-id` AS reply_id, - reply_post.`author-id` AS reply_author, - reply_post.created AS reply_date, - like_post.`uri-id` AS like_id, - like_post.`author-id` AS like_author, - like_post.created AS like_date - FROM - post AS original_post - JOIN - post AS target_post - ON - original_post.`uri-id` = target_post.`parent-uri-id` - JOIN - post AS reply_post - ON - target_post.`uri-id` = reply_post.`thr-parent-id` AND - reply_post.`author-id` = ? AND - reply_post.`author-id` != target_post.`author-id` AND - reply_post.`author-id` != original_post.`author-id` AND - reply_post.`uri-id` != reply_post.`thr-parent-id` AND - reply_post.vid = ? AND - reply_post.created > CURDATE() - INTERVAL 1 MONTH - LEFT OUTER JOIN - post AS like_post - ON - reply_post.`uri-id` = like_post.`thr-parent-id` AND - like_post.vid = ? AND - like_post.`author-id` != reply_post.`author-id` - ) AS post_meta -) AS reply_counts -', $contact_uid, $post_vid, $like_vid); - return $reply_guy_result; - } - - // https://stackoverflow.com/a/48283297/235936 - protected function sigFig($value, $digits) - { - if ($value == 0) { - $decimalPlaces = $digits - 1; - } elseif ($value < 0) { - $decimalPlaces = $digits - floor(log10($value * -1)) - 1; - } else { - $decimalPlaces = $digits - floor(log10($value)) - 1; - } - - $answer = ($decimalPlaces > 0) ? - number_format($value, $decimalPlaces) : round($value, $decimalPlaces); - return $answer; - } - - protected function fillReplyGuyData(&$user) - { - $reply_guy_result = $this->getReplyGuyRow($user['user_contact_uid']); - if (DBA::isResult($reply_guy_result)) { - $reply_guy_result_row = DBA::fetch($reply_guy_result); - $user['reply_count'] = (int) $reply_guy_result_row['replies_total'] ?? 0; - $user['reply_likes'] = (int) $reply_guy_result_row['like_total'] ?? 0; - $user['reply_respondee_likes'] = (int) $reply_guy_result_row['target_like_total'] ?? 0; - $user['reply_op_likes'] = (int) $reply_guy_result_row['original_like_total'] ?? 0; - - $denominator = $user['reply_likes'] + $user['reply_respondee_likes'] + $user['reply_op_likes']; - if ($user['reply_count'] === 0) { - $user['reply_guy'] = false; - $user['reply_guy_score'] = 0; - } elseif ($denominator == 0) { - $user['reply_guy'] = true; - $user['reply_guy_score'] = '∞'; - } else { - $reply_guy_score = $user['reply_count'] / $denominator; - $user['reply_guy'] = $reply_guy_score >= 1.0; - $user['reply_guy_score'] = $this->sigFig($reply_guy_score, 2); - } - } else { - $user['reply_count'] = "error"; - $user['reply_likes'] = "error"; - $user['reply_respondee_likes'] = "error"; - $user['reply_op_likes'] = "error"; - $user['reply_guy'] = false; - $user['reply_guy_score'] = 0; - } - } - - protected function setupUserCallback(): \Closure - { - DI::logger()->debug("ratioed: setupUserCallback"); - $parentCallback = parent::setupUserCallback(); - return function ($user) use ($parentCallback) { - $blocked_count = DBA::count('user-contact', ['uid' => $user['uid'], 'is-blocked' => 1]); - $user['blocked_by'] = $blocked_count; - - $self_contact_result = DBA::p('SELECT admin_contact.id AS user_contact_uid FROM contact AS admin_contact JOIN contact AS user_contact ON admin_contact.`uri-id` = user_contact.`uri-id` AND admin_contact.self = 0 AND user_contact.self = 1 WHERE user_contact.uid = ?', $user['uid']); - if (DBA::isResult($self_contact_result)) { - $self_contact_result_row = DBA::fetch($self_contact_result); - $user['user_contact_uid'] = $self_contact_result_row['user_contact_uid']; - } else { - $user['user_contact_uid'] = null; - } - - if ($user['user_contact_uid']) { - $post_engagement_result = DBA::p('SELECT SUM(`comments`) AS `comment_count`, SUM(`activities`) AS `activities_count` FROM `post-engagement` WHERE `post-engagement`.created > DATE_SUB(now(), INTERVAL 1 DAY) AND `post-engagement`.`owner-id` = ?', $user['user_contact_uid']); - if (DBA::isResult($post_engagement_result)) { - $post_engagement_result_row = DBA::fetch($post_engagement_result); - $user['comments'] = $post_engagement_result_row['comment_count']; - $user['reactions'] = $post_engagement_result_row['activities_count']; - if ($user['reactions'] > 0) { - $user['ratio'] = number_format($user['comments'] / $user['reactions'], 1, '.', ''); - $user['ratioed'] = (float)($user['ratio']) >= 2.0; - } else { - $user['reactions'] = 0; - if ($user['comments'] == 0) { - $user['comments'] = 0; - $user['ratio'] = 0; - $user['ratioed'] = false; - } else { - $user['ratio'] = '∞'; - $user['ratioed'] = false; - } - } - } else { - $user['comments'] = 'error'; - $user['reactions'] = 'error'; - $user['ratio'] = 'error'; - $user['ratioed'] = false; - } - } else { - $user['comments'] = 'error'; - $user['reactions'] = 'error'; - $user['ratio'] = 'error'; - $user['ratioed'] = false; - } - - $this->fillReplyGuyData($user); - - $user = $parentCallback($user); - DI::logger()->debug("ratioed: setupUserCallback", [ - 'uid' => $user['uid'], - 'blocked_by' => $user['blocked_by'], - 'comments' => $user['comments'], - 'reactions' => $user['reactions'], - 'ratio' => $user['ratio'], - 'ratioed' => $user['ratioed'], - ]); - return $user; - }; - } -} diff --git a/ratioed/lang/C/messages.po b/ratioed/lang/C/messages.po deleted file mode 100644 index 58e61175..00000000 --- a/ratioed/lang/C/messages.po +++ /dev/null @@ -1,130 +0,0 @@ -# ADDON ratioed -# Copyright (C) -# This file is distributed under the same license as the Friendica ratioed addon package. -# -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-08 13:50+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: RatioedPanel.php:34 -msgid "User not found" -msgstr "" - -#: RatioedPanel.php:69 -msgid "Name" -msgstr "" - -#: RatioedPanel.php:70 -msgid "Email" -msgstr "" - -#: RatioedPanel.php:71 -msgid "Register date" -msgstr "" - -#: RatioedPanel.php:72 -msgid "Last login" -msgstr "" - -#: RatioedPanel.php:73 -msgid "Last public item" -msgstr "" - -#: RatioedPanel.php:74 -msgid "Type" -msgstr "" - -#: RatioedPanel.php:75 -msgid "Blocked by" -msgstr "" - -#: RatioedPanel.php:76 -msgid "Comments last 24h" -msgstr "" - -#: RatioedPanel.php:77 -msgid "Reactions last 24h" -msgstr "" - -#: RatioedPanel.php:78 -msgid "Ratio last 24h" -msgstr "" - -#: RatioedPanel.php:79 -msgid "Replies last month" -msgstr "" - -#: RatioedPanel.php:80 -msgid "Reply likes" -msgstr "" - -#: RatioedPanel.php:81 -msgid "Respondee likes" -msgstr "" - -#: RatioedPanel.php:82 -msgid "OP likes" -msgstr "" - -#: RatioedPanel.php:83 -msgid "Reply guy score" -msgstr "" - -#: RatioedPanel.php:109 -msgid "Moderation" -msgstr "" - -#: RatioedPanel.php:111 ratioed.php:39 -msgid "Behaviour" -msgstr "" - -#: RatioedPanel.php:112 -msgid "select all" -msgstr "" - -#: RatioedPanel.php:113 -msgid "Delete" -msgstr "" - -#: RatioedPanel.php:114 -msgid "Block" -msgstr "" - -#: RatioedPanel.php:115 -msgid "User blocked" -msgstr "" - -#: RatioedPanel.php:116 -msgid "Site admin" -msgstr "" - -#: RatioedPanel.php:117 -msgid "Account expired" -msgstr "" - -#: RatioedPanel.php:118 -msgid "Create a new user" -msgstr "" - -#: RatioedPanel.php:124 -msgid "Selected users will be deleted!\\n\\nEverything these users had posted on this site will be permanently deleted!\\n\\nAre you sure?" -msgstr "" - -#: RatioedPanel.php:125 -msgid "The user {0} will be deleted!\\n\\nEverything this user has posted on this site will be permanently deleted!\\n\\nAre you sure?" -msgstr "" - -#: ratioed.php:42 -msgid "Statistics about users behaviour" -msgstr "" diff --git a/ratioed/ratioed.php b/ratioed/ratioed.php deleted file mode 100644 index 5cc6d539..00000000 --- a/ratioed/ratioed.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ - -use Friendica\Addon\ratioed\RatioedPanel; -use Friendica\Core\Hook; -use Friendica\DI; - -/** - * Sets up the addon hooks and updates data in the database if needed - */ -function ratioed_install() -{ - Hook::register('moderation_users_tabs', 'addon/ratioed/ratioed.php', 'ratioed_users_tabs'); - - DI::logger()->info("ratioed: installed"); -} - -/** - * This is a statement rather than an actual function definition. The simple - * existence of this method is checked to figure out if the addon offers a - * module. - */ -function ratioed_module() {} - -/** - * @brief Adds additional users tab to the moderation panel - * - * @param array $arr Parameters, including "tabs" which is the list to modify, and "selectedTab", which is the currently selected tab ID - */ -function ratioed_users_tabs(array &$arr) { - DI::logger()->debug("ratioed: users tabs"); - - array_push($arr['tabs'], [ - 'label' => DI::l10n()->t('Behaviour'), - 'url' => 'ratioed', - 'sel' => $arr['selectedTab'] == 'ratioed' ? 'active' : '', - 'title' => DI::l10n()->t('Statistics about users behaviour'), - 'id' => 'admin-users-ratioed', - 'accesskey' => 'r', - ]); -} - -/** - * @brief Displays the ratioed tab in the moderation panel - */ -function ratioed_content() { - DI::logger()->debug("ratioed: content"); - - $ratioed = DI::getDice()->create(RatioedPanel::class, [$_SERVER]); - $httpException = DI::getDice()->create(Friendica\Module\Special\HTTPException::class); - $ratioed->run($httpException); -} diff --git a/ratioed/templates/help.tpl b/ratioed/templates/help.tpl deleted file mode 100644 index 0d012ca7..00000000 --- a/ratioed/templates/help.tpl +++ /dev/null @@ -1,145 +0,0 @@ -
-
-

Ratioed Plugin Help

-

- This plugin provides moderators with additional statistics about - the behaviour of users. These may be useful as early warning signs - that warrant more carefully watching the behaviour of a user. They - are not suitable as a trigger for instantly blocking, - muting, or reporting a user, since they lack context. -

-

- The name of the plugin comes - from "The - Ratio", a well-known quick rule of thumb: -

-
- If the Replies:RT ratio is greater than 2:1, you done messed up. -
-

- To "get ratioed" is to receive a large number of comments in a short - space of time, with relatively few likes or boosts. If commenters - were enthusiastic about the posts, they would also have liked or - boosted them. Receiving many comments without such likes or boosts - indicates the comments were probably angry. This anger may or may - not be justified, but either way this is probably something - moderators should be aware of. -

-

- This plugin allows viewing of an actual ratio, calculated over the - last 24 hours. This is a useful timeframe for sudden dogpiling - events that moderators might not otherwise notice. The plugin - also calculates other statistics. -

-

Explanation of Statistics

-

Blocked by

-

- This summarises the number of users on remote servers that have - blocked this user. -

-

- Note that the ActivityPub spec expressly says that - implementations "SHOULD NOT" forward such block messages to - remote servers. Nevertheless some implementations do this - anyway, notably Mastodon. This statistic can only count block - messages from servers that do this, as well as blocks from local - users. As such, it is usually an undercount. -

-

- The reason the spec recommends against forwarding these messages - is that they can lead to retaliation. For this reason, this - plugin deliberately does not provide any way to investigate - exactly who blocked the user. -

-

Comments last 24h

-

- This gives the number of comments made on the top-level posts that - this user made within the last 24 hours. -

-

Reactions last 24h

-

- This collects the number of likes, boosts, or other "one-click" - interactions made on the user's top-level posts within the last 24 - hours. -

-

Ratio last 24h

-

- This is the ratio between "Comments last 24h" and "Reactions last - 24h". It is intended to approximate the traditional ratio as - understood on Twitter. -

-

Replies last month

-

- This is the number of times the user posted a reply to someone - else, on a thread the user did not start, any time in the last - month. -

-

Reply likes

-

- This is the number of likes received by the user on their - replies to other people's posts in the last month. Replies that - receive likes can be assumed to be more of a valuable - contribution than replies that do not. -

-

Respondee likes

-

- The number of times in the last month the user replied to - someone else's comment and that person then liked the reply. - Likes to replies are not necessarily a positive thing, but if - the person you're replying to approves the reply, that's a very - good sign. Of course it's also common in a debate for neither - side to like the other side's comments without that indicating - an unhealthy interaction, so interpret this statistic cautiously. -

-

OP likes

-

- The number of times in the last month the user replied on a - thread and the original poster that started the thread liked the - reply. While there is no formal concept of "ownership" of a - thread, conventionally the original poster is assumed to have - started the thread for a reason, and making replies that do not - fulfil that purpose are bad etiquette. Getting approval from - the original poster therefore is a good sign that the user is - posting replies that are wanted. -

-

Reply guy score

-

- A "reply - guy" is a common Internet phenomenon of people - (disproportionately male) posting unwanted comments on other - (disproportionately female) people's threads, derailing the - conversation. This score loosely quantifies this phenomenon, - as the ratio betwen the number of replies and the sum of likes, - respondee likes, and OP likes. This formula gives extra weight - to particularly relevant likes: a reply to a top-level post that - is liked by the original poster scores the maximum of 3 - "points". A score above 1.0 might indicate cause for concern - for moderators. -

-

- Since this is indicative of long-term behaviour, the score is - calculated over a month instead of 24 hours. -

-

-

Performance

-

- The statistics are computed from scratch each time the page loads. - It's possible that this might put a heavy load on the database, and - the page may take a long time to load. -

-

Extending

-

- Suggestions for additional statistics are welcome, especially from - moderators. This plugin should be considered a sandbox for - experimentation, so it is not necessary to prove that any statistic - is correlated with unwanted behaviour. -

-

- However, this plugin does deal with potentially sensitive - information. Even if moderators do in principle have access to all - information, it should not necessarily be highlighted. Statistics - should be kept anonymous and neutral. Also, they should be - presented only to moderators, not to the users themselves. -

-
-
diff --git a/ratioed/templates/ratioed.tpl b/ratioed/templates/ratioed.tpl deleted file mode 100644 index 2413ed9d..00000000 --- a/ratioed/templates/ratioed.tpl +++ /dev/null @@ -1,131 +0,0 @@ - - - -
-

- {{$title}} - {{$page}} ({{$count}}) - -

-
- - - - - - - {{foreach $th_users as $k=>$th}} - {{if $k < 2 || $order_users == $th.1 || ($k==4 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.5.1])) }} - - {{/if}} - {{/foreach}} - - - - - {{foreach $users as $u}} - - - - - - {{if $order_users == $th_users.2.1}} - - {{/if}} - - {{if $order_users == $th_users.3.1}} - - {{/if}} - - {{if $order_users == $th_users.5.1}} - - {{/if}} - - {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.5.1]) }} - - {{/if}} - - - - - - - - - {{/foreach}} - -
- - {{if $order_users == $th.1}} - {{if $order_direction_users == "+"}} - ↓ - {{else}} - ↑ - {{/if}} - {{else}} - ↕ - {{/if}} - {{$th.0}} - -
{{$u.name}}{{$u.email}}{{$u.register_date}}{{$u.login_date}} - - - {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}} - - {{/if}} - {{if $u.is_admin}}{{/if}} - {{if $u.account_expired}}{{/if}} - {{$u.lastitem_date}} - -
- {{$pager nofilter}} -
-
diff --git a/rendertime/lang/bg/messages.po b/rendertime/lang/bg/messages.po deleted file mode 100644 index f55f683f..00000000 --- a/rendertime/lang/bg/messages.po +++ /dev/null @@ -1,53 +0,0 @@ -# ADDON rendertime -# Copyright (C) -# This file is distributed under the same license as the Friendica rendertime addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-12 22:09+0000\n" -"PO-Revision-Date: 2014-06-23 12:36+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Bulgarian (http://app.transifex.com/Friendica/friendica/language/bg/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: bg\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/bg/strings.php b/rendertime/lang/bg/strings.php deleted file mode 100644 index d912b572..00000000 --- a/rendertime/lang/bg/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -\n" -"Language-Team: Catalan (http://app.transifex.com/Friendica/friendica/language/ca/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ca\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/ca/strings.php b/rendertime/lang/ca/strings.php index d34874f6..ab4fa67a 100644 --- a/rendertime/lang/ca/strings.php +++ b/rendertime/lang/ca/strings.php @@ -1,7 +1,2 @@ -\n" -"Language-Team: Esperanto (http://app.transifex.com/Friendica/friendica/language/eo/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: eo\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/eo/strings.php b/rendertime/lang/eo/strings.php index 68e8a64c..ab4fa67a 100644 --- a/rendertime/lang/eo/strings.php +++ b/rendertime/lang/eo/strings.php @@ -1,7 +1,2 @@ -\n" -"Language-Team: Estonian (http://app.transifex.com/Friendica/friendica/language/et/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: et\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/et/strings.php b/rendertime/lang/et/strings.php deleted file mode 100644 index dfe78358..00000000 --- a/rendertime/lang/et/strings.php +++ /dev/null @@ -1,7 +0,0 @@ -, 2022 # Nicolas Derive, 2022 # Thecross, 2017 @@ -14,8 +13,8 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-12 22:09+0000\n" "PO-Revision-Date: 2014-06-23 12:36+0000\n" -"Last-Translator: cracrayol, 2025\n" -"Language-Team: French (http://app.transifex.com/Friendica/friendica/language/fr/)\n" +"Last-Translator: Nicolas Derive, 2022\n" +"Language-Team: French (http://www.transifex.com/Friendica/friendica/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -24,7 +23,7 @@ msgstr "" #: rendertime.php:30 msgid "Save Settings" -msgstr "Sauvegarder les paramètres" +msgstr "Enregistrer les paramètres" #: rendertime.php:31 msgid "Show callstack" diff --git a/rendertime/lang/fr/strings.php b/rendertime/lang/fr/strings.php index 2d21fdad..d6aed6fa 100644 --- a/rendertime/lang/fr/strings.php +++ b/rendertime/lang/fr/strings.php @@ -5,7 +5,7 @@ function string_plural_select_fr($n){ $n = intval($n); if (($n == 0 || $n == 1)) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; } }} -$a->strings['Save Settings'] = 'Sauvegarder les paramètres'; +$a->strings['Save Settings'] = 'Enregistrer les paramètres'; $a->strings['Show callstack'] = 'Afficher le callstack'; $a->strings['Show detailed performance measures in the callstack. When deactivated, only the summary will be displayed.'] = 'Affiche les performances détaillées dans le callstack. Si désactivé, seul le résumé sera affiché.'; $a->strings['Minimal time'] = 'Temps minimal'; diff --git a/rendertime/lang/gd/messages.po b/rendertime/lang/gd/messages.po deleted file mode 100644 index 9362eb06..00000000 --- a/rendertime/lang/gd/messages.po +++ /dev/null @@ -1,53 +0,0 @@ -# ADDON rendertime -# Copyright (C) -# This file is distributed under the same license as the Friendica rendertime addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-12 22:09+0000\n" -"PO-Revision-Date: 2014-06-23 12:36+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Gaelic, Scottish (http://app.transifex.com/Friendica/friendica/language/gd/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: gd\n" -"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/gd/strings.php b/rendertime/lang/gd/strings.php deleted file mode 100644 index dcbcfe0a..00000000 --- a/rendertime/lang/gd/strings.php +++ /dev/null @@ -1,7 +0,0 @@ - 2 && $n < 20)) { return 2; } else { return 3; } -}} diff --git a/rendertime/lang/is/messages.po b/rendertime/lang/is/messages.po deleted file mode 100644 index 9812a11f..00000000 --- a/rendertime/lang/is/messages.po +++ /dev/null @@ -1,53 +0,0 @@ -# ADDON rendertime -# Copyright (C) -# This file is distributed under the same license as the Friendica rendertime addon package. -# -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: friendica\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-12 22:09+0000\n" -"PO-Revision-Date: 2014-06-23 12:36+0000\n" -"Last-Translator: FULL NAME \n" -"Language-Team: Icelandic (http://app.transifex.com/Friendica/friendica/language/is/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: is\n" -"Plural-Forms: nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/is/strings.php b/rendertime/lang/is/strings.php index 975c341e..ab4fa67a 100644 --- a/rendertime/lang/is/strings.php +++ b/rendertime/lang/is/strings.php @@ -1,7 +1,2 @@ -\n" -"Language-Team: Russian (http://app.transifex.com/Friendica/friendica/language/ru/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" - -#: rendertime.php:30 -msgid "Save Settings" -msgstr "" - -#: rendertime.php:31 -msgid "Show callstack" -msgstr "" - -#: rendertime.php:31 -msgid "" -"Show detailed performance measures in the callstack. When deactivated, only " -"the summary will be displayed." -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time" -msgstr "" - -#: rendertime.php:32 -msgid "Minimal time that an activity needs to be listed in the callstack." -msgstr "" - -#: rendertime.php:57 -#, php-format -msgid "" -"Database: %s/%s, Network: %s, Rendering: %s, Session: %s, I/O: %s, Other: " -"%s, Total: %s" -msgstr "" - -#: rendertime.php:74 -#, php-format -msgid "Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s" -msgstr "" diff --git a/rendertime/lang/ru/strings.php b/rendertime/lang/ru/strings.php index 0579fc21..ab4fa67a 100644 --- a/rendertime/lang/ru/strings.php +++ b/rendertime/lang/ru/strings.php @@ -1,7 +1,2 @@ -=2 && $n%10<=4 && ($n%100<12 || $n%100>14)) { return 1; } else if ($n%10==0 || ($n%10>=5 && $n%10<=9) || ($n%100>=11 && $n%100<=14)) { return 2; } else { return 3; } -}} +isSiteAdmin() && (($_GET['mode'] ?? '') != 'minimal') && !DI::mode()->isMobile() && !DI::mode()->isMobile() && !$ignored) { - $o = $o . '