Update to use sunra/php-simple-html-dom-parser

Remove the simple-html-dom parser that relies on an outdated repo. This
appears to be the most popular repo for the dom library.
This commit is contained in:
Craig Davis 2014-05-14 19:50:33 -05:00
parent 0ac35d16a8
commit c19ecaf71e
4 changed files with 105 additions and 89 deletions

View File

@ -49,18 +49,13 @@
"michelf/php-smartypants": "1.6.0-beta1", "michelf/php-smartypants": "1.6.0-beta1",
"mustache/mustache": "2.5.1", "mustache/mustache": "2.5.1",
"phpunit/phpunit": "3.7.*", "phpunit/phpunit": "3.7.*",
"simple-html-dom/simple-html-dom": "1.5.0",
"squizlabs/php_codesniffer": "1.*", "squizlabs/php_codesniffer": "1.*",
"sunra/php-simple-html-dom-parser": "v1.5.0",
"symfony/config": "v2.3.4", "symfony/config": "v2.3.4",
"symfony/console": "v2.3.4", "symfony/console": "v2.3.4",
"symfony/yaml": "v2.3.4", "symfony/yaml": "v2.3.4",
"twig/twig": "v1.13.2" "twig/twig": "v1.13.2"
}, },
"autoload": {
"classmap": [
"vendor/simple-html-dom/simple-html-dom/"
]
},
"bin": [ "bin": [
"bin/md2resume" "bin/md2resume"
] ]

178
composer.lock generated
View File

