gnu-social/vendor/masterminds/html5/bin/entities.php
Diogo Cordeiro 2a06261f75 [CORE][COMPOSER] Move extlib packages with immediate composer correspondent to composer dependencies
This adds a composer.json for all dependencies that are available
2019-08-03 17:47:24 +01:00

27 lines
638 B
PHP

<?php
/**
* Fetch the entities.json file and convert to PHP datastructure.
*/
// The URL to the official entities JSON file.
$ENTITIES_URL = 'http://www.w3.org/TR/2012/CR-html5-20121217/entities.json';
$payload = file_get_contents($ENTITIES_URL);
$json = json_decode($payload);
$table = array();
foreach ($json as $name => $obj) {
$sname = substr($name, 1, -1);
$table[$sname] = $obj->characters;
}
echo '<?php
namespace Masterminds\\HTML5;
/** Entity lookup tables. This class is automatically generated. */
class Entities {
public static $byName = ';
var_export($table);
echo ';
}' . PHP_EOL;
//print serialize($table);