Update composer package pear2/services_linkback from v0.3.0 to v0.4.0 master github/master
authorChristian Weiske <cweiske@cweiske.de>
Thu, 30 Nov 2023 10:00:40 +0000 (11:00 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 30 Nov 2023 10:00:44 +0000 (11:00 +0100)
.. so we get pear/http2 2.0.0 that works on PHP8

.gitignore
composer.json [new file with mode: 0644]
composer.lock [new file with mode: 0644]
data/templates/index.htm
data/templates/latest-atom.htm [new file with mode: 0644]
data/templates/latest.htm
data/templates/post-like.htm
data/templates/post-reply.htm
src/anoweco/autoload.php
www/latest-atom.php [new file with mode: 0644]
www/www-header.php

index d1e93efa63f884d883ea5bfced25f073329909ce..689f977809ae6aee8adcce467aa9a7f8853da28f 100644 (file)
@@ -1,2 +1,3 @@
 /data/config.php
 /README.html
+/vendor/
diff --git a/composer.json b/composer.json
new file mode 100644 (file)
index 0000000..b26790c
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    "require": {
+        "pear/net_url2": "^2.2",
+        "twig/twig": "^3.0",
+        "pear/services_libravatar": "^0.2.4",
+        "pear2/services_linkback": "^0.4.0"
+    }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644 (file)
index 0000000..9ded57a
--- /dev/null
@@ -0,0 +1,673 @@
+{
+    "_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": "875fa1befaae8ac8d43aa38d81775c35",
+    "packages": [
+        {
+            "name": "pear/http2",
+            "version": "v2.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/pear/HTTP2.git",
+                "reference": "72e15b4faa86f6109c6fc3aa82c5515b6453b3b5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/pear/HTTP2/zipball/72e15b4faa86f6109c6fc3aa82c5515b6453b3b5",
+                "reference": "72e15b4faa86f6109c6fc3aa82c5515b6453b3b5",
+                "shasum": ""
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^9"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "HTTP2": "./"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "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",
+            "support": {
+                "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=HTTP2",
+                "source": "https://github.com/pear/HTTP2"
+            },
+            "time": "2023-03-22T20:22:11+00:00"
+        },
+        {
+            "name": "pear/http_request2",
+            "version": "v2.6.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/pear/HTTP_Request2.git",
+                "reference": "f010a16ccddd1ee7d2ee085e8006ee712c00f706"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/pear/HTTP_Request2/zipball/f010a16ccddd1ee7d2ee085e8006ee712c00f706",
+                "reference": "f010a16ccddd1ee7d2ee085e8006ee712c00f706",
+                "shasum": ""
+            },
+            "require": {
+                "pear/net_url2": "^2.2.0",
+                "pear/pear_exception": "^1.0.0",
+                "php": ">=5.6.0"
+            },
+            "require-dev": {
+                "yoast/phpunit-polyfills": "^1.0.0"
+            },
+            "suggest": {
+                "ext-curl": "Allows using cURL as a request backend.",
+                "ext-fileinfo": "Adds support for looking up mime-types using finfo.",
+                "ext-openssl": "Allows handling SSL requests when not using cURL.",
+                "ext-zlib": "Allows handling gzip compressed responses."
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "HTTP_Request2": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Alexey Borzov",
+                    "email": "avb@php.net"
+                }
+            ],
+            "description": "Provides an easy way to perform HTTP requests.",
+            "homepage": "https://pear.php.net/package/HTTP_Request2",
+            "keywords": [
+                "PEAR",
+                "curl",
+                "http",
+                "request"
+            ],
+            "support": {
+                "docs": "https://pear.php.net/manual/en/package.http.http-request2.php",
+                "issues": "https://github.com/pear/HTTP_Request2/issues",
+                "source": "https://github.com/pear/HTTP_Request2"
+            },
+            "time": "2023-11-01T19:51:41+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"
+            ],
+            "support": {
+                "issues": "https://pear.php.net/bugs/search.php?cmd=display&package_name[]=Net_URL2",
+                "source": "https://github.com/pear/Net_URL2"
+            },
+            "time": "2017-08-25T06:16:11+00:00"
+        },
+        {
+            "name": "pear/pear_exception",
+            "version": "v1.0.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/pear/PEAR_Exception.git",
+                "reference": "b14fbe2ddb0b9f94f5b24cf08783d599f776fff0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/b14fbe2ddb0b9f94f5b24cf08783d599f776fff0",
+                "reference": "b14fbe2ddb0b9f94f5b24cf08783d599f776fff0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.2.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "<9"
+            },
+            "type": "class",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "classmap": [
+                    "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"
+            ],
+            "support": {
+                "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PEAR_Exception",
+                "source": "https://github.com/pear/PEAR_Exception"
+            },
+            "time": "2021-03-21T15:43:46+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",
+            "support": {
+                "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Services_Libravatar",
+                "source": "https://github.com/pear/Services_Libravatar"
+            },
+            "time": "2017-08-23T20:23:02+00:00"
+        },
+        {
+            "name": "pear2/services_linkback",
+            "version": "v0.4.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/pear2/Services_Linkback.git",
+                "reference": "61790889871cae0bc6e54adb2637b9e0ec93275f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/pear2/Services_Linkback/zipball/61790889871cae0bc6e54adb2637b9e0ec93275f",
+                "reference": "61790889871cae0bc6e54adb2637b9e0ec93275f",
+                "shasum": ""
+            },
+            "require": {
+                "ext-xmlrpc": "*",
+                "pear/http2": "^2.0",
+                "pear/http_request2": "^2.5",
+                "pear/net_url2": "^2.2"
+            },
+            "require-dev": {
+                "pear/stream_var": "^2.0",
+                "phpunit/phpunit": "^9",
+                "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",
+            "support": {
+                "email": "pear-general@lists.php.net",
+                "issues": "https://github.com/pear2/Services_Linkback/issues/",
+                "source": "https://github.com/pear2/Services_Linkback/tree/v0.4.0"
+            },
+            "time": "2023-03-22T21:18:04+00:00"
+        },
+        {
+            "name": "symfony/polyfill-ctype",
+            "version": "v1.28.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-ctype.git",
+                "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
+                "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "provide": {
+                "ext-ctype": "*"
+            },
+            "suggest": {
+                "ext-ctype": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.28-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Ctype\\": ""
+                }
+            },
+            "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"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2023-01-26T09:26:14+00:00"
+        },
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "v1.28.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "42292d99c55abe617799667f454222c54c60e229"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
+                "reference": "42292d99c55abe617799667f454222c54c60e229",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "provide": {
+                "ext-mbstring": "*"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.28-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "bootstrap.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                }
+            },
+            "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"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2023-07-28T09:04:16+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php80",
+            "version": "v1.28.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php80.git",
+                "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
+                "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.28-dev"
+                },
+                "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"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2023-01-26T09:26:14+00:00"
+        },
+        {
+            "name": "twig/twig",
+            "version": "v3.8.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/twigphp/Twig.git",
+                "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/twigphp/Twig/zipball/9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
+                "reference": "9d15f0ac07f44dc4217883ec6ae02fd555c6f71d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/polyfill-ctype": "^1.8",
+                "symfony/polyfill-mbstring": "^1.3",
+                "symfony/polyfill-php80": "^1.22"
+            },
+            "require-dev": {
+                "psr/container": "^1.0|^2.0",
+                "symfony/phpunit-bridge": "^5.4.9|^6.3|^7.0"
+            },
+            "type": "library",
+            "autoload": {
+                "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": "Twig Team",
+                    "role": "Contributors"
+                },
+                {
+                    "name": "Armin Ronacher",
+                    "email": "armin.ronacher@active-4.com",
+                    "role": "Project Founder"
+                }
+            ],
+            "description": "Twig, the flexible, fast, and secure template language for PHP",
+            "homepage": "https://twig.symfony.com",
+            "keywords": [
+                "templating"
+            ],
+            "support": {
+                "issues": "https://github.com/twigphp/Twig/issues",
+                "source": "https://github.com/twigphp/Twig/tree/v3.8.0"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/twig/twig",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2023-11-21T18:54:41+00:00"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": [],
+    "plugin-api-version": "2.3.0"
+}
index 2443e26ccaf5310211141d0f5ba7d7e593e06a22..3d20c28921b5cd9c435586495ba30a2f9f197be2 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>{{title}}</title>
@@ -5,6 +6,8 @@
   <link rel="token_endpoint" href="{{baseurl}}token.php"/>
   <link rel="micropub" href="{{baseurl}}micropub.php"/>
   <link rel="stylesheet" type="text/css" href="css/index.css"/>
