diff options
-rw-r--r-- | .default.env | 11 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | .release-it.json | 11 | ||||
-rw-r--r-- | Makefile | 164 | ||||
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | app/class/Config.php | 13 | ||||
-rw-r--r-- | app/fn/fn.php | 7 | ||||
-rw-r--r-- | app/view/templates/home.php | 4 | ||||
-rw-r--r-- | app/view/templates/layout.php | 10 | ||||
-rw-r--r-- | composer.json | 3 | ||||
-rw-r--r-- | composer.lock | 1369 | ||||
-rw-r--r-- | index.php | 17 | ||||
-rw-r--r-- | package-lock.json | 170 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | src/sentry.js | 10 | ||||
-rw-r--r-- | webpack.config.js | 14 |
17 files changed, 1739 insertions, 93 deletions
diff --git a/.default.env b/.default.env index d6692ef..33fb433 100644 --- a/.default.env +++ b/.default.env @@ -1,7 +1,12 @@ # .env -# Build environment. (prod|dev) -ENV=dev +# Build environment. (dev|prod|dist) +ENV=prod # GitHub token used by release-it to publish releases -GITHUB_TOKEN=
\ No newline at end of file +GITHUB_TOKEN= + +# Sentry variables used to publish releases to Sentry +SENTRY_AUTH_TOKEN= +SENTRY_ORG=vincent-peugnet +SENTRY_PROJECT=wcms
\ No newline at end of file @@ -1,15 +1,18 @@ .vscode/* .env *.bundle.js +*.bundle.js.map assets/render/* assets/global/* database/* fonts/* media/* render/ +build/ dist/ vendor/* node_modules/ config.json error_log +VERSION !README.md diff --git a/.release-it.json b/.release-it.json index 0096671..7ab2857 100644 --- a/.release-it.json +++ b/.release-it.json @@ -9,15 +9,8 @@ "dist/*.zip" ] }, - "plugins": { - "@release-it/bumper": { - "out": { - "file": "VERSION", - "type": "text/plain" - } - } - }, "hooks": { - "after:git:release": "make dist" + "after:git:release": "make dist", + "after:release": "make sentryrelease" } }
\ No newline at end of file @@ -2,81 +2,163 @@ include .default.env include .env export -PATH := vendor/bin:node_modules/.bin:$(PATH) -GIT_VERSION := $(shell git --no-pager describe --always --tags) +build_dir := build -js_sources := $(wildcard src/*.js) -js_bundles := $(js_sources:src/%.js=assets/js/%.bundle.js) +# Misc variables. +PATH := vendor/bin:node_modules/.bin:$(PATH) +override GIT_VERSION := $(shell git --no-pager describe --always --tags) +override CUR_VERSION := $(strip $(shell cat VERSION 2>/dev/null)) +override WEBPACK_FLAGS += $(if $(filter $(ENV),dist),-p) +override COMPOSER_FLAGS += $(if $(filter $(ENV),dist),--no-dev --prefer-dist) +PREV_ENV_FILE := $(build_dir)/prev_env +PREV_ENV := $(strip $(shell cat $(PREV_ENV_FILE) 2>/dev/null)) + +# Files variables. +js_src_dir := src +js_sources := $(wildcard $(js_src_dir)/*.js) +js_bundles := $(js_sources:$(js_src_dir)/%.js=assets/js/%.bundle.js) +js_srcmaps := $(js_sources:$(js_src_dir)/%.js=assets/js/%.bundle.js.map) zip_release := dist/w_cms_$(GIT_VERSION).zip -all: vendor build +# Default target. This executes everything targets needed to get a fully +# working development environment. +.PHONY: all +all: $(PREV_ENV_FILE) vendor build -build: $(js_bundles) +# Build generated files. +.PHONY: build +build: VERSION $(PREV_ENV_FILE) $(js_bundles) -watch: node_modules - webpack --env dev --watch +# Run webpack in watch mode. +.PHONY: watch +watch: ENV := dev +watch: + $(MAKE) .watch ENV=$(ENV) -release: +.PHONY: .watch +.watch: $(PREV_ENV_FILE) node_modules + webpack --env $(ENV) --watch + +# Create a new release and upload it on GitHub. +.PHONY: release +release: node_modules release-it -dist: ENV := prod -dist: distclean $(zip_release) +# Inform Sentry of a new release. +.PHONY: sentryrelease +sentryrelease: ENV := dist +sentryrelease: + $(MAKE) .sentryrelease ENV=$(ENV) + +.PHONY: .sentryrelease +.sentryrelease: $(PREV_ENV_FILE) build $(js_srcmaps) + sentry-cli releases new $(GIT_VERSION) + sentry-cli releases set-commits $(GIT_VERSION) --auto + sentry-cli releases files $(GIT_VERSION) upload-sourcemaps assets/js --url-prefix '~/assets/js' --rewrite + sentry-cli releases finalize $(GIT_VERSION) + +# Generate the distribution files. +.PHONY: dist +dist: ENV := dist +dist: + $(MAKE) .dist ENV=$(ENV) + +.PHONY: .dist +.dist: distclean $(zip_release) $(js_srcmaps) dist/w_cms_%.zip: all - @echo "Building Zip release..." + @echo Building Zip release... mkdir -p $(dir $@) - git archive --format=zip HEAD -o $@ +# Include git tracked files (everything except ignored) + needed files. + zip -r $@ \ + $(shell git ls-tree -r HEAD --name-only) \ + VERSION \ + assets/js \ + vendor \ + -x "*test*" \ + -x "*docs*" +# Include non-empty git tracked directories (to keep dir permissions). + zip $@ $(shell git ls-tree -r HEAD --name-only -d) +# Remove non-useful files. zip -d $@ \ - "src*" \ + "$(js_src_dir)/*" \ + $(js_srcmaps) \ .default.env \ .gitignore \ .release-it.json \ - composer.json \ - composer.lock \ Makefile \ + "composer*" \ "package*" \ webpack.config.js - zip -r $@ \ - assets/js \ - vendor \ - -x "*test*" \ - -x "*docs*" -assets/js/%.bundle.js: src/%.js node_modules - @echo "Building JS Bundles..." +# Generate the js bundles (and sourcemaps). +assets/js/%.bundle.js assets/js/%.bundle.js.map: $(js_src_dir)/%.js node_modules webpack.config.js + @echo Building JS Bundles... mkdir -p $(dir $@) -ifeq ($(ENV),prod) - webpack $< -o $@ --env prod -p -else - webpack $< -o $@ --env dev -endif + webpack $< -o $@ --env $(ENV) $(WEBPACK_FLAGS) +# Generate a .env file if none is present. .env: - cp .default.env .env + cp .default.env $@ -vendor: composer.json composer.lock - @echo "Installing PHP dependencies..." -ifeq ($(ENV),prod) - composer install --no-dev --prefer-dist +# Generate the VERSION file. +VERSION: .FORCE +ifneq ($(CUR_VERSION),$(GIT_VERSION)) + echo $(GIT_VERSION) > $@ +endif + +# Trick to force rebuild if the build environment has changed. +ifneq ($(PREV_ENV),$(ENV)) +$(PREV_ENV_FILE): touch +ifdef PREV_ENV + @echo Build env has changed ! else - composer install + @echo New build env. +endif + mkdir -p $(dir $@) + echo $(ENV) > $@ endif +# Install PHP dependencies. +vendor: composer.json composer.lock + @echo Installing PHP dependencies... + composer install $(COMPOSER_FLAGS) + +# Install JS dependencies. node_modules: package.json package-lock.json - @echo "Installing JS dependencies..." + @echo Installing JS dependencies... npm install --loglevel=error +# Clean files generated by `make all`. +.PHONY: clean clean: buildclean - @echo "Cleaning PHP..." + @echo Cleaning make artifacts... rm -rf vendor - @echo "Cleaning JS..." rm -rf node_modules + rm -rf VERSION -distclean: buildclean +# Clean files generated by `make dist`. +.PHONY: distclean +distclean: + @echo Cleaning dist artifacts... rm -rf dist +# Clean files generated by `make build`. +.PHONY: buildclean buildclean: - @echo "Cleaning build artifacts..." + @echo Cleaning build artifacts... rm -rf $(js_bundles) - -.PHONY: all build watch release dist clean distclean buildclean + rm -rf $(js_srcmaps) + rm -rf $(build_dir) + +# Touch files affected by the build environment to force the execution +# of the corresponding targets. +.PHONY: touch +touch: + touch $(js_sources) + touch composer.json + +# Special (fake) target to always run a target but have Make consider +# this updated if it was actually rewritten (a .PHONY target is always +# considered new). +.FORCE: ; @@ -73,6 +73,19 @@ If you want to contribute to the project. The last two commands can be run at once using only `make`. +There are 3 different build environments that `make` can use: + +- **`dev`** _when developing the application._ + It installs every dependencies and builds big but easy-to-debug js bundles. + +- **`prod`** _when installing from sources a deployed production application._ + It installs every dependencies and builds minified js bundles. + +- **`dist`** _to create the releases' distribution zip._ + It strips all the development dependencies and the error reporting module and the sourcemaps of the js bundles are hidden. It can also be used for a production environment if the error reports are not used. + +The build environment can be set either for each `make` command by changing it in the `.env` file or on a per command basis by adding it at the end of the command (e.g. `make build ENV=prod`). + ## JS development While developing the JS sources it is useful to run webpack in watch mode so that the bundles get built at each file change. To do so, use the following command: @@ -81,11 +94,16 @@ While developing the JS sources it is useful to run webpack in watch mode so tha ## Publish a new release -The release process uses [release-it](https://github.com/release-it/release-it), so to create and publish a new release you will need a [GitHub personnal access token](https://github.com/settings/tokens) with repository access, saved in a `.env` file like so: +The release process uses [release-it](https://github.com/release-it/release-it) and uploads sourcemaps to [Sentry](https://sentry.io/). So to create and publish a new release you will need two access tokens: +- a [GitHub personnal access token](https://github.com/settings/tokens) with `repository` access +- a [Sentry authentification token](https://sentry.io/settings/account/api/auth-tokens/) with `project:read`, `project:releases` and `org:read` access + +saved in a `.env` file like so: ```bash # .env -GITHUB_TOKEN='{{github token value}}' +GITHUB_TOKEN='<github token value>' +SENTRY_AUTH_TOKEN='<sentry token value>' ``` Then, to make the release, run the following command: diff --git a/VERSION b/VERSION deleted file mode 100644 index 5849151..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.7.5
\ No newline at end of file diff --git a/app/class/Config.php b/app/class/Config.php index 1a4bb17..555129b 100644 --- a/app/class/Config.php +++ b/app/class/Config.php @@ -32,6 +32,7 @@ abstract class Config protected static $homeredirect = null; protected static $interfacecss = null; protected static $bookmark = []; + protected static $sentrydsn = ''; // _______________________________________ F U N _______________________________________ @@ -248,6 +249,11 @@ abstract class Config return self::$bookmark; } + public static function sentrydsn() + { + return self::$sentrydsn; + } + // __________________________________________ S E T ______________________________________ @@ -426,6 +432,13 @@ abstract class Config } } + public static function setsentrydsn($sentrydsn) + { + if (is_string($sentrydsn)) { + self::$sentrydsn = $sentrydsn; + } + } + diff --git a/app/fn/fn.php b/app/fn/fn.php index f462d2d..ccccfb9 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -72,11 +72,16 @@ function idclean(string $input) return $input; } +function isreportingerrors() +{ + return function_exists('Sentry\init') && !empty(Wcms\Config::sentrydsn()); +} + function getversion() { if(file_exists('VERSION')) { - $version = file_get_contents('VERSION'); + $version = trim(file_get_contents('VERSION')); } else { $version = 'unknown'; } diff --git a/app/view/templates/home.php b/app/view/templates/home.php index 9758c95..01bc0e4 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -173,10 +173,10 @@ <?php $this->insert('footer', ['footer' => $footer]) ?> - <?php } ?> + <script src="<?= Wcms\Model::jspath() ?>home.bundle.js"></script> + <?php } ?> - <script src="<?= Wcms\Model::jspath() ?>home.bundle.js"></script> </body> diff --git a/app/view/templates/layout.php b/app/view/templates/layout.php index 85351d6..9259fda 100644 --- a/app/view/templates/layout.php +++ b/app/view/templates/layout.php @@ -17,7 +17,17 @@ if (!empty(Wcms\Config::interfacecss())) { echo '<link rel="stylesheet" href="' . Wcms\Model::csspath() . Wcms\Config::interfacecss() . '">'; } + if (isreportingerrors()) { ?> + <script> + const sentrydsn = '<?= Wcms\Config::sentrydsn() ?>'; + const version = '<?= getversion() ?>'; + const url = '<?= Wcms\Config::url() ?>'; + const basepath = '<?= Wcms\Config::basepath() ?>'; + </script> + <script src="https://browser.sentry-cdn.com/5.9.0/bundle.min.js"></script> + <script src="<?= Wcms\Model::jspath() ?>sentry.bundle.js"></script> + <?php } ?> </head> diff --git a/composer.json b/composer.json index b3ddbd0..7b7a74a 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,9 @@ "league/plates": "^3.3", "michelf/php-markdown": "^1.8" }, + "require-dev": { + "sentry/sdk": "^2.0" + }, "autoload": { "psr-4": { "Wcms\\": "app/class" diff --git a/composer.lock b/composer.lock index bbd865c..032b962 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "52b153ad00e36470a69f2e3fe33019b9", + "content-hash": "e05bfe26b073b9471312ec3c4fdd83fe", "packages": [ { "name": "altorouter/altorouter", @@ -219,7 +219,1372 @@ "time": "2018-01-15T00:49:33+00:00" } ], - "packages-dev": [], + "packages-dev": [ + { + "name": "clue/stream-filter", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71", + "reference": "5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2019-04-09T12:31:48+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2019-07-01T23:21:34+00:00" + }, + { + "name": "http-interop/http-factory-guzzle", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/http-interop/http-factory-guzzle.git", + "reference": "34861658efb9899a6618cef03de46e2a52c80fc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/34861658efb9899a6618cef03de46e2a52c80fc0", + "reference": "34861658efb9899a6618cef03de46e2a52c80fc0", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.4.2", + "psr/http-factory": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.5", + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Factory\\Guzzle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "An HTTP Factory using Guzzle PSR7", + "keywords": [ + "factory", + "http", + "psr-17", + "psr-7" + ], + "time": "2018-07-31T19:32:56+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "1.2", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.2.0", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "time": "2018-06-13T13:22:40+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-02-21T12:16:21+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, + { + "name": "php-http/client-common", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "2b8aa3c4910afc21146a9c8f96adb266e869517a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/2b8aa3c4910afc21146a9c8f96adb266e869517a", + "reference": "2b8aa3c4910afc21146a9c8f96adb266e869517a", + "shasum": "" + }, + "require": { + "php": "^7.1", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": " ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^5.1", + "phpspec/prophecy": "^1.8", + "sebastian/comparator": "^3.0" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2019-02-03T16:49:09+00:00" + }, + { + "name": "php-http/curl-client", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/curl-client.git", + "reference": "e7a2a5ebcce1ff7d75eaf02b7c85634a6fac00da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/curl-client/zipball/e7a2a5ebcce1ff7d75eaf02b7c85634a6fac00da", + "reference": "e7a2a5ebcce1ff7d75eaf02b7c85634a6fac00da", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": "^7.1", + "php-http/discovery": "^1.6", + "php-http/httplug": "^2.0", + "php-http/message": "^1.2", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "symfony/options-resolver": "^3.4 || ^4.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.0", + "php-http/client-integration-tests": "^2.0", + "phpunit/phpunit": "^7.5", + "zendframework/zend-diactoros": "^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Curl\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Михаил Красильников", + "email": "m.krasilnikov@yandex.ru" + } + ], + "description": "PSR-18 and HTTPlug Async client with cURL", + "homepage": "http://php-http.org", + "keywords": [ + "curl", + "http", + "psr-18" + ], + "time": "2019-03-05T19:59:23+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "e822f86a6983790aa17ab13aa7e69631e86806b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/e822f86a6983790aa17ab13aa7e69631e86806b6", + "reference": "e822f86a6983790aa17ab13aa7e69631e86806b6", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "conflict": { + "nyholm/psr7": "<1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^4.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2019-06-30T09:04:27+00:00" + }, + { + "name": "php-http/httplug", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "b3842537338c949f2469557ef4ad4bdc47b58603" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/b3842537338c949f2469557ef4ad4bdc47b58603", + "reference": "b3842537338c949f2469557ef4ad4bdc47b58603", + "shasum": "" + }, + "require": { + "php": "^7.0", + "php-http/promise": "^1.0", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2018-10-31T09:14:44+00:00" + }, + { + "name": "php-http/message", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "ce8f43ac1e294b54aabf5808515c3554a19c1e1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/ce8f43ac1e294b54aabf5808515c3554a19c1e1c", + "reference": "ce8f43ac1e294b54aabf5808515c3554a19c1e1c", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^7.1", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2019-08-05T06:55:08+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "496a823ef742b632934724bf769560c2a5c7c44e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/496a823ef742b632934724bf769560c2a5c7c44e", + "reference": "496a823ef742b632934724bf769560c2a5c7c44e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "time": "2018-10-30T23:29:13+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/uuid", + "version": "3.8.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "^1.0|^2.0|9.99.99", + "php": "^5.4 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "codeception/aspect-mock": "^1.0 | ~2.0.0", + "doctrine/annotations": "~1.2.0", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", + "ircmaxell/random-lib": "^1.1", + "jakub-onderka/php-parallel-lint": "^0.9.0", + "mockery/mockery": "^0.9.9", + "moontoast/math": "^1.1", + "php-mock/php-mock-phpunit": "^0.3|^1.1", + "phpunit/phpunit": "^4.7|^5.0|^6.5", + "squizlabs/php_codesniffer": "^2.3" + }, + "suggest": { + "ext-ctype": "Provides support for PHP Ctype functions", + "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", + "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", + "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "moontoast/math": "Provides support for converting UUID to 128-bit integer (in string form).", + "ramsey/uuid-console": "A console application for generating UUIDs with ramsey/uuid", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marijn Huizendveld", + "email": "marijn.huizendveld@gmail.com" + }, + { + "name": "Thibaud Fabre", + "email": "thibaud@aztech.io" + }, + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", + "homepage": "https://github.com/ramsey/uuid", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "time": "2018-07-19T23:38:55+00:00" + }, + { + "name": "sentry/sdk", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/getsentry/sentry-php-sdk.git", + "reference": "4c115873c86ad5bd0ac6d962db70ca53bf8fb874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/4c115873c86ad5bd0ac6d962db70ca53bf8fb874", + "reference": "4c115873c86ad5bd0ac6d962db70ca53bf8fb874", + "shasum": "" + }, + "require": { + "http-interop/http-factory-guzzle": "^1.0", + "php-http/curl-client": "^1.0|^2.0", + "sentry/sentry": "^2.1.3" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sentry", + "email": "accounts@sentry.io" + } + ], + "description": "This is a metapackage shipping sentry/sentry with a recommended http client.", + "time": "2019-09-09T19:54:44+00:00" + }, + { + "name": "sentry/sentry", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/getsentry/sentry-php.git", + "reference": "a74999536b9119257cb1a4b1aa038e4a08439f67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/a74999536b9119257cb1a4b1aa038e4a08439f67", + "reference": "a74999536b9119257cb1a4b1aa038e4a08439f67", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/promises": "^1.3", + "jean85/pretty-package-versions": "^1.2", + "php": "^7.1", + "php-http/async-client-implementation": "^1.0", + "php-http/client-common": "^1.5|^2.0", + "php-http/discovery": "^1.6.1", + "php-http/httplug": "^1.1|^2.0", + "php-http/message": "^1.5", + "psr/http-message-implementation": "^1.0", + "ramsey/uuid": "^3.3", + "symfony/options-resolver": "^2.7|^3.0|^4.0", + "zendframework/zend-diactoros": "^1.4|^2.0" + }, + "conflict": { + "php-http/client-common": "1.8.0", + "raven/raven": "*" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.13", + "monolog/monolog": "^1.3|^2.0", + "php-http/mock-client": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpunit/phpunit": "^7.5", + "symfony/phpunit-bridge": "^4.3", + "vimeo/psalm": "^3.4" + }, + "suggest": { + "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Sentry\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sentry", + "email": "accounts@sentry.io" + } + ], + "description": "A PHP SDK for Sentry (http://sentry.io)", + "homepage": "http://sentry.io", + "keywords": [ + "crash-reporting", + "crash-reports", + "error-handler", + "error-monitoring", + "log", + "logging", + "sentry" + ], + "time": "2019-11-04T10:30:51+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v4.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4", + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2019-10-28T20:59:01+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" + }, + { + "name": "zendframework/zend-diactoros", + "version": "2.1.5", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-diactoros.git", + "reference": "6dcf9e760a6b476f3e9d80abbc9ce9c4aa921f9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/6dcf9e760a6b476f3e9d80abbc9ce9c4aa921f9c", + "reference": "6dcf9e760a6b476f3e9d80abbc9ce9c4aa921f9c", + "shasum": "" + }, + "require": { + "php": "^7.1", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "ext-dom": "*", + "ext-libxml": "*", + "http-interop/http-factory-tests": "^0.5.0", + "php-http/psr7-integration-tests": "dev-master", + "phpunit/phpunit": "^7.0.2", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev", + "dev-develop": "2.2.x-dev", + "dev-release-1.8": "1.8.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php" + ], + "psr-4": { + "Zend\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR HTTP Message implementations", + "keywords": [ + "http", + "psr", + "psr-7" + ], + "time": "2019-10-10T17:38:20+00:00" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], @@ -14,11 +14,28 @@ require('./vendor/autoload.php'); $app = new Wcms\Application(); $app->wakeup(); +if (isreportingerrors()) { + Sentry\init([ + 'dsn' => Wcms\Config::sentrydsn(), + 'release' => getversion(), + 'project_root' => 'app', + ]); + Sentry\configureScope(function ($scope) { + $scope->setUser([ + 'id' => Wcms\Config::url(), + 'username' => Wcms\Config::basepath(), + ]); + }); +} + try { $matchoper = new Wcms\Routes(); $matchoper->match(); } catch (Exception $e) { + if (isreportingerrors()) { + Sentry\captureException($e); + } echo '<h1>⚠ Woops ! There is a little problem : </h1>', $e->getMessage(), "\n"; } diff --git a/package-lock.json b/package-lock.json index 7dbe19c..cc91b99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,18 +124,81 @@ "universal-user-agent": "^4.0.0" } }, - "@release-it/bumper": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@release-it/bumper/-/bumper-1.0.5.tgz", - "integrity": "sha512-LqfiUu5IgzdYAHH8+VwVEg30+Q7sRSD44XuwqbfVwhQJYmScO6Ik0Eet+FOAxYr4EskwK8KM4TjsdX+QurgZqA==", + "@sentry/browser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.9.0.tgz", + "integrity": "sha512-KTpmAau98QyJZtoV7LVYEFd1cdKQGk5yHlRyP3pCkhDcRbgicBNR3umdRDpsI5Ozgix3zNlyQprz0iQPmrPNRQ==", "dev": true, "requires": { - "detect-indent": "^6.0.0", - "lodash.castarray": "^4.4.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "mock-fs": "^4.10.1", - "release-it": "^12.4.2" + "@sentry/core": "5.8.0", + "@sentry/types": "5.7.1", + "@sentry/utils": "5.8.0", + "tslib": "^1.9.3" + } + }, + "@sentry/cli": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-1.49.0.tgz", + "integrity": "sha512-Augz7c42Cxz/xWQ/NOVjUGePKVA370quvskWbCICMUwxcTvKnCLI+7KDdzEoCexj4MSuxFfBzLnrrn4w2+c9TQ==", + "dev": true, + "requires": { + "fs-copy-file-sync": "^1.1.1", + "https-proxy-agent": "^3.0.0", + "mkdirp": "^0.5.1", + "node-fetch": "^2.1.2", + "progress": "2.0.0", + "proxy-from-env": "^1.0.0" + } + }, + "@sentry/core": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.8.0.tgz", + "integrity": "sha512-aAh2KLidIXJVGrxmHSVq2eVKbu7tZiYn5ylW6yzJXFetS5z4MA+JYaSBaG2inVYDEEqqMIkb17TyWxxziUDieg==", + "dev": true, + "requires": { + "@sentry/hub": "5.8.0", + "@sentry/minimal": "5.8.0", + "@sentry/types": "5.7.1", + "@sentry/utils": "5.8.0", + "tslib": "^1.9.3" + } + }, + "@sentry/hub": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.8.0.tgz", + "integrity": "sha512-VdApn1ZCNwH1wwQwoO6pu53PM/qgHG+DQege0hbByluImpLBhAj9w50nXnF/8KzV4UoMIVbzCb6jXzMRmqqp9A==", + "dev": true, + "requires": { + "@sentry/types": "5.7.1", + "@sentry/utils": "5.8.0", + "tslib": "^1.9.3" + } + }, + "@sentry/minimal": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.8.0.tgz", + "integrity": "sha512-MIlFOgd+JvAUrBBmq7vr9ovRH1HvckhnwzHdoUPpKRBN+rQgTyZy1o6+kA2fASCbrRqFCP+Zk7EHMACKg8DpIw==", + "dev": true, + "requires": { + "@sentry/hub": "5.8.0", + "@sentry/types": "5.7.1", + "tslib": "^1.9.3" + } + }, + "@sentry/types": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.7.1.tgz", + "integrity": "sha512-tbUnTYlSliXvnou5D4C8Zr+7/wJrHLbpYX1YkLXuIJRU0NSi81bHMroAuHWILcQKWhVjaV/HZzr7Y/hhWtbXVQ==", + "dev": true + }, + "@sentry/utils": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.8.0.tgz", + "integrity": "sha512-KDxUvBSYi0/dHMdunbxAxD3389pcQioLtcO6CI6zt/nJXeVFolix66cRraeQvqupdLhvOk/el649W4fCPayTHw==", + "dev": true, + "requires": { + "@sentry/types": "5.7.1", + "tslib": "^1.9.3" } }, "@sindresorhus/is": { @@ -376,6 +439,15 @@ "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", "dev": true }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -1531,12 +1603,6 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, - "detect-indent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", - "dev": true - }, "detect-repo-changelog": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/detect-repo-changelog/-/detect-repo-changelog-1.0.1.tgz", @@ -1687,6 +1753,21 @@ "is-arrayish": "^0.2.1" } }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2117,6 +2198,12 @@ "readable-stream": "^2.0.0" } }, + "fs-copy-file-sync": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/fs-copy-file-sync/-/fs-copy-file-sync-1.1.1.tgz", + "integrity": "sha512-2QY5eeqVv4m2PfyMiEuy9adxNP+ajf+8AR05cEi+OAzPcOj90hvFImeZhTmKLBgSd9EvG33jsD7ZRxsx9dThkQ==", + "dev": true + }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -2939,6 +3026,33 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "https-proxy-agent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", + "integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3479,12 +3593,6 @@ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, - "lodash.castarray": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", - "integrity": "sha1-wCUTUV4wna3dTCTGDP3c9ZdtkRU=", - "dev": true - }, "lodash.find": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz", @@ -3758,12 +3866,6 @@ } } }, - "mock-fs": { - "version": "4.10.2", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.2.tgz", - "integrity": "sha512-ewPQ83O4U8/Gd8I15WoB6vgTTmq5khxBskUWCRvswUqjCfOOTREmxllztQOm+PXMWUxATry+VBWXQJloAyxtbQ==", - "dev": true - }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -4359,6 +4461,12 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, "promise-inflight": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", @@ -4371,6 +4479,12 @@ "integrity": "sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg==", "dev": true }, + "proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=", + "dev": true + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", diff --git a/package.json b/package.json index ad88d1d..e2c0a41 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "codemirror": "^5.49.0" }, "devDependencies": { - "@release-it/bumper": "^1.0.5", + "@sentry/browser": "^5.9.0", + "@sentry/cli": "^1.49.0", "css-loader": "^3.2.0", "prettier": "^1.18.2", "prettier-webpack-plugin": "^1.2.0", diff --git a/src/sentry.js b/src/sentry.js new file mode 100644 index 0000000..d30752d --- /dev/null +++ b/src/sentry.js @@ -0,0 +1,10 @@ +import * as Sentry from '@sentry/browser'; + +Sentry.init({ + dsn: sentrydsn, + release: version, +}); +Sentry.setUser({ + id: url, + username: basepath, +}); diff --git a/webpack.config.js b/webpack.config.js index b4a445a..9c6607d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,17 +5,22 @@ module.exports = (env) => { return { // Environment dependent mode: env == 'dev' ? 'development' : 'production', - devtool: env == 'dev' ? 'inline-source-map' : 'none', + devtool: env == 'dev' ? + 'cheap-eval-source-map' : + env == 'dist' ? + 'hidden-source-map' : + 'source-map', stats: env == 'dev' ? {} : { warnings: false }, // Constant entry: { edit: './src/edit.js', home: './src/home.js', + sentry: './src/sentry.js', }, output: { - filename: 'assets/js/[name].bundle.js', - path: path.resolve(__dirname), + filename: '[name].bundle.js', + path: path.resolve(__dirname, 'assets', 'js'), libraryTarget: 'window' }, module: { @@ -36,5 +41,8 @@ module.exports = (env) => { singleQuote: true, }) ], + externals: { + '@sentry/browser': 'Sentry', + }, } }; |