Younès EL BIACHE

replace GPL diff lib with MIT lib

replace gpl lib with mit lib
...@@ -12,7 +12,7 @@ use BookStack\Repos\ChapterRepo; ...@@ -12,7 +12,7 @@ use BookStack\Repos\ChapterRepo;
12 use BookStack\Repos\PageRepo; 12 use BookStack\Repos\PageRepo;
13 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 13 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
14 use Views; 14 use Views;
15 -use Icap\HtmlDiff\HtmlDiff; 15 +use GatherContent\Htmldiff\Htmldiff;
16 16
17 class PageController extends Controller 17 class PageController extends Controller
18 { 18 {
...@@ -334,9 +334,8 @@ class PageController extends Controller ...@@ -334,9 +334,8 @@ class PageController extends Controller
334 $page = $this->pageRepo->getBySlug($pageSlug, $book->id); 334 $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
335 $revision = $this->pageRepo->getRevisionById($revisionId); 335 $revision = $this->pageRepo->getRevisionById($revisionId);
336 336
337 - $next = $revision->getNext() ?: $page; 337 + $next = $revision->getNext() ?: $page;
338 - $htmlDiff = new HtmlDiff($revision->html, $next->html, true); 338 + $diff = (new Htmldiff)->diff($revision->html, $next->html);
339 - $diff = $htmlDiff->outputDiff()->toString();
340 339
341 $page->fill($revision->toArray()); 340 $page->fill($revision->toArray());
342 $this->setPageTitle('Page Revision For ' . $page->getShortName()); 341 $this->setPageTitle('Page Revision For ' . $page->getShortName());
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
6 "type": "project", 6 "type": "project",
7 "require": { 7 "require": {
8 "php": ">=5.5.9", 8 "php": ">=5.5.9",
9 + "ext-tidy": "*",
10 +
9 "laravel/framework": "5.2.*", 11 "laravel/framework": "5.2.*",
10 "intervention/image": "^2.3", 12 "intervention/image": "^2.3",
11 "laravel/socialite": "^2.0", 13 "laravel/socialite": "^2.0",
...@@ -14,7 +16,7 @@ ...@@ -14,7 +16,7 @@
14 "league/flysystem-aws-s3-v3": "^1.0", 16 "league/flysystem-aws-s3-v3": "^1.0",
15 "barryvdh/laravel-dompdf": "0.6.*", 17 "barryvdh/laravel-dompdf": "0.6.*",
16 "predis/predis": "^1.0", 18 "predis/predis": "^1.0",
17 - "icap/html-diff": "^1.1" 19 + "gathercontent/htmldiff": "^0.2.1"
18 }, 20 },
19 "require-dev": { 21 "require-dev": {
20 "fzaninotto/faker": "~1.4", 22 "fzaninotto/faker": "~1.4",
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 "This file is @generated automatically" 5 "This file is @generated automatically"
6 ], 6 ],
7 - "hash": "3d8e2dfddefb412055d28ffc922969fd", 7 + "hash": "097beaeb7ce90384b824d65d9dd36520",
8 - "content-hash": "7658fea0b4df71cf7b97bcdf8a29b9eb", 8 + "content-hash": "233ce3d93ee0c9b005c263ff1449ae0f",
9 "packages": [ 9 "packages": [
10 { 10 {
11 "name": "aws/aws-sdk-php", 11 "name": "aws/aws-sdk-php",
...@@ -359,6 +359,57 @@ ...@@ -359,6 +359,57 @@
359 "time": "2015-11-09 22:51:51" 359 "time": "2015-11-09 22:51:51"
360 }, 360 },
361 { 361 {
362 + "name": "cogpowered/finediff",
363 + "version": "0.3.1",
364 + "source": {
365 + "type": "git",
366 + "url": "https://github.com/cogpowered/FineDiff.git",
367 + "reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8"
368 + },
369 + "dist": {
370 + "type": "zip",
371 + "url": "https://api.github.com/repos/cogpowered/FineDiff/zipball/339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
372 + "reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
373 + "shasum": ""
374 + },
375 + "require": {
376 + "php": ">=5.3.0"
377 + },
378 + "require-dev": {
379 + "mockery/mockery": "*",
380 + "phpunit/phpunit": "*"
381 + },
382 + "type": "library",
383 + "autoload": {
384 + "psr-0": {
385 + "cogpowered\\FineDiff": "src/"
386 + }
387 + },
388 + "notification-url": "https://packagist.org/downloads/",
389 + "license": [
390 + "MIT"
391 + ],
392 + "authors": [
393 + {
394 + "name": "Rob Crowe",
395 + "email": "rob@cogpowered.com"
396 + },
397 + {
398 + "name": "Raymond Hill"
399 + }
400 + ],
401 + "description": "PHP implementation of a Fine granularity Diff engine",
402 + "homepage": "https://github.com/cogpowered/FineDiff",
403 + "keywords": [
404 + "diff",
405 + "finediff",
406 + "opcode",
407 + "string",
408 + "text"
409 + ],
410 + "time": "2014-05-19 10:25:02"
411 + },
412 + {
362 "name": "dnoegel/php-xdg-base-dir", 413 "name": "dnoegel/php-xdg-base-dir",
363 "version": "0.1", 414 "version": "0.1",
364 "source": { 415 "source": {
...@@ -500,6 +551,55 @@ ...@@ -500,6 +551,55 @@
500 "time": "2015-12-07 04:07:13" 551 "time": "2015-12-07 04:07:13"
501 }, 552 },
502 { 553 {
554 + "name": "gathercontent/htmldiff",
555 + "version": "0.2.1",
556 + "source": {
557 + "type": "git",
558 + "url": "https://github.com/gathercontent/htmldiff.git",
559 + "reference": "24674a62315f64330134b4a4c5b01a7b59193c93"
560 + },
561 + "dist": {
562 + "type": "zip",
563 + "url": "https://api.github.com/repos/gathercontent/htmldiff/zipball/24674a62315f64330134b4a4c5b01a7b59193c93",
564 + "reference": "24674a62315f64330134b4a4c5b01a7b59193c93",
565 + "shasum": ""
566 + },
567 + "require": {
568 + "cogpowered/finediff": "0.3.1",
569 + "ext-tidy": "*"
570 + },
571 + "require-dev": {
572 + "phpunit/phpunit": "4.*",
573 + "squizlabs/php_codesniffer": "1.*"
574 + },
575 + "type": "library",
576 + "autoload": {
577 + "psr-0": {
578 + "GatherContent\\Htmldiff": "src/"
579 + }
580 + },
581 + "notification-url": "https://packagist.org/downloads/",
582 + "license": [
583 + "MIT"
584 + ],
585 + "authors": [
586 + {
587 + "name": "Andrew Cairns",
588 + "email": "andrew@gathercontent.com"
589 + },
590 + {
591 + "name": "Mathew Chapman",
592 + "email": "mat@gathercontent.com"
593 + },
594 + {
595 + "name": "Peter Legierski",
596 + "email": "peter@gathercontent.com"
597 + }
598 + ],
599 + "description": "Compare two HTML strings",
600 + "time": "2015-04-15 15:39:46"
601 + },
602 + {
503 "name": "guzzle/guzzle", 603 "name": "guzzle/guzzle",
504 "version": "v3.8.1", 604 "version": "v3.8.1",
505 "source": { 605 "source": {
...@@ -764,50 +864,6 @@ ...@@ -764,50 +864,6 @@
764 "time": "2016-06-24 23:00:38" 864 "time": "2016-06-24 23:00:38"
765 }, 865 },
766 { 866 {
767 - "name": "icap/html-diff",
768 - "version": "v1.1.0",
769 - "source": {
770 - "type": "git",
771 - "url": "https://github.com/iCAPLyon1/HtmlDiff.git",
772 - "reference": "f58ddb196292ae585a2efb7692653d015ecc436f"
773 - },
774 - "dist": {
775 - "type": "zip",
776 - "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f",
777 - "reference": "f58ddb196292ae585a2efb7692653d015ecc436f",
778 - "shasum": ""
779 - },
780 - "require": {
781 - "php": ">=5.3.0"
782 - },
783 - "require-dev": {
784 - "php": ">=5.3.0"
785 - },
786 - "type": "library",
787 - "autoload": {
788 - "psr-4": {
789 - "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff"
790 - }
791 - },
792 - "notification-url": "https://packagist.org/downloads/",
793 - "authors": [
794 - {
795 - "name": "Panagiotis Tsavdaris",
796 - "email": "ptsavdar@gmail.com"
797 - },
798 - {
799 - "name": "ICAP development team",
800 - "homepage": "https://github.com/iCAPLyon1"
801 - }
802 - ],
803 - "description": "A PHP5 library that diffs (compares) HTML files.",
804 - "keywords": [
805 - "daisy diff",
806 - "html diff"
807 - ],
808 - "time": "2016-02-17 16:35:09"
809 - },
810 - {
811 "name": "intervention/image", 867 "name": "intervention/image",
812 "version": "2.3.7", 868 "version": "2.3.7",
813 "source": { 869 "source": {
...@@ -3105,6 +3161,50 @@ ...@@ -3105,6 +3161,50 @@
3105 "time": "2015-05-11 14:41:42" 3161 "time": "2015-05-11 14:41:42"
3106 }, 3162 },
3107 { 3163 {
3164 + "name": "icap/html-diff",
3165 + "version": "v1.1.0",
3166 + "source": {
3167 + "type": "git",
3168 + "url": "https://github.com/iCAPLyon1/HtmlDiff.git",
3169 + "reference": "f58ddb196292ae585a2efb7692653d015ecc436f"
3170 + },
3171 + "dist": {
3172 + "type": "zip",
3173 + "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f",
3174 + "reference": "f58ddb196292ae585a2efb7692653d015ecc436f",
3175 + "shasum": ""
3176 + },
3177 + "require": {
3178 + "php": ">=5.3.0"
3179 + },
3180 + "require-dev": {
3181 + "php": ">=5.3.0"
3182 + },
3183 + "type": "library",
3184 + "autoload": {
3185 + "psr-4": {
3186 + "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff"
3187 + }
3188 + },
3189 + "notification-url": "https://packagist.org/downloads/",
3190 + "authors": [
3191 + {
3192 + "name": "Panagiotis Tsavdaris",
3193 + "email": "ptsavdar@gmail.com"
3194 + },
3195 + {
3196 + "name": "ICAP development team",
3197 + "homepage": "https://github.com/iCAPLyon1"
3198 + }
3199 + ],
3200 + "description": "A PHP5 library that diffs (compares) HTML files.",
3201 + "keywords": [
3202 + "daisy diff",
3203 + "html diff"
3204 + ],
3205 + "time": "2016-02-17 16:35:09"
3206 + },
3207 + {
3108 "name": "mockery/mockery", 3208 "name": "mockery/mockery",
3109 "version": "0.9.5", 3209 "version": "0.9.5",
3110 "source": { 3210 "source": {
......
...@@ -62,15 +62,15 @@ ...@@ -62,15 +62,15 @@
62 } 62 }
63 63
64 // diffs 64 // diffs
65 - .diff-html-removed, 65 + ins,
66 - .diff-html-added { 66 + del {
67 text-decoration: none; 67 text-decoration: none;
68 } 68 }
69 - .diff-html-added { 69 + ins {
70 - background: rgba(45, 255, 0, 0.2); 70 + background: #dbffdb;
71 } 71 }
72 - .diff-html-removed { 72 + del {
73 - background: rgba(255, 0, 0, 0.2); 73 + background: #FFECEC;
74 } 74 }
75 } 75 }
76 76
......