@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
], ],
"hash": "87e1f659b849bce922f4a0bffa38d61f", "hash": "c7a457f7ccfb1a6ec431bf89e1d4933c",
"packages": [ "packages": [
{ {
"name": "fabpot/php-cs-fixer", "name": "fabpot/php-cs-fixer",
@ -384,22 +384,22 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "1.2.13", "version": "1.2.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94" "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/466e7cd2554b4e264c9e3f31216d25ac0e5f3d94", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ef2bf3a1c47eca07ea95f0d8a902a6340390b34",
"reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94", "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"phpunit/php-file-iterator": ">=1.3.0@stable", "phpunit/php-file-iterator": ">=1.3.0@stable",
"phpunit/php-text-template": ">=1.1.1@stable", "phpunit/php-text-template": ">=1.2.0@stable",
"phpunit/php-token-stream": ">=1.1.3@stable" "phpunit/php-token-stream": ">=1.1.3@stable"
}, },
"require-dev": { "require-dev": {
@ -441,7 +441,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2013-09-10 08:14:32" "time": "2014-03-28 10:53:45"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -490,16 +490,16 @@
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
"version": "1.1.4", "version": "1.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git", "url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23" "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5180896f51c5b3648ac946b05f9ec02be78a0b23", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23", "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -530,7 +530,7 @@
"keywords": [ "keywords": [
"template" "template"
], ],
"time": "2012-10-31 18:15:28" "time": "2014-01-30 17:20:04"
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
@ -582,12 +582,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" "reference": "955c24b708f8bfd6a05f303217a8dac3a443d531"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/955c24b708f8bfd6a05f303217a8dac3a443d531",
"reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", "reference": "955c24b708f8bfd6a05f303217a8dac3a443d531",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -624,7 +624,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2014-03-03 05:10:30" "time": "2014-05-12 05:34:42"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
@ -632,34 +632,33 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "4dbc3ab5de25a9ffd07796519f9f7f4aaddc37e0" "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4dbc3ab5de25a9ffd07796519f9f7f4aaddc37e0", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
"reference": "4dbc3ab5de25a9ffd07796519f9f7f4aaddc37e0", "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-ctype": "*",
"ext-dom": "*", "ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*", "ext-pcre": "*",
"ext-reflection": "*", "ext-reflection": "*",
"ext-spl": "*", "ext-spl": "*",
"php": ">=5.3.3", "php": ">=5.3.3",
"phpunit/php-code-coverage": "~1.2.1", "phpunit/php-code-coverage": "~1.2",
"phpunit/php-file-iterator": "~1.3.1", "phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.1.1", "phpunit/php-text-template": "~1.1",
"phpunit/php-timer": "~1.0.4", "phpunit/php-timer": "~1.0",
"phpunit/phpunit-mock-objects": "~1.2.0", "phpunit/phpunit-mock-objects": "~1.2",
"symfony/yaml": "~2.0" "symfony/yaml": "~2.0"
}, },
"require-dev": { "require-dev": {
"pear-pear.php.net/pear": "1.9.4" "pear-pear.php.net/pear": "1.9.4"
}, },
"suggest": { "suggest": {
"ext-json": "*",
"ext-simplexml": "*",
"ext-tokenizer": "*",
"phpunit/php-invoker": "~1.1" "phpunit/php-invoker": "~1.1"
}, },
"bin": [ "bin": [
@ -698,7 +697,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2014-03-05 12:52:24" "time": "2014-04-30 12:24:19"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
@ -763,12 +762,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/diff.git", "url": "https://github.com/sebastianbergmann/diff.git",
"reference": "ecc923996545d4e4395c0759b6c538f085233f62" "reference": "ac84cfdec593945f36f24074d6ea17d296e86f76"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ecc923996545d4e4395c0759b6c538f085233f62", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ac84cfdec593945f36f24074d6ea17d296e86f76",
"reference": "ecc923996545d4e4395c0759b6c538f085233f62", "reference": "ac84cfdec593945f36f24074d6ea17d296e86f76",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -805,49 +804,20 @@
"keywords": [ "keywords": [
"diff" "diff"
], ],
"time": "2014-02-16 12:08:10" "time": "2014-05-12 05:21:40"
},
{
"name": "simple-html-dom/simple-html-dom",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/Youpie/simple-html-dom.git",
"reference": "961610576c460546677a635062e9d3d7b6dab745"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Youpie/simple-html-dom/zipball/961610576c460546677a635062e9d3d7b6dab745",
"reference": "961610576c460546677a635062e9d3d7b6dab745",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "S.C. Chen",
"email": "me578022@gmail.com",
"homepage": "http://simplehtmldom.sourceforge.net/"
}
],
"description": "A copy of the PHP Simple HTML DOM Parser project.",
"time": "2013-05-14 22:27:35"
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
"version": "1.5.2", "version": "1.5.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "a76a39b317ce8106abe6264daa505e24e1731860" "reference": "396178ada8499ec492363587f037125bf7b07fcc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a76a39b317ce8106abe6264daa505e24e1731860", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/396178ada8499ec492363587f037125bf7b07fcc",
"reference": "a76a39b317ce8106abe6264daa505e24e1731860", "reference": "396178ada8499ec492363587f037125bf7b07fcc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -861,6 +831,11 @@
"scripts/phpcs" "scripts/phpcs"
], ],
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-phpcs-fixer": "2.0.x-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"CodeSniffer.php", "CodeSniffer.php",
@ -904,7 +879,50 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2014-02-04 23:49:58" "time": "2014-05-01 03:07:07"
},
{
"name": "sunra/php-simple-html-dom-parser",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/sunra/php-simple-html-dom-parser.git",
"reference": "a0b80ace086c7e09085669205e1b3c2c9c7a453c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sunra/php-simple-html-dom-parser/zipball/a0b80ace086c7e09085669205e1b3c2c9c7a453c",
"reference": "a0b80ace086c7e09085669205e1b3c2c9c7a453c",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"autoload": {
"psr-0": {
"Sunra\\PhpSimple\\HtmlDomParser": "Src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sunra",
"email": "sunra@yandex.ru",
"homepage": "https://github.com/sunra"
}
],
"description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.",
"homepage": "https://github.com/sunra/php-simple-html-dom-parser",
"keywords": [
"dom",
"html",
"parser"
],
"time": "2013-05-04 14:32:03"
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
@ -1014,12 +1032,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Filesystem.git", "url": "https://github.com/symfony/Filesystem.git",
"reference": "e81f1b30eb9748c3f8e0de3a92ea210845cff0a9" "reference": "98e831eac836a0a5911626ce82684155f21d0e4d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Filesystem/zipball/e81f1b30eb9748c3f8e0de3a92ea210845cff0a9", "url": "https://api.github.com/repos/symfony/Filesystem/zipball/98e831eac836a0a5911626ce82684155f21d0e4d",
"reference": "e81f1b30eb9748c3f8e0de3a92ea210845cff0a9", "reference": "98e831eac836a0a5911626ce82684155f21d0e4d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1043,7 +1061,9 @@
"authors": [ "authors": [
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com" "email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
}, },
{ {
"name": "Symfony Community", "name": "Symfony Community",
@ -1052,7 +1072,7 @@
], ],
"description": "Symfony Filesystem Component", "description": "Symfony Filesystem Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2014-01-07 13:29:57" "time": "2014-04-16 10:36:21"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
@ -1061,12 +1081,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Finder.git", "url": "https://github.com/symfony/Finder.git",
"reference": "d45faef922df8438cce99b5ee226bf06c32d145e" "reference": "1343b576d1401f4a5117cab4e250201ae348143a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Finder/zipball/d45faef922df8438cce99b5ee226bf06c32d145e", "url": "https://api.github.com/repos/symfony/Finder/zipball/1343b576d1401f4a5117cab4e250201ae348143a",
"reference": "d45faef922df8438cce99b5ee226bf06c32d145e", "reference": "1343b576d1401f4a5117cab4e250201ae348143a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1101,7 +1121,7 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2014-03-03 12:53:01" "time": "2014-05-12 09:28:39"
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
@ -1110,12 +1130,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Process.git", "url": "https://github.com/symfony/Process.git",
"reference": "0ae3bf5ff90edbe6e30e645221646479c2f1ef54" "reference": "8a3edace8e8aabed8992b993bfc13df3b1e836f2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/0ae3bf5ff90edbe6e30e645221646479c2f1ef54", "url": "https://api.github.com/repos/symfony/Process/zipball/8a3edace8e8aabed8992b993bfc13df3b1e836f2",
"reference": "0ae3bf5ff90edbe6e30e645221646479c2f1ef54", "reference": "8a3edace8e8aabed8992b993bfc13df3b1e836f2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1150,7 +1170,7 @@
], ],
"description": "Symfony Process Component", "description": "Symfony Process Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2014-02-24 16:21:51" "time": "2014-04-28 05:15:04"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",

