1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 15:51:16 +02:00

Rejig post formatting

This commit is contained in:
Toby Zerner
2015-02-09 09:49:48 +10:30
parent 5d83e51813
commit a89fe9fbd5
7 changed files with 309 additions and 249 deletions

View File

@@ -12,7 +12,8 @@
"illuminate/support": "4.2.*", "illuminate/support": "4.2.*",
"laracasts/commander": "1.1.*", "laracasts/commander": "1.1.*",
"tobscure/json-api": "dev-master", "tobscure/json-api": "dev-master",
"tobscure/permissible": "dev-master" "tobscure/permissible": "dev-master",
"misd/linkify": "1.1.*"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "1.4.0", "fzaninotto/faker": "1.4.0",

View File

@@ -4,7 +4,7 @@
"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",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "a491c426ea0308a8fee769f5d3829509", "hash": "f965b67cdaace68ab3e159d2c058c449",
"packages": [ "packages": [
{ {
"name": "illuminate/container", "name": "illuminate/container",
@@ -54,12 +54,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/database.git", "url": "https://github.com/illuminate/database.git",
"reference": "6e37c45fe7b9ac1681033779d1863bcff4e66cdc" "reference": "eabb5ad0db896339f821ef088ca2fd0d6972e137"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/database/zipball/6e37c45fe7b9ac1681033779d1863bcff4e66cdc", "url": "https://api.github.com/repos/illuminate/database/zipball/eabb5ad0db896339f821ef088ca2fd0d6972e137",
"reference": "6e37c45fe7b9ac1681033779d1863bcff4e66cdc", "reference": "eabb5ad0db896339f821ef088ca2fd0d6972e137",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -102,7 +102,7 @@
"orm", "orm",
"sql" "sql"
], ],
"time": "2015-01-15 07:24:16" "time": "2015-01-27 20:51:43"
}, },
{ {
"name": "illuminate/events", "name": "illuminate/events",
@@ -154,12 +154,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/illuminate/support.git", "url": "https://github.com/illuminate/support.git",
"reference": "1194d557f21301784191dbaef6ee9fc206e473c9" "reference": "db61f3f6d507ce417ca993e1f93585db7efd8b12"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/1194d557f21301784191dbaef6ee9fc206e473c9", "url": "https://api.github.com/repos/illuminate/support/zipball/db61f3f6d507ce417ca993e1f93585db7efd8b12",
"reference": "1194d557f21301784191dbaef6ee9fc206e473c9", "reference": "db61f3f6d507ce417ca993e1f93585db7efd8b12",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -167,7 +167,7 @@
}, },
"require-dev": { "require-dev": {
"jeremeamia/superclosure": "~1.0.1", "jeremeamia/superclosure": "~1.0.1",
"patchwork/utf8": "1.1.*" "patchwork/utf8": "~1.1"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -193,7 +193,7 @@
"email": "taylorotwell@gmail.com" "email": "taylorotwell@gmail.com"
} }
], ],
"time": "2015-01-01 17:42:14" "time": "2015-01-27 20:51:43"
}, },
{ {
"name": "laracasts/commander", "name": "laracasts/commander",
@@ -233,17 +233,68 @@
"time": "2014-07-03 13:05:27" "time": "2014-07-03 13:05:27"
}, },
{ {
"name": "nesbot/carbon", "name": "misd/linkify",
"version": "1.13.0", "version": "dev-master",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/misd-service-development/php-linkify.git",
"reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42" "reference": "682bb65ea0329df43df1f805601ff9bae5c6b0b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/5cb6e71055f7b0b57956b73d324cc4de31278f42", "url": "https://api.github.com/repos/misd-service-development/php-linkify/zipball/682bb65ea0329df43df1f805601ff9bae5c6b0b6",
"reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42", "reference": "682bb65ea0329df43df1f805601ff9bae5c6b0b6",
"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-4": {
"Misd\\Linkify\\": "src/Misd/Linkify"
}
},
"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": "2015-01-02 08:43:02"
},
{
"name": "nesbot/carbon",
"version": "1.14.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "bb87460c995d97fe55b39e65f6ffb7f64b0a941e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bb87460c995d97fe55b39e65f6ffb7f64b0a941e",
"reference": "bb87460c995d97fe55b39e65f6ffb7f64b0a941e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -276,7 +327,7 @@
"datetime", "datetime",
"time" "time"
], ],
"time": "2014-09-26 02:52:02" "time": "2015-02-06 05:07:29"
}, },
{ {
"name": "tobscure/json-api", "name": "tobscure/json-api",
@@ -284,12 +335,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/tobscure/json-api.git", "url": "https://github.com/tobscure/json-api.git",
"reference": "9a87425ad1f5e95506787df194a5d3e7a7d27224" "reference": "27a87507d2b1eacdd41c97878ed07226355ce07b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/tobscure/json-api/zipball/9a87425ad1f5e95506787df194a5d3e7a7d27224", "url": "https://api.github.com/repos/tobscure/json-api/zipball/27a87507d2b1eacdd41c97878ed07226355ce07b",
"reference": "9a87425ad1f5e95506787df194a5d3e7a7d27224", "reference": "27a87507d2b1eacdd41c97878ed07226355ce07b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -312,7 +363,7 @@
} }
], ],
"description": "JSON-API responses in PHP.", "description": "JSON-API responses in PHP.",
"time": "2014-08-23 10:19:16" "time": "2015-02-05 05:31:31"
}, },
{ {
"name": "tobscure/permissible", "name": "tobscure/permissible",
@@ -359,21 +410,21 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Codeception/Codeception.git", "url": "https://github.com/Codeception/Codeception.git",
"reference": "14f40697efd0a3b7f763e93836b79ac709970528" "reference": "1416a5ed429615664ba406a37de141a7cba2982b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/14f40697efd0a3b7f763e93836b79ac709970528", "url": "https://api.github.com/repos/Codeception/Codeception/zipball/1416a5ed429615664ba406a37de141a7cba2982b",
"reference": "14f40697efd0a3b7f763e93836b79ac709970528", "reference": "1416a5ed429615664ba406a37de141a7cba2982b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-json": "*", "ext-json": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"facebook/webdriver": "~0.4", "facebook/webdriver": "~0.4|~0.5",
"guzzlehttp/guzzle": "~4.0|~5.0", "guzzlehttp/guzzle": "~4.0|~5.0",
"php": ">=5.4.0", "php": ">=5.4.0",
"phpunit/phpunit": "~4.0", "phpunit/phpunit": "4.4.*",
"symfony/browser-kit": "~2.4", "symfony/browser-kit": "~2.4",
"symfony/console": "~2.4", "symfony/console": "~2.4",
"symfony/css-selector": "~2.4", "symfony/css-selector": "~2.4",
@@ -384,12 +435,10 @@
}, },
"require-dev": { "require-dev": {
"codeception/specify": "~0.3", "codeception/specify": "~0.3",
"codegyre/robo-ci": "@dev",
"facebook/php-sdk": "~3.2", "facebook/php-sdk": "~3.2",
"flow/jsonpath": "~0.1", "flow/jsonpath": "~0.2",
"monolog/monolog": "~1.8", "monolog/monolog": "~1.8",
"pda/pheanstalk": "~2.0", "pda/pheanstalk": "~2.0",
"phpseclib/phpseclib": "~0.3.6",
"videlalvaro/php-amqplib": "~2.4" "videlalvaro/php-amqplib": "~2.4"
}, },
"suggest": { "suggest": {
@@ -433,7 +482,7 @@
"functional testing", "functional testing",
"unit testing" "unit testing"
], ],
"time": "2015-01-17 12:30:26" "time": "2015-02-07 01:27:55"
}, },
{ {
"name": "codeception/mockery-module", "name": "codeception/mockery-module",
@@ -616,16 +665,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "5.1.0", "version": "5.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "f1085bb4e023766a66b7b051914ec73bdf7202b5" "reference": "475b29ccd411f2fa8a408e64576418728c032cfa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/f1085bb4e023766a66b7b051914ec73bdf7202b5", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/475b29ccd411f2fa8a408e64576418728c032cfa",
"reference": "f1085bb4e023766a66b7b051914ec73bdf7202b5", "reference": "475b29ccd411f2fa8a408e64576418728c032cfa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -670,7 +719,7 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2014-12-19 20:27:15" "time": "2015-01-28 01:03:29"
}, },
{ {
"name": "guzzlehttp/ringphp", "name": "guzzlehttp/ringphp",
@@ -729,12 +778,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/streams.git", "url": "https://github.com/guzzle/streams.git",
"reference": "1fa6dfa8bca38fc32b189e91273b6a74c47df1ae" "reference": "d1f8a6c55f0f753cfd6f6755856473eb02cedb19"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/streams/zipball/1fa6dfa8bca38fc32b189e91273b6a74c47df1ae", "url": "https://api.github.com/repos/guzzle/streams/zipball/d1f8a6c55f0f753cfd6f6755856473eb02cedb19",
"reference": "1fa6dfa8bca38fc32b189e91273b6a74c47df1ae", "reference": "d1f8a6c55f0f753cfd6f6755856473eb02cedb19",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -771,7 +820,7 @@
"Guzzle", "Guzzle",
"stream" "stream"
], ],
"time": "2015-01-11 22:40:57" "time": "2015-01-22 00:01:34"
}, },
{ {
"name": "laracasts/testdummy", "name": "laracasts/testdummy",
@@ -826,12 +875,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/padraic/mockery.git", "url": "https://github.com/padraic/mockery.git",
"reference": "cce38ee95d444190e8aac2d46c6d5e7b94ea44ef" "reference": "0bf3f7346cb49a24587a1a6292e7f20fcd80af0a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/padraic/mockery/zipball/cce38ee95d444190e8aac2d46c6d5e7b94ea44ef", "url": "https://api.github.com/repos/padraic/mockery/zipball/0bf3f7346cb49a24587a1a6292e7f20fcd80af0a",
"reference": "cce38ee95d444190e8aac2d46c6d5e7b94ea44ef", "reference": "0bf3f7346cb49a24587a1a6292e7f20fcd80af0a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -884,115 +933,7 @@
"test double", "test double",
"testing" "testing"
], ],
"time": "2015-01-18 20:11:41" "time": "2015-02-05 10:30:00"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "fd0ac2007401505fb596fdfb859ec4e103d69e55"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/fd0ac2007401505fb596fdfb859ec4e103d69e55",
"reference": "fd0ac2007401505fb596fdfb859ec4e103d69e55",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-0": {
"phpDocumentor": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "mike.vanriel@naenius.com"
}
],
"time": "2014-09-02 14:26:20"
},
{
"name": "phpspec/prophecy",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "1828bb298d75727d0dd10b348d1afae204d38634"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/1828bb298d75727d0dd10b348d1afae204d38634",
"reference": "1828bb298d75727d0dd10b348d1afae204d38634",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"phpdocumentor/reflection-docblock": "~2.0"
},
"require-dev": {
"phpspec/phpspec": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-0": {
"Prophecy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"email": "marcello.duarte@gmail.com"
}
],
"description": "Highly opinionated mocking framework for PHP 5.3+",
"homepage": "https://github.com/phpspec/prophecy",
"keywords": [
"Double",
"Dummy",
"fake",
"mock",
"spy",
"stub"
],
"time": "2015-01-18 16:48:09"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
@@ -1000,12 +941,12 @@
"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": "5aaadd58aab6fd96200596820994641cb685f4aa" "reference": "34cc484af1ca149188d0d9e91412191e398e0b67"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5aaadd58aab6fd96200596820994641cb685f4aa", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67",
"reference": "5aaadd58aab6fd96200596820994641cb685f4aa", "reference": "34cc484af1ca149188d0d9e91412191e398e0b67",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1054,7 +995,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2015-01-15 05:45:24" "time": "2015-01-24 10:06:35"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@@ -1240,16 +1181,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "dev-master", "version": "4.4.x-dev",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "2d8c819677473bf0859c2baa31998c4c672032a5" "reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2d8c819677473bf0859c2baa31998c4c672032a5", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2e8580deebb7d1ac92ac878595e6bffe01069c2a",
"reference": "2d8c819677473bf0859c2baa31998c4c672032a5", "reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1259,19 +1200,19 @@
"ext-reflection": "*", "ext-reflection": "*",
"ext-spl": "*", "ext-spl": "*",
"php": ">=5.3.3", "php": ">=5.3.3",
"phpspec/prophecy": "~1.3.1",
"phpunit/php-code-coverage": "~2.0", "phpunit/php-code-coverage": "~2.0",
"phpunit/php-file-iterator": "~1.3", "phpunit/php-file-iterator": "~1.3.2",
"phpunit/php-text-template": "~1.2", "phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "~1.0", "phpunit/php-timer": "~1.0.2",
"phpunit/phpunit-mock-objects": "~2.3", "phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.1", "sebastian/comparator": "~1.0",
"sebastian/diff": "~1.2", "sebastian/diff": "~1.1",
"sebastian/environment": "~1.2", "sebastian/environment": "~1.1",
"sebastian/exporter": "~1.0", "sebastian/exporter": "~1.1",
"sebastian/global-state": "~1.0", "sebastian/global-state": "~1.0",
"sebastian/recursion-context": "~1.0",
"sebastian/version": "~1.0", "sebastian/version": "~1.0",
"symfony/yaml": "~2.1|~3.0" "symfony/yaml": "~2.0"
}, },
"suggest": { "suggest": {
"phpunit/php-invoker": "~1.1" "phpunit/php-invoker": "~1.1"
@@ -1282,7 +1223,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.6.x-dev" "dev-master": "4.4.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -1308,7 +1249,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2015-01-19 08:18:11" "time": "2015-01-27 16:06:15"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
@@ -1415,21 +1356,21 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git", "url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "6a1e846331bb3cc1a305168125d047fb86260e3d" "reference": "1dd8869519a225f7f2b9eb663e225298fade819e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1e846331bb3cc1a305168125d047fb86260e3d", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e",
"reference": "6a1e846331bb3cc1a305168125d047fb86260e3d", "reference": "1dd8869519a225f7f2b9eb663e225298fade819e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"sebastian/diff": "~1.1", "sebastian/diff": "~1.2",
"sebastian/exporter": "~1.0" "sebastian/exporter": "~1.2"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.1" "phpunit/phpunit": "~4.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -1471,7 +1412,7 @@
"compare", "compare",
"equality" "equality"
], ],
"time": "2015-01-05 16:29:00" "time": "2015-01-29 16:28:08"
}, },
{ {
"name": "sebastian/diff", "name": "sebastian/diff",
@@ -1581,24 +1522,25 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git", "url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "e0a5fdd64463a0d524305c733e3e4391c76cf739" "reference": "84839970d05254c73cde183a721c7af13aede943"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/e0a5fdd64463a0d524305c733e3e4391c76cf739", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943",
"reference": "e0a5fdd64463a0d524305c733e3e4391c76cf739", "reference": "84839970d05254c73cde183a721c7af13aede943",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3",
"sebastian/recursion-context": "~1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.0" "phpunit/phpunit": "~4.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.0.x-dev" "dev-master": "1.2.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -1638,7 +1580,7 @@
"export", "export",
"exporter" "exporter"
], ],
"time": "2015-01-01 09:36:15" "time": "2015-01-27 07:23:06"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
@@ -1691,6 +1633,59 @@
], ],
"time": "2015-01-20 04:09:31" "time": "2015-01-20 04:09:31"
}, },
{
"name": "sebastian/recursion-context",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "3989662bbb30a29d20d9faa04a846af79b276252"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252",
"reference": "3989662bbb30a29d20d9faa04a846af79b276252",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2015-01-24 09:48:32"
},
{ {
"name": "sebastian/version", "name": "sebastian/version",
"version": "1.0.4", "version": "1.0.4",
@@ -1788,12 +1783,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Console.git", "url": "https://github.com/symfony/Console.git",
"reference": "d20ea145861e86f064912fcfb152862ce0631796" "reference": "e30a2778069b48bd1e560e4a2815d15c9ab2f563"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/d20ea145861e86f064912fcfb152862ce0631796", "url": "https://api.github.com/repos/symfony/Console/zipball/e30a2778069b48bd1e560e4a2815d15c9ab2f563",
"reference": "d20ea145861e86f064912fcfb152862ce0631796", "reference": "e30a2778069b48bd1e560e4a2815d15c9ab2f563",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1836,7 +1831,7 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2015-01-20 01:40:35" "time": "2015-02-05 07:11:58"
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
@@ -1896,12 +1891,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/DomCrawler.git", "url": "https://github.com/symfony/DomCrawler.git",
"reference": "57ef66b6d806d9d1b9234e27da304ee5d1e54641" "reference": "49d1657a690eaa6e8fd4f92d828b89bed05dd55d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/DomCrawler/zipball/57ef66b6d806d9d1b9234e27da304ee5d1e54641", "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/49d1657a690eaa6e8fd4f92d828b89bed05dd55d",
"reference": "57ef66b6d806d9d1b9234e27da304ee5d1e54641", "reference": "49d1657a690eaa6e8fd4f92d828b89bed05dd55d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1940,7 +1935,7 @@
], ],
"description": "Symfony DomCrawler Component", "description": "Symfony DomCrawler Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2015-01-09 13:24:18" "time": "2015-02-05 06:58:17"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
@@ -1949,12 +1944,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/EventDispatcher.git", "url": "https://github.com/symfony/EventDispatcher.git",
"reference": "7a26717d431dfb092198d7c55f06788b2de5aaf7" "reference": "e9298668dce8dd219d1ee2290c7f313954f1f984"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/7a26717d431dfb092198d7c55f06788b2de5aaf7", "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e9298668dce8dd219d1ee2290c7f313954f1f984",
"reference": "7a26717d431dfb092198d7c55f06788b2de5aaf7", "reference": "e9298668dce8dd219d1ee2290c7f313954f1f984",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1998,7 +1993,7 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2015-01-16 15:11:56" "time": "2015-02-05 06:58:17"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
@@ -2054,12 +2049,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Yaml.git", "url": "https://github.com/symfony/Yaml.git",
"reference": "077ae1200d35a90947b80b4c64e022ddc81536d6" "reference": "02ba3dc638c5d3f0ab3b47ddb74f98c11dcc0c60"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/077ae1200d35a90947b80b4c64e022ddc81536d6", "url": "https://api.github.com/repos/symfony/Yaml/zipball/02ba3dc638c5d3f0ab3b47ddb74f98c11dcc0c60",
"reference": "077ae1200d35a90947b80b4c64e022ddc81536d6", "reference": "02ba3dc638c5d3f0ab3b47ddb74f98c11dcc0c60",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2092,7 +2087,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2015-01-20 01:40:35" "time": "2015-01-25 04:39:35"
} }
], ],
"aliases": [], "aliases": [],

