From: Christian Weiske Date: Sat, 15 Dec 2018 22:36:06 +0000 (+0100) Subject: Use dependency installation via composer X-Git-Tag: v1.0.0 X-Git-Url: https://git.cweiske.de/anoweco.git/commitdiff_plain/1dd6167d9893d05d0d968f0aac90e71cb3a16003 Use dependency installation via composer --- diff --git a/.gitignore b/.gitignore index d1e93ef..689f977 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /data/config.php /README.html +/vendor/ diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..a4340c1 --- /dev/null +++ b/composer.json @@ -0,0 +1,8 @@ +{ + "require": { + "pear/net_url2": "^2.2", + "twig/twig": "^2.5", + "pear/services_libravatar": "^0.2.4", + "pear2/services_linkback": "^0.3.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..e0d4701 --- /dev/null +++ b/composer.lock @@ -0,0 +1,516 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "8f0806c1db09f689e6499c38f58669bd", + "packages": [ + { + "name": "pear/http2", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/pear/HTTP2.git", + "reference": "b87527415aa1439d5abc2c620a37f0047c3b1568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/HTTP2/zipball/b87527415aa1439d5abc2c620a37f0047c3b1568", + "reference": "b87527415aa1439d5abc2c620a37f0047c3b1568", + "shasum": "" + }, + "require-dev": { + "pear/pear-core": "*" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTTP2": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Michael Wallner", + "email": "mike@php.net", + "role": "Lead" + }, + { + "name": "Philippe Jausions", + "email": "jausions@php.net", + "role": "Lead" + } + ], + "description": "Miscellaneous HTTP utilities", + "homepage": "http://pear.php.net/package/HTTP2", + "time": "2016-08-10T19:11:15+00:00" + }, + { + "name": "pear/http_request2", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/pear/HTTP_Request2.git", + "reference": "3599cf0fe455a4e281da464f6510bfc5c2ce54c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/3599cf0fe455a4e281da464f6510bfc5c2ce54c4", + "reference": "3599cf0fe455a4e281da464f6510bfc5c2ce54c4", + "shasum": "" + }, + "require": { + "pear/net_url2": "^2.2.0", + "pear/pear_exception": "^1.0.0", + "php": ">=5.2.0" + }, + "suggest": { + "ext-fileinfo": "Adds support for looking up mime-types using finfo.", + "ext-zlib": "Allows handling gzip compressed responses.", + "lib-curl": "Allows using cURL as a request backend.", + "lib-openssl": "Allows handling SSL requests when not using cURL." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-trunk": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "HTTP_Request2": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Alexey Borzov", + "email": "avb@php.net" + } + ], + "description": "Provides an easy way to perform HTTP requests.", + "homepage": "http://pear.php.net/package/HTTP_Request2", + "keywords": [ + "PEAR", + "curl", + "http", + "request" + ], + "time": "2016-02-13T20:20:39+00:00" + }, + { + "name": "pear/net_url2", + "version": "v2.2.2", + "source": { + "type": "git", + "url": "https://github.com/pear/Net_URL2.git", + "reference": "07fd055820dbf466ee3990abe96d0e40a8791f9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Net_URL2/zipball/07fd055820dbf466ee3990abe96d0e40a8791f9d", + "reference": "07fd055820dbf466ee3990abe96d0e40a8791f9d", + "shasum": "" + }, + "require": { + "php": ">=5.1.4" + }, + "require-dev": { + "phpunit/phpunit": ">=3.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "Net/URL2.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "David Coallier", + "email": "davidc@php.net" + }, + { + "name": "Tom Klingenberg", + "email": "tkli@php.net" + }, + { + "name": "Christian Schmidt", + "email": "chmidt@php.net" + } + ], + "description": "Class for parsing and handling URL. Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of relative URLs.", + "homepage": "https://github.com/pear/Net_URL2", + "keywords": [ + "PEAR", + "net", + "networking", + "rfc3986", + "uri", + "url" + ], + "time": "2017-08-25T06:16:11+00:00" + }, + { + "name": "pear/pear_exception", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/PEAR_Exception.git", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", + "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "shasum": "" + }, + "require": { + "php": ">=4.4.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "class", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "PEAR": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "." + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Helgi Thormar", + "email": "dufuz@php.net" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net" + } + ], + "description": "The PEAR Exception base class.", + "homepage": "https://github.com/pear/PEAR_Exception", + "keywords": [ + "exception" + ], + "time": "2015-02-10T20:07:52+00:00" + }, + { + "name": "pear/services_libravatar", + "version": "v0.2.4", + "source": { + "type": "git", + "url": "https://github.com/pear/Services_Libravatar.git", + "reference": "8b9fda8c896afb18fdedc60ead29ee305ea222e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Services_Libravatar/zipball/8b9fda8c896afb18fdedc60ead29ee305ea222e9", + "reference": "8b9fda8c896afb18fdedc60ead29ee305ea222e9", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Services": "./Services/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "role": "Developer" + }, + { + "name": "Melissa Draper", + "email": "melissa@meldraweb.com", + "role": "Lead" + } + ], + "description": "API interfacing class for libravatar.org", + "homepage": "http://pear.php.net/package/Services_Libravatar", + "time": "2017-08-23T20:23:02+00:00" + }, + { + "name": "pear2/services_linkback", + "version": "v0.3.0", + "source": { + "type": "git", + "url": "https://github.com/pear2/Services_Linkback.git", + "reference": "afee0b32c171c999e20ac199361eb6df650f6483" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear2/Services_Linkback/zipball/afee0b32c171c999e20ac199361eb6df650f6483", + "reference": "afee0b32c171c999e20ac199361eb6df650f6483", + "shasum": "" + }, + "require": { + "pear/http2": "~1.1", + "pear/http_request2": "~2.2", + "pear/net_url2": "~2.2" + }, + "require-dev": { + "phpunit/phpunit": "*", + "squizlabs/php_codesniffer": "~2.6" + }, + "type": "library", + "autoload": { + "psr-0": { + "PEAR2\\Services\\Linkback\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0+" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@php.net", + "homepage": "http://cweiske.de/" + } + ], + "description": "Pingback+webmention client and server implementation ", + "homepage": "http://pear2.php.net/PEAR2_Services_Linkback", + "time": "2016-08-10T19:33:01+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "twig/twig", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "6a5f676b77a90823c2d4eaf76137b771adf31323" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/6a5f676b77a90823c2d4eaf76137b771adf31323", + "reference": "6a5f676b77a90823c2d4eaf76137b771adf31323", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://twig.symfony.com/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "time": "2018-07-13T07:18:09+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/src/anoweco/autoload.php b/src/anoweco/autoload.php index 5fb876a..515e8fa 100644 --- a/src/anoweco/autoload.php +++ b/src/anoweco/autoload.php @@ -26,6 +26,7 @@ if (file_exists(__DIR__ . '/../../lib/PEAR.php')) { ); } +require_once __DIR__ . '/../../vendor/autoload.php'; spl_autoload_register( function ($class) { $file = str_replace(array('\\', '_'), '/', $class) . '.php'; diff --git a/www/www-header.php b/www/www-header.php index 3a7d606..dbca097 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -4,8 +4,6 @@ require_once __DIR__ . '/../src/anoweco/autoload.php'; header("Access-Control-Allow-Origin: *"); -\Twig_Autoloader::register(); - $loader = new \Twig_Loader_Filesystem(__DIR__ . '/../data/templates/'); $twig = new \Twig_Environment( $loader,