+  <meta name="generator" content="anoweco"/>
+  <link rel="vcs-git" href="https://github.com/cweiske/anoweco"/>
  </head>
  <body>
   <h1>{{title}}</h1>
    simply type:
   </p>
   <pre>{{baseurl}}</pre>
+
+
+  <h2>Misc</h2>
+  <p>
+   anoweco is <a href="https://github.com/cweiske/anoweco">open source</a>.
+   You may view the
+   <a href="latest.php">latest posts</a>.
+  </p>
  </body>
 </html>
diff --git a/data/templates/latest-atom.htm b/data/templates/latest-atom.htm
new file mode 100644 (file)
index 0000000..3c8ac13
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>Latest comments</title>
+ <link rel="alternate" type="text/html" href="{{baseUrl}}/latest.php"/>
+ <link rel="self" href="{{baseUrl}}/latest-atom.php"/>
+ <updated>{{lastComment.comment_published|date("c")}}</updated>
+ <id>{{baseUrl}}/latest-atom.php</id>
+ <generator uri="https://github.com/cweiske/anoweco">anoweco</generator>
+
+ {% for comment in comments %}
+ <entry>
+  <title>{{comment.comment_type}} #{{comment.comment_id}} to {{comment.domain}}</title>
+  <link href="{{baseUrl}}{{comment.url}}"/>
+  <id>{{baseUrl}}{{comment.url}}</id>
+  <updated>{{comment.comment_published|date("c")}}</updated>
+  <author>
+   <name>{{comment.user.user_name}}</name>
+  </author>
+  <summary>
+   {{comment.comment_type}} to
+   {{comment.comment_of_url}}
+  </summary>
+ </entry>
+ {% endfor %}
+</feed>
index e574bc05cb77b766d0b9013f68051963e93ccda5..5d9d38022c67707ec775be9f5cdc03ef49ed9d77 100644 (file)
@@ -1,8 +1,11 @@
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta charset="utf-8"/>
   <title>Latest comments</title>
   <link rel="stylesheet" type="text/css" href="css/latest.css"/>
