diff --git a/apps/advanced/composer.json b/apps/advanced/composer.json index 94a60be..2d5b987 100644 --- a/apps/advanced/composer.json +++ b/apps/advanced/composer.json @@ -13,12 +13,6 @@ "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "dev", - "repositories": [ - { - "type": "pear", - "url": "http://pear.horde.org" - } - ], "require": { "php": ">=5.3.0", "yiisoft/yii2": "dev-master", diff --git a/apps/basic/composer.json b/apps/basic/composer.json index f372912..dd50b69 100644 --- a/apps/basic/composer.json +++ b/apps/basic/composer.json @@ -13,12 +13,6 @@ "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "dev", - "repositories": [ - { - "type": "pear", - "url": "http://pear.horde.org" - } - ], "require": { "php": ">=5.3.0", "yiisoft/yii2": "dev-master", diff --git a/framework/composer.json b/framework/composer.json index 2258309..89d6064 100644 --- a/framework/composer.json +++ b/framework/composer.json @@ -63,17 +63,11 @@ "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, - "repositories": [ - { - "type": "pear", - "url": "http://pear.horde.org" - } - ], "require": { "php": ">=5.3.7", "ext-mbstring": "*", "lib-pcre": "*", - "pear-pear.horde.org/horde_text_diff": "2.0.*", + "phpspec/php-diff": "1.0.*", "ezyang/htmlpurifier": "4.5.*" }, "autoload": { diff --git a/framework/yii/gii/CodeFile.php b/framework/yii/gii/CodeFile.php index bd77df6..d3dcd43 100644 --- a/framework/yii/gii/CodeFile.php +++ b/framework/yii/gii/CodeFile.php @@ -143,8 +143,7 @@ class CodeFile extends Object if (in_array($type, array('jpg', 'gif', 'png', 'exe'))) { return false; } elseif ($this->operation === self::OP_OVERWRITE) { - list ($diff, $addedLines, $deletedLines) = StringHelper::diff(file($this->path), $this->content); - return $diff; + return StringHelper::diff(file($this->path), $this->content); } else { return ''; } diff --git a/framework/yii/gii/assets/main.css b/framework/yii/gii/assets/main.css index 62d0972..11615a1 100644 --- a/framework/yii/gii/assets/main.css +++ b/framework/yii/gii/assets/main.css @@ -111,3 +111,88 @@ body { background: lightgreen; text-decoration: none; } + + +.Differences { + width: 100%; + border-collapse: collapse; + border-spacing: 0; + empty-cells: show; +} + +.Differences thead { + display: none; +} + +.Differences tbody th { + text-align: right; + background: #FAFAFA; + padding: 1px 2px; + border-right: 1px solid #eee; + vertical-align: top; + font-size: 13px; + font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; + font-weight: normal; + color: #999; + width: 5px; +} + +.Differences td { + padding: 1px 2px; + font-size: 13px; + font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; +} + +.DifferencesSideBySide .ChangeInsert td.Left { + background: #dfd; +} + +.DifferencesSideBySide .ChangeInsert td.Right { + background: #cfc; +} + +.DifferencesSideBySide .ChangeDelete td.Left { + background: #f88; +} + +.DifferencesSideBySide .ChangeDelete td.Right { + background: #faa; +} + +.DifferencesSideBySide .ChangeReplace .Left { + background: #fe9; +} + +.DifferencesSideBySide .ChangeReplace .Right { + background: #fd8; +} + +.Differences ins, .Differences del { + text-decoration: none; +} + +.DifferencesSideBySide .ChangeReplace ins, .DifferencesSideBySide .ChangeReplace del { + background: #fc0; +} + +.Differences .Skipped { + background: #f7f7f7; +} + +.DifferencesInline .ChangeReplace .Left, +.DifferencesInline .ChangeDelete .Left { + background: #fdd; +} + +.DifferencesInline .ChangeReplace .Right, +.DifferencesInline .ChangeInsert .Right { + background: #dfd; +} + +.DifferencesInline .ChangeReplace ins { + background: #9e9; +} + +.DifferencesInline .ChangeReplace del { + background: #e99; +} diff --git a/framework/yii/gii/views/default/diff.php b/framework/yii/gii/views/default/diff.php index 53763ab..6ec990d 100644 --- a/framework/yii/gii/views/default/diff.php +++ b/framework/yii/gii/views/default/diff.php @@ -10,8 +10,6 @@