From a0fe68272cef8ca9c85c334fddde788e344c5618 Mon Sep 17 00:00:00 2001
From: Toby Zerner
Date: Wed, 22 Jul 2015 16:03:48 +0930
Subject: [PATCH] Implement TextFormatter for posts
Get rid of formatting on user bios, we'll do that with JavaScript
---
composer.json | 7 +-
composer.lock | 1696 ++---------------
js/forum/src/components/UserBio.js | 2 +-
js/lib/models/User.js | 2 +-
.../2015_02_24_000000_create_posts_table.php | 1 -
.../2015_02_24_000000_create_users_table.php | 1 -
src/Api/Serializers/UserSerializer.php | 3 +-
src/Core/Formatter/Formatter.php | 110 +-
src/Core/Formatter/FormatterManager.php | 143 --
.../Formatter/FormatterServiceProvider.php | 2 +-
src/Core/Formatter/LinkifyFormatter.php | 28 -
src/Core/Formatter/TextFormatter.php | 120 --
src/Core/Posts/CommentPost.php | 55 +-
src/Core/Users/User.php | 45 -
src/Core/Users/UsersServiceProvider.php | 1 -
15 files changed, 243 insertions(+), 1973 deletions(-)
delete mode 100644 src/Core/Formatter/FormatterManager.php
delete mode 100644 src/Core/Formatter/LinkifyFormatter.php
delete mode 100644 src/Core/Formatter/TextFormatter.php
diff --git a/composer.json b/composer.json
index d7e66e32c..d66d83c98 100644
--- a/composer.json
+++ b/composer.json
@@ -11,11 +11,9 @@
"php": ">=5.4.0",
"illuminate/support": "5.0.*",
"tobscure/json-api": "dev-master",
- "tobscure/permissible": "dev-master",
- "misd/linkify": "1.1.*",
"oyejorge/less.php": "~1.5",
"intervention/image": "^2.3.0",
- "ezyang/htmlpurifier": "^4.6.0",
+ "s9e/text-formatter": "dev-release/php5.3",
"psr/http-message": "^1.0",
"zendframework/zend-diactoros": "^1.1",
"nikic/fast-route": "^0.6",
@@ -23,9 +21,6 @@
},
"require-dev": {
"fzaninotto/faker": "1.4.0",
- "codeception/codeception": "~2.0.0",
- "codeception/mockery-module": "*",
- "laracasts/testdummy": "~2.0",
"squizlabs/php_codesniffer": "2.*",
"phpspec/phpspec": "^2.2"
},
diff --git a/composer.lock b/composer.lock
index ed93e5a0e..394b4c803 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "6f47932716cfbd88646a021ea58c18b5",
+ "hash": "0d4b9771622dc53634ebec14bfa1f8ef",
"packages": [
{
"name": "danielstjules/stringy",
@@ -181,50 +181,6 @@
],
"time": "2014-12-20 21:24:13"
},
- {
- "name": "ezyang/htmlpurifier",
- "version": "v4.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/ezyang/htmlpurifier.git",
- "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd",
- "reference": "6f389f0f25b90d0b495308efcfa073981177f0fd",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "HTMLPurifier": "library/"
- },
- "files": [
- "library/HTMLPurifier.composer.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL"
- ],
- "authors": [
- {
- "name": "Edward Z. Yang",
- "email": "admin@htmlpurifier.org",
- "homepage": "http://ezyang.com"
- }
- ],
- "description": "Standards compliant HTML filter written in PHP",
- "homepage": "http://htmlpurifier.org/",
- "keywords": [
- "html"
- ],
- "time": "2013-11-30 08:25:19"
- },
{
"name": "guzzlehttp/psr7",
"version": "1.1.0",
@@ -283,49 +239,6 @@
],
"time": "2015-06-24 19:55:15"
},
- {
- "name": "illuminate/container",
- "version": "v5.0.33",
- "source": {
- "type": "git",
- "url": "https://github.com/illuminate/container.git",
- "reference": "aa85c752eb7c6ccc2c6ffc5bfffb3ba8dd9719d6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/illuminate/container/zipball/aa85c752eb7c6ccc2c6ffc5bfffb3ba8dd9719d6",
- "reference": "aa85c752eb7c6ccc2c6ffc5bfffb3ba8dd9719d6",
- "shasum": ""
- },
- "require": {
- "illuminate/contracts": "5.0.*",
- "php": ">=5.4.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Illuminate\\Container\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylorotwell@gmail.com"
- }
- ],
- "description": "The Illuminate Container package.",
- "homepage": "http://laravel.com",
- "time": "2015-05-29 20:16:27"
- },
{
"name": "illuminate/contracts",
"version": "v5.0.33",
@@ -368,64 +281,6 @@
"homepage": "http://laravel.com",
"time": "2015-05-15 07:22:28"
},
- {
- "name": "illuminate/database",
- "version": "v5.0.33",
- "source": {
- "type": "git",
- "url": "https://github.com/illuminate/database.git",
- "reference": "6d79bb678a91123a15418863af901d2145b50349"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/illuminate/database/zipball/6d79bb678a91123a15418863af901d2145b50349",
- "reference": "6d79bb678a91123a15418863af901d2145b50349",
- "shasum": ""
- },
- "require": {
- "illuminate/container": "5.0.*",
- "illuminate/contracts": "5.0.*",
- "illuminate/support": "5.0.*",
- "nesbot/carbon": "~1.0",
- "php": ">=5.4.0"
- },
- "suggest": {
- "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).",
- "illuminate/console": "Required to use the database commands (5.0.*).",
- "illuminate/events": "Required to use the observers with Eloquent (5.0.*).",
- "illuminate/filesystem": "Required to use the migrations (5.0.*)."
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Illuminate\\Database\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylorotwell@gmail.com"
- }
- ],
- "description": "The Illuminate Database package.",
- "homepage": "http://laravel.com",
- "keywords": [
- "database",
- "laravel",
- "orm",
- "sql"
- ],
- "time": "2015-06-02 13:39:10"
- },
{
"name": "illuminate/support",
"version": "v5.0.33",
@@ -481,16 +336,16 @@
},
{
"name": "intervention/image",
- "version": "2.3.0",
+ "version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
- "reference": "ff4f45412044f3ab26f29260570a14ff41631d87"
+ "reference": "156f9d6f8a186c68b92f0c50084718f02dae1b5f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Intervention/image/zipball/ff4f45412044f3ab26f29260570a14ff41631d87",
- "reference": "ff4f45412044f3ab26f29260570a14ff41631d87",
+ "url": "https://api.github.com/repos/Intervention/image/zipball/156f9d6f8a186c68b92f0c50084718f02dae1b5f",
+ "reference": "156f9d6f8a186c68b92f0c50084718f02dae1b5f",
"shasum": ""
},
"require": {
@@ -508,6 +363,11 @@
"intervention/imagecache": "Caching extension for the Intervention Image library"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.3-dev"
+ }
+ },
"autoload": {
"psr-4": {
"Intervention\\Image\\": "src/Intervention/Image"
@@ -534,105 +394,7 @@
"thumbnail",
"watermark"
],
- "time": "2015-06-28 15:55:12"
- },
- {
- "name": "misd/linkify",
- "version": "v1.1.2",
- "source": {
- "type": "git",
- "url": "https://github.com/misd-service-development/php-linkify.git",
- "reference": "4dbe3e9f966e446a257d0f60a91f39e0b7f4f4d6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/misd-service-development/php-linkify/zipball/4dbe3e9f966e446a257d0f60a91f39e0b7f4f4d6",
- "reference": "4dbe3e9f966e446a257d0f60a91f39e0b7f4f4d6",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Misd\\Linkify\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Chris Wilkinson",
- "email": "chris.wilkinson@admin.cam.ac.uk"
- }
- ],
- "description": "Converts URLs and email addresses in text into HTML links",
- "homepage": "https://github.com/misd-service-development/php-linkify",
- "keywords": [
- "convert",
- "email address",
- "link",
- "url"
- ],
- "time": "2014-05-12 11:52:18"
- },
- {
- "name": "nesbot/carbon",
- "version": "1.20.0",
- "source": {
- "type": "git",
- "url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "bfd3eaba109c9a2405c92174c8e17f20c2b9caf3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bfd3eaba109c9a2405c92174c8e17f20c2b9caf3",
- "reference": "bfd3eaba109c9a2405c92174c8e17f20c2b9caf3",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0",
- "symfony/translation": "~2.6|~3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Carbon": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Brian Nesbitt",
- "email": "brian@nesbot.com",
- "homepage": "http://nesbot.com"
- }
- ],
- "description": "A simple API extension for DateTime.",
- "homepage": "http://carbon.nesbot.com",
- "keywords": [
- "date",
- "datetime",
- "time"
- ],
- "time": "2015-06-25 04:19:39"
+ "time": "2015-07-10 15:03:58"
},
{
"name": "nikic/fast-route",
@@ -679,20 +441,20 @@
},
{
"name": "oyejorge/less.php",
- "version": "v1.7.0.4",
+ "version": "v1.7.0.5",
"source": {
"type": "git",
"url": "https://github.com/oyejorge/less.php.git",
- "reference": "fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e"
+ "reference": "4385036b1dbfaf37f5380bd26a1e6006fc43149f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/oyejorge/less.php/zipball/fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e",
- "reference": "fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e",
+ "url": "https://api.github.com/repos/oyejorge/less.php/zipball/4385036b1dbfaf37f5380bd26a1e6006fc43149f",
+ "reference": "4385036b1dbfaf37f5380bd26a1e6006fc43149f",
"shasum": ""
},
"require": {
- "php": ">=5.2"
+ "php": ">=5.3"
},
"bin": [
"bin/lessc"
@@ -734,7 +496,7 @@
"php",
"stylesheet"
],
- "time": "2015-05-27 17:50:32"
+ "time": "2015-07-13 20:34:18"
},
{
"name": "psr/http-message",
@@ -786,151 +548,125 @@
"time": "2015-05-04 20:22:00"
},
{
- "name": "symfony/translation",
- "version": "v2.7.1",
+ "name": "s9e/text-formatter",
+ "version": "dev-release/php5.3",
"source": {
"type": "git",
- "url": "https://github.com/symfony/Translation.git",
- "reference": "8349a2b0d11bd0311df9e8914408080912983a0b"
+ "url": "https://github.com/s9e/TextFormatter.git",
+ "reference": "6260b224c4e993dcce4367229ee4af4efd8db197"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Translation/zipball/8349a2b0d11bd0311df9e8914408080912983a0b",
- "reference": "8349a2b0d11bd0311df9e8914408080912983a0b",
+ "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/6260b224c4e993dcce4367229ee4af4efd8db197",
+ "reference": "6260b224c4e993dcce4367229ee4af4efd8db197",
"shasum": ""
},
"require": {
- "php": ">=5.3.9"
- },
- "conflict": {
- "symfony/config": "<2.7"
- },
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "~2.7",
- "symfony/intl": "~2.3",
- "symfony/phpunit-bridge": "~2.7",
- "symfony/yaml": "~2.2"
+ "ext-dom": "*",
+ "ext-filter": "*",
+ "lib-pcre": ">=7.2",
+ "php": ">=5.3.3"
},
"suggest": {
- "psr/log": "To use logging capability in translator",
- "symfony/config": "",
- "symfony/yaml": ""
+ "ext-intl": "Allows international URLs to be accepted by the URL filter",
+ "ext-json": "Enables the generation of a JavaScript parser",
+ "ext-mbstring": "Enables some optimizations in the PHP renderer",
+ "ext-tokenizer": "Enables optimizations in the PHP renderer",
+ "ext-xsl": "Enables the XSLT renderer",
+ "ext-zlib": "Enables gzip compression when scraping content via the MediaEmbed plugin"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "s9e\\TextFormatter\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding media (YouTube, etc...), enhanced typography and more.",
+ "homepage": "https://github.com/s9e/TextFormatter/",
+ "keywords": [
+ "bbcode",
+ "bbcodes",
+ "blog",
+ "censor",
+ "embed",
+ "emoji",
+ "emoticons",
+ "engine",
+ "forum",
+ "html",
+ "markdown",
+ "markup",
+ "media",
+ "parser",
+ "shortcodes"
+ ],
+ "time": "2015-07-21 17:04:09"
+ },
+ {
+ "name": "tobscure/json-api",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tobscure/json-api.git",
+ "reference": "95c049696443da6dd3467dd4e5a6012ac44fe548"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tobscure/json-api/zipball/95c049696443da6dd3467dd4e5a6012ac44fe548",
+ "reference": "95c049696443da6dd3467dd4e5a6012ac44fe548",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "squizlabs/php_codesniffer": "1.5.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
- "Symfony\\Component\\Translation\\": ""
+ "Tobscure\\JsonApi\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Translation Component",
- "homepage": "https://symfony.com",
- "time": "2015-06-11 17:26:34"
- },
- {
- "name": "tobscure/json-api",
- "version": "dev-master",
- "source": {
- "type": "git",
- "url": "https://github.com/tobscure/json-api.git",
- "reference": "fe013caafe9ed0797b1b6abb116d514b301fbf1c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/tobscure/json-api/zipball/2629b6f48eb380973848c7e5fc36d41f33b305b3",
- "reference": "fe013caafe9ed0797b1b6abb116d514b301fbf1c",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4.0"
- },
- "require-dev": {
- "squizlabs/php_codesniffer": "1.5.3"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Tobscure\\JsonApi\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
"authors": [
{
"name": "Toby Zerner",
"email": "toby.zerner@gmail.com"
}
],
- "description": "JSON-API responses in PHP.",
- "time": "2015-07-05 23:48:08"
- },
- {
- "name": "tobscure/permissible",
- "version": "dev-master",
- "source": {
- "type": "git",
- "url": "https://github.com/tobscure/permissible.git",
- "reference": "0ba23dd1ed6f5372bf86fa917450cb70d08c012b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/tobscure/permissible/zipball/0ba23dd1ed6f5372bf86fa917450cb70d08c012b",
- "reference": "0ba23dd1ed6f5372bf86fa917450cb70d08c012b",
- "shasum": ""
- },
- "require": {
- "illuminate/database": "5.0.*",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "squizlabs/php_codesniffer": "1.5.3"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Tobscure\\Permissible\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "authors": [
- {
- "name": "Toby Zerner",
- "email": "toby.zerner@gmail.com"
- }
+ "description": "JSON-API responses in PHP",
+ "keywords": [
+ "api",
+ "json",
+ "standard"
],
- "description": "Powerful, flexible, relational permissions using Eloquent.",
- "time": "2015-05-29 05:01:56"
+ "time": "2015-07-21 21:35:56"
},
{
"name": "zendframework/zend-diactoros",
- "version": "1.1.1",
+ "version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-diactoros.git",
- "reference": "eeedadd333b80bb5d93559e2285047463fe4fe33"
+ "reference": "bac9f86a4dbf282a3029602411ae655225bc370b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/eeedadd333b80bb5d93559e2285047463fe4fe33",
- "reference": "eeedadd333b80bb5d93559e2285047463fe4fe33",
+ "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/bac9f86a4dbf282a3029602411ae655225bc370b",
+ "reference": "bac9f86a4dbf282a3029602411ae655225bc370b",
"shasum": ""
},
"require": {
@@ -967,126 +703,10 @@
"psr",
"psr-7"
],
- "time": "2015-06-25 18:07:28"
+ "time": "2015-07-12 17:59:47"
}
],
"packages-dev": [
- {
- "name": "codeception/codeception",
- "version": "2.0.15",
- "source": {
- "type": "git",
- "url": "https://github.com/Codeception/Codeception.git",
- "reference": "3f38f54892194f924f15ad87c977dc41932241b6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Codeception/Codeception/zipball/3f38f54892194f924f15ad87c977dc41932241b6",
- "reference": "3f38f54892194f924f15ad87c977dc41932241b6",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "ext-mbstring": "*",
- "facebook/webdriver": "~0.4|~0.5",
- "guzzlehttp/guzzle": "~4.0|~5.0",
- "php": ">=5.4.0",
- "phpunit/phpunit": "~4.7.0",
- "symfony/browser-kit": "~2.4",
- "symfony/console": "~2.4",
- "symfony/css-selector": "~2.4",
- "symfony/dom-crawler": "~2.4,!=2.4.5",
- "symfony/event-dispatcher": "~2.4",
- "symfony/finder": "~2.4",
- "symfony/yaml": "~2.4"
- },
- "require-dev": {
- "codeception/specify": "~0.3",
- "facebook/php-sdk": "~3.2",
- "flow/jsonpath": "~0.2",
- "monolog/monolog": "~1.8",
- "pda/pheanstalk": "~2.0",
- "videlalvaro/php-amqplib": "~2.4"
- },
- "suggest": {
- "codeception/phpbuiltinserver": "Extension to start and stop PHP built-in web server for your tests",
- "codeception/specify": "BDD-style code blocks",
- "codeception/verify": "BDD-style assertions",
- "monolog/monolog": "Log test steps",
- "phpseclib/phpseclib": "Extension required to use the SFTP option in the FTP Module."
- },
- "bin": [
- "codecept"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.1-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Codeception": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Bodnarchuk",
- "email": "davert@mail.ua",
- "homepage": "http://codegyre.com"
- }
- ],
- "description": "BDD-style testing framework",
- "homepage": "http://codeception.com/",
- "keywords": [
- "BDD",
- "TDD",
- "acceptance testing",
- "functional testing",
- "unit testing"
- ],
- "time": "2015-06-26 02:31:19"
- },
- {
- "name": "codeception/mockery-module",
- "version": "0.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/Codeception/MockeryModule.git",
- "reference": "178dd30c676220731d6d1efa07743143ad0b3525"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/Codeception/MockeryModule/zipball/178dd30c676220731d6d1efa07743143ad0b3525",
- "reference": "178dd30c676220731d6d1efa07743143ad0b3525",
- "shasum": ""
- },
- "require": {
- "mockery/mockery": "~0.8"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Codeception\\Module\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Bodnarchuk",
- "email": "davert.php@mailican.com"
- }
- ],
- "description": "Mockery Module for Codeception",
- "time": "2014-08-30 22:28:34"
- },
{
"name": "doctrine/instantiator",
"version": "1.0.5",
@@ -1141,47 +761,6 @@
],
"time": "2015-06-14 21:17:01"
},
- {
- "name": "facebook/webdriver",
- "version": "v0.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/facebook/php-webdriver.git",
- "reference": "2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5",
- "reference": "2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.19"
- },
- "require-dev": {
- "phpdocumentor/phpdocumentor": "2.*",
- "phpunit/phpunit": "3.7.*"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "lib/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "Apache-2.0"
- ],
- "description": "A php client for WebDriver",
- "homepage": "https://github.com/facebook/php-webdriver",
- "keywords": [
- "facebook",
- "php",
- "selenium",
- "webdriver"
- ],
- "time": "2015-02-09 19:39:34"
- },
{
"name": "fzaninotto/faker",
"version": "v1.4.0",
@@ -1230,327 +809,6 @@
],
"time": "2014-06-04 14:43:02"
},
- {
- "name": "guzzlehttp/guzzle",
- "version": "5.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/guzzle.git",
- "reference": "f3c8c22471cb55475105c14769644a49c3262b93"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93",
- "reference": "f3c8c22471cb55475105c14769644a49c3262b93",
- "shasum": ""
- },
- "require": {
- "guzzlehttp/ringphp": "^1.1",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "ext-curl": "*",
- "phpunit/phpunit": "^4.0",
- "psr/log": "^1.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
- "homepage": "http://guzzlephp.org/",
- "keywords": [
- "client",
- "curl",
- "framework",
- "http",
- "http client",
- "rest",
- "web service"
- ],
- "time": "2015-05-20 03:47:55"
- },
- {
- "name": "guzzlehttp/ringphp",
- "version": "1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/RingPHP.git",
- "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
- "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b",
- "shasum": ""
- },
- "require": {
- "guzzlehttp/streams": "~3.0",
- "php": ">=5.4.0",
- "react/promise": "~2.0"
- },
- "require-dev": {
- "ext-curl": "*",
- "phpunit/phpunit": "~4.0"
- },
- "suggest": {
- "ext-curl": "Guzzle will use specific adapters if cURL is present"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\Ring\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.",
- "time": "2015-05-20 03:37:09"
- },
- {
- "name": "guzzlehttp/streams",
- "version": "3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/streams.git",
- "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
- "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\Stream\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- }
- ],
- "description": "Provides a simple abstraction over streams of data",
- "homepage": "http://guzzlephp.org/",
- "keywords": [
- "Guzzle",
- "stream"
- ],
- "time": "2014-10-12 19:18:40"
- },
- {
- "name": "hamcrest/hamcrest-php",
- "version": "v1.2.2",
- "source": {
- "type": "git",
- "url": "https://github.com/hamcrest/hamcrest-php.git",
- "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c",
- "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.2"
- },
- "replace": {
- "cordoval/hamcrest-php": "*",
- "davedevelopment/hamcrest-php": "*",
- "kodova/hamcrest-php": "*"
- },
- "require-dev": {
- "phpunit/php-file-iterator": "1.3.3",
- "satooshi/php-coveralls": "dev-master"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "hamcrest"
- ],
- "files": [
- "hamcrest/Hamcrest.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD"
- ],
- "description": "This is the PHP port of Hamcrest Matchers",
- "keywords": [
- "test"
- ],
- "time": "2015-05-11 14:41:42"
- },
- {
- "name": "laracasts/testdummy",
- "version": "2.3.2",
- "source": {
- "type": "git",
- "url": "https://github.com/laracasts/TestDummy.git",
- "reference": "ba986a66b6f4a1e149355357353af3072d5521ee"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/laracasts/TestDummy/zipball/ba986a66b6f4a1e149355357353af3072d5521ee",
- "reference": "ba986a66b6f4a1e149355357353af3072d5521ee",
- "shasum": ""
- },
- "require": {
- "fzaninotto/faker": "~1.4",
- "illuminate/support": "~4.0|~5.0",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "illuminate/database": "~4.0|~5.0",
- "phpspec/phpspec": "~2.0",
- "phpunit/phpunit": "~4.7@dev"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Laracasts\\TestDummy\\": "src/"
- },
- "files": [
- "src/functions.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jeffrey Way",
- "email": "jeffrey@laracasts.com"
- }
- ],
- "description": "Easy test stubs",
- "keywords": [
- "factorygirl",
- "laravel",
- "stubs",
- "testing"
- ],
- "time": "2015-04-27 15:56:12"
- },
- {
- "name": "mockery/mockery",
- "version": "0.9.4",
- "source": {
- "type": "git",
- "url": "https://github.com/padraic/mockery.git",
- "reference": "70bba85e4aabc9449626651f48b9018ede04f86b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/padraic/mockery/zipball/70bba85e4aabc9449626651f48b9018ede04f86b",
- "reference": "70bba85e4aabc9449626651f48b9018ede04f86b",
- "shasum": ""
- },
- "require": {
- "hamcrest/hamcrest-php": "~1.1",
- "lib-pcre": ">=7.0",
- "php": ">=5.3.2"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.9.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Mockery": "library/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Pádraic Brady",
- "email": "padraic.brady@gmail.com",
- "homepage": "http://blog.astrumfutura.com"
- },
- {
- "name": "Dave Marshall",
- "email": "dave.marshall@atstsolutions.co.uk",
- "homepage": "http://davedevelopment.co.uk"
- }
- ],
- "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.",
- "homepage": "http://github.com/padraic/mockery",
- "keywords": [
- "BDD",
- "TDD",
- "library",
- "mock",
- "mock objects",
- "mockery",
- "stub",
- "test",
- "test double",
- "testing"
- ],
- "time": "2015-04-02 19:54:00"
- },
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.4",
@@ -1772,417 +1030,6 @@
],
"time": "2015-04-27 22:15:08"
},
- {
- "name": "phpunit/php-code-coverage",
- "version": "2.1.7",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "07e27765596d72c378a6103e80da5d84e802f1e4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/07e27765596d72c378a6103e80da5d84e802f1e4",
- "reference": "07e27765596d72c378a6103e80da5d84e802f1e4",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3",
- "phpunit/php-file-iterator": "~1.3",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-token-stream": "~1.3",
- "sebastian/environment": "~1.0",
- "sebastian/version": "~1.0"
- },
- "require-dev": {
- "ext-xdebug": ">=2.1.4",
- "phpunit/phpunit": "~4"
- },
- "suggest": {
- "ext-dom": "*",
- "ext-xdebug": ">=2.2.1",
- "ext-xmlwriter": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.1.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
- }
- ],
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
- "keywords": [
- "coverage",
- "testing",
- "xunit"
- ],
- "time": "2015-06-30 06:52:35"
- },
- {
- "name": "phpunit/php-file-iterator",
- "version": "1.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb",
- "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
- }
- ],
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
- "keywords": [
- "filesystem",
- "iterator"
- ],
- "time": "2015-04-02 05:19:05"
- },
- {
- "name": "phpunit/php-text-template",
- "version": "1.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Simple template engine.",
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
- "keywords": [
- "template"
- ],
- "time": "2015-06-21 13:50:34"
- },
- {
- "name": "phpunit/php-timer",
- "version": "1.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d",
- "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
- }
- ],
- "description": "Utility class for timing",
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
- "keywords": [
- "timer"
- ],
- "time": "2015-06-13 07:35:30"
- },
- {
- "name": "phpunit/php-token-stream",
- "version": "1.4.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9",
- "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9",
- "shasum": ""
- },
- "require": {
- "ext-tokenizer": "*",
- "php": ">=5.3.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.2"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.4-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Wrapper around PHP's tokenizer extension.",
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
- "keywords": [
- "tokenizer"
- ],
- "time": "2015-06-19 03:43:16"
- },
- {
- "name": "phpunit/phpunit",
- "version": "4.7.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b",
- "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-json": "*",
- "ext-pcre": "*",
- "ext-reflection": "*",
- "ext-spl": "*",
- "php": ">=5.3.3",
- "phpspec/prophecy": "~1.3,>=1.3.1",
- "phpunit/php-code-coverage": "~2.1",
- "phpunit/php-file-iterator": "~1.4",
- "phpunit/php-text-template": "~1.2",
- "phpunit/php-timer": ">=1.0.6",
- "phpunit/phpunit-mock-objects": "~2.3",
- "sebastian/comparator": "~1.1",
- "sebastian/diff": "~1.2",
- "sebastian/environment": "~1.2",
- "sebastian/exporter": "~1.2",
- "sebastian/global-state": "~1.0",
- "sebastian/version": "~1.0",
- "symfony/yaml": "~2.1|~3.0"
- },
- "suggest": {
- "phpunit/php-invoker": "~1.1"
- },
- "bin": [
- "phpunit"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.7.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "The PHP Unit Testing framework.",
- "homepage": "https://phpunit.de/",
- "keywords": [
- "phpunit",
- "testing",
- "xunit"
- ],
- "time": "2015-06-30 06:53:57"
- },
- {
- "name": "phpunit/phpunit-mock-objects",
- "version": "2.3.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
- "reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/92408bb1968a81b3217a6fdf6c1a198da83caa35",
- "reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35",
- "shasum": ""
- },
- "require": {
- "doctrine/instantiator": "~1.0,>=1.0.2",
- "php": ">=5.3.3",
- "phpunit/php-text-template": "~1.2"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.4"
- },
- "suggest": {
- "ext-soap": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
- "role": "lead"
- }
- ],
- "description": "Mock Object library for PHPUnit",
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
- "keywords": [
- "mock",
- "xunit"
- ],
- "time": "2015-06-11 15:55:48"
- },
- {
- "name": "react/promise",
- "version": "v2.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/reactphp/promise.git",
- "reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/reactphp/promise/zipball/365fcee430dfa4ace1fbc75737ca60ceea7eeeef",
- "reference": "365fcee430dfa4ace1fbc75737ca60ceea7eeeef",
- "shasum": ""
- },
- "require": {
- "php": ">=5.4.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "React\\Promise\\": "src/"
- },
- "files": [
- "src/functions_include.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jan Sorgalla",
- "email": "jsorgalla@googlemail.com"
- }
- ],
- "description": "A lightweight implementation of CommonJS Promises/A for PHP",
- "time": "2014-12-30 13:32:42"
- },
{
"name": "sebastian/comparator",
"version": "1.1.1",
@@ -2299,56 +1146,6 @@
],
"time": "2015-02-22 15:13:53"
},
- {
- "name": "sebastian/environment",
- "version": "1.2.2",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e",
- "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.4"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.3.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides functionality to handle HHVM/PHP environments",
- "homepage": "http://www.github.com/sebastianbergmann/environment",
- "keywords": [
- "Xdebug",
- "environment",
- "hhvm"
- ],
- "time": "2015-01-01 10:01:08"
- },
{
"name": "sebastian/exporter",
"version": "1.2.0",
@@ -2415,57 +1212,6 @@
],
"time": "2015-01-27 07:23:06"
},
- {
- "name": "sebastian/global-state",
- "version": "1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01",
- "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.2"
- },
- "suggest": {
- "ext-uopz": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Snapshotting of global state",
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
- "keywords": [
- "global state"
- ],
- "time": "2014-10-06 09:23:50"
- },
{
"name": "sebastian/recursion-context",
"version": "1.0.0",
@@ -2519,53 +1265,18 @@
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2015-01-24 09:48:32"
},
- {
- "name": "sebastian/version",
- "version": "1.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
- "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
- "shasum": ""
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "time": "2015-06-21 13:59:46"
- },
{
"name": "squizlabs/php_codesniffer",
- "version": "2.3.2",
+ "version": "2.3.3",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404"
+ "reference": "c1a26c729508f73560c1a4f767f60b8ab6b4a666"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e96d8579fbed0c95ecf2a0501ec4f307a4aa6404",
- "reference": "e96d8579fbed0c95ecf2a0501ec4f307a4aa6404",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/c1a26c729508f73560c1a4f767f60b8ab6b4a666",
+ "reference": "c1a26c729508f73560c1a4f767f60b8ab6b4a666",
"shasum": ""
},
"require": {
@@ -2626,75 +1337,20 @@
"phpcs",
"standards"
],
- "time": "2015-04-28 23:28:20"
- },
- {
- "name": "symfony/browser-kit",
- "version": "v2.7.1",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/BrowserKit.git",
- "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/d0a144a1a96d5dc90bed2814b2096a1322761672",
- "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.9",
- "symfony/dom-crawler": "~2.0,>=2.0.5"
- },
- "require-dev": {
- "symfony/css-selector": "~2.0,>=2.0.5",
- "symfony/phpunit-bridge": "~2.7",
- "symfony/process": "~2.0,>=2.0.5"
- },
- "suggest": {
- "symfony/process": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.7-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\BrowserKit\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony BrowserKit Component",
- "homepage": "https://symfony.com",
- "time": "2015-06-04 20:11:48"
+ "time": "2015-06-24 03:16:23"
},
{
"name": "symfony/console",
- "version": "v2.7.1",
+ "version": "v2.7.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
- "reference": "564398bc1f33faf92fc2ec86859983d30eb81806"
+ "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/564398bc1f33faf92fc2ec86859983d30eb81806",
- "reference": "564398bc1f33faf92fc2ec86859983d30eb81806",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/8cf484449130cabfd98dcb4694ca9945802a21ed",
+ "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed",
"shasum": ""
},
"require": {
@@ -2738,126 +1394,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2015-06-10 15:30:22"
- },
- {
- "name": "symfony/css-selector",
- "version": "v2.7.1",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/CssSelector.git",
- "reference": "0b5c07b516226b7dd32afbbc82fe547a469c5092"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/CssSelector/zipball/0b5c07b516226b7dd32afbbc82fe547a469c5092",
- "reference": "0b5c07b516226b7dd32afbbc82fe547a469c5092",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.9"
- },
- "require-dev": {
- "symfony/phpunit-bridge": "~2.7"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.7-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\CssSelector\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jean-François Simon",
- "email": "jeanfrancois.simon@sensiolabs.com"
- },
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony CssSelector Component",
- "homepage": "https://symfony.com",
- "time": "2015-05-15 13:33:16"
- },
- {
- "name": "symfony/dom-crawler",
- "version": "v2.7.1",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/DomCrawler.git",
- "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/11d8eb8ccc1533f4c2d89a025f674894fda520b3",
- "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.9"
- },
- "require-dev": {
- "symfony/css-selector": "~2.3",
- "symfony/phpunit-bridge": "~2.7"
- },
- "suggest": {
- "symfony/css-selector": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.7-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\DomCrawler\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony DomCrawler Component",
- "homepage": "https://symfony.com",
- "time": "2015-05-22 14:54:25"
+ "time": "2015-07-09 16:07:40"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.7.1",
+ "version": "v2.7.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9"
+ "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/be3c5ff8d503c46768aeb78ce6333051aa6f26d9",
- "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3",
+ "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3",
"shasum": ""
},
"require": {
@@ -2902,20 +1452,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2015-06-08 09:37:21"
+ "time": "2015-06-18 19:21:56"
},
{
"name": "symfony/finder",
- "version": "v2.7.1",
+ "version": "v2.7.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/Finder.git",
- "reference": "c13a40d638aeede1e8400f8c956c7f9246c05f75"
+ "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Finder/zipball/c13a40d638aeede1e8400f8c956c7f9246c05f75",
- "reference": "c13a40d638aeede1e8400f8c956c7f9246c05f75",
+ "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4",
+ "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4",
"shasum": ""
},
"require": {
@@ -2951,7 +1501,7 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2015-06-04 20:11:48"
+ "time": "2015-07-09 16:07:40"
},
{
"name": "symfony/process",
@@ -3004,16 +1554,16 @@
},
{
"name": "symfony/yaml",
- "version": "v2.7.1",
+ "version": "v2.7.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160"
+ "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160",
- "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860",
+ "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860",
"shasum": ""
},
"require": {
@@ -3049,14 +1599,14 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2015-06-10 15:30:22"
+ "time": "2015-07-01 11:25:50"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"tobscure/json-api": 20,
- "tobscure/permissible": 20
+ "s9e/text-formatter": 20
},
"prefer-stable": false,
"prefer-lowest": false,
diff --git a/js/forum/src/components/UserBio.js b/js/forum/src/components/UserBio.js
index e44d8a5d4..b0b5fddf7 100644
--- a/js/forum/src/components/UserBio.js
+++ b/js/forum/src/components/UserBio.js
@@ -35,7 +35,7 @@ export default class UserBio extends Component {
let subContent;
if (this.loading) {
- subContent = {LoadingIndicator.component()}
;
+ subContent = {LoadingIndicator.component({size: 'tiny'})}
;
} else {
const bioHtml = user.bioHtml();
diff --git a/js/lib/models/User.js b/js/lib/models/User.js
index 482e64c03..d0c3378f1 100644
--- a/js/lib/models/User.js
+++ b/js/lib/models/User.js
@@ -15,7 +15,7 @@ export default class User extends mixin(Model, {
avatarUrl: Model.attribute('avatarUrl'),
bio: Model.attribute('bio'),
- bioHtml: Model.attribute('bioHtml'),
+ bioHtml: computed('bio', bio => '' + $('
').text(bio).html() + '
'),
preferences: Model.attribute('preferences'),
groups: Model.hasMany('groups'),
diff --git a/migrations/2015_02_24_000000_create_posts_table.php b/migrations/2015_02_24_000000_create_posts_table.php
index f3b2f52fd..a811973d6 100644
--- a/migrations/2015_02_24_000000_create_posts_table.php
+++ b/migrations/2015_02_24_000000_create_posts_table.php
@@ -23,7 +23,6 @@ class CreatePostsTable extends Migration
$table->integer('user_id')->unsigned()->nullable();
$table->string('type', 100)->nullable();
$table->text('content')->nullable();
- $table->text('content_html')->nullable();
$table->dateTime('edit_time')->nullable();
$table->integer('edit_user_id')->unsigned()->nullable();
diff --git a/migrations/2015_02_24_000000_create_users_table.php b/migrations/2015_02_24_000000_create_users_table.php
index 8995ece86..2d3544d29 100644
--- a/migrations/2015_02_24_000000_create_users_table.php
+++ b/migrations/2015_02_24_000000_create_users_table.php
@@ -22,7 +22,6 @@ class CreateUsersTable extends Migration
$table->string('password', 100);
$table->string('locale', 10)->default('en');
$table->text('bio')->nullable();
- $table->text('bio_html')->nullable();
$table->string('avatar_path', 100)->nullable();
$table->binary('preferences')->nullable();
$table->dateTime('join_time')->nullable();
diff --git a/src/Api/Serializers/UserSerializer.php b/src/Api/Serializers/UserSerializer.php
index ca79f5ad9..2eaf1170b 100644
--- a/src/Api/Serializers/UserSerializer.php
+++ b/src/Api/Serializers/UserSerializer.php
@@ -12,7 +12,7 @@ class UserSerializer extends UserBasicSerializer
$canEdit = $user->can($this->actor, 'edit');
$attributes += [
- 'bioHtml' => $user->bio_html,
+ 'bio' => $user->bio,
'joinTime' => $user->join_time ? $user->join_time->toRFC3339String() : null,
'discussionsCount' => (int) $user->discussions_count,
'commentsCount' => (int) $user->comments_count,
@@ -28,7 +28,6 @@ class UserSerializer extends UserBasicSerializer
if ($canEdit) {
$attributes += [
- 'bio' => $user->bio,
'isActivated' => $user->is_activated,
'email' => $user->email,
'isConfirmed' => $user->is_confirmed
diff --git a/src/Core/Formatter/Formatter.php b/src/Core/Formatter/Formatter.php
index fe114424e..7508bc4e5 100644
--- a/src/Core/Formatter/Formatter.php
+++ b/src/Core/Formatter/Formatter.php
@@ -1,31 +1,93 @@
cache = $cache;
+ }
- /**
- * Format the text after purification takes place.
- *
- * @param string $text
- * @param Model|null $model The entity that owns the text.
- * @return string
- */
- public function formatAfterPurification($text, Model $model = null);
+ protected function getConfigurator()
+ {
+ $configurator = new Configurator;
+ $configurator->rootRules->enableAutoLineBreaks();
+
+ $configurator->BBCodes->addFromRepository('B');
+ $configurator->BBCodes->addFromRepository('I');
+ $configurator->BBCodes->addFromRepository('U');
+ $configurator->BBCodes->addFromRepository('S');
+ $configurator->BBCodes->addFromRepository('COLOR');
+ $configurator->BBCodes->addFromRepository('URL');
+ $configurator->BBCodes->addFromRepository('EMAIL');
+ $configurator->BBCodes->addFromRepository('CODE');
+ $configurator->BBCodes->addFromRepository('QUOTE');
+ $configurator->BBCodes->addFromRepository('LIST');
+ $configurator->BBCodes->addFromRepository('*');
+ $configurator->BBCodes->addFromRepository('SPOILER');
+
+ $configurator->Autoemail;
+ $configurator->Autolink;
+
+ $configurator->Litedown;
+
+ $configurator->Emoticons->add(':)', '😀');
+
+ return $configurator;
+ }
+
+ protected function getComponent($key)
+ {
+ $cacheKey = 'flarum.formatter.' . $key;
+
+ return $this->cache->rememberForever($cacheKey, function () use ($key) {
+ return $this->getConfigurator()->finalize()[$key];
+ });
+ }
+
+ protected function getParser()
+ {
+ return $this->getComponent('parser');
+ }
+
+ protected function getRenderer()
+ {
+ return $this->getComponent('renderer');
+ }
+
+ public function getJS()
+ {
+ $configurator = $this->getConfigurator();
+ $configurator->enableJavaScript();
+ $configurator->javascript->setMinifier('ClosureCompilerService');
+
+ return $configurator->finalize([
+ 'returnParser' => false,
+ 'returnRenderer' => false
+ ])['js'];
+ }
+
+ public function parse($text)
+ {
+ $parser = $this->getParser();
+
+ return $parser->parse($text);
+ }
+
+ public function render($xml)
+ {
+ $renderer = $this->getRenderer();
+
+ return $renderer->render($xml);
+ }
+
+ public function unparse($xml)
+ {
+ return Unparser::unparse($xml);
+ }
}
diff --git a/src/Core/Formatter/FormatterManager.php b/src/Core/Formatter/FormatterManager.php
deleted file mode 100644
index f2daabcf9..000000000
--- a/src/Core/Formatter/FormatterManager.php
+++ /dev/null
@@ -1,143 +0,0 @@
-container = $container;
-
- // TODO: Studio does not yet merge autoload_files...
- // https://github.com/franzliedke/studio/commit/4f0f4314db4ed3e36c869a5f79b855c97bdd1be7
- require __DIR__.'/../../../vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php';
-
- $this->htmlPurifierConfig = $this->getDefaultHtmlPurifierConfig();
- }
-
- /**
- * Get the HTMLPurifier configuration object.
- *
- * @return HTMLPurifier_Config
- */
- public function getHtmlPurifierConfig()
- {
- return $this->htmlPurifierConfig;
- }
-
- /**
- * Add a new formatter.
- *
- * @param string $formatter
- */
- public function add($formatter)
- {
- $this->formatters[] = $formatter;
- }
-
- /**
- * Format the given text using the collected formatters.
- *
- * @param string $text
- * @param Model|null $model The entity that owns the text.
- * @return string
- */
- public function format($text, Model $model = null)
- {
- $formatters = $this->getFormatters();
-
- foreach ($formatters as $formatter) {
- $formatter->config($this);
- }
-
- foreach ($formatters as $formatter) {
- $text = $formatter->formatBeforePurification($text, $model);
- }
-
- $text = $this->purify($text);
-
- foreach ($formatters as $formatter) {
- $text = $formatter->formatAfterPurification($text, $model);
- }
-
- return $text;
- }
-
- /**
- * Instantiate the collected formatters.
- *
- * @return Formatter[]
- */
- protected function getFormatters()
- {
- $formatters = [];
-
- foreach ($this->formatters as $formatter) {
- $formatter = $this->container->make($formatter);
-
- if (! $formatter instanceof Formatter) {
- throw new LogicException('Formatter ' . get_class($formatter)
- . ' does not implement ' . Formatter::class);
- }
-
- $formatters[] = $formatter;
- }
-
- return $formatters;
- }
-
- /**
- * Purify the given text, making sure it is safe to be displayed in web
- * browsers.
- *
- * @param string $text
- * @return string
- */
- protected function purify($text)
- {
- $purifier = new HTMLPurifier($this->htmlPurifierConfig);
-
- return $purifier->purify($text);
- }
-
- /**
- * Get the default HTMLPurifier config settings.
- *
- * @return HTMLPurifier_Config
- */
- protected function getDefaultHtmlPurifierConfig()
- {
- $config = HTMLPurifier_Config::createDefault();
- $config->set('Core.Encoding', 'UTF-8');
- $config->set('Core.EscapeInvalidTags', true);
- $config->set('HTML.Doctype', 'HTML 4.01 Strict');
- $config->set('HTML.Allowed', 'p,em,strong,a[href|title],ul,ol,li,code,pre,blockquote,h1,h2,h3,h4,h5,h6,br,hr,img[src|alt]');
- $config->set('HTML.Nofollow', true);
-
- return $config;
- }
-}
diff --git a/src/Core/Formatter/FormatterServiceProvider.php b/src/Core/Formatter/FormatterServiceProvider.php
index 310c1a72f..83a37f41d 100644
--- a/src/Core/Formatter/FormatterServiceProvider.php
+++ b/src/Core/Formatter/FormatterServiceProvider.php
@@ -21,6 +21,6 @@ class FormatterServiceProvider extends ServiceProvider
*/
public function register()
{
- $this->app->singleton('flarum.formatter', 'Flarum\Core\Formatter\FormatterManager');
+ $this->app->singleton('flarum.formatter', 'Flarum\Core\Formatter\Formatter');
}
}
diff --git a/src/Core/Formatter/LinkifyFormatter.php b/src/Core/Formatter/LinkifyFormatter.php
deleted file mode 100644
index 76c8214e7..000000000
--- a/src/Core/Formatter/LinkifyFormatter.php
+++ /dev/null
@@ -1,28 +0,0 @@
-linkify = $linkify;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function formatTextBeforePurification($text, Model $post = null)
- {
- return $this->linkify->process($text, ['attr' => ['target' => '_blank']]);
- }
-}
diff --git a/src/Core/Formatter/TextFormatter.php b/src/Core/Formatter/TextFormatter.php
deleted file mode 100644
index 1f006802f..000000000
--- a/src/Core/Formatter/TextFormatter.php
+++ /dev/null
@@ -1,120 +0,0 @@
- and untouched.
- */
-abstract class TextFormatter implements Formatter
-{
- /**
- * A list of tags to ignore when applying formatting.
- *
- * @var array
- */
- protected $ignoreTags = ['code', 'pre'];
-
- /**
- * {@inheritdoc}
- */
- public function config(FormatterManager $manager)
- {
- }
-
- /**
- * {@inheritdoc}
- */
- public function formatBeforePurification($text, Model $model = null)
- {
- return $this->formatAroundIgnoredTags($text, function ($text) use ($model) {
- return $this->formatTextBeforePurification($text, $model);
- });
- }
-
- /**
- * {@inheritdoc}
- */
- public function formatAfterPurification($text, Model $model = null)
- {
- return $this->formatAroundIgnoredTags($text, function ($text) use ($model) {
- return $this->formatTextAfterPurification($text, $model);
- });
- }
-
- /**
- * Format non-ignored text before purification has taken place.
- *
- * @param string $text
- * @param Model $model
- * @return mixed
- */
- protected function formatTextBeforePurification($text, Model $model = null)
- {
- return $text;
- }
-
- /**
- * Format non-ignored text after purification has taken place.
- *
- * @param string $text
- * @param Model $model
- * @return string
- */
- protected function formatTextAfterPurification($text, Model $model = null)
- {
- return $text;
- }
-
- /**
- * Run a callback on parts of the provided text that aren't within the list
- * of ignored tags.
- *
- * @param string $text
- * @param callable $callback
- * @return string
- */
- protected function formatAroundIgnoredTags($text, callable $callback)
- {
- return $this->formatAroundTags($text, $this->ignoreTags, $callback);
- }
-
- /**
- * Run a callback on parts of the provided text that aren't within the
- * given list of tags.
- *
- * @param string $text
- * @param array $tags
- * @param callable $callback
- * @return string
- */
- protected function formatAroundTags($text, array $tags, callable $callback)
- {
- $chunks = preg_split('/(<.+?>)/is', $text, 0, PREG_SPLIT_DELIM_CAPTURE);
- $openTag = null;
-
- for ($i = 0; $i < count($chunks); $i++) {
- if ($i % 2 === 0) { // even numbers are text
- // Only process this chunk if there are no unclosed $ignoreTags
- if (null === $openTag) {
- $chunks[$i] = $callback($chunks[$i]);
- }
- } else { // odd numbers are tags
- // Only process this tag if there are no unclosed $ignoreTags
- if (null === $openTag) {
- // Check whether this tag is contained in $ignoreTags and is not self-closing
- if (preg_match("`<(" . implode('|', $tags) . ").*(?$`is", $chunks[$i], $matches)) {
- $openTag = $matches[1];
- }
- } else {
- // Otherwise, check whether this is the closing tag for $openTag.
- if (preg_match('`\s*' . $openTag . '>`i', $chunks[$i], $matches)) {
- $openTag = null;
- }
- }
- }
- }
-
- return implode($chunks);
- }
-}
diff --git a/src/Core/Posts/CommentPost.php b/src/Core/Posts/CommentPost.php
index 3ccf9c481..366f21873 100755
--- a/src/Core/Posts/CommentPost.php
+++ b/src/Core/Posts/CommentPost.php
@@ -1,7 +1,7 @@
content !== $content) {
$this->content = $content;
- $this->content_html = static::formatContent($this);
$this->edit_time = time();
$this->edit_user_id = $actor->id;
@@ -114,25 +113,40 @@ class CommentPost extends Post
}
/**
- * Get the content formatted as HTML.
+ * Parse the content before it is saved to the database.
+ *
+ * @param string $value
+ */
+ public function getContentAttribute($value)
+ {
+ return static::$formatter->unparse($value);
+ }
+
+ /**
+ * Parse the content before it is saved to the database.
+ *
+ * @param string $value
+ */
+ public function setContentAttribute($value)
+ {
+ $this->attributes['content'] = static::$formatter->parse($value);
+ }
+
+ /**
+ * Get the content rendered as HTML.
*
* @param string $value
* @return string
*/
public function getContentHtmlAttribute($value)
{
- if (! $value) {
- $this->content_html = $value = static::formatContent($this);
- $this->save();
- }
-
- return $value;
+ return static::$formatter->render($this->attributes['content']);
}
/**
- * Get text formatter instance.
+ * Get the text formatter instance.
*
- * @return FormatterManager
+ * @return Formatter
*/
public static function getFormatter()
{
@@ -140,23 +154,12 @@ class CommentPost extends Post
}
/**
- * Set text formatter instance.
+ * Set the text formatter instance.
*
- * @param FormatterManager $formatter
+ * @param Formatter $formatter
*/
- public static function setFormatter(FormatterManager $formatter)
+ public static function setFormatter(Formatter $formatter)
{
static::$formatter = $formatter;
}
-
- /**
- * Format a string of post content using the set formatter.
- *
- * @param CommentPost $post
- * @return string
- */
- protected static function formatContent(CommentPost $post)
- {
- return static::$formatter->format($post->content, $post);
- }
}
diff --git a/src/Core/Users/User.php b/src/Core/Users/User.php
index 2dde9fc94..6b68ab8d5 100755
--- a/src/Core/Users/User.php
+++ b/src/Core/Users/User.php
@@ -60,13 +60,6 @@ class User extends Model
'notification_read_time'
];
- /**
- * The text formatter instance.
- *
- * @var FormatterManager
- */
- protected static $formatter;
-
/**
* The hasher with which to hash passwords.
*
@@ -215,29 +208,12 @@ class User extends Model
public function changeBio($bio)
{
$this->bio = $bio;
- $this->bio_html = null;
$this->raise(new UserBioWasChanged($this));
return $this;
}
- /**
- * Get the user's bio formatted as HTML.
- *
- * @param string $value
- * @return string
- */
- public function getBioHtmlAttribute($value)
- {
- if ($value === null) {
- $this->bio_html = $value = static::formatBio($this);
- $this->save();
- }
-
- return $value;
- }
-
/**
* Mark all discussions as read.
*
@@ -565,27 +541,6 @@ class User extends Model
static::$hasher = $hasher;
}
- /**
- * Set the text formatter instance.
- *
- * @param FormatterManager $formatter
- */
- public static function setFormatter(FormatterManager $formatter)
- {
- static::$formatter = $formatter;
- }
-
- /**
- * Get the formatted content of a user's bio.
- *
- * @param User $user
- * @return string
- */
- protected static function formatBio(User $user)
- {
- return static::$formatter->format($user->bio, $user);
- }
-
/**
* Register a preference with a transformer and a default value.
*
diff --git a/src/Core/Users/UsersServiceProvider.php b/src/Core/Users/UsersServiceProvider.php
index 14e446f77..9381ae7fd 100644
--- a/src/Core/Users/UsersServiceProvider.php
+++ b/src/Core/Users/UsersServiceProvider.php
@@ -18,7 +18,6 @@ class UsersServiceProvider extends ServiceProvider
public function boot()
{
User::setHasher($this->app->make('hash'));
- User::setFormatter($this->app->make('flarum.formatter'));
User::setValidator($this->app->make('validator'));
$events = $this->app->make('events');