diff --git a/framework/core/composer.json b/framework/core/composer.json index 4131829f8..d5f562cc2 100644 --- a/framework/core/composer.json +++ b/framework/core/composer.json @@ -12,7 +12,8 @@ "illuminate/support": "4.2.*", "laracasts/commander": "1.1.*", "tobscure/json-api": "dev-master", - "tobscure/permissible": "dev-master" + "tobscure/permissible": "dev-master", + "misd/linkify": "1.1.*" }, "require-dev": { "fzaninotto/faker": "1.4.0", diff --git a/framework/core/composer.lock b/framework/core/composer.lock index b21572a69..c720fbf12 100644 --- a/framework/core/composer.lock +++ b/framework/core/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "a491c426ea0308a8fee769f5d3829509", + "hash": "f965b67cdaace68ab3e159d2c058c449", "packages": [ { "name": "illuminate/container", @@ -54,12 +54,12 @@ "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "6e37c45fe7b9ac1681033779d1863bcff4e66cdc" + "reference": "eabb5ad0db896339f821ef088ca2fd0d6972e137" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/6e37c45fe7b9ac1681033779d1863bcff4e66cdc", - "reference": "6e37c45fe7b9ac1681033779d1863bcff4e66cdc", + "url": "https://api.github.com/repos/illuminate/database/zipball/eabb5ad0db896339f821ef088ca2fd0d6972e137", + "reference": "eabb5ad0db896339f821ef088ca2fd0d6972e137", "shasum": "" }, "require": { @@ -102,7 +102,7 @@ "orm", "sql" ], - "time": "2015-01-15 07:24:16" + "time": "2015-01-27 20:51:43" }, { "name": "illuminate/events", @@ -154,12 +154,12 @@ "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "1194d557f21301784191dbaef6ee9fc206e473c9" + "reference": "db61f3f6d507ce417ca993e1f93585db7efd8b12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/1194d557f21301784191dbaef6ee9fc206e473c9", - "reference": "1194d557f21301784191dbaef6ee9fc206e473c9", + "url": "https://api.github.com/repos/illuminate/support/zipball/db61f3f6d507ce417ca993e1f93585db7efd8b12", + "reference": "db61f3f6d507ce417ca993e1f93585db7efd8b12", "shasum": "" }, "require": { @@ -167,7 +167,7 @@ }, "require-dev": { "jeremeamia/superclosure": "~1.0.1", - "patchwork/utf8": "1.1.*" + "patchwork/utf8": "~1.1" }, "type": "library", "extra": { @@ -193,7 +193,7 @@ "email": "taylorotwell@gmail.com" } ], - "time": "2015-01-01 17:42:14" + "time": "2015-01-27 20:51:43" }, { "name": "laracasts/commander", @@ -233,17 +233,68 @@ "time": "2014-07-03 13:05:27" }, { - "name": "nesbot/carbon", - "version": "1.13.0", + "name": "misd/linkify", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42" + "url": "https://github.com/misd-service-development/php-linkify.git", + "reference": "682bb65ea0329df43df1f805601ff9bae5c6b0b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/5cb6e71055f7b0b57956b73d324cc4de31278f42", - "reference": "5cb6e71055f7b0b57956b73d324cc4de31278f42", + "url": "https://api.github.com/repos/misd-service-development/php-linkify/zipball/682bb65ea0329df43df1f805601ff9bae5c6b0b6", + "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": "" }, "require": { @@ -276,7 +327,7 @@ "datetime", "time" ], - "time": "2014-09-26 02:52:02" + "time": "2015-02-06 05:07:29" }, { "name": "tobscure/json-api", @@ -284,12 +335,12 @@ "source": { "type": "git", "url": "https://github.com/tobscure/json-api.git", - "reference": "9a87425ad1f5e95506787df194a5d3e7a7d27224" + "reference": "27a87507d2b1eacdd41c97878ed07226355ce07b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tobscure/json-api/zipball/9a87425ad1f5e95506787df194a5d3e7a7d27224", - "reference": "9a87425ad1f5e95506787df194a5d3e7a7d27224", + "url": "https://api.github.com/repos/tobscure/json-api/zipball/27a87507d2b1eacdd41c97878ed07226355ce07b", + "reference": "27a87507d2b1eacdd41c97878ed07226355ce07b", "shasum": "" }, "require": { @@ -312,7 +363,7 @@ } ], "description": "JSON-API responses in PHP.", - "time": "2014-08-23 10:19:16" + "time": "2015-02-05 05:31:31" }, { "name": "tobscure/permissible", @@ -359,21 +410,21 @@ "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "14f40697efd0a3b7f763e93836b79ac709970528" + "reference": "1416a5ed429615664ba406a37de141a7cba2982b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/14f40697efd0a3b7f763e93836b79ac709970528", - "reference": "14f40697efd0a3b7f763e93836b79ac709970528", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/1416a5ed429615664ba406a37de141a7cba2982b", + "reference": "1416a5ed429615664ba406a37de141a7cba2982b", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facebook/webdriver": "~0.4", + "facebook/webdriver": "~0.4|~0.5", "guzzlehttp/guzzle": "~4.0|~5.0", "php": ">=5.4.0", - "phpunit/phpunit": "~4.0", + "phpunit/phpunit": "4.4.*", "symfony/browser-kit": "~2.4", "symfony/console": "~2.4", "symfony/css-selector": "~2.4", @@ -384,12 +435,10 @@ }, "require-dev": { "codeception/specify": "~0.3", - "codegyre/robo-ci": "@dev", "facebook/php-sdk": "~3.2", - "flow/jsonpath": "~0.1", + "flow/jsonpath": "~0.2", "monolog/monolog": "~1.8", "pda/pheanstalk": "~2.0", - "phpseclib/phpseclib": "~0.3.6", "videlalvaro/php-amqplib": "~2.4" }, "suggest": { @@ -433,7 +482,7 @@ "functional testing", "unit testing" ], - "time": "2015-01-17 12:30:26" + "time": "2015-02-07 01:27:55" }, { "name": "codeception/mockery-module", @@ -616,16 +665,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "5.1.0", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f1085bb4e023766a66b7b051914ec73bdf7202b5" + "reference": "475b29ccd411f2fa8a408e64576418728c032cfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f1085bb4e023766a66b7b051914ec73bdf7202b5", - "reference": "f1085bb4e023766a66b7b051914ec73bdf7202b5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/475b29ccd411f2fa8a408e64576418728c032cfa", + "reference": "475b29ccd411f2fa8a408e64576418728c032cfa", "shasum": "" }, "require": { @@ -670,7 +719,7 @@ "rest", "web service" ], - "time": "2014-12-19 20:27:15" + "time": "2015-01-28 01:03:29" }, { "name": "guzzlehttp/ringphp", @@ -729,12 +778,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/streams.git", - "reference": "1fa6dfa8bca38fc32b189e91273b6a74c47df1ae" + "reference": "d1f8a6c55f0f753cfd6f6755856473eb02cedb19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/1fa6dfa8bca38fc32b189e91273b6a74c47df1ae", - "reference": "1fa6dfa8bca38fc32b189e91273b6a74c47df1ae", + "url": "https://api.github.com/repos/guzzle/streams/zipball/d1f8a6c55f0f753cfd6f6755856473eb02cedb19", + "reference": "d1f8a6c55f0f753cfd6f6755856473eb02cedb19", "shasum": "" }, "require": { @@ -771,7 +820,7 @@ "Guzzle", "stream" ], - "time": "2015-01-11 22:40:57" + "time": "2015-01-22 00:01:34" }, { "name": "laracasts/testdummy", @@ -826,12 +875,12 @@ "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "cce38ee95d444190e8aac2d46c6d5e7b94ea44ef" + "reference": "0bf3f7346cb49a24587a1a6292e7f20fcd80af0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/cce38ee95d444190e8aac2d46c6d5e7b94ea44ef", - "reference": "cce38ee95d444190e8aac2d46c6d5e7b94ea44ef", + "url": "https://api.github.com/repos/padraic/mockery/zipball/0bf3f7346cb49a24587a1a6292e7f20fcd80af0a", + "reference": "0bf3f7346cb49a24587a1a6292e7f20fcd80af0a", "shasum": "" }, "require": { @@ -884,115 +933,7 @@ "test double", "testing" ], - "time": "2015-01-18 20:11:41" - }, - { - "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" + "time": "2015-02-05 10:30:00" }, { "name": "phpunit/php-code-coverage", @@ -1000,12 +941,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5aaadd58aab6fd96200596820994641cb685f4aa" + "reference": "34cc484af1ca149188d0d9e91412191e398e0b67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5aaadd58aab6fd96200596820994641cb685f4aa", - "reference": "5aaadd58aab6fd96200596820994641cb685f4aa", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67", + "reference": "34cc484af1ca149188d0d9e91412191e398e0b67", "shasum": "" }, "require": { @@ -1054,7 +995,7 @@ "testing", "xunit" ], - "time": "2015-01-15 05:45:24" + "time": "2015-01-24 10:06:35" }, { "name": "phpunit/php-file-iterator", @@ -1240,16 +1181,16 @@ }, { "name": "phpunit/phpunit", - "version": "dev-master", + "version": "4.4.x-dev", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2d8c819677473bf0859c2baa31998c4c672032a5" + "reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2d8c819677473bf0859c2baa31998c4c672032a5", - "reference": "2d8c819677473bf0859c2baa31998c4c672032a5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2e8580deebb7d1ac92ac878595e6bffe01069c2a", + "reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a", "shasum": "" }, "require": { @@ -1259,19 +1200,19 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "~1.3.1", "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-timer": "~1.0", + "phpunit/php-timer": "~1.0.2", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", - "sebastian/exporter": "~1.0", + "sebastian/comparator": "~1.0", + "sebastian/diff": "~1.1", + "sebastian/environment": "~1.1", + "sebastian/exporter": "~1.1", "sebastian/global-state": "~1.0", + "sebastian/recursion-context": "~1.0", "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "symfony/yaml": "~2.0" }, "suggest": { "phpunit/php-invoker": "~1.1" @@ -1282,7 +1223,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.6.x-dev" + "dev-master": "4.4.x-dev" } }, "autoload": { @@ -1308,7 +1249,7 @@ "testing", "xunit" ], - "time": "2015-01-19 08:18:11" + "time": "2015-01-27 16:06:15" }, { "name": "phpunit/phpunit-mock-objects", @@ -1415,21 +1356,21 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1e846331bb3cc1a305168125d047fb86260e3d" + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1e846331bb3cc1a305168125d047fb86260e3d", - "reference": "6a1e846331bb3cc1a305168125d047fb86260e3d", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { @@ -1471,7 +1412,7 @@ "compare", "equality" ], - "time": "2015-01-05 16:29:00" + "time": "2015-01-29 16:28:08" }, { "name": "sebastian/diff", @@ -1581,24 +1522,25 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "e0a5fdd64463a0d524305c733e3e4391c76cf739" + "reference": "84839970d05254c73cde183a721c7af13aede943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/e0a5fdd64463a0d524305c733e3e4391c76cf739", - "reference": "e0a5fdd64463a0d524305c733e3e4391c76cf739", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", + "reference": "84839970d05254c73cde183a721c7af13aede943", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1638,7 +1580,7 @@ "export", "exporter" ], - "time": "2015-01-01 09:36:15" + "time": "2015-01-27 07:23:06" }, { "name": "sebastian/global-state", @@ -1691,6 +1633,59 @@ ], "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", "version": "1.0.4", @@ -1788,12 +1783,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "d20ea145861e86f064912fcfb152862ce0631796" + "reference": "e30a2778069b48bd1e560e4a2815d15c9ab2f563" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/d20ea145861e86f064912fcfb152862ce0631796", - "reference": "d20ea145861e86f064912fcfb152862ce0631796", + "url": "https://api.github.com/repos/symfony/Console/zipball/e30a2778069b48bd1e560e4a2815d15c9ab2f563", + "reference": "e30a2778069b48bd1e560e4a2815d15c9ab2f563", "shasum": "" }, "require": { @@ -1836,7 +1831,7 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2015-01-20 01:40:35" + "time": "2015-02-05 07:11:58" }, { "name": "symfony/css-selector", @@ -1896,12 +1891,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/DomCrawler.git", - "reference": "57ef66b6d806d9d1b9234e27da304ee5d1e54641" + "reference": "49d1657a690eaa6e8fd4f92d828b89bed05dd55d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/57ef66b6d806d9d1b9234e27da304ee5d1e54641", - "reference": "57ef66b6d806d9d1b9234e27da304ee5d1e54641", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/49d1657a690eaa6e8fd4f92d828b89bed05dd55d", + "reference": "49d1657a690eaa6e8fd4f92d828b89bed05dd55d", "shasum": "" }, "require": { @@ -1940,7 +1935,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "http://symfony.com", - "time": "2015-01-09 13:24:18" + "time": "2015-02-05 06:58:17" }, { "name": "symfony/event-dispatcher", @@ -1949,12 +1944,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "7a26717d431dfb092198d7c55f06788b2de5aaf7" + "reference": "e9298668dce8dd219d1ee2290c7f313954f1f984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/7a26717d431dfb092198d7c55f06788b2de5aaf7", - "reference": "7a26717d431dfb092198d7c55f06788b2de5aaf7", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/e9298668dce8dd219d1ee2290c7f313954f1f984", + "reference": "e9298668dce8dd219d1ee2290c7f313954f1f984", "shasum": "" }, "require": { @@ -1998,7 +1993,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2015-01-16 15:11:56" + "time": "2015-02-05 06:58:17" }, { "name": "symfony/finder", @@ -2054,12 +2049,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "077ae1200d35a90947b80b4c64e022ddc81536d6" + "reference": "02ba3dc638c5d3f0ab3b47ddb74f98c11dcc0c60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/077ae1200d35a90947b80b4c64e022ddc81536d6", - "reference": "077ae1200d35a90947b80b4c64e022ddc81536d6", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/02ba3dc638c5d3f0ab3b47ddb74f98c11dcc0c60", + "reference": "02ba3dc638c5d3f0ab3b47ddb74f98c11dcc0c60", "shasum": "" }, "require": { @@ -2092,7 +2087,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2015-01-20 01:40:35" + "time": "2015-01-25 04:39:35" } ], "aliases": [], diff --git a/framework/core/src/Flarum/Core/CoreServiceProvider.php b/framework/core/src/Flarum/Core/CoreServiceProvider.php index e7364524e..d5af47b4c 100644 --- a/framework/core/src/Flarum/Core/CoreServiceProvider.php +++ b/framework/core/src/Flarum/Core/CoreServiceProvider.php @@ -4,6 +4,8 @@ use Illuminate\Support\ServiceProvider; use Config; use Event; +use Flarum\Core\Formatter\FormatterManager; + 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\UserMetadataUpdater'); - Event::listen('Flarum.Core.*', 'Flarum\Core\Listeners\PostFormatter'); 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->singleton('flarum.formatter', function () { + $formatter = new FormatterManager($this->app); + $formatter->add('basic', 'Flarum\Core\Formatter\BasicFormatter'); + return $formatter; + }); + + // $this->app->singleton( // 'Flarum\Core\Repositories\Contracts\DiscussionRepository', diff --git a/framework/core/src/Flarum/Core/Formatter/BasicFormatter.php b/framework/core/src/Flarum/Core/Formatter/BasicFormatter.php new file mode 100644 index 000000000..abdf20f0b --- /dev/null +++ b/framework/core/src/Flarum/Core/Formatter/BasicFormatter.php @@ -0,0 +1,18 @@ +process($text, ['attr' => ['target' => '_blank']]); + + $text = '

'.preg_replace(['/[\n]{2,}/', '/\n/'], ['

', '
'], trim($text)).'

'; + + return $text; + } +} diff --git a/framework/core/src/Flarum/Core/Formatter/FormatterManager.php b/framework/core/src/Flarum/Core/Formatter/FormatterManager.php new file mode 100644 index 000000000..e0871b7ab --- /dev/null +++ b/framework/core/src/Flarum/Core/Formatter/FormatterManager.php @@ -0,0 +1,67 @@ +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; + } +} diff --git a/framework/core/src/Flarum/Core/Listeners/PostFormatter.php b/framework/core/src/Flarum/Core/Listeners/PostFormatter.php deleted file mode 100755 index c2efd358a..000000000 --- a/framework/core/src/Flarum/Core/Listeners/PostFormatter.php +++ /dev/null @@ -1,48 +0,0 @@ -postRepo = $postRepo; - } - - protected function formatPost($post) - { - $post = $this->postRepo->find($post->id); - - // By default, we want to convert paragraphs of text into

tags. - // And maybe also wrap URLs in 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 = '

'.$html.'

'; // 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); - } -} diff --git a/framework/core/src/Flarum/Core/Posts/CommentPost.php b/framework/core/src/Flarum/Core/Posts/CommentPost.php index fdff4a88b..8836eba71 100755 --- a/framework/core/src/Flarum/Core/Posts/CommentPost.php +++ b/framework/core/src/Flarum/Core/Posts/CommentPost.php @@ -1,5 +1,6 @@ content = $content; + $post->content_html = static::formatContent($post->content); $post->time = time(); $post->discussion_id = $discussionId; $post->user_id = $userId; @@ -38,6 +40,7 @@ class CommentPost extends Post public function revise($content, $user) { $this->content = $content; + $this->content_html = static::formatContent($this->content); $this->edit_time = time(); $this->edit_user_id = $user->id; @@ -60,4 +63,20 @@ class CommentPost extends Post $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); + } }