+  <link rel="alternate" type="application/atom+xml" href="latest-atom.php"/>
+  <meta name="generator" content="anoweco"/>
  </head>
  <body class="h-entry">
   <h1>Latest comments</h1>
index 463e703e9bbfb66e78077a6aa2f4abb4a36bd1ce..2b7445dcb30b6aa564d603637ee3acf92cf022e4 100644 (file)
@@ -1,16 +1,18 @@
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta charset="utf-8"/>
   <title>Like of {{attribute(json, 'like-of').0}}</title>
+  <meta name="generator" content="anoweco"/>
  </head>
  <body class="h-entry">
   <h1>Like #{{crow.comment_id}}</h1>
   <p>
-   {% spaceless %}
+   {% apply spaceless %}
    <a class="p-author h-card" href="{{author.url}}">
     <img class="u-photo" src="{{author.imageurl}}" alt="" width="32" height="32" />
     {{author.name}}</a>
-   {% endspaceless %}
+   {% endapply %}
    <a href="{{postUrl}}" class="u-url">likes</a>
    <a class="u-like-of"
       href="{{attribute(json, 'like-of').0}}">{{attribute(json, 'like-of').0}}</a>.
index 2c2e7cd48c29849ae11e98907fe114e82c7da049..bbebfa55b26132fe00b4b56208469186981a2ac4 100644 (file)
@@ -1,16 +1,18 @@
+<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <meta charset="utf-8"/>
   <title>Comment to {{attribute(json, 'in-reply-to').0}}</title>
+  <meta name="generator" content="anoweco"/>
  </head>
  <body class="h-entry">
   <h1>Comment #{{crow.comment_id}}</h1>
   <p>
-   {% spaceless %}
+   {% apply spaceless %}
    <a class="p-author h-card" href="{{author.url}}">
     <img class="u-photo" src="{{author.imageurl}}" alt="" width="32" height="32" />
     {{author.name}}</a>
-   {% endspaceless %}
+   {% endapply %}
    <a href="{{postUrl}}" class="u-url">wrote</a>
    the following reply to
    <a class="in-reply-to u-in-reply-to"
index 5fb876a7e330467ce6f85ebbd1a056e8fa53b741..515e8fa7907efa0f62f7fff9330d19f79bb0d154 100644 (file)
@@ -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/latest-atom.php b/www/latest-atom.php
new file mode 100644 (file)
index 0000000..6232b57
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+namespace anoweco;
+require 'www-header.php';
+
+$storage = new Storage();
+$comments = $storage->listLatest();
+
+foreach ($comments as $comment) {
+    $comment->url = Urls::comment($comment->comment_id);
+    $comment->domain = parse_url($comment->comment_of_url, PHP_URL_HOST);
+}
+
+$vars = [
+    'baseUrl'     => getBaseUrl(),
+    'comments'    => $comments,
+    'lastComment' => $comments[0],
+];
+header('Content-Type: application/atom+xml');
+render('latest-atom', $vars);
+?>
index 3a7d606bbc396bc9125341cda5a180c0132b7968..ec7e8b3dafc3d1e59963de74466507d402d6e3ee 100644 (file)
@@ -4,10 +4,8 @@ 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 = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../data/templates/');
+$twig = new \Twig\Environment(
     $loader,
     array(
         //'cache' => '/path/to/compilation_cache',
@@ -67,7 +65,7 @@ function error($description, $status = 'HTTP/1.0 400 Bad Request')
 
 function render($tplname, $vars = array(), $return = false)
 {
-    $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
+    $template = $GLOBALS['twig']->load($tplname . '.htm');
 
     if ($return) {
         return $template->render($vars);
@@ -75,4 +73,13 @@ function render($tplname, $vars = array(), $return = false)
         echo $template->render($vars);
     }
 }
-?>
\ No newline at end of file
+
+/**
+ * No trailing slash
+ */
+function getBaseUrl()
+{
+    return $_SERVER['REQUEST_SCHEME']
+        . '://' . $_SERVER['HTTP_HOST'];
+}
+?>