From 4d3e80a0afbb97909f6203b7669d7b309deb0c23 Mon Sep 17 00:00:00 2001 From: fritzmg Date: Tue, 31 Jan 2017 13:50:09 +0100 Subject: [PATCH 1/7] fix rename warning on new installation When installing the composer-client for the first time, the composer.phar will not be present and thus ```php rename($file, $backup); ``` will lead to a Warning. https://community.contao.org/de/showthread.php?65133-Composer-Installation-Warning-rename&p=428099&highlight=rename#post428099 https://community.contao.org/de/showthread.php?65515-Composer-%C3%BCber-Installtool-in-3-5-24-bringt-Fehler&p=431146&viewfull=1#post431146 --- src/system/modules/!composer/src/Runtime.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/modules/!composer/src/Runtime.php b/src/system/modules/!composer/src/Runtime.php index 2222ea8..0a6480b 100644 --- a/src/system/modules/!composer/src/Runtime.php +++ b/src/system/modules/!composer/src/Runtime.php @@ -11,6 +11,7 @@ * @author Dominik Zogg * @author Oliver Hoff * @author Nicky Hoff + * @author Fritz Michael Gschwantner * @package Composer * @license LGPLv3 * @filesource @@ -244,7 +245,9 @@ public static function updateComposer() if (is_file($backup)) { unlink($backup); } - rename($file, $backup); + if (is_file($file)) { + rename($file, $backup); + } rename($tmpFile, $file); return true; From e257803a3936d73644d1e0a51bcddf255c09d1a7 Mon Sep 17 00:00:00 2001 From: fritzmg Date: Mon, 6 Feb 2017 13:24:28 +0100 Subject: [PATCH 2/7] fix PHP7 error --- .check-author.yml | 6 ++++++ src/system/modules/!composer/src/Client.php | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.check-author.yml b/.check-author.yml index a7ee324..641b55b 100644 --- a/.check-author.yml +++ b/.check-author.yml @@ -3,3 +3,9 @@ exclude: - tests mapping: + "Fritz Michael Gschwantner ": + - "Fritz Michael Gschwantner " + - "Fritz Michael Gschwantner " + - "fritzmg " + - "fritzmg " + - "fritzmg " diff --git a/src/system/modules/!composer/src/Client.php b/src/system/modules/!composer/src/Client.php index 4b10980..32b0258 100644 --- a/src/system/modules/!composer/src/Client.php +++ b/src/system/modules/!composer/src/Client.php @@ -8,6 +8,7 @@ * @copyright ContaoCommunityAlliance 2013 * @author Christian Schiffler * @author Tristan Lins + * @author Fritz Michael Gschwantner * @package Composer * @license LGPLv3 * @filesource @@ -73,7 +74,7 @@ public function disableOldClientHook() // disable the repo client $reset = false; $activeModules = $this->Config->getActiveModules(); - $inactiveModules = deserialize($GLOBALS['TL_CONFIG']['inactiveModules']); + $inactiveModules = deserialize($GLOBALS['TL_CONFIG']['inactiveModules'], true); if (in_array('repository', $activeModules)) { $inactiveModules[] = 'repository'; From a64a0f15e5367bd61747f9daaf8550fca7a32f75 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Fri, 10 Mar 2017 17:39:35 +0100 Subject: [PATCH 3/7] Fix #309 - minor PHP7 issue --- src/system/modules/!composer/src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/modules/!composer/src/Client.php b/src/system/modules/!composer/src/Client.php index 32b0258..932675b 100644 --- a/src/system/modules/!composer/src/Client.php +++ b/src/system/modules/!composer/src/Client.php @@ -56,7 +56,7 @@ public function getModules() { $callback = $this->inactiveModulesOptionsCallback; $this->import($callback[0]); - $modules = $this->$callback[0]->$callback[1](); + $modules = $this->{$callback[0]}->{$callback[1]}(); if (isset($modules['repository'])) { $modules['repository'] = sprintf( From a63465926cb6ac0beb8610626397e0e775fb95dd Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Fri, 10 Mar 2017 18:06:52 +0100 Subject: [PATCH 4/7] Fixes #310 - detail view back link return to list The back link in package detail view now returns to the search view if coming from there. --- .../!composer/templates/be_composer_client_install.html5 | 2 +- .../!composer/templates/be_composer_client_search.html5 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/modules/!composer/templates/be_composer_client_install.html5 b/src/system/modules/!composer/templates/be_composer_client_install.html5 index 6d604c1..d2d84be 100644 --- a/src/system/modules/!composer/templates/be_composer_client_install.html5 +++ b/src/system/modules/!composer/templates/be_composer_client_install.html5 @@ -44,7 +44,7 @@ $source = $preferedCandidate->getSourceUrl();
diff --git a/src/system/modules/!composer/templates/be_composer_client_search.html5 b/src/system/modules/!composer/templates/be_composer_client_search.html5 index 2e52417..551ed59 100644 --- a/src/system/modules/!composer/templates/be_composer_client_search.html5 +++ b/src/system/modules/!composer/templates/be_composer_client_search.html5 @@ -55,7 +55,7 @@ $installationManager = $composer->getInstallationManager(); ?>
- + @@ -83,7 +83,7 @@ $installationManager = $composer->getInstallationManager(); ); else: ?> - + generateImage( 'system/modules/!composer/assets/images/mark_install.png', $GLOBALS['TL_LANG']['composer_client']['mark_to_install'], From 08c11fd8a2ba358cf455ba61cf96b5dba337dacc Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Fri, 10 Mar 2017 18:07:39 +0100 Subject: [PATCH 5/7] Remove minimum-stability from composer.json Should have been done a long time ago... --- composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b217975..1a590c5 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,5 @@ "dev-master": "0.16.x-dev", "dev-develop": "0.17.x-dev" } - }, - "prefer-stable": true, - "minimum-stability": "dev" + } } From e4f405624bbcec99b82f4f7ef1bbc7b698811e3a Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Fri, 10 Mar 2017 18:22:09 +0100 Subject: [PATCH 6/7] Bump memory limit to 1.5G This is what it currently is set to in composer 1.4.x. --- src/system/modules/!composer/src/Runtime.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/modules/!composer/src/Runtime.php b/src/system/modules/!composer/src/Runtime.php index 0a6480b..6185cc1 100644 --- a/src/system/modules/!composer/src/Runtime.php +++ b/src/system/modules/!composer/src/Runtime.php @@ -283,9 +283,9 @@ public static function increaseMemoryLimit() }; $memoryLimit = trim(ini_get('memory_limit')); - // Increase memory_limit if it is lower than 512M - if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024) { - @ini_set('memory_limit', '1024M'); + // Increase memory_limit if it is lower than 1.5GB + if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1536) { + @ini_set('memory_limit', '1536M'); } unset($memoryInBytes, $memoryLimit); } From d52f0f042a9176a22b8a654da3415e54ce3c89d3 Mon Sep 17 00:00:00 2001 From: Christian Schiffler Date: Mon, 13 Mar 2017 14:20:40 +0100 Subject: [PATCH 7/7] Escape ampersand correctly --- .../!composer/templates/be_composer_client_install.html5 | 2 +- .../!composer/templates/be_composer_client_search.html5 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/modules/!composer/templates/be_composer_client_install.html5 b/src/system/modules/!composer/templates/be_composer_client_install.html5 index d2d84be..40bb6c6 100644 --- a/src/system/modules/!composer/templates/be_composer_client_install.html5 +++ b/src/system/modules/!composer/templates/be_composer_client_install.html5 @@ -44,7 +44,7 @@ $source = $preferedCandidate->getSourceUrl();
diff --git a/src/system/modules/!composer/templates/be_composer_client_search.html5 b/src/system/modules/!composer/templates/be_composer_client_search.html5 index 551ed59..65eb1ec 100644 --- a/src/system/modules/!composer/templates/be_composer_client_search.html5 +++ b/src/system/modules/!composer/templates/be_composer_client_search.html5 @@ -55,7 +55,7 @@ $installationManager = $composer->getInstallationManager(); ?>
- + @@ -83,7 +83,7 @@ $installationManager = $composer->getInstallationManager(); ); else: ?> - + generateImage( 'system/modules/!composer/assets/images/mark_install.png', $GLOBALS['TL_LANG']['composer_client']['mark_to_install'],