From 9537e2ae9572f75edc8da7fb23572346c56f101d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Youn=C3=A8s=20EL=20BIACHE?= Date: Thu, 7 Jul 2016 19:42:21 +0200 Subject: [PATCH 01/32] html diff in revision view --- app/Http/Controllers/PageController.php | 13 +- app/PageRevision.php | 21 + composer.json | 3 +- composer.lock | 831 ++++++++++++------- resources/assets/sass/_pages.scss | 12 + resources/views/pages/page-display.blade.php | 6 +- 6 files changed, 589 insertions(+), 297 deletions(-) mode change 100644 => 100755 resources/assets/sass/_pages.scss diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index f35834e62..1844e0c0c 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -12,6 +12,7 @@ use BookStack\Repos\ChapterRepo; use BookStack\Repos\PageRepo; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Views; +use Icap\HtmlDiff\HtmlDiff; class PageController extends Controller { @@ -332,9 +333,19 @@ class PageController extends Controller $book = $this->bookRepo->getBySlug($bookSlug); $page = $this->pageRepo->getBySlug($pageSlug, $book->id); $revision = $this->pageRepo->getRevisionById($revisionId); + + $next = $revision->getNext() ?: $page; + $htmlDiff = new HtmlDiff($revision->html, $next->html, true); + $diff = $htmlDiff->outputDiff()->toString(); + $page->fill($revision->toArray()); $this->setPageTitle('Page Revision For ' . $page->getShortName()); - return view('pages/revision', ['page' => $page, 'book' => $book]); + + return view('pages/revision', [ + 'page' => $page, + 'book' => $book, + 'diff' => $diff, + ]); } /** diff --git a/app/PageRevision.php b/app/PageRevision.php index dae74cd0f..1baf0f8e5 100644 --- a/app/PageRevision.php +++ b/app/PageRevision.php @@ -32,4 +32,25 @@ class PageRevision extends Model return $this->page->getUrl() . '/revisions/' . $this->id; } + /** + * Get previous revision + * @return \BookStack\PageRevision + */ + public function getPrevious() + { + if ($id = PageRevision::where('id', '<', $this->id)->max('id')) { + return PageRevision::find($id); + } + } + + /** + * Get next revision + * @return \BookStack\PageRevision + */ + public function getNext() + { + if ($id = PageRevision::where('id', '>', $this->id)->min('id')) { + return PageRevision::find($id); + } + } } diff --git a/composer.json b/composer.json index 8f375a279..41f1ada5d 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "barryvdh/laravel-debugbar": "^2.0", "league/flysystem-aws-s3-v3": "^1.0", "barryvdh/laravel-dompdf": "0.6.*", - "predis/predis": "^1.0" + "predis/predis": "^1.0", + "icap/html-diff": "^1.1" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/composer.lock b/composer.lock index 63d378753..f97aeb992 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "eb7c71e9ed116d3fd2a1d0af07f9f134", - "content-hash": "17d2d7fc5fed682f2a290d6588538035", + "hash": "3d8e2dfddefb412055d28ffc922969fd", + "content-hash": "7658fea0b4df71cf7b97bcdf8a29b9eb", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.17.5", + "version": "3.18.25", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "1cef9b334729b3564c9aef15481a55561c54b53f" + "reference": "37a8ce927a69de3d821c21b64674a2b3b9d1d247" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1cef9b334729b3564c9aef15481a55561c54b53f", - "reference": "1cef9b334729b3564c9aef15481a55561c54b53f", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/37a8ce927a69de3d821c21b64674a2b3b9d1d247", + "reference": "37a8ce927a69de3d821c21b64674a2b3b9d1d247", "shasum": "" }, "require": { "guzzlehttp/guzzle": "~5.3|~6.0.1|~6.1", "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.0", + "guzzlehttp/psr7": "~1.3.1", "mtdowling/jmespath.php": "~2.2", "php": ">=5.5" }, @@ -85,20 +85,20 @@ "s3", "sdk" ], - "time": "2016-04-07 22:44:13" + "time": "2016-07-05 19:25:06" }, { "name": "barryvdh/laravel-debugbar", - "version": "v2.2.0", + "version": "v2.2.2", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "13b7058d2120c8d5af7f1ada21b7c44dd87b666a" + "reference": "c291e58d0a13953e0f68d99182ee77ebc693edc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/13b7058d2120c8d5af7f1ada21b7c44dd87b666a", - "reference": "13b7058d2120c8d5af7f1ada21b7c44dd87b666a", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/c291e58d0a13953e0f68d99182ee77ebc693edc0", + "reference": "c291e58d0a13953e0f68d99182ee77ebc693edc0", "shasum": "" }, "require": { @@ -139,7 +139,7 @@ "profiler", "webprofiler" ], - "time": "2016-02-17 08:32:21" + "time": "2016-05-11 13:54:43" }, { "name": "barryvdh/laravel-dompdf", @@ -191,28 +191,31 @@ }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.1.4", + "version": "v2.2.1", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "f1ebd847aac9a4545325d35108cafc285fe1605f" + "reference": "28af7cd19ca41cc0c63dd1de2b46c2b84d31c463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/f1ebd847aac9a4545325d35108cafc285fe1605f", - "reference": "f1ebd847aac9a4545325d35108cafc285fe1605f", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/28af7cd19ca41cc0c63dd1de2b46c2b84d31c463", + "reference": "28af7cd19ca41cc0c63dd1de2b46c2b84d31c463", "shasum": "" }, "require": { - "illuminate/console": "5.0.x|5.1.x|5.2.x", - "illuminate/filesystem": "5.0.x|5.1.x|5.2.x", - "illuminate/support": "5.0.x|5.1.x|5.2.x", + "barryvdh/reflection-docblock": "^2.0.4", + "illuminate/console": "^5.0,<5.4", + "illuminate/filesystem": "^5.0,<5.4", + "illuminate/support": "^5.0,<5.4", "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0.4", - "symfony/class-loader": "~2.3|~3.0" + "symfony/class-loader": "^2.3|^3.0" }, "require-dev": { - "doctrine/dbal": "~2.3" + "doctrine/dbal": "~2.3", + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" }, "suggest": { "doctrine/dbal": "Load information from the database about models for phpdocs (~2.3)" @@ -220,7 +223,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -250,7 +253,56 @@ "phpstorm", "sublime" ], - "time": "2016-03-03 08:45:00" + "time": "2016-07-04 11:52:48" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "3dcbd98b5d9384a5357266efba8fd29884458e5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/3dcbd98b5d9384a5357266efba8fd29884458e5c", + "reference": "3dcbd98b5d9384a5357266efba8fd29884458e5c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0,<4.5" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-06-13 19:28:20" }, { "name": "classpreloader/classpreloader", @@ -537,6 +589,7 @@ "rest", "web service" ], + "abandoned": "guzzlehttp/guzzle", "time": "2014-01-28 22:29:15" }, { @@ -603,16 +656,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8" + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8", - "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8", + "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", "shasum": "" }, "require": { @@ -650,20 +703,20 @@ "keywords": [ "promise" ], - "time": "2016-03-08 01:15:46" + "time": "2016-05-18 16:56:05" }, { "name": "guzzlehttp/psr7", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b" + "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b", - "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", + "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", "shasum": "" }, "require": { @@ -679,7 +732,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -708,20 +761,64 @@ "stream", "uri" ], - "time": "2016-02-18 21:54:00" + "time": "2016-06-24 23:00:38" }, { - "name": "intervention/image", - "version": "2.3.6", + "name": "icap/html-diff", + "version": "v1.1.0", "source": { "type": "git", - "url": "https://github.com/Intervention/image.git", - "reference": "e368d262887dbb2fdfaf710880571ede51e9c0e6" + "url": "https://github.com/iCAPLyon1/HtmlDiff.git", + "reference": "f58ddb196292ae585a2efb7692653d015ecc436f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/e368d262887dbb2fdfaf710880571ede51e9c0e6", - "reference": "e368d262887dbb2fdfaf710880571ede51e9c0e6", + "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f", + "reference": "f58ddb196292ae585a2efb7692653d015ecc436f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff" + } + }, + "notification-url": "https://packagist.org/downloads/", + "authors": [ + { + "name": "Panagiotis Tsavdaris", + "email": "ptsavdar@gmail.com" + }, + { + "name": "ICAP development team", + "homepage": "https://github.com/iCAPLyon1" + } + ], + "description": "A PHP5 library that diffs (compares) HTML files.", + "keywords": [ + "daisy diff", + "html diff" + ], + "time": "2016-02-17 16:35:09" + }, + { + "name": "intervention/image", + "version": "2.3.7", + "source": { + "type": "git", + "url": "https://github.com/Intervention/image.git", + "reference": "22088b04728a039bd1fc32f7e79a89a118b78698" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Intervention/image/zipball/22088b04728a039bd1fc32f7e79a89a118b78698", + "reference": "22088b04728a039bd1fc32f7e79a89a118b78698", "shasum": "" }, "require": { @@ -770,7 +867,7 @@ "thumbnail", "watermark" ], - "time": "2016-02-26 18:18:19" + "time": "2016-04-26 14:08:40" }, { "name": "jakub-onderka/php-console-color", @@ -919,16 +1016,16 @@ }, { "name": "laravel/framework", - "version": "v5.2.29", + "version": "v5.2.39", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "e3d644eb131f18c5f3d28ff7bc678bc797091f20" + "reference": "c2a77050269b4e03bd9a735a9f24e573a7598b8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/e3d644eb131f18c5f3d28ff7bc678bc797091f20", - "reference": "e3d644eb131f18c5f3d28ff7bc678bc797091f20", + "url": "https://api.github.com/repos/laravel/framework/zipball/c2a77050269b4e03bd9a735a9f24e573a7598b8a", + "reference": "c2a77050269b4e03bd9a735a9f24e573a7598b8a", "shasum": "" }, "require": { @@ -989,7 +1086,7 @@ }, "require-dev": { "aws/aws-sdk-php": "~3.0", - "mockery/mockery": "~0.9.2", + "mockery/mockery": "~0.9.4", "pda/pheanstalk": "~3.0", "phpunit/phpunit": "~4.1", "predis/predis": "~1.0", @@ -1007,7 +1104,8 @@ "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", "symfony/css-selector": "Required to use some of the crawler integration testing tools (2.8.*|3.0.*).", - "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*)." + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (2.8.*|3.0.*).", + "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." }, "type": "library", "extra": { @@ -1043,20 +1141,20 @@ "framework", "laravel" ], - "time": "2016-04-03 01:43:55" + "time": "2016-06-17 19:25:12" }, { "name": "laravel/socialite", - "version": "v2.0.15", + "version": "v2.0.18", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "edd00ab96933e3ef053533cce81e958fb26921af" + "reference": "76ee5397fcdea5a062361392abca4eb397e519a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/edd00ab96933e3ef053533cce81e958fb26921af", - "reference": "edd00ab96933e3ef053533cce81e958fb26921af", + "url": "https://api.github.com/repos/laravel/socialite/zipball/76ee5397fcdea5a062361392abca4eb397e519a3", + "reference": "76ee5397fcdea5a062361392abca4eb397e519a3", "shasum": "" }, "require": { @@ -1069,7 +1167,7 @@ }, "require-dev": { "mockery/mockery": "~0.9", - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.0|~5.0" }, "type": "library", "extra": { @@ -1097,20 +1195,20 @@ "laravel", "oauth" ], - "time": "2016-03-21 14:30:30" + "time": "2016-06-22 12:40:16" }, { "name": "league/flysystem", - "version": "1.0.20", + "version": "1.0.24", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "e87a786e3ae12a25cf78a71bb07b4b384bfaa83a" + "reference": "9aca859a303fdca30370f42b8c611d9cf0dedf4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e87a786e3ae12a25cf78a71bb07b4b384bfaa83a", - "reference": "e87a786e3ae12a25cf78a71bb07b4b384bfaa83a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9aca859a303fdca30370f42b8c611d9cf0dedf4b", + "reference": "9aca859a303fdca30370f42b8c611d9cf0dedf4b", "shasum": "" }, "require": { @@ -1180,20 +1278,20 @@ "sftp", "storage" ], - "time": "2016-03-14 21:54:11" + "time": "2016-06-03 19:11:39" }, { "name": "league/flysystem-aws-s3-v3", - "version": "1.0.9", + "version": "1.0.13", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "595e24678bf78f8107ebc9355d8376ae0eb712c6" + "reference": "dc56a8faf3aff0841f9eae04b6af94a50657896c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/595e24678bf78f8107ebc9355d8376ae0eb712c6", - "reference": "595e24678bf78f8107ebc9355d8376ae0eb712c6", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/dc56a8faf3aff0841f9eae04b6af94a50657896c", + "reference": "dc56a8faf3aff0841f9eae04b6af94a50657896c", "shasum": "" }, "require": { @@ -1227,7 +1325,7 @@ } ], "description": "Flysystem adapter for the AWS S3 SDK v3.x", - "time": "2015-11-19 08:44:16" + "time": "2016-06-21 21:34:35" }, { "name": "league/oauth1-client", @@ -1355,16 +1453,16 @@ }, { "name": "monolog/monolog", - "version": "1.18.2", + "version": "1.20.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "064b38c16790249488e7a8b987acf1c9d7383c09" + "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/064b38c16790249488e7a8b987acf1c9d7383c09", - "reference": "064b38c16790249488e7a8b987acf1c9d7383c09", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/55841909e2bcde01b5318c35f2b74f8ecc86e037", + "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037", "shasum": "" }, "require": { @@ -1383,8 +1481,8 @@ "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "~5.3" }, "suggest": { @@ -1396,9 +1494,9 @@ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { @@ -1429,7 +1527,7 @@ "logging", "psr-3" ], - "time": "2016-04-02 13:12:58" + "time": "2016-07-02 14:02:10" }, { "name": "mtdowling/cron-expression", @@ -1579,16 +1677,16 @@ }, { "name": "nikic/php-parser", - "version": "v2.0.1", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "ce5be709d59b32dd8a88c80259028759991a4206" + "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ce5be709d59b32dd8a88c80259028759991a4206", - "reference": "ce5be709d59b32dd8a88c80259028759991a4206", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/47b254ea51f1d6d5dc04b9b299e88346bf2369e3", + "reference": "47b254ea51f1d6d5dc04b9b299e88346bf2369e3", "shasum": "" }, "require": { @@ -1604,7 +1702,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -1626,7 +1724,7 @@ "parser", "php" ], - "time": "2016-02-28 19:48:28" + "time": "2016-04-19 13:41:41" }, { "name": "paragonie/random_compat", @@ -1710,74 +1808,25 @@ "homepage": "https://github.com/PhenX/php-font-lib", "time": "2014-02-01 15:22:28" }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "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": "2015-02-03 12:10:50" - }, { "name": "predis/predis", - "version": "v1.0.3", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/nrk/predis.git", - "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04" + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nrk/predis/zipball/84060b9034d756b4d79641667d7f9efe1aeb8e04", - "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04", + "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1", + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8" }, "suggest": { "ext-curl": "Allows access to Webdis when paired with phpiredis", @@ -1800,14 +1849,14 @@ "homepage": "http://clorophilla.net" } ], - "description": "Flexible and feature-complete PHP client library for Redis", + "description": "Flexible and feature-complete Redis client for PHP and HHVM", "homepage": "http://github.com/nrk/predis", "keywords": [ "nosql", "predis", "redis" ], - "time": "2015-07-30 18:34:15" + "time": "2016-06-16 16:22:20" }, { "name": "psr/http-message", @@ -1970,16 +2019,16 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.1", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" + "reference": "d8db871a54619458a805229a057ea2af33c753e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/d8db871a54619458a805229a057ea2af33c753e8", + "reference": "d8db871a54619458a805229a057ea2af33c753e8", "shasum": "" }, "require": { @@ -2019,20 +2068,20 @@ "mail", "mailer" ], - "time": "2015-06-06 14:19:39" + "time": "2016-05-01 08:45:47" }, { "name": "symfony/class-loader", - "version": "v3.0.4", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877" + "reference": "0d0ac77c336eb73f35bebdf3e1f3695ac741bbc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877", - "reference": "cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/0d0ac77c336eb73f35bebdf3e1f3695ac741bbc9", + "reference": "0d0ac77c336eb73f35bebdf3e1f3695ac741bbc9", "shasum": "" }, "require": { @@ -2048,7 +2097,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2075,20 +2124,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/console", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd" + "reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6b1175135bc2a74c08a28d89761272de8beed8cd", - "reference": "6b1175135bc2a74c08a28d89761272de8beed8cd", + "url": "https://api.github.com/repos/symfony/console/zipball/a7abb7153f6d1da47f87ec50274844e246b09d9f", + "reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f", "shasum": "" }, "require": { @@ -2135,20 +2184,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-03-16 17:00:50" + "time": "2016-06-29 07:02:21" }, { "name": "symfony/debug", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "a06d10888a45afd97534506afb058ec38d9ba35b" + "reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/a06d10888a45afd97534506afb058ec38d9ba35b", - "reference": "a06d10888a45afd97534506afb058ec38d9ba35b", + "url": "https://api.github.com/repos/symfony/debug/zipball/c54bc3539c3b87e86799533801e8ae0e971d78c2", + "reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2", "shasum": "" }, "require": { @@ -2192,20 +2241,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.0.4", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39" + "reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9002dcf018d884d294b1ef20a6f968efc1128f39", - "reference": "9002dcf018d884d294b1ef20a6f968efc1128f39", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7f9839ede2070f53e7e2f0849b9bd14748c434c5", + "reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5", "shasum": "" }, "require": { @@ -2225,7 +2274,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2252,20 +2301,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-03-10 10:34:12" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/finder", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c54e407b35bc098916704e9fd090da21da4c4f52" + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52", - "reference": "c54e407b35bc098916704e9fd090da21da4c4f52", + "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "shasum": "" }, "require": { @@ -2301,20 +2350,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-03-10 11:13:05" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/http-foundation", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "99f38445a874e7becb8afc4b4a79ee181cf6ec3f" + "reference": "1341139f906d295baa4f4abd55293d07e25a065a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/99f38445a874e7becb8afc4b4a79ee181cf6ec3f", - "reference": "99f38445a874e7becb8afc4b4a79ee181cf6ec3f", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1341139f906d295baa4f4abd55293d07e25a065a", + "reference": "1341139f906d295baa4f4abd55293d07e25a065a", "shasum": "" }, "require": { @@ -2354,20 +2403,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-03-27 14:50:32" + "time": "2016-06-29 07:02:21" }, { "name": "symfony/http-kernel", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "579f828489659d7b3430f4bd9b67b4618b387dea" + "reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/579f828489659d7b3430f4bd9b67b4618b387dea", - "reference": "579f828489659d7b3430f4bd9b67b4618b387dea", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/177b63b2d50b63fa6d82ea41359ed9928cc7a1fb", + "reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb", "shasum": "" }, "require": { @@ -2375,7 +2424,7 @@ "psr/log": "~1.0", "symfony/debug": "~2.8|~3.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0" + "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" }, "conflict": { "symfony/config": "<2.8" @@ -2436,20 +2485,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-03-25 01:41:20" + "time": "2016-06-30 16:30:17" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "1289d16209491b584839022f29257ad859b8532d" + "reference": "dff51f72b0706335131b00a7f49606168c582594" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", - "reference": "1289d16209491b584839022f29257ad859b8532d", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", "shasum": "" }, "require": { @@ -2461,7 +2510,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -2495,20 +2544,20 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-php56", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9" + "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/4d891fff050101a53a4caabb03277284942d1ad9", - "reference": "4d891fff050101a53a4caabb03277284942d1ad9", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", + "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", "shasum": "" }, "require": { @@ -2518,7 +2567,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -2551,20 +2600,20 @@ "portable", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/polyfill-util", - "version": "v1.1.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4" + "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", - "reference": "8de62801aa12bc4dfcf85eef5d21981ae7bb3cc4", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", + "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", "shasum": "" }, "require": { @@ -2573,7 +2622,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -2603,20 +2652,20 @@ "polyfill", "shim" ], - "time": "2016-01-20 09:13:37" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/process", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776" + "reference": "d7cde1f9d94d87060204f863779389b61c382eeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e6f1f98bbd355d209a992bfff45e7edfbd4a0776", - "reference": "e6f1f98bbd355d209a992bfff45e7edfbd4a0776", + "url": "https://api.github.com/repos/symfony/process/zipball/d7cde1f9d94d87060204f863779389b61c382eeb", + "reference": "d7cde1f9d94d87060204f863779389b61c382eeb", "shasum": "" }, "require": { @@ -2652,20 +2701,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/routing", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d061b609f2d0769494c381ec92f5c5cc5e4a20aa" + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d061b609f2d0769494c381ec92f5c5cc5e4a20aa", - "reference": "d061b609f2d0769494c381ec92f5c5cc5e4a20aa", + "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "shasum": "" }, "require": { @@ -2727,20 +2776,20 @@ "uri", "url" ], - "time": "2016-03-23 13:23:25" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/translation", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f7a07af51ea067745a521dab1e3152044a2fb1f2" + "reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f7a07af51ea067745a521dab1e3152044a2fb1f2", - "reference": "f7a07af51ea067745a521dab1e3152044a2fb1f2", + "url": "https://api.github.com/repos/symfony/translation/zipball/6bf844e1ee3c820c012386c10427a5c67bbefec8", + "reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8", "shasum": "" }, "require": { @@ -2791,20 +2840,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-03-25 01:41:20" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/var-dumper", - "version": "v3.0.4", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3841ed86527d18ee2c35fe4afb1b2fc60f8fae79" + "reference": "2f046e9a9d571f22cc8b26783564876713b06579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3841ed86527d18ee2c35fe4afb1b2fc60f8fae79", - "reference": "3841ed86527d18ee2c35fe4afb1b2fc60f8fae79", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2f046e9a9d571f22cc8b26783564876713b06579", + "reference": "2f046e9a9d571f22cc8b26783564876713b06579", "shasum": "" }, "require": { @@ -2854,32 +2903,32 @@ "debug", "dump" ], - "time": "2016-03-10 10:34:12" + "time": "2016-06-29 05:40:00" }, { "name": "vlucas/phpdotenv", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "9caf304153dc2288e4970caec6f1f3b3bc205412" + "reference": "9ca5644c536654e9509b9d257f53c58630eb2a6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/9caf304153dc2288e4970caec6f1f3b3bc205412", - "reference": "9caf304153dc2288e4970caec6f1f3b3bc205412", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/9ca5644c536654e9509b9d257f53c58630eb2a6a", + "reference": "9ca5644c536654e9509b9d257f53c58630eb2a6a", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.0" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -2889,7 +2938,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "BSD-3-Clause-Attribution" ], "authors": [ { @@ -2899,13 +2948,12 @@ } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", - "homepage": "http://github.com/vlucas/phpdotenv", "keywords": [ "dotenv", "env", "environment" ], - "time": "2015-12-29 15:10:30" + "time": "2016-06-14 14:14:52" } ], "packages-dev": [ @@ -2965,33 +3013,29 @@ }, { "name": "fzaninotto/faker", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "d0190b156bcca848d401fb80f31f504f37141c8d" + "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d0190b156bcca848d401fb80f31f504f37141c8d", - "reference": "d0190b156bcca848d401fb80f31f504f37141c8d", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", + "reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3|^7.0" }, "require-dev": { + "ext-intl": "*", "phpunit/phpunit": "~4.0", "squizlabs/php_codesniffer": "~1.5" }, - "suggest": { - "ext-intl": "*" - }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -3013,7 +3057,7 @@ "faker", "fixtures" ], - "time": "2015-05-29 06:29:14" + "time": "2016-04-29 12:21:54" }, { "name": "hamcrest/hamcrest-php", @@ -3062,16 +3106,16 @@ }, { "name": "mockery/mockery", - "version": "0.9.4", + "version": "0.9.5", "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "70bba85e4aabc9449626651f48b9018ede04f86b" + "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/70bba85e4aabc9449626651f48b9018ede04f86b", - "reference": "70bba85e4aabc9449626651f48b9018ede04f86b", + "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", + "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", "shasum": "" }, "require": { @@ -3123,7 +3167,153 @@ "test double", "testing" ], - "time": "2015-04-02 19:54:00" + "time": "2016-05-22 21:52:33" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-06-10 09:48:41" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" }, { "name": "phpspec/php-diff", @@ -3239,32 +3429,32 @@ }, { "name": "phpspec/prophecy", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -3297,7 +3487,7 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/php-code-coverage", @@ -3451,21 +3641,24 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ @@ -3488,7 +3681,7 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", @@ -3541,16 +3734,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.24", + "version": "4.8.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", + "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", "shasum": "" }, "require": { @@ -3564,7 +3757,7 @@ "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/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -3609,7 +3802,7 @@ "testing", "xunit" ], - "time": "2016-03-14 06:16:08" + "time": "2016-05-17 03:09:28" }, { "name": "phpunit/phpunit-mock-objects", @@ -3785,16 +3978,16 @@ }, { "name": "sebastian/environment", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { @@ -3831,20 +4024,20 @@ "environment", "hhvm" ], - "time": "2016-02-26 18:40:46" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -3852,12 +4045,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -3897,7 +4091,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -4040,16 +4234,16 @@ }, { "name": "symfony/css-selector", - "version": "v3.0.4", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0" + "reference": "2851e1932d77ce727776154d659b232d061e816a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/65e764f404685f2dc20c057e889b3ad04b2e2db0", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/2851e1932d77ce727776154d659b232d061e816a", + "reference": "2851e1932d77ce727776154d659b232d061e816a", "shasum": "" }, "require": { @@ -4058,7 +4252,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -4089,20 +4283,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/dom-crawler", - "version": "v3.0.4", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f" + "reference": "99ec4a23330fcd0c8667095f3ef7aa204ffd9dc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/18a06d7a9af41718c20764a674a0ebba3bc40d1f", - "reference": "18a06d7a9af41718c20764a674a0ebba3bc40d1f", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/99ec4a23330fcd0c8667095f3ef7aa204ffd9dc0", + "reference": "99ec4a23330fcd0c8667095f3ef7aa204ffd9dc0", "shasum": "" }, "require": { @@ -4118,7 +4312,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -4145,20 +4339,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-03-23 13:23:25" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/yaml", - "version": "v3.0.4", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0047c8366744a16de7516622c5b7355336afae96" + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", - "reference": "0047c8366744a16de7516622c5b7355336afae96", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", "shasum": "" }, "require": { @@ -4167,7 +4361,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -4194,7 +4388,56 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-06-29 05:41:56" + }, + { + "name": "webmozart/assert", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2015-08-24 13:29:44" } ], "aliases": [], diff --git a/resources/assets/sass/_pages.scss b/resources/assets/sass/_pages.scss old mode 100644 new mode 100755 index 49b701dda..2a27fadb9 --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@ -60,6 +60,18 @@ word-break: break-word; hyphens: auto; } + + // diffs + .diff-html-removed, + .diff-html-added { + text-decoration: none; + } + .diff-html-added { + background: rgba(45, 255, 0, 0.2); + } + .diff-html-removed { + background: rgba(255, 0, 0, 0.2); + } } // Page content pointers diff --git a/resources/views/pages/page-display.blade.php b/resources/views/pages/page-display.blade.php index d0bdcf880..17ac115b8 100644 --- a/resources/views/pages/page-display.blade.php +++ b/resources/views/pages/page-display.blade.php @@ -18,5 +18,9 @@
- {!! $page->html !!} + @if (isset($diff) && $diff) + {!! $diff !!} + @else + {!! $page->html !!} + @endif \ No newline at end of file From c279c6e2af60274871a5e2d3082e8cae444ece18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Youn=C3=A8s=20EL=20BIACHE?= Date: Sun, 10 Jul 2016 11:53:37 +0200 Subject: [PATCH 02/32] replace GPL diff lib with MIT lib replace gpl lib with mit lib --- app/Http/Controllers/PageController.php | 7 +- composer.json | 4 +- composer.lock | 192 ++++++++++++++++++------ resources/assets/sass/_pages.scss | 12 +- 4 files changed, 158 insertions(+), 57 deletions(-) diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 1844e0c0c..fc71292e0 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -12,7 +12,7 @@ use BookStack\Repos\ChapterRepo; use BookStack\Repos\PageRepo; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Views; -use Icap\HtmlDiff\HtmlDiff; +use GatherContent\Htmldiff\Htmldiff; class PageController extends Controller { @@ -334,9 +334,8 @@ class PageController extends Controller $page = $this->pageRepo->getBySlug($pageSlug, $book->id); $revision = $this->pageRepo->getRevisionById($revisionId); - $next = $revision->getNext() ?: $page; - $htmlDiff = new HtmlDiff($revision->html, $next->html, true); - $diff = $htmlDiff->outputDiff()->toString(); + $next = $revision->getNext() ?: $page; + $diff = (new Htmldiff)->diff($revision->html, $next->html); $page->fill($revision->toArray()); $this->setPageTitle('Page Revision For ' . $page->getShortName()); diff --git a/composer.json b/composer.json index 41f1ada5d..d1f99a8f3 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,8 @@ "type": "project", "require": { "php": ">=5.5.9", + "ext-tidy": "*", + "laravel/framework": "5.2.*", "intervention/image": "^2.3", "laravel/socialite": "^2.0", @@ -14,7 +16,7 @@ "league/flysystem-aws-s3-v3": "^1.0", "barryvdh/laravel-dompdf": "0.6.*", "predis/predis": "^1.0", - "icap/html-diff": "^1.1" + "gathercontent/htmldiff": "^0.2.1" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/composer.lock b/composer.lock index f97aeb992..98fb86ce5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "3d8e2dfddefb412055d28ffc922969fd", - "content-hash": "7658fea0b4df71cf7b97bcdf8a29b9eb", + "hash": "097beaeb7ce90384b824d65d9dd36520", + "content-hash": "233ce3d93ee0c9b005c263ff1449ae0f", "packages": [ { "name": "aws/aws-sdk-php", @@ -358,6 +358,57 @@ ], "time": "2015-11-09 22:51:51" }, + { + "name": "cogpowered/finediff", + "version": "0.3.1", + "source": { + "type": "git", + "url": "https://github.com/cogpowered/FineDiff.git", + "reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cogpowered/FineDiff/zipball/339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8", + "reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "mockery/mockery": "*", + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "psr-0": { + "cogpowered\\FineDiff": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rob Crowe", + "email": "rob@cogpowered.com" + }, + { + "name": "Raymond Hill" + } + ], + "description": "PHP implementation of a Fine granularity Diff engine", + "homepage": "https://github.com/cogpowered/FineDiff", + "keywords": [ + "diff", + "finediff", + "opcode", + "string", + "text" + ], + "time": "2014-05-19 10:25:02" + }, { "name": "dnoegel/php-xdg-base-dir", "version": "0.1", @@ -499,6 +550,55 @@ "homepage": "https://github.com/dompdf/dompdf", "time": "2015-12-07 04:07:13" }, + { + "name": "gathercontent/htmldiff", + "version": "0.2.1", + "source": { + "type": "git", + "url": "https://github.com/gathercontent/htmldiff.git", + "reference": "24674a62315f64330134b4a4c5b01a7b59193c93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gathercontent/htmldiff/zipball/24674a62315f64330134b4a4c5b01a7b59193c93", + "reference": "24674a62315f64330134b4a4c5b01a7b59193c93", + "shasum": "" + }, + "require": { + "cogpowered/finediff": "0.3.1", + "ext-tidy": "*" + }, + "require-dev": { + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "GatherContent\\Htmldiff": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrew Cairns", + "email": "andrew@gathercontent.com" + }, + { + "name": "Mathew Chapman", + "email": "mat@gathercontent.com" + }, + { + "name": "Peter Legierski", + "email": "peter@gathercontent.com" + } + ], + "description": "Compare two HTML strings", + "time": "2015-04-15 15:39:46" + }, { "name": "guzzle/guzzle", "version": "v3.8.1", @@ -763,50 +863,6 @@ ], "time": "2016-06-24 23:00:38" }, - { - "name": "icap/html-diff", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/iCAPLyon1/HtmlDiff.git", - "reference": "f58ddb196292ae585a2efb7692653d015ecc436f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f", - "reference": "f58ddb196292ae585a2efb7692653d015ecc436f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff" - } - }, - "notification-url": "https://packagist.org/downloads/", - "authors": [ - { - "name": "Panagiotis Tsavdaris", - "email": "ptsavdar@gmail.com" - }, - { - "name": "ICAP development team", - "homepage": "https://github.com/iCAPLyon1" - } - ], - "description": "A PHP5 library that diffs (compares) HTML files.", - "keywords": [ - "daisy diff", - "html diff" - ], - "time": "2016-02-17 16:35:09" - }, { "name": "intervention/image", "version": "2.3.7", @@ -3104,6 +3160,50 @@ ], "time": "2015-05-11 14:41:42" }, + { + "name": "icap/html-diff", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/iCAPLyon1/HtmlDiff.git", + "reference": "f58ddb196292ae585a2efb7692653d015ecc436f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f", + "reference": "f58ddb196292ae585a2efb7692653d015ecc436f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff" + } + }, + "notification-url": "https://packagist.org/downloads/", + "authors": [ + { + "name": "Panagiotis Tsavdaris", + "email": "ptsavdar@gmail.com" + }, + { + "name": "ICAP development team", + "homepage": "https://github.com/iCAPLyon1" + } + ], + "description": "A PHP5 library that diffs (compares) HTML files.", + "keywords": [ + "daisy diff", + "html diff" + ], + "time": "2016-02-17 16:35:09" + }, { "name": "mockery/mockery", "version": "0.9.5", diff --git a/resources/assets/sass/_pages.scss b/resources/assets/sass/_pages.scss index 2a27fadb9..562bc9a47 100755 --- a/resources/assets/sass/_pages.scss +++ b/resources/assets/sass/_pages.scss @@ -62,15 +62,15 @@ } // diffs - .diff-html-removed, - .diff-html-added { + ins, + del { text-decoration: none; } - .diff-html-added { - background: rgba(45, 255, 0, 0.2); + ins { + background: #dbffdb; } - .diff-html-removed { - background: rgba(255, 0, 0, 0.2); + del { + background: #FFECEC; } } From 42d8e9e5bda57a26bbaa3f6e4a9e4e5f94a341e7 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 29 Sep 2016 09:13:15 +0100 Subject: [PATCH 03/32] Improved numeric term search capabilities Prevented a quoted term also being added to fuzzy searches and also added check to see if the term is numeric to check if an exact match is required. Closes #200 --- app/Entity.php | 67 +++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/app/Entity.php b/app/Entity.php index 496d20a33..8a15b5aa4 100644 --- a/app/Entity.php +++ b/app/Entity.php @@ -160,44 +160,49 @@ class Entity extends Ownable public function fullTextSearchQuery($fieldsToSearch, $terms, $wheres = []) { $exactTerms = []; - if (count($terms) === 0) { - $search = $this; - $orderBy = 'updated_at'; - } else { - foreach ($terms as $key => $term) { - $term = htmlentities($term, ENT_QUOTES); - $term = preg_replace('/[+\-><\(\)~*\"@]+/', ' ', $term); - if (preg_match('/".*?"/', $term)) { - $term = str_replace('"', '', $term); - $exactTerms[] = '%' . $term . '%'; - $term = '"' . $term . '"'; - } else { - $term = '' . $term . '*'; - } - if ($term !== '*') $terms[$key] = $term; - } - $termString = implode(' ', $terms); - $fields = implode(',', $fieldsToSearch); - $search = static::selectRaw('*, MATCH(name) AGAINST(? IN BOOLEAN MODE) AS title_relevance', [$termString]); - $search = $search->whereRaw('MATCH(' . $fields . ') AGAINST(? IN BOOLEAN MODE)', [$termString]); + $fuzzyTerms = []; + $search = static::newQuery(); - // Ensure at least one exact term matches if in search - if (count($exactTerms) > 0) { - $search = $search->where(function ($query) use ($exactTerms, $fieldsToSearch) { - foreach ($exactTerms as $exactTerm) { - foreach ($fieldsToSearch as $field) { - $query->orWhere($field, 'like', $exactTerm); - } - } - }); + foreach ($terms as $key => $term) { + $term = htmlentities($term, ENT_QUOTES); + $term = preg_replace('/[+\-><\(\)~*\"@]+/', ' ', $term); + if (preg_match('/".*?"/', $term) || is_numeric($term)) { + $term = str_replace('"', '', $term); + $exactTerms[] = '%' . $term . '%'; + } else { + $term = '' . $term . '*'; + if ($term !== '*') $fuzzyTerms[] = $term; } - $orderBy = 'title_relevance'; - }; + } + + $isFuzzy = count($exactTerms) === 0 || count($fuzzyTerms) > 0; + + // Perform fulltext search if relevant terms exist. + if ($isFuzzy) { + $termString = implode(' ', $fuzzyTerms); + $fields = implode(',', $fieldsToSearch); + $search = $search->selectRaw('*, MATCH(name) AGAINST(? IN BOOLEAN MODE) AS title_relevance', [$termString]); + $search = $search->whereRaw('MATCH(' . $fields . ') AGAINST(? IN BOOLEAN MODE)', [$termString]); + } + + // Ensure at least one exact term matches if in search + if (count($exactTerms) > 0) { + $search = $search->where(function ($query) use ($exactTerms, $fieldsToSearch) { + foreach ($exactTerms as $exactTerm) { + foreach ($fieldsToSearch as $field) { + $query->orWhere($field, 'like', $exactTerm); + } + } + }); + } + + $orderBy = $isFuzzy ? 'title_relevance' : 'updated_at'; // Add additional where terms foreach ($wheres as $whereTerm) { $search->where($whereTerm[0], $whereTerm[1], $whereTerm[2]); } + // Load in relations if ($this->isA('page')) { $search = $search->with('book', 'chapter', 'createdBy', 'updatedBy'); From f15cc5bdfad7ce729e61abbd14ebc2807d7bb651 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 29 Sep 2016 10:10:46 +0100 Subject: [PATCH 04/32] Separated revision preview and diff & fixed chosen diff html Closes #8 --- app/Http/Controllers/PageController.php | 29 ++++++++++++++++++++--- app/PageRevision.php | 26 ++++++++------------ app/Repos/PageRepo.php | 2 +- resources/views/pages/revisions.blade.php | 23 ++++++++++-------- routes/web.php | 1 + 5 files changed, 51 insertions(+), 30 deletions(-) diff --git a/app/Http/Controllers/PageController.php b/app/Http/Controllers/PageController.php index 6081d1b27..033377a4d 100644 --- a/app/Http/Controllers/PageController.php +++ b/app/Http/Controllers/PageController.php @@ -336,13 +336,36 @@ class PageController extends Controller $book = $this->bookRepo->getBySlug($bookSlug); $page = $this->pageRepo->getBySlug($pageSlug, $book->id); $revision = $this->pageRepo->getRevisionById($revisionId); - - $next = $revision->getNext() ?: $page; - $diff = (new Htmldiff)->diff($revision->html, $next->html); $page->fill($revision->toArray()); $this->setPageTitle('Page Revision For ' . $page->getShortName()); + return view('pages/revision', [ + 'page' => $page, + 'book' => $book, + ]); + } + + /** + * Shows the changes of a single revision + * @param string $bookSlug + * @param string $pageSlug + * @param int $revisionId + * @return \Illuminate\View\View + */ + public function showRevisionChanges($bookSlug, $pageSlug, $revisionId) + { + $book = $this->bookRepo->getBySlug($bookSlug); + $page = $this->pageRepo->getBySlug($pageSlug, $book->id); + $revision = $this->pageRepo->getRevisionById($revisionId); + + $prev = $revision->getPrevious(); + $prevContent = ($prev === null) ? '' : $prev->html; + $diff = (new Htmldiff)->diff($prevContent, $revision->html); + + $page->fill($revision->toArray()); + $this->setPageTitle('Page Revision For ' . $page->getShortName()); + return view('pages/revision', [ 'page' => $page, 'book' => $book, diff --git a/app/PageRevision.php b/app/PageRevision.php index e5721f5aa..ff469f0ed 100644 --- a/app/PageRevision.php +++ b/app/PageRevision.php @@ -25,32 +25,26 @@ class PageRevision extends Model /** * Get the url for this revision. + * @param null|string $path * @return string */ - public function getUrl() + public function getUrl($path = null) { - return $this->page->getUrl() . '/revisions/' . $this->id; + $url = $this->page->getUrl() . '/revisions/' . $this->id; + if ($path) return $url . '/' . trim($path, '/'); + return $url; } /** - * Get previous revision - * @return \BookStack\PageRevision + * Get the previous revision for the same page if existing + * @return \BookStack\PageRevision|null */ public function getPrevious() { - if ($id = PageRevision::where('id', '<', $this->id)->max('id')) { - return PageRevision::find($id); + if ($id = static::where('page_id', '=', $this->page_id)->where('id', '<', $this->id)->max('id')) { + return static::find($id); } + return null; } - /** - * Get next revision - * @return \BookStack\PageRevision - */ - public function getNext() - { - if ($id = PageRevision::where('id', '>', $this->id)->min('id')) { - return PageRevision::find($id); - } - } } diff --git a/app/Repos/PageRepo.php b/app/Repos/PageRepo.php index c64da1267..93ff61b62 100644 --- a/app/Repos/PageRepo.php +++ b/app/Repos/PageRepo.php @@ -548,7 +548,7 @@ class PageRepo extends EntityRepo /** * Gets a single revision via it's id. * @param $id - * @return mixed + * @return PageRevision */ public function getRevisionById($id) { diff --git a/resources/views/pages/revisions.blade.php b/resources/views/pages/revisions.blade.php index 926affffc..720e34fea 100644 --- a/resources/views/pages/revisions.blade.php +++ b/resources/views/pages/revisions.blade.php @@ -32,11 +32,11 @@ - - + + - + @foreach($page->revisions as $index => $revision) @@ -49,15 +49,18 @@ - @if ($index !== 0) - - @else - - @endif + Restore + @endif + @endforeach
NameCreated ByNameCreated By Revision Date ChangelogActionsActions
@if($revision->createdBy) {{ $revision->createdBy->name }} @else Deleted User @endif {{ $revision->created_at->format('jS F, Y H:i:s') }}
({{ $revision->created_at->diffForHumans() }})
{{ $revision->summary }} + + Changes +  |  + + @if ($index === 0) + Current Version + @else Preview  |  - Restore - Current Version
diff --git a/routes/web.php b/routes/web.php index 58ceb5f3b..c3fe503d1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -47,6 +47,7 @@ Route::group(['middleware' => 'auth'], function () { // Revisions Route::get('/{bookSlug}/page/{pageSlug}/revisions', 'PageController@showRevisions'); Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', 'PageController@showRevision'); + Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', 'PageController@showRevisionChanges'); Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', 'PageController@restoreRevision'); // Chapters From 771626b6ecb97158d5903536726431e2b594f783 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Thu, 29 Sep 2016 12:43:46 +0100 Subject: [PATCH 05/32] Started work on making the public role/user configurable Create a new 'public' guest user and made the public role visible on role setting screens. --- app/Http/Controllers/ChapterController.php | 2 +- app/Http/Controllers/Controller.php | 11 ++-- app/Http/Controllers/UserController.php | 9 +-- app/Repos/BookRepo.php | 6 +- app/Repos/ChapterRepo.php | 4 +- app/Repos/EntityRepo.php | 3 +- app/Repos/PageRepo.php | 14 ++-- app/Repos/PermissionsRepo.php | 6 +- app/Repos/UserRepo.php | 6 +- app/Services/ActivityService.php | 2 +- app/Services/ImageService.php | 4 +- app/Services/PermissionService.php | 2 +- app/Services/SocialAuthService.php | 6 +- app/Services/ViewService.php | 4 +- app/User.php | 20 ++++-- app/helpers.php | 12 +++- .../2016_09_29_101449_remove_hidden_roles.php | 66 +++++++++++++++++++ resources/views/settings/index.blade.php | 2 +- resources/views/users/forms/system.blade.php | 25 +++++++ 19 files changed, 156 insertions(+), 48 deletions(-) create mode 100644 database/migrations/2016_09_29_101449_remove_hidden_roles.php create mode 100644 resources/views/users/forms/system.blade.php diff --git a/app/Http/Controllers/ChapterController.php b/app/Http/Controllers/ChapterController.php index 03ec2c110..57ca58beb 100644 --- a/app/Http/Controllers/ChapterController.php +++ b/app/Http/Controllers/ChapterController.php @@ -117,7 +117,7 @@ class ChapterController extends Controller $this->checkOwnablePermission('chapter-update', $chapter); $chapter->fill($request->all()); $chapter->slug = $this->chapterRepo->findSuitableSlug($chapter->name, $book->id, $chapter->id); - $chapter->updated_by = auth()->user()->id; + $chapter->updated_by = user()->id; $chapter->save(); Activity::add($chapter, 'chapter_update', $book->id); return redirect($chapter->getUrl()); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 43292d941..2dabc417b 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -33,17 +33,16 @@ abstract class Controller extends BaseController $this->middleware(function ($request, $next) { // Get a user instance for the current user - $user = auth()->user(); - if (!$user) $user = User::getDefault(); - - // Share variables with views - view()->share('signedIn', auth()->check()); - view()->share('currentUser', $user); + $user = user(); // Share variables with controllers $this->currentUser = $user; $this->signedIn = auth()->check(); + // Share variables with views + view()->share('signedIn', $this->signedIn); + view()->share('currentUser', $user); + return $next($request); }); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 4c56516dc..51c5d25bb 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -57,7 +57,7 @@ class UserController extends Controller { $this->checkPermission('users-manage'); $authMethod = config('auth.method'); - $roles = $this->userRepo->getAssignableRoles(); + $roles = $this->userRepo->getAllRoles(); return view('users/create', ['authMethod' => $authMethod, 'roles' => $roles]); } @@ -126,12 +126,13 @@ class UserController extends Controller return $this->currentUser->id == $id; }); - $authMethod = config('auth.method'); - $user = $this->user->findOrFail($id); + + $authMethod = ($user->system_name) ? 'system' : config('auth.method'); + $activeSocialDrivers = $socialAuthService->getActiveDrivers(); $this->setPageTitle('User Profile'); - $roles = $this->userRepo->getAssignableRoles(); + $roles = $this->userRepo->getAllRoles(); return view('users/edit', ['user' => $user, 'activeSocialDrivers' => $activeSocialDrivers, 'authMethod' => $authMethod, 'roles' => $roles]); } diff --git a/app/Repos/BookRepo.php b/app/Repos/BookRepo.php index fdc4dd8d4..1af02035d 100644 --- a/app/Repos/BookRepo.php +++ b/app/Repos/BookRepo.php @@ -132,8 +132,8 @@ class BookRepo extends EntityRepo { $book = $this->book->newInstance($input); $book->slug = $this->findSuitableSlug($book->name); - $book->created_by = auth()->user()->id; - $book->updated_by = auth()->user()->id; + $book->created_by = user()->id; + $book->updated_by = user()->id; $book->save(); $this->permissionService->buildJointPermissionsForEntity($book); return $book; @@ -149,7 +149,7 @@ class BookRepo extends EntityRepo { $book->fill($input); $book->slug = $this->findSuitableSlug($book->name, $book->id); - $book->updated_by = auth()->user()->id; + $book->updated_by = user()->id; $book->save(); $this->permissionService->buildJointPermissionsForEntity($book); return $book; diff --git a/app/Repos/ChapterRepo.php b/app/Repos/ChapterRepo.php index c12a9f0f2..96f5b2d1e 100644 --- a/app/Repos/ChapterRepo.php +++ b/app/Repos/ChapterRepo.php @@ -98,8 +98,8 @@ class ChapterRepo extends EntityRepo { $chapter = $this->chapter->newInstance($input); $chapter->slug = $this->findSuitableSlug($chapter->name, $book->id); - $chapter->created_by = auth()->user()->id; - $chapter->updated_by = auth()->user()->id; + $chapter->created_by = user()->id; + $chapter->updated_by = user()->id; $chapter = $book->chapters()->save($chapter); $this->permissionService->buildJointPermissionsForEntity($chapter); return $chapter; diff --git a/app/Repos/EntityRepo.php b/app/Repos/EntityRepo.php index c94601738..42b0b6b7b 100644 --- a/app/Repos/EntityRepo.php +++ b/app/Repos/EntityRepo.php @@ -132,9 +132,8 @@ class EntityRepo */ public function getUserDraftPages($count = 20, $page = 0) { - $user = auth()->user(); return $this->page->where('draft', '=', true) - ->where('created_by', '=', $user->id) + ->where('created_by', '=', user()->id) ->orderBy('updated_at', 'desc') ->skip($count * $page)->take($count)->get(); } diff --git a/app/Repos/PageRepo.php b/app/Repos/PageRepo.php index 93ff61b62..537dd9bd0 100644 --- a/app/Repos/PageRepo.php +++ b/app/Repos/PageRepo.php @@ -148,8 +148,8 @@ class PageRepo extends EntityRepo { $page = $this->page->newInstance(); $page->name = 'New Page'; - $page->created_by = auth()->user()->id; - $page->updated_by = auth()->user()->id; + $page->created_by = user()->id; + $page->updated_by = user()->id; $page->draft = true; if ($chapter) $page->chapter_id = $chapter->id; @@ -330,7 +330,7 @@ class PageRepo extends EntityRepo } // Update with new details - $userId = auth()->user()->id; + $userId = user()->id; $page->fill($input); $page->html = $this->formatHtml($input['html']); $page->text = strip_tags($page->html); @@ -363,7 +363,7 @@ class PageRepo extends EntityRepo $page->fill($revision->toArray()); $page->slug = $this->findSuitableSlug($page->name, $book->id, $page->id); $page->text = strip_tags($page->html); - $page->updated_by = auth()->user()->id; + $page->updated_by = user()->id; $page->save(); return $page; } @@ -381,7 +381,7 @@ class PageRepo extends EntityRepo $revision->page_id = $page->id; $revision->slug = $page->slug; $revision->book_slug = $page->book->slug; - $revision->created_by = auth()->user()->id; + $revision->created_by = user()->id; $revision->created_at = $page->updated_at; $revision->type = 'version'; $revision->summary = $summary; @@ -404,7 +404,7 @@ class PageRepo extends EntityRepo */ public function saveUpdateDraft(Page $page, $data = []) { - $userId = auth()->user()->id; + $userId = user()->id; $drafts = $this->userUpdateDraftsQuery($page, $userId)->get(); if ($drafts->count() > 0) { @@ -535,7 +535,7 @@ class PageRepo extends EntityRepo $query = $this->pageRevision->where('type', '=', 'update_draft') ->where('page_id', '=', $page->id) ->where('updated_at', '>', $page->updated_at) - ->where('created_by', '!=', auth()->user()->id) + ->where('created_by', '!=', user()->id) ->with('createdBy'); if ($minRange !== null) { diff --git a/app/Repos/PermissionsRepo.php b/app/Repos/PermissionsRepo.php index e026d83e8..24497c911 100644 --- a/app/Repos/PermissionsRepo.php +++ b/app/Repos/PermissionsRepo.php @@ -35,7 +35,7 @@ class PermissionsRepo */ public function getAllRoles() { - return $this->role->where('hidden', '=', false)->get(); + return $this->role->all(); } /** @@ -45,7 +45,7 @@ class PermissionsRepo */ public function getAllRolesExcept(Role $role) { - return $this->role->where('id', '!=', $role->id)->where('hidden', '=', false)->get(); + return $this->role->where('id', '!=', $role->id)->get(); } /** @@ -90,8 +90,6 @@ class PermissionsRepo { $role = $this->role->findOrFail($roleId); - if ($role->hidden) throw new PermissionsException("Cannot update a hidden role"); - $permissions = isset($roleData['permissions']) ? array_keys($roleData['permissions']) : []; $this->assignRolePermissions($role, $permissions); diff --git a/app/Repos/UserRepo.php b/app/Repos/UserRepo.php index 127db9fb5..ab3716fca 100644 --- a/app/Repos/UserRepo.php +++ b/app/Repos/UserRepo.php @@ -199,9 +199,9 @@ class UserRepo * Get the roles in the system that are assignable to a user. * @return mixed */ - public function getAssignableRoles() + public function getAllRoles() { - return $this->role->visible(); + return $this->role->all(); } /** @@ -211,7 +211,7 @@ class UserRepo */ public function getRestrictableRoles() { - return $this->role->where('hidden', '=', false)->where('system_name', '=', '')->get(); + return $this->role->where('system_name', '!=', 'admin')->get(); } } \ No newline at end of file diff --git a/app/Services/ActivityService.php b/app/Services/ActivityService.php index f6fea33a1..e41036238 100644 --- a/app/Services/ActivityService.php +++ b/app/Services/ActivityService.php @@ -19,7 +19,7 @@ class ActivityService { $this->activity = $activity; $this->permissionService = $permissionService; - $this->user = auth()->user(); + $this->user = user(); } /** diff --git a/app/Services/ImageService.php b/app/Services/ImageService.php index aa1375487..a56626246 100644 --- a/app/Services/ImageService.php +++ b/app/Services/ImageService.php @@ -108,8 +108,8 @@ class ImageService 'uploaded_to' => $uploadedTo ]; - if (auth()->user() && auth()->user()->id !== 0) { - $userId = auth()->user()->id; + if (user()->id !== 0) { + $userId = user()->id; $imageDetails['created_by'] = $userId; $imageDetails['updated_by'] = $userId; } diff --git a/app/Services/PermissionService.php b/app/Services/PermissionService.php index 341a69edb..bb78f0b0a 100644 --- a/app/Services/PermissionService.php +++ b/app/Services/PermissionService.php @@ -614,7 +614,7 @@ class PermissionService private function currentUser() { if ($this->currentUserModel === false) { - $this->currentUserModel = auth()->user() ? auth()->user() : new User(); + $this->currentUserModel = user(); } return $this->currentUserModel; diff --git a/app/Services/SocialAuthService.php b/app/Services/SocialAuthService.php index b28a97ea4..d76a7231b 100644 --- a/app/Services/SocialAuthService.php +++ b/app/Services/SocialAuthService.php @@ -100,7 +100,7 @@ class SocialAuthService $socialAccount = $this->socialAccount->where('driver_id', '=', $socialId)->first(); $user = $this->userRepo->getByEmail($socialUser->getEmail()); $isLoggedIn = auth()->check(); - $currentUser = auth()->user(); + $currentUser = user(); // When a user is not logged in and a matching SocialAccount exists, // Simply log the user into the application. @@ -214,9 +214,9 @@ class SocialAuthService public function detachSocialAccount($socialDriver) { session(); - auth()->user()->socialAccounts()->where('driver', '=', $socialDriver)->delete(); + user()->socialAccounts()->where('driver', '=', $socialDriver)->delete(); session()->flash('success', title_case($socialDriver) . ' account successfully detached'); - return redirect(auth()->user()->getEditUrl()); + return redirect(user()->getEditUrl()); } } \ No newline at end of file diff --git a/app/Services/ViewService.php b/app/Services/ViewService.php index aac9831f7..1a9ee5f70 100644 --- a/app/Services/ViewService.php +++ b/app/Services/ViewService.php @@ -18,7 +18,7 @@ class ViewService public function __construct(View $view, PermissionService $permissionService) { $this->view = $view; - $this->user = auth()->user(); + $this->user = user(); $this->permissionService = $permissionService; } @@ -84,7 +84,7 @@ class ViewService ->filterRestrictedEntityRelations($this->view, 'views', 'viewable_id', 'viewable_type'); if ($filterModel) $query = $query->where('viewable_type', '=', get_class($filterModel)); - $query = $query->where('user_id', '=', auth()->user()->id); + $query = $query->where('user_id', '=', user()->id); $viewables = $query->with('viewable')->orderBy('updated_at', 'desc') ->skip($count * $page)->take($count)->get()->pluck('viewable'); diff --git a/app/User.php b/app/User.php index 8c39d81be..09b189cbb 100644 --- a/app/User.php +++ b/app/User.php @@ -5,6 +5,7 @@ use Illuminate\Auth\Authenticatable; use Illuminate\Auth\Passwords\CanResetPassword; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Notifications\Notifiable; class User extends Model implements AuthenticatableContract, CanResetPasswordContract @@ -36,21 +37,30 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon protected $permissions; /** - * Returns a default guest user. + * Returns the default public user. + * @return User */ public static function getDefault() { - return new static([ - 'email' => 'guest', - 'name' => 'Guest' - ]); + return static::where('system_name', '=', 'public')->first(); + } + + /** + * Check if the user is the default public user. + * @return bool + */ + public function isDefault() + { + return $this->system_name === 'public'; } /** * The roles that belong to the user. + * @return BelongsToMany */ public function roles() { + if ($this->id === 0) return ; return $this->belongsToMany(Role::class); } diff --git a/app/helpers.php b/app/helpers.php index dd835fbf6..ad1c7dd20 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -36,6 +36,16 @@ function versioned_asset($file = '') throw new InvalidArgumentException("File {$file} not defined in asset manifest."); } +/** + * Helper method to get the current User. + * Defaults to public 'Guest' user if not logged in. + * @return \BookStack\User + */ +function user() +{ + return auth()->user() ?: \BookStack\User::getDefault(); +} + /** * Check if the current user has a permission. * If an ownable element is passed in the jointPermissions are checked against @@ -47,7 +57,7 @@ function versioned_asset($file = '') function userCan($permission, Ownable $ownable = null) { if ($ownable === null) { - return auth()->user() && auth()->user()->can($permission); + return user() && user()->can($permission); } // Check permission on ownable item diff --git a/database/migrations/2016_09_29_101449_remove_hidden_roles.php b/database/migrations/2016_09_29_101449_remove_hidden_roles.php new file mode 100644 index 000000000..f666cad2c --- /dev/null +++ b/database/migrations/2016_09_29_101449_remove_hidden_roles.php @@ -0,0 +1,66 @@ +dropColumn('hidden'); + }); + + // Add column to mark system users + Schema::table('users', function(Blueprint $table) { + $table->string('system_name')->nullable()->index(); + }); + + // Insert our new public system user. + $publicUserId = DB::table('users')->insertGetId([ + 'email' => 'guest@example.com', + 'name' => 'Guest', + 'system_name' => 'public', + 'email_confirmed' => true, + 'created_at' => \Carbon\Carbon::now(), + 'updated_at' => \Carbon\Carbon::now(), + ]); + + // Get the public role + $publicRole = DB::table('roles')->where('system_name', '=', 'public')->first(); + + // Connect the new public user to the public role + DB::table('role_user')->insert([ + 'user_id' => $publicUserId, + 'role_id' => $publicRole->id + ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('roles', function(Blueprint $table) { + $table->boolean('hidden')->default(false); + $table->index('hidden'); + }); + + DB::table('users')->where('system_name', '=', 'public')->delete(); + + Schema::table('users', function(Blueprint $table) { + $table->dropColumn('system_name'); + }); + + DB::table('roles')->where('system_name', '=', 'public')->update(['hidden' => true]); + } +} diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index 757729763..ac25eb3b5 100644 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -79,7 +79,7 @@