Plugin Directory

Changeset 2921855


Ignore:
Timestamp:
06/05/2023 04:43:18 PM (3 years ago)
Author:
aveltens
Message:

publish to wordpress plugin repo

Location:
wp-linked-data/trunk
Files:
71 added
40 edited

Legend:

Unmodified
Added
Removed
  • wp-linked-data/trunk/controller/UserProfileController.php

    r769768 r2921855  
    4343            $serializedRdf = trim (stripslashes ($_POST['additionalRdf']));
    4444            if (!empty($serializedRdf)) {
    45                 $graph = new \EasyRdf_Graph();
     45                $graph = new \EasyRdf\Graph();
    4646                $graph->parse ($serializedRdf); // parsing if done to check if syntax is valid
    4747                update_user_meta ($userId, 'additionalRdf', $serializedRdf);
  • wp-linked-data/trunk/rdf/RdfBuilder.php

    r2177822 r2921855  
    1515
    1616    public function buildGraph ($queriedObject, $wpQuery) {
    17         $graph = new \EasyRdf_Graph();
     17        $graph = new \EasyRdf\Graph();
    1818        if (!$queriedObject) {
    1919            return $this->buildGraphForBlog ($graph, $wpQuery);
     
    4646        $post_resource->set ('dc:title', $post->post_title);
    4747        $post_resource->set ('sioc:content', strip_tags($post->post_content));
    48         $post_resource->set ('dc:modified', \EasyRdf_Literal_Date::parse($post->post_modified));
    49         $post_resource->set ('dc:created', \EasyRdf_Literal_Date::parse($post->post_date));
     48        $post_resource->set ('dc:modified', \EasyRdf\Literal\Date::parse($post->post_modified));
     49        $post_resource->set ('dc:created', \EasyRdf\Literal\Date::parse($post->post_date));
    5050
    5151        $author = get_userdata ($post->post_author);
     
    100100        if ($rsaPublicKey) {
    101101            $key_resource = $graph->newBNode ('cert:RSAPublicKey');
    102             $key_resource->set ('cert:exponent', new \EasyRdf_Literal_Integer($rsaPublicKey->getExponent ()));
    103             $key_resource->set ('cert:modulus', new \EasyRdf_Literal_HexBinary($rsaPublicKey->getModulus ()));
     102            $key_resource->set ('cert:exponent', new \EasyRdf\Literal\Integer($rsaPublicKey->getExponent ()));
     103            $key_resource->set ('cert:modulus', new \EasyRdf\Literal\HexBinary($rsaPublicKey->getModulus ()));
    104104            $author_resource->set ('cert:key', $key_resource);
    105105        }
  • wp-linked-data/trunk/readme.txt

    r2856603 r2921855  
    44Tags: linked data, rdf, semantic web, webid, solid
    55Requires at least: 3.5.1
    6 Tested up to: 6.1
     6Tested up to: 6.2
    77Stable tag: trunk
    88License: GPLv3
     
    6666== Changelog ==
    6767
     68= 0.5.4 =
     69
     70* Fix: compatibility with PHP 8
     71
    6872= 0.5.3 =
    6973
  • wp-linked-data/trunk/vendor/autoload.php

    r2856603 r2921855  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInit7eeb0d37b137ab979f259838b63ffd05::getLoader();
     25return ComposerAutoloaderInitfba302fb16f43093c13bd9f227a751dc::getLoader();
  • wp-linked-data/trunk/vendor/composer/ClassLoader.php

    r2856603 r2921855  
    430430    {
    431431        if ($file = $this->findFile($class)) {
    432             (self::$includeFile)($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    433434
    434435            return true;
     
    561562    }
    562563
    563     private static function initializeIncludeClosure(): void
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
    564568    {
    565569        if (self::$includeFile !== null) {
     
    575579         * @return void
    576580         */
    577         self::$includeFile = static function($file) {
     581        self::$includeFile = \Closure::bind(static function($file) {
    578582            include $file;
    579         };
     583        }, null, null);
    580584    }
    581585}
  • wp-linked-data/trunk/vendor/composer/InstalledVersions.php

    r2856603 r2921855  
    9999        foreach (self::getInstalled() as $installed) {
    100100            if (isset($installed['versions'][$packageName])) {
    101                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
     101                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
    102102            }
    103103        }
     
    120120    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    121121    {
    122         $constraint = $parser->parseConstraints($constraint);
     122        $constraint = $parser->parseConstraints((string) $constraint);
    123123        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    124124
     
    329329                    $installed[] = self::$installedByVendor[$vendorDir];
    330330                } elseif (is_file($vendorDir.'/composer/installed.php')) {
    331                     $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
     331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     332                    $required = require $vendorDir.'/composer/installed.php';
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
    332334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    333335                        self::$installed = $installed[count($installed) - 1];
     
    341343            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    342344            if (substr(__DIR__, -8, 1) !== 'C') {
    343                 self::$installed = require __DIR__ . '/installed.php';
     345                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     346                $required = require __DIR__ . '/installed.php';
     347                self::$installed = $required;
    344348            } else {
    345349                self::$installed = array();
    346350            }
    347351        }
    348         $installed[] = self::$installed;
     352
     353        if (self::$installed !== array()) {
     354            $installed[] = self::$installed;
     355        }
    349356
    350357        return $installed;
  • wp-linked-data/trunk/vendor/composer/autoload_namespaces.php

    r2856603 r2921855  
    88return array(
    99    'ML\\IRI' => array($vendorDir . '/ml/iri'),
    10     'EasyRdf_' => array($vendorDir . '/easyrdf/easyrdf/lib'),
    1110);
  • wp-linked-data/trunk/vendor/composer/autoload_psr4.php

    r2856603 r2921855  
    99    'Negotiation\\' => array($vendorDir . '/willdurand/negotiation/src/Negotiation'),
    1010    'ML\\JsonLD\\' => array($vendorDir . '/ml/json-ld'),
     11    'EasyRdf\\' => array($vendorDir . '/easyrdf/easyrdf/lib'),
    1112);
  • wp-linked-data/trunk/vendor/composer/autoload_real.php

    r2856603 r2921855  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit7eeb0d37b137ab979f259838b63ffd05
     5class ComposerAutoloaderInitfba302fb16f43093c13bd9f227a751dc
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit7eeb0d37b137ab979f259838b63ffd05', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitfba302fb16f43093c13bd9f227a751dc', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit7eeb0d37b137ab979f259838b63ffd05', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitfba302fb16f43093c13bd9f227a751dc', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInit7eeb0d37b137ab979f259838b63ffd05::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInitfba302fb16f43093c13bd9f227a751dc::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • wp-linked-data/trunk/vendor/composer/autoload_static.php

    r2856603 r2921855  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInit7eeb0d37b137ab979f259838b63ffd05
     7class ComposerStaticInitfba302fb16f43093c13bd9f227a751dc
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    1515        array (
    1616            'ML\\JsonLD\\' => 10,
     17        ),
     18        'E' =>
     19        array (
     20            'EasyRdf\\' => 8,
    1721        ),
    1822    );
     
    2731            0 => __DIR__ . '/..' . '/ml/json-ld',
    2832        ),
     33        'EasyRdf\\' =>
     34        array (
     35            0 => __DIR__ . '/..' . '/easyrdf/easyrdf/lib',
     36        ),
    2937    );
    3038
     
    3543            array (
    3644                0 => __DIR__ . '/..' . '/ml/iri',
    37             ),
    38         ),
    39         'E' =>
    40         array (
    41             'EasyRdf_' =>
    42             array (
    43                 0 => __DIR__ . '/..' . '/easyrdf/easyrdf/lib',
    4445            ),
    4546        ),
     
    5354    {
    5455        return \Closure::bind(function () use ($loader) {
    55             $loader->prefixLengthsPsr4 = ComposerStaticInit7eeb0d37b137ab979f259838b63ffd05::$prefixLengthsPsr4;
    56             $loader->prefixDirsPsr4 = ComposerStaticInit7eeb0d37b137ab979f259838b63ffd05::$prefixDirsPsr4;
    57             $loader->prefixesPsr0 = ComposerStaticInit7eeb0d37b137ab979f259838b63ffd05::$prefixesPsr0;
    58             $loader->classMap = ComposerStaticInit7eeb0d37b137ab979f259838b63ffd05::$classMap;
     56            $loader->prefixLengthsPsr4 = ComposerStaticInitfba302fb16f43093c13bd9f227a751dc::$prefixLengthsPsr4;
     57            $loader->prefixDirsPsr4 = ComposerStaticInitfba302fb16f43093c13bd9f227a751dc::$prefixDirsPsr4;
     58            $loader->prefixesPsr0 = ComposerStaticInitfba302fb16f43093c13bd9f227a751dc::$prefixesPsr0;
     59            $loader->classMap = ComposerStaticInitfba302fb16f43093c13bd9f227a751dc::$classMap;
    5960
    6061        }, null, ClassLoader::class);
  • wp-linked-data/trunk/vendor/composer/installed.json

    r2856603 r2921855  
    33        {
    44            "name": "easyrdf/easyrdf",
    5             "version": "0.9.1",
    6             "version_normalized": "0.9.1.0",
    7             "source": {
    8                 "type": "git",
    9                 "url": "https://github.com/njh/easyrdf.git",
    10                 "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566"
    11             },
    12             "dist": {
    13                 "type": "zip",
    14                 "url": "https://api.github.com/repos/njh/easyrdf/zipball/acd09dfe0555fbcfa254291e433c45fdd4652566",
    15                 "reference": "acd09dfe0555fbcfa254291e433c45fdd4652566",
    16                 "shasum": ""
    17             },
    18             "require": {
     5            "version": "1.1.1",
     6            "version_normalized": "1.1.1.0",
     7            "source": {
     8                "type": "git",
     9                "url": "https://github.com/easyrdf/easyrdf.git",
     10                "reference": "c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/easyrdf/easyrdf/zipball/c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64",
     15                "reference": "c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64",
     16                "shasum": ""
     17            },
     18            "require": {
     19                "ext-dom": "*",
    1920                "ext-mbstring": "*",
    2021                "ext-pcre": "*",
    21                 "php": ">=5.2.8"
     22                "ext-xmlreader": "*",
     23                "lib-libxml": "*",
     24                "php": ">=7.1.0"
    2225            },
    2326            "require-dev": {
    24                 "phpunit/phpunit": "~3.5",
    25                 "sami/sami": "~1.4",
    26                 "squizlabs/php_codesniffer": "~1.4.3"
     27                "code-lts/doctum": "^5",
     28                "ml/json-ld": "~1.0",
     29                "phpunit/phpunit": "^7",
     30                "semsol/arc2": "^2.4",
     31                "squizlabs/php_codesniffer": "3.*",
     32                "zendframework/zend-http": "~2.3"
    2733            },
    2834            "suggest": {
    29                 "ml/json-ld": "~1.0"
    30             },
    31             "time": "2015-02-27T09:45:49+00:00",
    32             "type": "library",
    33             "installation-source": "dist",
    34             "autoload": {
    35                 "psr-0": {
    36                     "EasyRdf_": "lib/"
     35                "ml/json-ld": "~1.0",
     36                "semsol/arc2": "~2.2"
     37            },
     38            "time": "2020-12-02T08:47:31+00:00",
     39            "type": "library",
     40            "installation-source": "dist",
     41            "autoload": {
     42                "psr-4": {
     43                    "EasyRdf\\": "lib"
    3744                }
    3845            },
     
    5158                    "name": "Alexey Zakhlestin",
    5259                    "email": "indeyets@gmail.com",
     60                    "homepage": "http://indeyets.ru/",
    5361                    "role": "Developer"
    5462                }
     
    6472                "sparql"
    6573            ],
     74            "support": {
     75                "forum": "http://groups.google.com/group/easyrdf/",
     76                "issues": "http://github.com/easyrdf/easyrdf/issues",
     77                "source": "https://github.com/easyrdf/easyrdf/tree/1.1.1"
     78            },
    6679            "install-path": "../easyrdf/easyrdf"
    6780        },
     
    114127                "url"
    115128            ],
     129            "support": {
     130                "issues": "https://github.com/lanthaler/IRI/issues",
     131                "source": "https://github.com/lanthaler/IRI/tree/master"
     132            },
    116133            "install-path": "../ml/iri/ML/IRI"
    117134        },
    118135        {
    119136            "name": "ml/json-ld",
    120             "version": "1.1.0",
    121             "version_normalized": "1.1.0.0",
     137            "version": "1.2.1",
     138            "version_normalized": "1.2.1.0",
    122139            "source": {
    123140                "type": "git",
    124141                "url": "https://github.com/lanthaler/JsonLD.git",
    125                 "reference": "b5f82820c255cb64067b1c7adbb819cad4afa70a"
    126             },
    127             "dist": {
    128                 "type": "zip",
    129                 "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/b5f82820c255cb64067b1c7adbb819cad4afa70a",
    130                 "reference": "b5f82820c255cb64067b1c7adbb819cad4afa70a",
     142                "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8"
     143            },
     144            "dist": {
     145                "type": "zip",
     146                "url": "https://api.github.com/repos/lanthaler/JsonLD/zipball/537e68e87a6bce23e57c575cd5dcac1f67ce25d8",
     147                "reference": "537e68e87a6bce23e57c575cd5dcac1f67ce25d8",
    131148                "shasum": ""
    132149            },
     
    140157                "phpunit/phpunit": "^4"
    141158            },
    142             "time": "2018-11-18T20:26:18+00:00",
     159            "time": "2022-09-29T08:45:17+00:00",
    143160            "type": "library",
    144161            "installation-source": "dist",
     
    166183                "jsonld"
    167184            ],
     185            "support": {
     186                "issues": "https://github.com/lanthaler/JsonLD/issues",
     187                "source": "https://github.com/lanthaler/JsonLD/tree/1.2.1"
     188            },
    168189            "install-path": "../ml/json-ld"
    169190        },
    170191        {
    171192            "name": "willdurand/negotiation",
    172             "version": "v2.3.1",
    173             "version_normalized": "2.3.1.0",
     193            "version": "3.1.0",
     194            "version_normalized": "3.1.0.0",
    174195            "source": {
    175196                "type": "git",
    176197                "url": "https://github.com/willdurand/Negotiation.git",
    177                 "reference": "03436ededa67c6e83b9b12defac15384cb399dc9"
    178             },
    179             "dist": {
    180                 "type": "zip",
    181                 "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/03436ededa67c6e83b9b12defac15384cb399dc9",
    182                 "reference": "03436ededa67c6e83b9b12defac15384cb399dc9",
    183                 "shasum": ""
    184             },
    185             "require": {
    186                 "php": ">=5.4.0"
     198                "reference": "68e9ea0553ef6e2ee8db5c1d98829f111e623ec2"
     199            },
     200            "dist": {
     201                "type": "zip",
     202                "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/68e9ea0553ef6e2ee8db5c1d98829f111e623ec2",
     203                "reference": "68e9ea0553ef6e2ee8db5c1d98829f111e623ec2",
     204                "shasum": ""
     205            },
     206            "require": {
     207                "php": ">=7.1.0"
    187208            },
    188209            "require-dev": {
    189                 "phpunit/phpunit": "~4.5"
    190             },
    191             "time": "2017-05-14T17:21:12+00:00",
     210                "symfony/phpunit-bridge": "^5.0"
     211            },
     212            "time": "2022-01-30T20:08:53+00:00",
    192213            "type": "library",
    193214            "extra": {
    194215                "branch-alias": {
    195                     "dev-master": "2.3-dev"
     216                    "dev-master": "3.0-dev"
    196217                }
    197218            },
     
    221242                "negotiation"
    222243            ],
     244            "support": {
     245                "issues": "https://github.com/willdurand/Negotiation/issues",
     246                "source": "https://github.com/willdurand/Negotiation/tree/3.1.0"
     247            },
    223248            "install-path": "../willdurand/negotiation"
    224249        }
    225250    ],
    226     "dev": true,
     251    "dev": false,
    227252    "dev-package-names": []
    228253}
  • wp-linked-data/trunk/vendor/composer/installed.php

    r2856603 r2921855  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '289f6cdcbea10e1e2ef6e8063c38d8774593f0cb',
     6        'reference' => 'ce3bc31464ca0da8de099eba750a1fc6b48cf1cd',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../../',
    99        'aliases' => array(),
    10         'dev' => true,
     10        'dev' => false,
    1111    ),
    1212    'versions' => array(
     
    1414            'pretty_version' => 'dev-main',
    1515            'version' => 'dev-main',
    16             'reference' => '289f6cdcbea10e1e2ef6e8063c38d8774593f0cb',
     16            'reference' => 'ce3bc31464ca0da8de099eba750a1fc6b48cf1cd',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../../',
     
    2121        ),
    2222        'easyrdf/easyrdf' => array(
    23             'pretty_version' => '0.9.1',
    24             'version' => '0.9.1.0',
    25             'reference' => 'acd09dfe0555fbcfa254291e433c45fdd4652566',
     23            'pretty_version' => '1.1.1',
     24            'version' => '1.1.1.0',
     25            'reference' => 'c7b0a9dbcb211eb7de03ee99ff5b52d17f2a8e64',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../easyrdf/easyrdf',
     
    3939        ),
    4040        'ml/json-ld' => array(
    41             'pretty_version' => '1.1.0',
    42             'version' => '1.1.0.0',
    43             'reference' => 'b5f82820c255cb64067b1c7adbb819cad4afa70a',
     41            'pretty_version' => '1.2.1',
     42            'version' => '1.2.1.0',
     43            'reference' => '537e68e87a6bce23e57c575cd5dcac1f67ce25d8',
    4444            'type' => 'library',
    4545            'install_path' => __DIR__ . '/../ml/json-ld',
     
    4848        ),
    4949        'willdurand/negotiation' => array(
    50             'pretty_version' => 'v2.3.1',
    51             'version' => '2.3.1.0',
    52             'reference' => '03436ededa67c6e83b9b12defac15384cb399dc9',
     50            'pretty_version' => '3.1.0',
     51            'version' => '3.1.0.0',
     52            'reference' => '68e9ea0553ef6e2ee8db5c1d98829f111e623ec2',
    5353            'type' => 'library',
    5454            'install_path' => __DIR__ . '/../willdurand/negotiation',
  • wp-linked-data/trunk/vendor/composer/platform_check.php

    r2856603 r2921855  
    55$issues = array();
    66
    7 if (!(PHP_VERSION_ID >= 50400)) {
    8     $issues[] = 'Your Composer dependencies require a PHP version ">= 5.4.0". You are running ' . PHP_VERSION . '.';
     7if (!(PHP_VERSION_ID >= 70100)) {
     8    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
    99}
    1010
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/CHANGELOG.md

    r2177822 r2921855  
     1EasyRdf 1.1.1
     2=============
     3
     4Bug fix release that fixes parsing very large RDF/XML files.
     5
     6* Use chunked parsing to parse Large XML files using xml_parse (#350)
     7* Fix Resource- and Graph->label claim wrong return type (#254)
     8
     9
     10EasyRdf 1.1.0
     11=============
     12
     13Bug fix release with a few improvements and changes in Composer dependencies.
     14
     15Overview
     16--------
     17
     18* Composer:
     19  * changed ARC2 from `~2.2` to `^2.4` (#347)
     20  * replaced `sami/sami` with `code-lts/doctum`
     21  * added the following required PHP extensions: ext-pcre, ext-xmlreader, lib-libxml
     22* Accept an array of properties in get/getLiteral/getResource methods, fixes #325 (#326)
     23* Add support for parsing large SPARQL XML Results (#357)
     24* Made `Parser` class abstract, to be in line with `Serialiser` class (#328)
     25* Fixed "Sparql\Client uses invalid parameters for Zend\Http\Client->setHeaders" (#335)
     26* Fixed undefined index path in Http\Client::request (#271, #368)
     27
     28Highlights for EasyRdf developers
     29---------------------------------
     30
     31* added .editorconfig (#340)
     32* added a basic Docker setup to improve local development and testing (#334)
     33* added `CONTRIBUTING.md`
     34
     35
     36EasyRdf 1.0.0
     37=============
     38
     39Major new features
     40------------------
     41
     42* Minimum version of PHP is now PHP version 7.1, PHP 5.x is no-longer supported
     43* Usage without composer is not supported anymore
     44* Library is loaded via PSR-4 autoloader now
     45* The Redland PHP extension is no-longer supported
     46
     47Enhancements
     48------------
     49
     50* `$graph->isA()` can take full IRIs as second parameter (only qname was accepted earlier, see issue #215)
     51* `Accept` HTTP-header depends on SPARQL-query type (see issues #231, #226)
     52* It is possible to set alternate default `Resource` class via `Graph::setDefaultResourceClass()` (see issue #243)
     53* When calling `Graph::load()` set the HTTP Accept header to the desired format
     54* The RDF/PHP and RDF/JSON specifications were added to the documentation
     55* Added text/xml and application/xml MIME types to RDF/XML format
     56* Added additional namespaces from W3C RDFa context
     57* Speeding up the turtle parser by optimising the mb_substr calls
     58* Added support for compressed response body in HTTP client
     59* Updated to PHP CodeSniffer v3
     60* Updated to Sami v4 for API documentation
     61* Updated to PHPUnit v7
     62
     63API changes
     64-----------
     65
     66* Classes are renamed like this: `EasyRdf_Parser_Turtle` → `EasyRdf\Parser\Turtle`. With a single exception: `EasyRdf_Namespace` → `EasyRdf\RdfNamespace` (because `namespace` is a keyword in PHP)
     67* EasyRdf expects HTTP-client objects compatible with ZendFramework 2.x instead of 1.x now. (zend-http is added to require-dev so tests for it are always run)
     68* `Resource` implements `ArrayAccess` interface now (see #242)
     69* Now using PHP Type Hints in some classes, which avoids having to do type checks
     70* Serialiser class is now abstract
     71* Implement the ArrayAccess Interface in Resource
     72
     73Bug Fixes
     74---------
     75
     76* Fixes that add compatibility for PHP 7.4
     77* Unicode-strings are properly encoded in n-triples documents (see #219)
     78* `RdfPhp` parser validates its input (see #227)
     79* Timeout is applied to response-times, not only connection-times (see #202)
     80* `$graph->get()` is reliable after `$graph->delete()` now (see #239, #241)
     81* Fix for running Graphviz tests against newer versions of Graphviz
     82* Fixed for when the HTTP server doesn't return Reason-Phrase in the status (see #321)
     83* Corrections to RDF format URIs
     84* Fixes for format guessing, so it works with SPARQL-style PREFIX and BASE
     85* Turtle serialiser improvements and fixes
     86* Fix for unescaping URIs while parsing ntriples
     87* Fixed encoding of unicode literals in ntriples
     88
     89Changes to Examples
     90-------------------
     91
     92* Added index.php to examples folder, to make them easier to navigate
     93* Removed artistinfo.php example (BBC Music no longer publishes RDF)
     94* Replaced Dbpedialite Villages example with Wikidata Villages example
     95* Added Open Graph Protocol example
     96* Changed default URI for converter example
     97* Fixed namespace for dbpedia categories
     98* Fixes for UK Postcode example and changed it to use Open Street Map
     99
     100
    1101EasyRdf 0.9.1
    2102=============
     
    4104Bug Fixes
    5105---------
    6 
    7 * Timeout is applied to response-times, not only connection-times (see #202)
     106* Support timeouts for HTTP requests where the server takes a long time to answer. Fixes #202
     107* Fixed Google Map on UK Postcode example
     108
    8109
    9110EasyRdf 0.9.0
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/DEVELOPER.md

    r2177822 r2921855  
    1 Contributing to EasyRdf
    2 =======================
     1# Developers
    32
    4 Contributions to the EasyRdf codebase are welcome using the usual Github pull request workflow.
     3Please also read (CONTRIBUTING.md)[CONTRIBUTING.md].
    54
    6 To run the code style checker:
     5## .editorconfig
    76
    8 ```
    9 make cs
    10 ```
     7Please make sure your editor uses our `.editorconfig` file. It contains rules about our coding styles.
    118
    12 You can run the PHP unit test suite with:
     9## Docker
    1310
    14 ```
    15 make test-lib
    16 ```
     11To improve local development we have a Docker container on board. You can find it in `/docker`.
    1712
    18 Unit tests are automatically run after being received by Github:
    19 http://ci.aelius.com/job/easyrdf/
     13If you are on `Linux`, go to your terminal, switch to the `docker` folder and run:
    2014
    21 The tests for the examples are run separately:
    22 http://ci.aelius.com/job/easyrdf-examples/
     15> make
    2316
     17This will build and start the docker container.
     18After it started, you will be logged in automatically.
    2419
    25 Notes
    26 -----
     20Afterwards you can run further commands on the CLI, like `composer update` or PHPUnit test suite.
    2721
    28 * Please ask on the [mailing list] before starting work on any significant changes
    29 * Please write tests for any new features or bug fixes. The tests should be checked in the same commit as the code.
     22### Fuseki
    3023
    31 [mailing list]:http://groups.google.com/group/easyrdf
     24You can run Fuseki inside the Docker container by calling the following on the Terminal:
     25
     26> bash test/start_fuseki.sh
     27
     28It will start the server in the background. Wait a few seconds and then run PHPUnit as always.
     29
     30## Tests
     31
     32Our test related files are located in `test` folder. Tests are written using PHPUnit.
     33
     34Make sure you ran `composer update`, if you want to execute the test suite ([Getting Started](http://www.easyrdf.org/docs/getting-started)).
     35
     36To run all tests, open your terminal and run:
     37
     38> make test-lib
     39
     40### Travis
     41
     42We use Travis to run tests automatically after new code is being received by Github (library and examples):
     43
     44Link: https://travis-ci.com/github/easyrdf/easyrdf
     45
     46After you made a pull request, use Travis to check the test result.
     47
     48## Important notes
     49
     50* Don't rely on our test API, like functions or classes! They are only for internal use. If you want certain functionality be part of the public API, please create an issue.
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/LICENSE.md

    r2177822 r2921855  
    22=======
    33
    4 Copyright (c) 2009-2011 Nicholas J Humfrey.  All rights reserved.
     4Copyright (c) 2009-2020 Nicholas J Humfrey.  All rights reserved.
    55
    66Redistribution and use in source and binary forms, with or without
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/README.md

    r2177822 r2921855  
    11EasyRdf
    22=======
     3
     4[![Build Status](https://travis-ci.com/easyrdf/easyrdf.svg?branch=master)](https://travis-ci.com/easyrdf/easyrdf)
     5
    36EasyRdf is a PHP library designed to make it easy to consume and produce [RDF].
    47It was designed for use in mixed teams of experienced and inexperienced RDF
     
    1013inspect what data is available during development.
    1114
    12 Data is typically loaded into a [EasyRdf_Graph] object from source RDF
    13 documents, loaded from the web via HTTP. The [EasyRdf_GraphStore] class
     15Data is typically loaded into an [`EasyRdf\Graph`] object from source RDF
     16documents, loaded from the web via HTTP. The [`EasyRdf\GraphStore`] class
    1417simplifies loading and saving data to a SPARQL 1.1 Graph Store.
    1518
    1619SPARQL queries can be made over HTTP to a Triplestore using the
    17 [EasyRdf_Sparql_Client] class. SELECT and ASK queries will return an
    18 [EasyRdf_Sparql_Result] object and CONSTRUCT and DESCRIBE queries will return
    19 an [EasyRdf_Graph] object.
     20[`EasyRdf\Sparql\Client`] class. `SELECT` and `ASK` queries will return an
     21[`EasyRdf\Sparql\Result`] object and `CONSTRUCT` and `DESCRIBE` queries will return
     22an [`EasyRdf\Graph`] object.
    2023
    2124### Example ###
    2225
    23     $foaf = new EasyRdf_Graph("http://njh.me/foaf.rdf");
    24     $foaf->load();
    25     $me = $foaf->primaryTopic();
    26     echo "My name is: ".$me->get('foaf:name')."\n";
    27 
     26```php
     27$foaf = new \EasyRdf\Graph("http://njh.me/foaf.rdf");
     28$foaf->load();
     29$me = $foaf->primaryTopic();
     30echo "My name is: ".$me->get('foaf:name')."\n";
     31```
    2832
    2933Downloads
     
    3640-----
    3741
    38 * [EasyRdf Homepage](http://www.easyrdf.org/)
    39 * [API documentation](http://www.easyrdf.org/docs/api)
    40 * [Change Log](http://github.com/njh/easyrdf/blob/master/CHANGELOG.md)
    41 * Source Code: <http://github.com/njh/easyrdf>
    42 * Issue Tracker: <http://github.com/njh/easyrdf/issues>
     42* [EasyRdf Homepage](https://www.easyrdf.org/)
     43* [API documentation](https://www.easyrdf.org/docs/api)
     44* [Change Log](https://github.com/easyrdf/easyrdf/blob/master/CHANGELOG.md)
     45* [Source Code](https://github.com/easyrdf/easyrdf)
     46* [Issue Tracker](https://github.com/easyrdf/easyrdf/issues)
    4347
    4448
     
    4650------------
    4751
    48 * PHP 5.2.8 or higher
     52* PHP 7.1 or higher
    4953
    5054
     
    5256--------
    5357
    54 * API documentation written in phpdoc
    55 * Extensive unit tests written using phpunit
    56   * Automated testing against PHP 5.2, 5.3 and 5.4
     58* API documentation written in `phpdoc`
     59* Extensive unit tests written using `phpunit`
    5760* Built-in parsers and serialisers: RDF/JSON, N-Triples, RDF/XML, Turtle
    58 * Optional parsing support for: [ARC2], [Redland Bindings], [rapper]
    59 * Optional support for [Zend_Http_Client]
    60 * No required external dependancies upon other libraries (PEAR, Zend, etc...)
     61* Optional parsing support for: [ARC2], [rapper]
     62* Optional support for [`Zend\Http\Client`]
     63* No required external dependencies upon other libraries (PEAR, Zend, etc...)
    6164* Complies with Zend Framework coding style.
    62 * Type mapper - resources of type foaf:Person can be mapped into PHP object of class Foaf_Person
     65* Type mapper - resources of type `foaf:Person` can be mapped into PHP object of class `Foaf_Person`
    6366* Support for visualisation of graphs using [GraphViz]
    6467* Comes with a number of examples
    6568
    6669
    67 More Examples
    68 -------------
     70List of Examples
     71----------------
    6972
    70 * [artistinfo.php](https://github.com/njh/easyrdf/blob/master/examples/artistinfo.php#slider) - Example of mapping an RDF class type to a PHP Class
    71 * [basic.php](https://github.com/njh/easyrdf/blob/master/examples/basic.php#slider) - Basic "Hello World" type example
    72 * [basic_sparql.php](https://github.com/njh/easyrdf/blob/master/examples/basic_sparql.php#slider) - Example of making a SPARQL SELECT query
    73 * [converter.php](https://github.com/njh/easyrdf/blob/master/examples/converter.php#slider) - Convert RDF from one format to another
    74 * [dump.php](https://github.com/njh/easyrdf/blob/master/examples/dump.php#slider) - Display the contents of a graph
    75 * [foafinfo.php](https://github.com/njh/easyrdf/blob/master/examples/foafinfo.php#slider) - Display the basic information in a FOAF document
    76 * [foafmaker.php](https://github.com/njh/easyrdf/blob/master/examples/foafmaker.php#slider) - Construct a FOAF document with a choice of serialisations
    77 * [graph_direct.php](https://github.com/njh/easyrdf/blob/master/examples/graph_direct.php#slider) - Example of using EasyRdf_Graph directly without EasyRdf_Resource
    78 * [graphstore.php](https://github.com/njh/easyrdf/blob/master/examples/graphstore.php#slider) - Store and retrieve data from a SPARQL 1.1 Graph Store
    79 * [graphviz.php](https://github.com/njh/easyrdf/blob/master/examples/graphviz.php#slider) - GraphViz rendering example
    80 * [html_tag_helpers.php](https://github.com/njh/easyrdf/blob/master/examples/html_tag_helpers.php#slider) - Rails Style html tag helpers to make the EasyRdf examples simplier
    81 * [httpget.php](https://github.com/njh/easyrdf/blob/master/examples/httpget.php#slider) - No RDF, just test EasyRdf_Http_Client
    82 * [serialise.php](https://github.com/njh/easyrdf/blob/master/examples/serialise.php#slider) - Basic serialisation example
    83 * [sparql_queryform.php](https://github.com/njh/easyrdf/blob/master/examples/sparql_queryform.php#slider) - Form to submit SPARQL queries and display the result
    84 * [uk_postcode.php](https://github.com/njh/easyrdf/blob/master/examples/uk_postcode.php#slider) - Example of resolving UK postcodes using uk-postcodes.com
    85 * [villages.php](https://github.com/njh/easyrdf/blob/master/examples/villages.php#slider) - Fetch and information about villages in Fife from dbpedialite.org
    86 * [zend_framework.php](https://github.com/njh/easyrdf/blob/master/examples/zend_framework.php#slider) - Example of using Zend_Http_Client and Zend_Loader_Autoloader with EasyRdf
     73* [`basic.php`](/examples/basic.php#slider) - Basic "Hello World" type example
     74* [`basic_sparql.php`](/examples/basic_sparql.php#slider) - Example of making a SPARQL `SELECT` query
     75* [`converter.php`](/examples/converter.php#slider) - Convert RDF from one format to another
     76* [`dump.php`](/examples/dump.php#slider) - Display the contents of a graph
     77* [`foafinfo.php`](/examples/foafinfo.php#slider) - Display the basic information in a FOAF document
     78* [`foafmaker.php`](/examples/foafmaker.php#slider) - Construct a FOAF document with a choice of serialisations
     79* [`graph_direct.php`](/examples/graph_direct.php#slider) - Example of using `EasyRdf\Graph` directly without `EasyRdf\Resource`
     80* [`graphstore.php`](/examples/graphstore.php#slider) - Store and retrieve data from a SPARQL 1.1 Graph Store
     81* [`graphviz.php`](/examples/graphviz.php#slider) - GraphViz rendering example
     82* [`html_tag_helpers.php`](/examples/html_tag_helpers.php#slider) - Rails Style html tag helpers to make the EasyRdf examples simpler
     83* [`httpget.php`](/examples/httpget.php#slider) - No RDF, just test `EasyRdf\Http\Client`
     84* [`open_graph_protocol.php`](/examples/open_graph_protocol.php#slider) - Extract Open Graph Protocol metadata from a webpage
     85* [`serialise.php`](/examples/serialise.php#slider) - Basic serialisation example
     86* [`sparql_queryform.php`](/examples/sparql_queryform.php#slider) - Form to submit SPARQL queries and display the result
     87* [`uk_postcode.php`](/examples/uk_postcode.php#slider) - Example of resolving UK postcodes using uk-postcodes.com
     88* [`wikidata_villages.php`](/examples/wikidata_villages.php#slider) - Fetch and information about villages in Fife from Wikidata
     89* [`zend_framework.php`](/examples/zend_framework.php#slider) - Example of using `Zend\Http\Client` with EasyRdf
    8790
     91
     92Contributing
     93------------
     94
     95We welcome any contributions. For further information please read [CONTRIBUTING.md](CONTRIBUTING.md).
     96
     97For further information about extending / hack EasyRdf please read [DEVELOPER.md](DEVELOPER.md).
     98
     99Running Examples
     100----------------
     101
     102The easiest way of trying out some of the examples is to use the PHP command to
     103run a local web server on your computer.
     104
     105```
     106php -S localhost:8080 -t examples
     107```
     108
     109Then open the following URL in your browser: http://localhost:8080/
    88110
    89111
     
    96118
    97119
    98 [EasyRdf_Graph]:http://www.easyrdf.org/docs/api/EasyRdf_Graph.html
    99 [EasyRdf_GraphStore]:http://www.easyrdf.org/docs/api/EasyRdf_GraphStore.html
    100 [EasyRdf_Sparql_Client]:http://www.easyrdf.org/docs/api/EasyRdf_Sparql_Client.html
    101 [EasyRdf_Sparql_Result]:http://www.easyrdf.org/docs/api/EasyRdf_Sparql_Result.html
     120[`EasyRdf\Graph`]:https://www.easyrdf.org/docs/api/EasyRdf\Graph.html
     121[`EasyRdf\GraphStore`]:https://www.easyrdf.org/docs/api/EasyRdf\GraphStore.html
     122[`EasyRdf\Sparql\Client`]:https://www.easyrdf.org/docs/api/EasyRdf\Sparql\Client.html
     123[`EasyRdf\Sparql\Result`]:https://www.easyrdf.org/docs/api/EasyRdf\Sparql\Result.html
    102124
    103 [ARC2]:http://github.com/semsol/arc2/
    104 [BSD-3-Clause]:http://www.opensource.org/licenses/BSD-3-Clause
    105 [downloaded from the EasyRdf website]:http://www.easyrdf.org/downloads
    106 [GraphViz]:http://www.graphviz.org/
     125[ARC2]:https://github.com/semsol/arc2/
     126[BSD-3-Clause]:https://www.opensource.org/licenses/BSD-3-Clause
     127[downloaded from the EasyRdf website]:https://www.easyrdf.org/downloads
     128[GraphViz]:https://www.graphviz.org/
    107129[rapper]:http://librdf.org/raptor/rapper.html
    108 [RDF]:http://en.wikipedia.org/wiki/Resource_Description_Framework
    109 [Redland Bindings]:http://librdf.org/bindings/
    110 [SPARQL 1.1 query language]:http://www.w3.org/TR/sparql11-query/
    111 [UNLICENSE]:http://unlicense.org/
    112 [Zend_Http_Client]:http://framework.zend.com/manual/en/zend.http.client.html
     130[RDF]:https://en.wikipedia.org/wiki/Resource_Description_Framework
     131[SPARQL 1.1 query language]:https://www.w3.org/TR/sparql11-query/
     132[UNLICENSE]:https://unlicense.org/
     133[`Zend\Http\Client`]:https://docs.zendframework.com/zend-http/client/intro/
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/composer.json

    r2177822 r2921855  
    22    "name": "easyrdf/easyrdf",
    33    "description": "EasyRdf is a PHP library designed to make it easy to consume and produce RDF.",
    4     "version": "0.9.1",
    54    "type": "library",
    65    "keywords": ["RDF", "Semantic Web", "Linked Data", "Turtle", "RDFa", "SPARQL"],
     
    1716            "name": "Alexey Zakhlestin",
    1817            "email": "indeyets@gmail.com",
     18            "homepage": "http://indeyets.ru/",
    1919            "role": "Developer"
    2020        }
     
    2222    "support": {
    2323        "forum": "http://groups.google.com/group/easyrdf/",
    24         "issues": "http://github.com/njh/easyrdf/issues",
    25         "irc": "irc://chat.freenode.net/easyrdf"
     24        "issues": "http://github.com/easyrdf/easyrdf/issues"
    2625    },
    2726    "require": {
    28         "php": ">=5.2.8",
     27        "php": ">=7.1.0",
     28        "ext-dom" : "*",
    2929        "ext-mbstring": "*",
    30         "ext-pcre": "*"
     30        "ext-pcre": "*",
     31        "ext-xmlreader" : "*",
     32        "lib-libxml" : "*"
    3133    },
    3234    "suggest": {
    33         "ml/json-ld": "~1.0"
     35        "ml/json-ld": "~1.0",
     36        "semsol/arc2": "~2.2"
    3437    },
    3538    "require-dev": {
    36         "phpunit/PHPUnit": "~3.5",
    37         "squizlabs/php_codesniffer": "~1.4.3",
    38         "sami/sami": "~1.4"
     39        "ml/json-ld": "~1.0",
     40        "phpunit/phpunit": "^7",
     41        "code-lts/doctum": "^5",
     42        "semsol/arc2": "^2.4",
     43        "squizlabs/php_codesniffer": "3.*",
     44        "zendframework/zend-http": "~2.3"
    3945    },
    4046    "autoload": {
    41         "psr-0": { "EasyRdf_": "lib/" }
     47        "psr-4": {
     48            "EasyRdf\\": "lib"
     49        }
    4250    }
    4351}
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/doap.php

    r2177822 r2921855  
    11<?php
    2     require_once "vendor/autoload.php";
     2    require_once __DIR__."/vendor/autoload.php";
    33
    44    // Load some properties from the composer file
     
    66
    77    // Start building up a RDF graph
    8     $doap = new EasyRdf_Graph($composer->homepage.'doap.rdf');
     8    $doap = new \EasyRdf\Graph($composer->homepage.'doap.rdf');
    99    $easyrdf = $doap->resource('#easyrdf', 'doap:Project', 'foaf:Project');
    1010    $easyrdf->addLiteral('doap:name',  'EasyRDF');
     
    2121    );
    2222    $easyrdf->addResource('doap:license', 'http://usefulinc.com/doap/licenses/bsd');
    23     $easyrdf->addResource('doap:download-page', 'http://github.com/njh/easyrdf/downloads');
    24     $easyrdf->addResource('doap:download-page', 'http://github.com/njh/easyrdf/downloads');
    25     $easyrdf->addResource('doap:bug-database', 'http://github.com/njh/easyrdf/issues');
     23    $easyrdf->addResource('doap:download-page', 'http://github.com/easyrdf/easyrdf/downloads');
     24    $easyrdf->addResource('doap:bug-database', 'http://github.com/easyrdf/easyrdf/issues');
    2625    $easyrdf->addResource('doap:mailing-list', 'http://groups.google.com/group/easyrdf');
    2726
     
    3231
    3332    $repository = $doap->newBNode('doap:GitRepository');
    34     $repository->addResource('doap:browse', 'http://github.com/njh/easyrdf');
    35     $repository->addResource('doap:location', 'git://github.com/njh/easyrdf.git');
     33    $repository->addResource('doap:browse', 'http://github.com/easyrdf/easyrdf');
     34    $repository->addResource('doap:location', 'git://github.com/easyrdf/easyrdf.git');
    3635    $easyrdf->addResource('doap:repository', $repository);
    3736
  • wp-linked-data/trunk/vendor/easyrdf/easyrdf/scripts/copyright_updater.php

    r2177822 r2921855  
    1212        if (preg_match("/^(.+)Copyright\s+\(c\)\s+(\d+)-?(\d*) (Nicholas.+)$/", $line, $m)) {
    1313            $copy_statements++;
    14            
     14
    1515            if ($m[2] != $year and $m[3] != $year) {
    1616                // Change the line
     
    1818            }
    1919        }
    20        
     20
    2121        // Remove trailing whitespace
    2222        $line = rtrim($line);
    2323        $output .= "$line\n";
    2424    }
    25    
     25
    2626    // Remove surplus line endings
    2727    while (substr($output, -2) == "\n\n") {
     
    3939function process_directory($path) {
    4040    $dir = opendir($path);
    41    
     41
    4242    while ($file = readdir($dir)) {
    4343        if (substr($file, 0, 1) == '.') {
     
    5656        }
    5757    }
    58    
    59     closedir($dir);   
     58
     59    closedir($dir);
    6060}
    6161
  • wp-linked-data/trunk/vendor/ml/json-ld/FileGetContentsLoader.php

    r2177822 r2921855  
    5454                        $remoteDocument->mediaType = null;
    5555
    56                         $httpHeadersOffset = count($http_response_header);
     56                        $httpHeadersOffset = isset($http_response_header) ? count($http_response_header) : 0;
    5757                    }
    5858                }
     
    7878            }
    7979
    80             $linkHeaderValues = $this->parseContextLinkHeaders($linkHeaderValues, new IRI($url));
     80            $linkHeaderValues = $this->parseLinkHeaders($linkHeaderValues, new IRI($url));
    8181
    82             if (count($linkHeaderValues) === 1) {
    83                 $remoteDocument->contextUrl = reset($linkHeaderValues);
    84             } elseif (count($linkHeaderValues) > 1) {
     82            $contextLinkHeaders = array_filter($linkHeaderValues, function ($link) {
     83                return (isset($link['rel'])
     84                    && in_array('http://www.w3.org/ns/json-ld#context', explode(' ', $link['rel'])));
     85            });
     86
     87            if (count($contextLinkHeaders) === 1) {
     88                $remoteDocument->contextUrl = $contextLinkHeaders[0]['uri'];
     89            } elseif (count($contextLinkHeaders) > 1) {
    8590                throw new JsonLdException(
    8691                    JsonLdException::MULTIPLE_CONTEXT_LINK_HEADERS,
     
    101106                if ('application/ld+json' === $remoteDocument->mediaType) {
    102107                    $remoteDocument->contextUrl = null;
    103                 } elseif (('application/json' !== $remoteDocument->mediaType) &&
    104                     (0 !== substr_compare($remoteDocument->mediaType, '+json', -5))) {
    105                     throw new JsonLdException(
    106                         JsonLdException::LOADING_DOCUMENT_FAILED,
    107                         'Invalid media type',
    108                         $remoteDocument->mediaType
    109                     );
     108                } else {
     109                    // If the Media type was not as expected, check to see if the desired content type
     110                    // is being offered in a Link header (this is what schema.org now does).
     111                    $altLinkHeaders = array_filter($linkHeaderValues, function ($link) {
     112                        return (isset($link['rel']) && isset($link['type'])
     113                            && ($link['rel'] === 'alternate') && ($link['type'] === 'application/ld+json'));
     114                    });
     115
     116                    // The spec states 'A response MUST NOT contain more than one HTTP Link Header
     117                    // using the alternate link relation with type="application/ld+json"'
     118                    if (count($altLinkHeaders) === 1) {
     119                        return $this->loadDocument($altLinkHeaders[0]['uri']);
     120                    } elseif (count($altLinkHeaders) > 1) {
     121                        throw new JsonLdException(
     122                            JsonLdException::LOADING_DOCUMENT_FAILED,
     123                            'Received multiple alternate link headers'
     124                        );
     125                    }
     126
     127                    if (('application/json' !== $remoteDocument->mediaType) &&
     128                        (0 !== substr_compare($remoteDocument->mediaType, '+json', -5))) {
     129                        throw new JsonLdException(
     130                            JsonLdException::LOADING_DOCUMENT_FAILED,
     131                            'Invalid media type',
     132                            $remoteDocument->mediaType
     133                        );
     134                    }
    110135                }
    111136            }
     
    122147     * Parse HTTP Link headers
    123148     *
    124      * @param array $values  An array of HTTP Link header values
    125      * @param  IRI  $baseIri The document's URL (used to expand relative URLs to absolutes)
     149     * @param array $values  An array of HTTP Link headers.
     150     * @param IRI   $baseIri The document's URL (used to expand relative URLs to absolutes).
    126151     *
    127      * @return array An array of parsed HTTP Link headers
     152     * @return array A structured representation of the Link header values.
     153     *
     154     * @internal Do not use this method directly, it's only temporarily accessible for testing.
    128155     */
    129     private function parseContextLinkHeaders(array $values, IRI $baseIri)
     156    public function parseLinkHeaders(array $values, IRI $baseIri)
    130157    {
    131158        // Separate multiple links contained in a single header value
     
    145172
    146173        // Split the header in key-value pairs
     174        $result = array();
     175
    147176        foreach ($values as $val) {
    148177            $part = array();
     178
    149179            foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
    150180                preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches);
    151181                $pieces = array_map($trimWhitespaceCallback, $matches[0]);
    152                 $part[$pieces[0]] = isset($pieces[1]) ? $pieces[1] : '';
     182
     183                if (count($pieces) > 1) {
     184                    $part[$pieces[0]] = $pieces[1];
     185                } elseif (count($pieces) === 1) {
     186                    $part['uri'] = (string) $baseIri->resolve(trim($pieces[0], '<> '));
     187                }
    153188            }
    154189
    155             if (in_array('http://www.w3.org/ns/json-ld#context', explode(' ', $part['rel']))) {
    156                 $contexts[] = (string) $baseIri->resolve(trim(key($part), '<> '));
     190            if (!empty($part)) {
     191                $result[] = $part;
    157192            }
    158193        }
    159194
    160         return array_values(array_unique($contexts));
     195        return $result;
    161196    }
    162197}
  • wp-linked-data/trunk/vendor/ml/json-ld/NQuads.php

    r2177822 r2921855  
    4242                    : '<' . $quad->getObject() . '>';
    4343            } else {
    44                 $result .= '"' . $quad->getObject()->getValue() . '"';
     44                $result .= '"' . str_replace(
     45                    array("\n", '"'),
     46                    array('\n', '\"'),
     47                    $quad->getObject()->getValue()) . '"';
    4548                $result .= ($quad->getObject() instanceof TypedValue)
    4649                    ? (RdfConstants::XSD_STRING === $quad->getObject()->getType())
     
    7679        // define partial regexes
    7780        $iri = '(?:<([^>]*)>)';
    78         $bnode = '(_:(?:[A-Za-z0-9]+))';
     81
     82        // blank node labels based on https://www.w3.org/TR/n-quads/#BNodes
     83        $bnode = '(_:(?:[A-Za-z0-9_]|[A-Za-z0-9_][A-Za-z0-9_\-.]*[A-Za-z0-9_\-]))';
     84
    7985        $plain = '"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"';
    8086        $datatype = "\\^\\^$iri";
  • wp-linked-data/trunk/vendor/ml/json-ld/README.md

    r2177822 r2921855  
    1 JsonLD [![Build Status](https://secure.travis-ci.org/lanthaler/JsonLD.png?branch=master)](http://travis-ci.org/lanthaler/JsonLD)
     1JsonLD [![Continuous integration](https://github.com/lanthaler/JsonLD/actions/workflows/ci.yaml/badge.svg)](https://github.com/lanthaler/JsonLD/actions/workflows/ci.yaml)
    22==============
    33
  • wp-linked-data/trunk/vendor/ml/json-ld/Test/NQuadsTest.php

    r2177822 r2921855  
    1010namespace ML\JsonLD\Test;
    1111
     12use ML\JsonLD\JsonLD;
    1213use ML\JsonLD\NQuads;
    1314
     
    2021{
    2122    /**
    22      * Tests the expansion API
     23     * Tests that parsing an invalid NQuad file fails
    2324     *
    2425     * @expectedException \ML\JsonLD\Exception\InvalidQuadException
     
    2930        $nquads->parse('Invalid NQuads file');
    3031    }
     32
     33    /**
     34     * Tests escaping
     35     */
     36    public function testEscaping()
     37    {
     38        $doc = '<http://example.com>';
     39        $doc .= ' <http://schema.org/description>';
     40        $doc .= ' "String with line-break \n and quote (\")" .';
     41        $doc .= "\n";
     42
     43        $nquads = new NQuads();
     44        $parsed = JsonLD::fromRdf($nquads->parse($doc));
     45        $serialized = $nquads->serialize(JsonLD::toRdf($parsed));
     46
     47        $this->assertSame($doc, $serialized);
     48    }
     49
     50    /**
     51     * Tests blank node label parsing
     52     */
     53    public function testParseBlankNodes()
     54    {
     55        $nquads = new NQuads();
     56
     57        $this->assertNotEmpty($nquads->parse('_:b <http://ex/1> "Test" .'), 'just a letter');
     58
     59        $this->assertNotEmpty($nquads->parse('_:b1 <http://ex/1> "Test" .'), 'letter and number');
     60
     61        $this->assertNotEmpty($nquads->parse('_:_b1 <http://ex/1> "Test" .'), 'beginning _');
     62
     63        $this->assertNotEmpty($nquads->parse('_:b_1 <http://ex/1> "Test" .'), 'containing _');
     64
     65        $this->assertNotEmpty($nquads->parse('_:b1_ <http://ex/1> "Test" .'), 'ending _');
     66
     67        $this->assertNotEmpty($nquads->parse('_:b-1 <http://ex/1> "Test" .'), 'containing -');
     68
     69        $this->assertNotEmpty($nquads->parse('_:b-1 <http://ex/1> "Test" .'), 'ending -');
     70
     71        $this->assertNotEmpty($nquads->parse('_:b.1 <http://ex/1> "Test" .'), 'containing .');
     72    }
     73
     74    /**
     75     * Tests that parsing fails for blank node labels beginning with "-"
     76     *
     77     * @expectedException \ML\JsonLD\Exception\InvalidQuadException
     78     */
     79    public function testParseBlankNodeDashAtTheBeginning()
     80    {
     81        $nquads = new NQuads();
     82        $nquads->parse('_:-b1 <http://ex/1> "Test" .');
     83    }
     84
     85    /**
     86     * Tests that parsing fails for blank node labels beginning with "."
     87     *
     88     * @expectedException \ML\JsonLD\Exception\InvalidQuadException
     89     */
     90    public function testParseBlankNodePeriodAtTheBeginning()
     91    {
     92        $nquads = new NQuads();
     93        $nquads->parse('_:.b1 <http://ex/1> "Test" .');
     94    }
     95
     96    /**
     97     * Tests that parsing fails for blank node labels ending with "."
     98     *
     99     * @expectedException \ML\JsonLD\Exception\InvalidQuadException
     100     */
     101    public function testParseBlankNodePeriodAtTheEnd()
     102    {
     103        $nquads = new NQuads();
     104        $nquads->parse('_:b1. <http://ex/1> "Test" .');
     105    }
    31106}
  • wp-linked-data/trunk/vendor/willdurand/negotiation/.gitignore

    r2177822 r2921855  
    11/vendor/
    22composer.lock
     3.phpunit.result.cache
  • wp-linked-data/trunk/vendor/willdurand/negotiation/README.md

    r2177822 r2921855  
    22===========
    33
    4 [![Build
    5 Status](https://travis-ci.org/willdurand/Negotiation.png?branch=master)](http://travis-ci.org/willdurand/Negotiation)
    6 [![Build
    7 status](https://ci.appveyor.com/api/projects/status/6tbe8j3gofdlfm4v?svg=true)](https://ci.appveyor.com/project/willdurand/negotiation)
     4[![GitHub Actions](https://github.com/willdurand/Negotiation/workflows/ci/badge.svg)](https://github.com/willdurand/Negotiation/actions?query=workflow%3A%22ci%22+branch%3Amaster)
    85[![Total
    96Downloads](https://poser.pugx.org/willdurand/Negotiation/downloads.png)](https://packagist.org/packages/willdurand/Negotiation)
    107[![Latest Stable
    118Version](https://poser.pugx.org/willdurand/Negotiation/v/stable.png)](https://packagist.org/packages/willdurand/Negotiation)
    12 ![PHP 7 ready](https://img.shields.io/badge/PHP%207-ready-green.svg)
    139
    1410**Negotiation** is a standalone library without any dependencies that allows you
     
    1915extensively unit tested!
    2016
    21 > **Important:** You are browsing the documentation of Negotiation **2.x**.
    22 Documentation for version **1.x** is available here: [Negotiation 1.x
    23 documentation](https://github.com/willdurand/Negotiation/blob/1.x/README.md#usage).
    24 You might also be interested in this: [**What's new in Negotiation 2?**](https://github.com/willdurand/Negotiation/releases/tag/v2.0.0-alpha1)
     17> **Important:** You are browsing the documentation of Negotiation **3.x**+.
     18>
     19> Documentation for version **1.x** is available here: [Negotiation 1.x
     20> documentation](https://github.com/willdurand/Negotiation/blob/1.x/README.md#usage).
     21>
     22> Documentation for version **2.x** is available here: [Negotiation 2.x
     23> documentation](https://github.com/willdurand/Negotiation/blob/2.x/README.md#usage).
    2524
    2625
     
    6362$negotiator = new \Negotiation\LanguageNegotiator();
    6463
    65 $acceptLangageHeader = 'en; q=0.1, fr; q=0.4, fu; q=0.9, de; q=0.2';
     64$acceptLanguageHeader = 'en; q=0.1, fr; q=0.4, fu; q=0.9, de; q=0.2';
    6665$priorities          = array('de', 'fu', 'en');
    6766
    68 $bestLanguage = $negotiator->getBest($acceptLangageHeader, $priorities);
     67$bestLanguage = $negotiator->getBest($acceptLanguageHeader, $priorities);
    6968
    7069$type = $bestLanguage->getType();
     
    9695
    9796$acceptCharsetHeader = 'ISO-8859-1, UTF-8; q=0.9';
    98 $priorities          = array('iso-8859-1;q=0.3', 'utf-8;q=0.9', 'utf-16;q=1.0'); 
     97$priorities          = array('iso-8859-1;q=0.3', 'utf-8;q=0.9', 'utf-16;q=1.0');
    9998
    10099$bestCharset = $negotiator->getBest($acceptCharsetHeader, $priorities);
     
    125124
    126125
     126Versioning
     127----------
     128
     129Negotiation follows [Semantic Versioning](http://semver.org/).
     130
     131### End Of Life
     132
     133#### 1.x
     134
     135As of October 2016, [branch
     136`1.x`](https://github.com/willdurand/Negotiation/tree/1.x) is not supported
     137anymore, meaning major version `1` reached end of life. Last version is:
     138[1.5.0](https://github.com/willdurand/Negotiation/releases/tag/1.5.0).
     139
     140#### 2.x
     141
     142As of November 2020, [branch
     143`2.x`](https://github.com/willdurand/Negotiation/tree/2.x) is not supported
     144anymore, meaning major version `2` reached end of life. Last version is:
     145[2.3.1](https://github.com/willdurand/Negotiation/releases/tag/v2.3.1).
     146
     147### Stable Version
     148
     149#### 3.x (and `dev-master`)
     150
     151Negotiation [3.0](https://github.com/willdurand/Negotiation/releases/tag/3.0.0)
     152has been released on November 26th, 2020. This is the **current stable version**
     153and it is in sync with the main branch (a.k.a. `master`).
     154
    127155Unit Tests
    128156----------
     
    152180    * [PEAR HTTP2](https://github.com/pear/HTTP2).
    153181
    154 * William Durand <will+git@drnd.me>
     182* [William Durand](https://github.com/willdurand)
    155183* [@neural-wetware](https://github.com/neural-wetware)
    156184
  • wp-linked-data/trunk/vendor/willdurand/negotiation/composer.json

    r2177822 r2921855  
    1212    ],
    1313    "require": {
    14         "php": ">=5.4.0"
     14        "php": ">=7.1.0"
    1515    },
    1616    "autoload": {
    1717        "psr-4": { "Negotiation\\": "src/Negotiation" }
    1818    },
     19    "autoload-dev": {
     20        "psr-4": { "Negotiation\\Tests\\": "tests/Negotiation/Tests" }
     21    },
    1922    "extra": {
    2023        "branch-alias": {
    21             "dev-master": "2.3-dev"
     24            "dev-master": "3.0-dev"
    2225        }
    2326    },
    2427    "require-dev": {
    25         "phpunit/phpunit": "~4.5"
     28        "symfony/phpunit-bridge": "^5.0"
    2629    }
    2730}
  • wp-linked-data/trunk/vendor/willdurand/negotiation/phpunit.xml.dist

    r2177822 r2921855  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <phpunit backupGlobals="false"
     2<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
     3    backupGlobals="false"
    34    backupStaticAttributes="false"
    45    colors="true"
     
    89    processIsolation="false"
    910    stopOnFailure="false"
    10     syntaxCheck="false"
    1111    bootstrap="tests/bootstrap.php"
    1212    >
     
    1616        </testsuite>
    1717    </testsuites>
    18     <filter>
    19         <whitelist>
     18    <coverage>
     19        <include>
    2020            <directory>./src/Negotiation/</directory>
    21         </whitelist>
    22     </filter>
     21        </include>
     22    </coverage>
    2323</phpunit>
  • wp-linked-data/trunk/vendor/willdurand/negotiation/src/Negotiation/AbstractNegotiator.php

    r2177822 r2921855  
    1414     * @return AcceptHeader|null best matching type
    1515     */
    16     public function getBest($header, array $priorities)
     16    public function getBest($header, array $priorities, $strict = false)
    1717    {
    1818        if (empty($priorities)) {
     
    3434                $acceptedHeaders[] = $this->acceptFactory($h);
    3535            } catch (Exception\Exception $e) {
    36                 // silently skip in case of invalid headers coming in from a client
     36                if ($strict) {
     37                    throw $e;
     38                }
    3739            }
    3840        }
     
    4244        }
    4345        $matches         = $this->findMatches($acceptedHeaders, $acceptedPriorities);
    44         $specificMatches = array_reduce($matches, 'Negotiation\Match::reduce', []);
     46        $specificMatches = array_reduce($matches, 'Negotiation\AcceptMatch::reduce', []);
    4547
    46         usort($specificMatches, 'Negotiation\Match::compare');
     48        usort($specificMatches, 'Negotiation\AcceptMatch::compare');
    4749
    4850        $match = array_shift($specificMatches);
    4951
    5052        return null === $match ? null : $acceptedPriorities[$match->index];
     53    }
     54
     55    /**
     56     * @param string $header A string containing an `Accept|Accept-*` header.
     57     *
     58     * @return AcceptHeader[] An ordered list of accept header elements
     59     */
     60    public function getOrderedElements($header)
     61    {
     62        if (!$header) {
     63            throw new InvalidArgument('The header string should not be empty.');
     64        }
     65
     66        $elements = array();
     67        $orderKeys = array();
     68        foreach ($this->parseHeader($header) as $key => $h) {
     69            try {
     70                $element = $this->acceptFactory($h);
     71                $elements[] = $element;
     72                $orderKeys[] = [$element->getQuality(), $key, $element->getValue()];
     73            } catch (Exception\Exception $e) {
     74                // silently skip in case of invalid headers coming in from a client
     75            }
     76        }
     77
     78        // sort based on quality and then original order. This is necessary as
     79        // to ensure that the first in the list for two items with the same
     80        // quality stays in that order in both PHP5 and PHP7.
     81        uasort($orderKeys, function ($a, $b) {
     82            $qA = $a[0];
     83            $qB = $b[0];
     84
     85            if ($qA == $qB) {
     86                return $a[1] <=> $b[1];
     87            }
     88
     89            return ($qA > $qB) ? -1 : 1;
     90        });
     91
     92        $orderedElements = [];
     93        foreach ($orderKeys as $key) {
     94            $orderedElements[] = $elements[$key[1]];
     95        }
     96
     97        return $orderedElements;
    5198    }
    5299
     
    63110     * @param integer      $index
    64111     *
    65      * @return Match|null Headers matched
     112     * @return AcceptMatch|null Headers matched
    66113     */
    67114    protected function match(AcceptHeader $header, AcceptHeader $priority, $index)
     
    75122            $score = 1 * $equal;
    76123
    77             return new Match($header->getQuality() * $priority->getQuality(), $score, $index);
     124            return new AcceptMatch($header->getQuality() * $priority->getQuality(), $score, $index);
    78125        }
    79126
     
    101148     * @param Priority[]     $priorities  Configured priorities
    102149     *
    103      * @return Match[] Headers matched
     150     * @return AcceptMatch[] Headers matched
    104151     */
    105152    private function findMatches(array $headerParts, array $priorities)
  • wp-linked-data/trunk/vendor/willdurand/negotiation/src/Negotiation/BaseAccept.php

    r2177822 r2921855  
    113113    /**
    114114     *
    115      * @param  string $acceptPart
     115     * @param  string|null $acceptPart
    116116     * @return array
    117117     */
    118118    private function parseParameters($acceptPart)
    119119    {
     120        if ($acceptPart === null) {
     121            return ['', []];
     122        }
     123
    120124        $parts = explode(';', $acceptPart);
    121125        $type  = array_shift($parts);
  • wp-linked-data/trunk/vendor/willdurand/negotiation/src/Negotiation/LanguageNegotiator.php

    r2177822 r2921855  
    2828        $ps = $priority->getSubPart();
    2929
    30         $baseEqual = !strcasecmp($ab, $pb);
    31         $subEqual  = !strcasecmp($as, $ps);
     30        $baseEqual = !strcasecmp((string)$ab, (string)$pb);
     31        $subEqual  = !strcasecmp((string)$as, (string)$ps);
    3232
    33         if (($ab == '*' || $baseEqual) && ($as === null || $subEqual)) {
     33        if (($ab == '*' || $baseEqual) && ($as === null || $subEqual || null === $ps)) {
    3434            $score = 10 * $baseEqual + $subEqual;
    3535
    36             return new Match($acceptLanguage->getQuality() * $priority->getQuality(), $score, $index);
     36            return new AcceptMatch($acceptLanguage->getQuality() * $priority->getQuality(), $score, $index);
    3737        }
    3838
  • wp-linked-data/trunk/vendor/willdurand/negotiation/src/Negotiation/Negotiator.php

    r2177822 r2921855  
    3939            $score = 100 * $baseEqual + 10 * $subEqual + count($intersection);
    4040
    41             return new Match($accept->getQuality() * $priority->getQuality(), $score, $index);
     41            return new AcceptMatch($accept->getQuality() * $priority->getQuality(), $score, $index);
    4242        }
    4343
     
    6666            $score = 100 * $baseEqual + 10 * $subEqual + $plusEqual + count($intersection);
    6767
    68             return new Match($accept->getQuality() * $priority->getQuality(), $score, $index);
     68            return new AcceptMatch($accept->getQuality() * $priority->getQuality(), $score, $index);
    6969        }
    7070
  • wp-linked-data/trunk/vendor/willdurand/negotiation/tests/Negotiation/Tests/CharsetNegotiatorTest.php

    r2177822 r2921855  
    1313    private $negotiator;
    1414
    15     protected function setUp()
     15    protected function setUp(): void
    1616    {
    1717        $this->negotiator = new CharsetNegotiator();
     
    4444    {
    4545        if (is_null($expected))
    46             $this->setExpectedException('Negotiation\Exception\InvalidArgument');
     46            $this->expectException('Negotiation\Exception\InvalidArgument');
    4747
    4848        $accept = $this->negotiator->getBest($accept, $priorities);
  • wp-linked-data/trunk/vendor/willdurand/negotiation/tests/Negotiation/Tests/EncodingNegotiatorTest.php

    r2177822 r2921855  
    1313    private $negotiator;
    1414
    15     protected function setUp()
     15    protected function setUp(): void
    1616    {
    1717        $this->negotiator = new EncodingNegotiator();
  • wp-linked-data/trunk/vendor/willdurand/negotiation/tests/Negotiation/Tests/LanguageNegotiatorTest.php

    r2177822 r2921855  
    1414    private $negotiator;
    1515
    16     protected function setUp()
     16    protected function setUp(): void
    1717    {
    1818        $this->negotiator = new LanguageNegotiator();
     
    5252            # Quality of source factors
    5353            array('en;q=0.5,de', array('de;q=0.3', 'en;q=0.9'), 'en;q=0.9'),
     54            # Generic fallback
     55            array('fr-FR, en-US;q=0.8', array('fr'), 'fr'),
     56            array('fr-FR, en-US;q=0.8', array('fr', 'en-US'), 'fr'),
     57            array('fr-FR, en-US;q=0.8', array('fr-CA', 'en'), 'en'),
    5458        );
    5559    }
     
    7983        );
    8084    }
     85
     86    /**
     87     * Given a accept header containing specific languages (here 'en-US', 'fr-FR')
     88     *  And priorities containing a generic version of that language
     89     * Then the best language is mapped to the generic one here 'fr'
     90     */
     91    public function testSpecificLanguageAreMappedToGeneric()
     92    {
     93        $acceptLanguageHeader = 'fr-FR, en-US;q=0.8';
     94        $priorities           = array('fr');
     95
     96        $acceptHeader = $this->negotiator->getBest($acceptLanguageHeader, $priorities);
     97
     98        $this->assertInstanceOf('Negotiation\AcceptHeader', $acceptHeader);
     99        $this->assertEquals('fr', $acceptHeader->getValue());
     100    }
    81101}
  • wp-linked-data/trunk/vendor/willdurand/negotiation/tests/Negotiation/Tests/MatchTest.php

    r2177822 r2921855  
    33namespace Negotiation\Tests;
    44
    5 use Negotiation\Match;
     5use Negotiation\AcceptMatch;
    66
    77class MatchTest extends TestCase
     
    1212    public function testCompare($match1, $match2, $expected)
    1313    {
    14         $this->assertEquals($expected, Match::compare($match1, $match2));
     14        $this->assertEquals($expected, AcceptMatch::compare($match1, $match2));
    1515    }
    1616
     
    1818    {
    1919        return array(
    20             array(new Match(1.0, 110, 1), new Match(1.0, 111, 1),    0),
    21             array(new Match(0.1, 10,  1), new Match(0.1,  10, 2),   -1),
    22             array(new Match(0.5, 110, 5), new Match(0.5,  11, 4),    1),
    23             array(new Match(0.4, 110, 1), new Match(0.6, 111, 3),    1),
    24             array(new Match(0.6, 110, 1), new Match(0.4, 111, 3),   -1),
     20            array(new AcceptMatch(1.0, 110, 1), new AcceptMatch(1.0, 111, 1),    0),
     21            array(new AcceptMatch(0.1, 10,  1), new AcceptMatch(0.1,  10, 2),   -1),
     22            array(new AcceptMatch(0.5, 110, 5), new AcceptMatch(0.5,  11, 4),    1),
     23            array(new AcceptMatch(0.4, 110, 1), new AcceptMatch(0.6, 111, 3),    1),
     24            array(new AcceptMatch(0.6, 110, 1), new AcceptMatch(0.4, 111, 3),   -1),
    2525        );
    2626    }
     
    3131    public function testReduce($carry, $match, $expected)
    3232    {
    33         $this->assertEquals($expected, Match::reduce($carry, $match));
     33        $this->assertEquals($expected, AcceptMatch::reduce($carry, $match));
    3434    }
    3535
     
    3838        return array(
    3939            array(
    40                 array(1 => new Match(1.0, 10, 1)),
    41                 new Match(0.5, 111, 1),
    42                 array(1 => new Match(0.5, 111, 1)),
     40                array(1 => new AcceptMatch(1.0, 10, 1)),
     41                new AcceptMatch(0.5, 111, 1),
     42                array(1 => new AcceptMatch(0.5, 111, 1)),
    4343            ),
    4444            array(
    45                 array(1 => new Match(1.0, 110, 1)),
    46                 new Match(0.5, 11, 1),
    47                 array(1 => new Match(1.0, 110, 1)),
     45                array(1 => new AcceptMatch(1.0, 110, 1)),
     46                new AcceptMatch(0.5, 11, 1),
     47                array(1 => new AcceptMatch(1.0, 110, 1)),
    4848            ),
    4949            array(
    50                 array(0 => new Match(1.0, 10, 1)),
    51                 new Match(0.5, 111, 1),
    52                 array(0 => new Match(1.0, 10, 1), 1 => new Match(0.5, 111, 1)),
     50                array(0 => new AcceptMatch(1.0, 10, 1)),
     51                new AcceptMatch(0.5, 111, 1),
     52                array(0 => new AcceptMatch(1.0, 10, 1), 1 => new AcceptMatch(0.5, 111, 1)),
    5353            ),
    5454        );
  • wp-linked-data/trunk/vendor/willdurand/negotiation/tests/Negotiation/Tests/NegotiatorTest.php

    r2177822 r2921855  
    77use Negotiation\Negotiator;
    88use Negotiation\Accept;
    9 use Negotiation\Match;
     9use Negotiation\AcceptMatch;
    1010
    1111class NegotiatorTest extends TestCase
     
    1717    private $negotiator;
    1818
    19     protected function setUp()
     19    protected function setUp(): void
    2020    {
    2121        $this->negotiator = new Negotiator();
     
    105105    }
    106106
     107    /**
     108     * @dataProvider dataProviderForTestGetOrderedElements
     109     */
     110    public function testGetOrderedElements($header, $expected)
     111    {
     112        try {
     113            $elements = $this->negotiator->getOrderedElements($header);
     114        } catch (\Exception $e) {
     115            $this->assertEquals($expected, $e);
     116
     117            return;
     118        }
     119
     120        if (empty($elements)) {
     121            $this->assertNull($expected);
     122
     123            return;
     124        }
     125
     126        $this->assertInstanceOf('Negotiation\Accept', $elements[0]);
     127
     128        foreach ($expected as $key => $item) {
     129            $this->assertSame($item, $elements[$key]->getValue());
     130        }
     131    }
     132
     133    public static function dataProviderForTestGetOrderedElements()
     134    {
     135        return array(
     136            // error cases
     137            array('', new InvalidArgument('The header string should not be empty.')),
     138            array('/qwer', null),
     139
     140            // first one wins as no quality modifiers
     141            array('text/html, text/xml', array('text/html', 'text/xml')),
     142
     143            // ordered by quality modifier
     144            array(
     145                'text/html;q=0.3, text/html;q=0.7',
     146                array('text/html;q=0.7', 'text/html;q=0.3')
     147            ),
     148            // ordered by quality modifier - the one with no modifier wins, level not taken into account
     149            array(
     150                'text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5',
     151                array('text/html;level=1', 'text/html;q=0.7', '*/*;q=0.5', 'text/html;level=2;q=0.4', 'text/*;q=0.3')
     152            ),
     153        );
     154    }
     155
    107156    public function testGetBestRespectsQualityOfSource()
    108157    {
     
    110159        $this->assertInstanceOf('Negotiation\Accept', $accept);
    111160        $this->assertEquals('text/plain', $accept->getType());
     161    }
     162
     163    public function testGetBestInvalidMediaType()
     164    {
     165        $this->expectException(\Negotiation\Exception\InvalidMediaType::class);
     166        $header = 'sdlfkj20ff; wdf';
     167        $priorities = array('foo/qwer');
     168
     169        $this->negotiator->getBest($header, $priorities, true);
    112170    }
    113171
     
    155213                array(new Accept('text/html; charset=UTF-8'), new Accept('image/png; foo=bar'), new Accept('application/pdf')),
    156214                array(
    157                     new Match(1.0, 111, 0),
    158                     new Match(0.7, 111, 1),
    159                     new Match(0.4, 1,   1),
     215                    new AcceptMatch(1.0, 111, 0),
     216                    new AcceptMatch(0.7, 111, 1),
     217                    new AcceptMatch(0.4, 1,   1),
    160218                )
    161219            ),
     
    164222                array(new Accept('text/html; asfd=qwer'), new Accept('image/png'), new Accept('application/pdf')),
    165223                array(
    166                     new Match(1.0, 110, 0),
    167                     new Match(0.7, 100, 1),
     224                    new AcceptMatch(1.0, 110, 0),
     225                    new AcceptMatch(0.7, 100, 1),
    168226                )
    169227            ),
     
    172230                array(new Accept('text/html; level=1'), new Accept('text/html'), new Accept('text/plain'), new Accept('image/jpeg'), new Accept('text/html; level=2'), new Accept('text/html; level=3')),
    173231                array(
    174                     new Match(0.3,    100,    0),
    175                     new Match(0.7,    110,    0),
    176                     new Match(1.0,    111,    0),
    177                     new Match(0.5,      0,    0),
    178                     new Match(0.3,    100,    1),
    179                     new Match(0.7,    110,    1),
    180                     new Match(0.5,      0,    1),
    181                     new Match(0.3,    100,    2),
    182                     new Match(0.5,      0,    2),
    183                     new Match(0.5,      0,    3),
    184                     new Match(0.3,    100,    4),
    185                     new Match(0.7,    110,    4),
    186                     new Match(0.4,    111,    4),
    187                     new Match(0.5,      0,    4),
    188                     new Match(0.3,    100,    5),
    189                     new Match(0.7,    110,    5),
    190                     new Match(0.5,      0,    5),
     232                    new AcceptMatch(0.3,    100,    0),
     233                    new AcceptMatch(0.7,    110,    0),
     234                    new AcceptMatch(1.0,    111,    0),
     235                    new AcceptMatch(0.5,      0,    0),
     236                    new AcceptMatch(0.3,    100,    1),
     237                    new AcceptMatch(0.7,    110,    1),
     238                    new AcceptMatch(0.5,      0,    1),
     239                    new AcceptMatch(0.3,    100,    2),
     240                    new AcceptMatch(0.5,      0,    2),
     241                    new AcceptMatch(0.5,      0,    3),
     242                    new AcceptMatch(0.3,    100,    4),
     243                    new AcceptMatch(0.7,    110,    4),
     244                    new AcceptMatch(0.4,    111,    4),
     245                    new AcceptMatch(0.5,      0,    4),
     246                    new AcceptMatch(0.3,    100,    5),
     247                    new AcceptMatch(0.7,    110,    5),
     248                    new AcceptMatch(0.5,      0,    5),
    191249                )
    192250            )
  • wp-linked-data/trunk/vendor/willdurand/negotiation/tests/Negotiation/Tests/TestCase.php

    r2177822 r2921855  
    33namespace Negotiation\Tests;
    44
    5 abstract class TestCase extends \PHPUnit_Framework_TestCase
     5use PHPUnit\Framework\TestCase as PHPUnitTestCase;
     6
     7abstract class TestCase extends PHPUnitTestCase
    68{
    79    protected function call_private_method($class, $method, $object, $params)
  • wp-linked-data/trunk/wp-linked-data-initialize.php

    r2177822 r2921855  
    2323
    2424        private function registerRdfNamespaces () {
    25             EasyRdf_Namespace::set ('bio', 'http://purl.org/vocab/bio/0.1/');
    26             EasyRdf_Namespace::set ('sioct', 'http://rdfs.org/sioc/types#');
     25            EasyRdf\RdfNamespace::set ('bio', 'http://purl.org/vocab/bio/0.1/');
     26            EasyRdf\RdfNamespace::set ('sioct', 'http://rdfs.org/sioc/types#');
    2727        }
    2828
  • wp-linked-data/trunk/wp-linked-data.php

    r2494951 r2921855  
    44Plugin URI: http://wordpress.org/extend/plugins/wp-linked-data/
    55Description: Publishing blog contents as linked data
    6 Version: 0.5.3
     6Version: 0.5.4
    77Author: Angelo Veltens
    88Author URI: http://angelo.veltens.org/
     
    3030    class WpLinkedData {
    3131
    32         function WpLinkedData ($wpLinkedDataInitializer) {
     32        function __construct ($wpLinkedDataInitializer) {
    3333            register_activation_hook (__FILE__, array(&$this, 'onPluginActivation'));
    3434            if (phpVersionSupported()) {
Note: See TracChangeset for help on using the changeset viewer.