diff --git a/autoload.php b/autoload.php index 53f5ceed..d25383f7 100644 --- a/autoload.php +++ b/autoload.php @@ -39,7 +39,7 @@ class Autoloader $dir = new RecursiveDirectoryIterator(ROOT_DIR, RecursiveDirectoryIterator::SKIP_DOTS); $ite = new RecursiveIteratorIterator($dir); - $pathIterator = new RegexIterator($ite, '/.*\.class\.php$/', RegexIterator::GET_MATCH); + $pathIterator = new RegexIterator($ite, '/.*\.php$/', RegexIterator::GET_MATCH); foreach($pathIterator as $paths) { foreach($paths as $path) diff --git a/composer.json b/composer.json index 9ecee711..0a087866 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,12 @@ "php": ">=7.0", "ext-curl": "*", "ext-mbstring": "*", - "ext-xml": "*" + "ext-xml": "*", + "leafo/scssphp": "0.7.4", + "erusev/parsedown": "^1.6", + "erusev/parsedown-extra": "^0.7.1", + "pelago/emogrifier": "^2.0", + "mustangostang/spyc": "^0.6.2", + "phpunit/phpunit": "^6.5" } -} \ No newline at end of file +} diff --git a/dev.sh b/dev.sh index 06fe5fb4..891beed6 100755 --- a/dev.sh +++ b/dev.sh @@ -13,4 +13,6 @@ if ! which $PHPBIN 2>/dev/null; then PHPBIN=php fi +$PHPBIN composer.phar install + $PHPBIN --server localhost:8000 --docroot "$DIR/web" "$DIR/web/index.php" diff --git a/docker.sh b/docker.sh index 7bf021df..72f4572c 100755 --- a/docker.sh +++ b/docker.sh @@ -13,4 +13,5 @@ docker run --rm -it --name "dev.lbry.io" \ -p "127.0.0.1:8000:8000" \ -u "$(id -u):$(id -g)" \ php:7-alpine \ - php --server "0.0.0.0:8000" --docroot "web/" "web/index.php" + php composer.phar install + php --server "0.0.0.0:8000" --docroot "web/" "index.php" diff --git a/lib/vendor/Emogrifier.class.php b/lib/vendor/Emogrifier.class.php deleted file mode 100644 index f448fab2..00000000 --- a/lib/vendor/Emogrifier.class.php +++ /dev/null @@ -1,1501 +0,0 @@ - - * @author Roman Ožana - * @author Sander Kruger - */ -class Emogrifier -{ - /** - * @var int - */ - const CACHE_KEY_CSS = 0; - - /** - * @var int - */ - const CACHE_KEY_SELECTOR = 1; - - /** - * @var int - */ - const CACHE_KEY_XPATH = 2; - - /** - * @var int - */ - const CACHE_KEY_CSS_DECLARATIONS_BLOCK = 3; - - /** - * @var int - */ - const CACHE_KEY_COMBINED_STYLES = 4; - - /** - * for calculating nth-of-type and nth-child selectors - * - * @var int - */ - const INDEX = 0; - - /** - * for calculating nth-of-type and nth-child selectors - * - * @var int - */ - const MULTIPLIER = 1; - - /** - * @var string - */ - const ID_ATTRIBUTE_MATCHER = '/(\\w+)?\\#([\\w\\-]+)/'; - - /** - * @var string - */ - const CLASS_ATTRIBUTE_MATCHER = '/(\\w+|[\\*\\]])?((\\.[\\w\\-]+)+)/'; - - /** - * @var string - */ - const CONTENT_TYPE_META_TAG = ''; - - /** - * @var string - */ - const DEFAULT_DOCUMENT_TYPE = ''; - - /** - * @var string - */ - private $html = ''; - - /** - * @var string - */ - private $css = ''; - - /** - * @var bool[] - */ - private $excludedSelectors = []; - - /** - * @var string[] - */ - private $unprocessableHtmlTags = ['wbr']; - - /** - * @var bool[] - */ - private $allowedMediaTypes = ['all' => true, 'screen' => true, 'print' => true]; - - /** - * @var mixed[] - */ - private $caches = [ - self::CACHE_KEY_CSS => [], - self::CACHE_KEY_SELECTOR => [], - self::CACHE_KEY_XPATH => [], - self::CACHE_KEY_CSS_DECLARATIONS_BLOCK => [], - self::CACHE_KEY_COMBINED_STYLES => [], - ]; - - /** - * the visited nodes with the XPath paths as array keys - * - * @var \DOMElement[] - */ - private $visitedNodes = []; - - /** - * the styles to apply to the nodes with the XPath paths as array keys for the outer array - * and the attribute names/values as key/value pairs for the inner array - * - * @var string[][] - */ - private $styleAttributesForNodes = []; - - /** - * Determines whether the "style" attributes of tags in the the HTML passed to this class should be preserved. - * If set to false, the value of the style attributes will be discarded. - * - * @var bool - */ - private $isInlineStyleAttributesParsingEnabled = true; - - /** - * Determines whether the