View File

@ -11,6 +11,7 @@ use Assetic\Asset\FileAsset;
use Assetic\Filter; use Assetic\Filter;
use Michelf\MarkdownExtra; use Michelf\MarkdownExtra;
use Michelf\SmartyPants; use Michelf\SmartyPants;
use Sunra\PhpSimple\HtmlDomParser;
class HtmlCommand extends Command class HtmlCommand extends Command
{ {
@ -113,8 +114,7 @@ class HtmlCommand extends Command
$resumeHtml = SmartyPants::defaultTransform($resumeHtml); $resumeHtml = SmartyPants::defaultTransform($resumeHtml);
// Construct the title for the html document from the h1 and h2 tags // Construct the title for the html document from the h1 and h2 tags
$simpleDom = new \simple_html_dom(); $simpleDom = HtmlDomParser::str_get_html($resumeHtml);
$simpleDom->load($resumeHtml);
$title = sprintf( $title = sprintf(
'%s | %s', '%s | %s',
$simpleDom->find('h1', 0)->innertext, $simpleDom->find('h1', 0)->innertext,

View File

@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Sunra\PhpSimple\HtmlDomParser;
class PdfCommand extends HtmlCommand class PdfCommand extends HtmlCommand
{ {
@ -59,7 +60,7 @@ class PdfCommand extends HtmlCommand
// The pdf needs some extra css rules, and so we'll add them here // The pdf needs some extra css rules, and so we'll add them here
// to our html document // to our html document
$simpleDom = new \simple_html_dom($rendered); $simpleDom = HtmlDomParser::str_get_html($rendered);
$body = $simpleDom->find('body', 0); $body = $simpleDom->find('body', 0);
$body->class = $body->class . ' pdf'; $body->class = $body->class . ' pdf';
$rendered = (string) $simpleDom; $rendered = (string) $simpleDom;