View File

@@ -4,6 +4,8 @@ use Illuminate\Support\ServiceProvider;
use Config; use Config;
use Event; use Event;
use Flarum\Core\Formatter\FormatterManager;
class CoreServiceProvider extends ServiceProvider class CoreServiceProvider extends ServiceProvider
{ {
/** /**
@@ -28,7 +30,6 @@ class CoreServiceProvider extends ServiceProvider
Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\DiscussionMetadataUpdater'); Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\DiscussionMetadataUpdater');
Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\UserMetadataUpdater'); Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\UserMetadataUpdater');
Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\PostFormatter');
Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\TitleChangePostCreator'); Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\TitleChangePostCreator');
} }
@@ -63,6 +64,13 @@ class CoreServiceProvider extends ServiceProvider
$this->app->bind('flarum.discussionFinder', 'Flarum\Core\Discussions\DiscussionFinder'); $this->app->bind('flarum.discussionFinder', 'Flarum\Core\Discussions\DiscussionFinder');
$this->app->singleton('flarum.formatter', function () {
$formatter = new FormatterManager($this->app);
$formatter->add('basic', 'Flarum\Core\Formatter\BasicFormatter');
return $formatter;
});
// $this->app->singleton( // $this->app->singleton(
// 'Flarum\Core\Repositories\Contracts\DiscussionRepository', // 'Flarum\Core\Repositories\Contracts\DiscussionRepository',

View File

@@ -0,0 +1,18 @@
<?php namespace Flarum\Core\Formatter;
use Misd\Linkify\Linkify;
class BasicFormatter
{
public function format($text)
{
$text = htmlspecialchars($text);
$linkify = new Linkify;
$text = $linkify->process($text, ['attr' => ['target' => '_blank']]);
$text = '<p>'.preg_replace(['/[\n]{2,}/', '/\n/'], ['</p><p>', '<br>'], trim($text)).'</p>';
return $text;
}
}

View File

@@ -0,0 +1,67 @@
<?php namespace Flarum\Core\Formatter;
use Illuminate\Container\Container;
class FormatterManager
{
protected $formatters = [];
/**
* The IoC container instance.
*
* @var \Illuminate\Container\Container
*/
protected $container;
/**
* Create a new formatter manager instance.
*
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(Container $container = null)
{
$this->container = $container ?: new Container;
}
public function add($name, $formatter, $priority = 0)
{
$this->remove($name);
if (is_string($formatter)) {
$container = $this->container;
$formatter = function () use ($container, $formatter) {
$callable = array($container->make($formatter), 'format');
$data = func_get_args();
return call_user_func_array($callable, $data);
};
}
$this->formatters[$name] = [$formatter, $priority];
}
public function remove($name)
{
unset($this->formatters[$name]);
}
public function format($text)
{
$sorted = [];
foreach ($this->formatters as $array) {
list($formatter, $priority) = $array;
$sorted[$priority][] = $formatter;
}
ksort($sorted);
foreach ($sorted as $formatters) {
foreach ($formatters as $formatter) {
$text = $formatter($text);
}
}
return $text;
}
}

View File

@@ -1,48 +0,0 @@
<?php namespace Flarum\Core\Listeners;
use Laracasts\Commander\Events\EventListener;
use Flarum\Core\Posts\PostRepository;
use Flarum\Core\Posts\Post;
use Flarum\Core\Posts\Events\ReplyWasPosted;
use Flarum\Core\Posts\Events\PostWasRevised;
class PostFormatter extends EventListener
{
protected $postRepo;
public function __construct(PostRepository $postRepo)
{
$this->postRepo = $postRepo;
}
protected function formatPost($post)
{
$post = $this->postRepo->find($post->id);
// By default, we want to convert paragraphs of text into <p> tags.
// And maybe also wrap URLs in <a> tags.
// However, we want to allow plugins to completely override this, and/or
// just do some superficial formatting afterwards.
$html = htmlspecialchars($post->content);
// Primary formatter
$html = '<p>'.$html.'</p>'; // Move this to Flarum\Core\Support\Formatters\BasicFormatter < FormatterInterface
// Run additional formatters
$post->content_html = $html;
$this->postRepo->save($post);
}
public function whenReplyWasPosted(ReplyWasPosted $event)
{
$this->formatPost($event->post);
}
public function whenPostWasRevised(PostWasRevised $event)
{
$this->formatPost($event->post);
}
}

View File

@@ -1,5 +1,6 @@
<?php namespace Flarum\Core\Posts; <?php namespace Flarum\Core\Posts;
use App;
use Laracasts\Commander\Events\EventGenerator; use Laracasts\Commander\Events\EventGenerator;
use Tobscure\Permissible\Permissible; use Tobscure\Permissible\Permissible;
@@ -25,6 +26,7 @@ class CommentPost extends Post
$post = new static; $post = new static;
$post->content = $content; $post->content = $content;
$post->content_html = static::formatContent($post->content);
$post->time = time(); $post->time = time();
$post->discussion_id = $discussionId; $post->discussion_id = $discussionId;
$post->user_id = $userId; $post->user_id = $userId;
@@ -38,6 +40,7 @@ class CommentPost extends Post
public function revise($content, $user) public function revise($content, $user)
{ {
$this->content = $content; $this->content = $content;
$this->content_html = static::formatContent($this->content);
$this->edit_time = time(); $this->edit_time = time();
$this->edit_user_id = $user->id; $this->edit_user_id = $user->id;
@@ -60,4 +63,20 @@ class CommentPost extends Post
$this->raise(new Events\PostWasRestored($this)); $this->raise(new Events\PostWasRestored($this));
} }
public function getContentHtmlAttribute($value)
{
if (! $value) {
$this->content_html = $value = static::formatContent($this->content);
$this->save();
}
return $value;
}
protected static function formatContent($content)
{
$formatter = App::make('flarum.formatter');
return $formatter->format($content);
}
} }