Code Monkey home page Code Monkey logo

plugin-installer's People

Contributors

alecpl avatar andreashaerter avatar dsoares avatar jeromelebleu avatar johndoh avatar mazzanet avatar mvorisek avatar takika avatar thomascube avatar till avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin-installer's Issues

PluginInstaller.php Issue

Hi,

I am facing a issue and wondered if I could get a pointer if I do something wrong or if there is a issue. I just upgraded to Rouncube 1.4.1 and everything worked great.
However, I am trying to install some plugins with composer and get a error when I run

php composer.phar update

Fatal error: Cannot pass parameter 2 by reference in roundcube/vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php on line 272

So on line 272 is:

$exitCode = $process->execute($script, null, $plugin_dir);

I checked and in the latest version of PluginInstaller.php the second parameter is still "null".

Any tip of info would be very much appreciated.

PluginInstaller not found

After doing an upgrade from 1.1.4 to 1.3.6 I'm getting the below with "php composer.phar install"

HP Fatal error:  Uncaught Error: Class 'Roundcube\Composer\PluginInstaller' not found in phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php:201
Stack trace:
#0 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php(264): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage))
#1 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php(76): Composer\Plugin\PluginManager->loadRepository(Object(Composer\Repository\InstalledFilesystemRepository))
#2 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Factory.php(384): Composer\Plugin\PluginManager->loadInstalledPlugins()
#3 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Factory.php(576): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false)
#4 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Console/Application.php(338): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, false)
# in phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php on line 201

Fatal error: Uncaught Error: Class 'Roundcube\Composer\PluginInstaller' not found in phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php:201
Stack trace:
#0 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php(264): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage))
#1 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php(76): Composer\Plugin\PluginManager->loadRepository(Object(Composer\Repository\InstalledFilesystemRepository))
#2 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Factory.php(384): Composer\Plugin\PluginManager->loadInstalledPlugins()
#3 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Factory.php(576): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false)
#4 phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Console/Application.php(338): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, false)
# in phar:///var/www/html/roundcubemail/composer.phar/src/Composer/Plugin/PluginManager.php on line 201

maybe related? https://github.com/roundcube/plugin-installer/issues/1 Anything I can do to troubleshoot this on my end? Thank you.

Next release?

Any time frame for a new release?

I'm facing the issue fixed by pull request #10. I would like this fix without having to use dev-master...

Cannot reference (FK) other tables when using table prefix

Hello I'm working on plugin that uses database. I do have simple initial mysql SQL migration.

It seems like I'm not able to run migrations successfully when table prefix is used and SQL is mentioning foreign tables.

It seems like a table list is done per sql command, which is not able to replace referencing tables as it does not know them.

// read DDL file
if ($lines = file($file)) {
$sql = '';
foreach ($lines as $line) {
if (preg_match('/^--/', $line) || trim($line) == '')
continue;
$sql .= $line . "\n";
if (preg_match('/(;|^GO)$/', trim($line))) {
@$DB->query(fix_table_names($sql));
$sql = '';
if ($error = $DB->is_error()) {
break;
}
}
}
}

Also generic tables (eg. users) for roundcube cannot be referenced when using prefix.

example sql

CREATE TABLE `a` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  KEY `id` (`id`)
) /*!40000 ENGINE=InnoDB */ DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE `b` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `a_id` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `a_id` (`a_id`),
  CONSTRAINT `a_id_ibfk_1` FOREIGN KEY (`a_id`) REFERENCES `a`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
) /*!40000 ENGINE=InnoDB */ DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

cannot be installed from composer.phar

I have no idea what is going wrong, whether it is something with the repository or something else but installation fails:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for roundcube/carddav dev-issue_51 -> satisfiable by roundcube/carddav[dev-issue_51].
- roundcube/carddav dev-issue_51 requires roundcube/plugin-installer >=0.1.2 -> no matching package found.

Potential causes:

`composer update` with plugin-installer v0.3.6 installed can cause plugin config files to be deleted

I haven't had much time to try to debug this, so some of what's below might be wrong/incomplete, but I wanted to get this issue opened ASAP given its nature... "can cause deletion" probably means "will cause" for those who use composer to keep plugins up to date.

To reproduce, I believe the steps are:

  1. Ensure plugin-installer v0.3.5 or earlier is installed: composer require --update-no-dev roundcube/plugin-installer:0.3.5.
  2. Ensure that other packages are up to date (just to avoid confusion): composer update --no-dev.
  3. Require/install a plugin which uses a config.inc.php file, for example: composer require --update-no-dev radialapps/banner-ics.
  4. Modify its config.inc.php file.
  5. Switch back to the latest version of plugin-installer, but don't install it yet: composer require --no-install roundcube/plugin-installer.
  6. Note that the current state is one which will be common for those who use composer to keep packages up to date, but haven't yet updated to the latest plugin-installer.
  7. Update plugin-installer: composer update --no-dev.
  8. Run composer update --no-dev again. Nothing should happen, since an update was just completed above. Instead all plugin(s) installed with plugin-installer v0.3.5 or earlier are reinstalled from scratch:
    1. Something checks for the existence of vendor/radialapps/banner-ics which does not exist.
    2. plugins/banner-ics is recursively deleted (including any modified / config files).
    3. plugins/banner-ics is created and populated. vendor/radialapps/banner-ics is also created (empty).
    4. Any on-first-install tasks are executed (Do you want to activate the plugin?, creating a new config.inc.php file, SQL, etc.).
  9. Note that the plugin config.inc.php file(s) have been deleted and replaced by initial configs.

Future runs of composer update --no-dev do not reinstall the plugin(s) apparently because vendor/authorname/pluginname now exists.

I'm guessing this is caused by #51, but I'm not at all sure.

check plugin_name.inc.php too in PluginInstaller

The PluginInstaller's install function (L60-64) copies config.inc.php.dist to config.inc.php if it doesn't exist.
But plugins can use plugin_name.inc.php file in any configured path so the installer have to check existence of these files too or to workaround it add a new command line parameter to disable this copy.

plugin-installer is not installable

I installed the plugin-installer via numerous ways, none actually install it. Last attempt was as follows:

 php composer.phar require "roundcube/plugin-installer *"

In the same matter I installed the calendar, tasks, filters, but the actual plugin-installer just wont install

  • Ubuntu 18.04.1
  • Roundcube 1.3.7

Composer update ending on InvalidArgumentException

Composer version 1.0-dev (7a9eb02190d334513e99a479510f87eed18cf958) 2015-10-07 10:05:33

Hello, I'm upgrading roundcube webmail(0.9.2 to 1.1.3) and _php composer.phar update -vvv_ ending on error below.

Reading ./composer.json
Loading config file ./composer.json
Executing command (/var/www/rc): git describe --exact-match --tags
Executing command (/var/www/rc): git branch --no-color --no-abbrev -v
Executing command (/var/www/rc): hg branch
Executing command (/var/www/rc): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading composer repositories with package information
Downloading http://plugins.roundcube.net/packages.json
Writing /root/.composer/cache/repo/http---plugins.roundcube.net/packages.json into cache
Initializing PEAR repository http://pear.php.net
Downloading http://pear.php.net/channel.xml
Downloading http://pear.php.net/rest/c/categories.xml
Downloading http://pear.php.net/rest/c/Audio/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Authentication/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Benchmarking/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Caching/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Configuration/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Console/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Database/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Date+and+Time/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Encryption/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Event/packagesinfo.xml
Downloading http://pear.php.net/rest/c/File+Formats/packagesinfo.xml
Downloading http://pear.php.net/rest/c/File+System/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Gtk+Components/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Gtk2+Components/packagesinfo.xml
Downloading http://pear.php.net/rest/c/GUI/packagesinfo.xml
Downloading http://pear.php.net/rest/c/HTML/packagesinfo.xml
Downloading http://pear.php.net/rest/c/HTTP/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Images/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Internationalization/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Logging/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Mail/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Math/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Multimedia/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Networking/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Numbers/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Payment/packagesinfo.xml
Downloading http://pear.php.net/rest/c/PEAR/packagesinfo.xml
Downloading http://pear.php.net/rest/c/PEAR+Website/packagesinfo.xml
Downloading http://pear.php.net/rest/c/PHP/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Processing/packagesinfo.xml
Downloading http://pear.php.net/rest/c/QA+Tools/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Scheduling/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Science/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Search+Engine/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Security/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Semantic+Web/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Streams/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Structures/packagesinfo.xml
Downloading http://pear.php.net/rest/c/System/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Testing/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Text/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Tools+and+Utilities/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Validate/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Version+Control/packagesinfo.xml
Downloading http://pear.php.net/rest/c/Web+Services/packagesinfo.xml
Downloading http://pear.php.net/rest/c/XML/packagesinfo.xml
Could not load Auth 1.3.0r5: Invalid version string "1.3.0r5"
Could not load Auth 1.3.0r4: Invalid version string "1.3.0r4"
Could not load Auth 1.3.0r3: Invalid version string "1.3.0r3"
Could not load Auth 1.3.0r2: Invalid version string "1.3.0r2"
Could not load Auth 1.3.0r1: Invalid version string "1.3.0r1"
Could not load Auth_PrefManager2 2.0.0dev1: Invalid version string "2.0.0dev1"
Could not load Contact_AddressBook 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Gtk_ScrollingLabel 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Image_Graph 0.3.0dev4: Invalid version string "0.3.0dev4"
Could not load Image_Graph 0.3.0dev3: Invalid version string "0.3.0dev3"
Could not load Image_Graph 0.3.0dev2: Invalid version string "0.3.0dev2"
Could not load Image_Graph 0.3.0dev1: Invalid version string "0.3.0dev1"
Could not load Net_MPD 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load PEAR 1.10.0dev3: Invalid version string "1.10.0dev3"
Could not load PEAR 1.10.0dev2: Invalid version string "1.10.0dev2"
Could not load PEAR 1.10.0dev1: Invalid version string "1.10.0dev1"
Could not load PEAR 1.9.5dev1: Invalid version string "1.9.5dev1"
Could not load PEAR_Manpages 1.10.0dev2: Invalid version string "1.10.0dev2"
Could not load Structures_DataGrid 0.9.1dev1: Invalid version string "0.9.1dev1"
Could not load Structures_DataGrid_DataSource_Array 0.2.0dev1: Invalid version string "0.2.0dev1"
Could not load Structures_DataGrid_DataSource_DataObject 0.2.2dev1: Invalid version string "0.2.2dev1"
Could not load Structures_DataGrid_DataSource_XML 0.2.1dev1: Invalid version string "0.2.1dev1"
Could not load Structures_DataGrid_Renderer_CSV 0.1.5dev1: Invalid version string "0.1.5dev1"
Could not load Structures_DataGrid_Renderer_XML 0.1.4dev1: Invalid version string "0.1.4dev1"
Could not load Structures_Form 0.8.0devel: Invalid version string "0.8.0devel"
Could not load Structures_Form_Gtk2 0.8.0devel: Invalid version string "0.8.0devel"
Could not load Structures_DataGrid_DataSource_PDO 0.1.1dev1: Invalid version string "0.1.1dev1"
Could not load Text_PathNavigator 0.1.0dev2: Invalid version string "0.1.0dev2"
Could not load Text_PathNavigator 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Services_Pingback 0.2.0dev2: Invalid version string "0.2.0dev2"
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git rev-parse --git-dir
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git remote -v
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git remote set-url origin 'https://git.kolab.org/diffusion/PNL/php-net_ldap.git' && git remote update --prune origin
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git show-ref --tags
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git branch --no-color --no-abbrev -v
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git branch --no-color
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git show 'master':composer.json
Executing command (/root/.composer/cache/vcs/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/): git log -1 --format=%at 'master'
Reading composer.json of kolab/Net_LDAP3 (pear-Net-LDAP3-1.0.0)
Skipped tag pear-Net-LDAP3-1.0.0, invalid tag name
Reading composer.json of kolab/Net_LDAP3 (pear-Net-LDAP3-1.0.1)
Skipped tag pear-Net-LDAP3-1.0.1, invalid tag name
Reading composer.json of kolab/Net_LDAP3 (pear-Net-LDAP3-1.0.2)
Skipped tag pear-Net-LDAP3-1.0.2, invalid tag name
Reading composer.json of kolab/Net_LDAP3 (pear-Net-LDAP3-1.0.3)
Skipped tag pear-Net-LDAP3-1.0.3, invalid tag name
Reading composer.json of kolab/Net_LDAP3 (master)
Reading /root/.composer/cache/repo/https---git.kolab.org-diffusion-PNL-php-net-ldap.git/feb73bc6df2bddeb1ae63e13a198ac62cd90be28 from cache
Importing branch master (dev-master)
Downloading https://packagist.org/packages.json
Writing /root/.composer/cache/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /root/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/p-provider-2015-01.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/p-provider-2015-04.json from cache
Downloading http://packagist.org/p/provider-2015-07%24a37e1d2bde48a77d6ea3f4c8b8ca6b18fd63e10c6f38959814bd60a6172c62d5.json
Writing /root/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json into cache
Reading /root/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Downloading http://packagist.org/p/provider-latest%24767c6e407c87cdb8ead346bc4f9f2325ad2b5c70e0f0af3804cea4bcf5fa9c0c.json
Writing /root/.composer/cache/repo/https---packagist.org/p-provider-latest.json into cache
Reading /root/.composer/cache/repo/https---packagist.org/provider-patchwork$utf8.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/provider-roundcube$plugin-installer.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/provider-pear-pear.php.net$console-getopt.json from cache
Reading /root/.composer/cache/repo/https---packagist.org/provider-pear-pear.php.net$pear.json from cache
Analyzed 5636 packages to resolve dependencies
Analyzed 5566 rules to resolve dependencies



  [InvalidArgumentException]                                                      
  Invalid operator "0.9.4.0" given, expected one of: =, ==, <, <=, >, >=, <>, !=  



Exception trace:
 () at phar:///var/www/rc/composer.phar/vendor/composer/semver/src/Constraint/Constraint.php:84
 Composer\Semver\Constraint\Constraint->__construct() at /var/www/rc/vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php:168
 Roundcube\Composer\PluginInstaller->rcubeVersionCheck() at /var/www/rc/vendor/roundcube/plugin-installer/src/Roundcube/Composer/PluginInstaller.php:43
 Roundcube\Composer\PluginInstaller->install() at phar:///var/www/rc/composer.phar/src/Composer/Installer/InstallationManager.php:151
 Composer\Installer\InstallationManager->install() at phar:///var/www/rc/composer.phar/src/Composer/Installer/InstallationManager.php:138
 Composer\Installer\InstallationManager->execute() at phar:///var/www/rc/composer.phar/src/Composer/Installer.php:599
 Composer\Installer->doInstall() at phar:///var/www/rc/composer.phar/src/Composer/Installer.php:232
 Composer\Installer->run() at phar:///var/www/rc/composer.phar/src/Composer/Command/UpdateCommand.php:143
 Composer\Command\UpdateCommand->execute() at phar:///var/www/rc/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at phar:///var/www/rc/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/rc/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at phar:///var/www/rc/composer.phar/src/Composer/Console/Application.php:147
 Composer\Console\Application->doRun() at phar:///var/www/rc/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at phar:///var/www/rc/composer.phar/src/Composer/Console/Application.php:82
 Composer\Console\Application->run() at phar:///var/www/rc/composer.phar/bin/composer:43
 require() at /var/www/rc/composer.phar:25


update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]

Here is my _composer.json_ file:

{
    "name": "roundcube/roundcubemail",
    "description": "The Roundcube Webmail suite",
    "license": "GPL-3.0+",
    "repositories": [
        {
            "type": "composer",
            "url": "http://plugins.roundcube.net/"
        },
        {
            "type": "pear",
            "url": "http://pear.php.net/"
        },
        {
            "type": "vcs",
            "url": "https://git.kolab.org/diffusion/PNL/php-net_ldap.git"
        }
    ],
    "require": {
        "php": ">=5.3.7",
        "roundcube/plugin-installer": "~0.1.6",
        "cor/message_highlight": "dev-master",
        "gms-sa/advanced-search": "dev-master",
        "pear-pear.php.net/auth_sasl": "~1.0.6",
        "pear-pear.php.net/net_idna2": "~0.1.1",
        "pear-pear.php.net/net_sieve": "~1.3.4",
        "pear-pear.php.net/mail_mime": "~1.9.0",
        "pear-pear.php.net/net_smtp": "~1.6.3",
        "patchwork/utf8": "~1.2.3"
    },
    "minimum-stability": "dev"
}

This is next error on command _php composer.phar diagnose_

Checking composer.json: FAIL
require.cor/message_highlight : unbound version constraints (dev-master) should be avoided
require.gms-sa/advanced-search : unbound version constraints (dev-master) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

What do these errors mean?
Any suggestions how to solve these issues?

Thank you for the respond.

plugins/skins installing to the wrong directory

Hi,

I'm experiencing a really strange behavior and I have absolutely no idea where this is coming from. I suspect this issue to be connected with plugin installer, but maybe this might be the wrong place here. If so, sorry, however, maybe you can help me figuring out what is going wrong here.

What I would expect is the following (assuming a freshly downloaded and extraced release of roundcubemail):

  • composer require johndoh/contextmenu:3.3 installs into plugins
  • composer require roundcube/classic:1.6.0 installs into skins

What I'm experiencing is (again, freshly downloaded and extracted release of roundcubemail):

composer require roundcube/classic:1.6.0
composer require johndoh/contextmenu:3.3

Runs without errors, but both, the skin as well as the plugin, are installed into the skins directory:

$ ls skins
classic  contextmenu  elastic

Then, deleting the directory, creating a fresh directory with roundcube and reversing the order of composer require:

composer require johndoh/contextmenu:3.3
composer require roundcube/classic:1.6.0

Runs without errors, too, but both, the skin as well as the plugin, are now installed into the plugins directory:

$ ls skins
elastic
$ ls plugins
acl                         autologon    database_attachments  example_addressbook     http_authentication  krb_authentication  new_user_dialog    redundant_attachments    userinfo           zipdownload
additional_message_headers  autologout   debug_logger          filesystem_attachments  identicon            managesieve         new_user_identity  show_additional_headers  vcard_attachments
archive                     classic      emoticons             help                    identity_select      markasjunk          password           squirrelmail_usercopy    virtuser_file
attachment_reminder         contextmenu  enigma                hide_blockquote         jqueryui             newmail_notifier    reconnect          subscriptions_option     virtuser_query

So, it looks like that something is caching the first directory chosen for skin/plugin installation and keeps it for all subsequent installations.

Interestingly, this information is somehow cached within the roundcubemail directory. Deleting the directory and starting over "resets" the cache.

@thomascube, any idea?

Best regards
Matthias

Roundcube AD LDAP connection for Address List

After change config.inc.php for connecting to AD LDAP as below in configuration I have get this error
[27-Apr-2021 11:42:34 UTC] PHP Fatal error: Uncaught Error: Class 'Net_LDAP3' not found in /usr/share/roundcube/program/lib/Roundcube/rcube_ldap_generic.php:29
Stack trace:
#0 /usr/share/roundcube/program/lib/Roundcube/bootstrap.php(485): include_once()
#1 [internal function]: rcube_autoload()
#2 /usr/share/roundcube/program/lib/Roundcube/rcube_ldap.php(253): spl_autoload_call()
#3 /usr/share/roundcube/program/include/rcmail.php(220): rcube_ldap->__construct()
#4 /usr/share/roundcube/program/steps/addressbook/func.inc(152): rcmail->get_address_book()
#5 /usr/share/roundcube/program/steps/addressbook/list.inc(47): rcmail_contact_source()
#6 /usr/share/roundcube/index.php(302): include_once('/usr/share/roun...')
#7 {main}
thrown in /usr/share/roundcube/program/lib/Roundcube/rcube_ldap_generic.php on line 29

my reference is : https://github.com/roundcube/roundcubemail/wiki/Configuration%3A-LDAP-Address-Books

configuration of config.inc.php :
$config['ldap_public'] = array(
'MyAdLdap' => array (
'name' => 'Big Company, Inc',
'hosts' => array('myserver..'),
'sizelimit' => 6000,
'port' => 3268, # See comments below
'use_tls' => false,
'user_specific' => false,
'base_dn' => 'CN=users,DC=
,DC=',
'bind_dn' => '
@.',
'bind_pass' => '
************',
'writable' => false,
'ldap_version' => 3,
'search_fields' => array(
'mail',
'cn',
),
'fieldmap' => array(
'name' => 'cn',
'email' => 'mail',
'surname' => 'sn',
'firstname' => 'givenName',
),
'sort' => 'sn',
'scope' => 'list', # or 'sub'
'filter' => '(&(mail=
)(|(&(objectClass=user)(!(objectClass=computer)))(objectClass=group)))',
'global_search' => true,
'fuzzy_search' => true,
'vlv' => false,
),
);

Fatal error on install

Hello guys,

by installing this needed plugin i got every time:

Fatal error: Class 'Roundcube\Composer\PluginInstaller' not found in phar:///var/customers/webs/webmail/composer.phar/src/Composer/Installer/InstallerInstaller.php on line 101

My composer.json looks like follows:

{
"name": "roundcube/roundcubemail",
"description": "The Roundcube Webmail suite",
"license": "GPL-3.0+",
"repositories": [
{
"type": "composer",
"url": "http://plugins.roundcube.net/"
}
],
"require": {
"php": ">=5.3.0",
"johndoh/contextmenu": "dev-master",
"sblaisot/topline": "dev-master"
},
"minimum-stability": "dev"
}

System: Debian Squeeze
PHP Version: Version 5.3.3-7+squeeze15

Plesk Error

[InvalidArgumentException]
Could not find package roundcube/plugin-installer at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

I get this Message under the Plesk Installation of Roundcube.
How can I solve the problem?

plugin-installer needs to be adapted for composer2

Hello,

composer v2 has now been released and v1 will be considered EOL soon. Composer v2 has some API changes for custom installers, specifically concerning this project the LibraryInstaller install/update/uninstall methods may now work asynchronously and return a PromiseInterface. There is an example on how to adapt the code to be compatible with both composer v1 and v2.

As the composer project is encouraging all users to upgrade ASAP and indicates that they plan to cease support for v1, it would be great if plugin-installer could be made compatible with composer v2. I'm already receiving first issues (mstilkerich/rcmcarddav#311) causing failure of roundcube plugin installation when composer v2 is used. I verified that adapting the code as in the example fixes the issue.

Installing a core plugin throws a composer warning

On Roundcube master I wanted to test what happens if user would try to install a core plugin using composer.

So, I removed "roundcube/archive" from "require-dev" section, but left "repositories" intact. That way it will look like composer.json in a release package (where we remove the "require-dev" section).

./composer.sh require roundcube/archive
composer.json has been updated
Could not scan for classes inside "/home/alec/repos/roundcubemail/vendor/roundcube/archive/archive.php" which does not appear to be a file nor a folder

@mvorisek, Can we fix it so the warning is not printed? Or maybe it's a composer issue. Composer 2.7.2 on PHP 8.1.

Plugin activation fails to update the config file

In master, file plugin-installer/src/Roundcube/Composer/PluginInstaller.php, method rcubeAlterConfig(), line 201:

$new_config = preg_replace(
                    "/($varname\['plugins'\])\s+=\s+(.+);/Uims",
                    "\\1 = " . $var_export,
                    $config_templ);

In my installation, this doesn't work. $varname='$config' and the $ symbol messes with the regular expression. It should be:

$new_config = preg_replace(
                    "/(\\$varname\['plugins'\])\s+=\s+(.+);/Uims",
                    "\\1 = " . $var_export,
                    $config_templ);

This happens with PHP 5.3.3, CentOS 6.4.

Disable database initialization for use in building environments such as Docker

Following instructions to build a custom docker image, when adding any plugin which declares an sql-dir extra parameter for SQL database initialisation, it fails.

This is logical, as the database engine is not running in this build environment, in fact the actual configuration is not even loaded at this stage. And even if the script where to find the database, in docker the core database is not initialised until first execution, thus there will be no "standard" tables either, and plugins' scripts who rely on those will fail.

By removing the assumption that roundcube is set up and running when executing a composer require command, some of these issues could be avoided.

One alternative would be to have an execution switch to avoid executing database initialisation script (maybe post-installation scripts too).

Another way is to detect the condition the database is accessible with current configuration, and if it not the case append the plugin SQL initialisation scripts to the "core SQL initialisation scripts" (the scripts in roundcube/SQL/ directory); this still complies with the specification and enables the command to continue. I have been using this technique when "manually" building my docker image, and it works fine as the initialisation is handled just like the core SQL initialisation. This of course only works with clean installs, plugin updates in roundcube-docker are not considered; thus manual SQL initialisation is always necessary in these cases anyway.

UPDATE: Failed to connect to database exception is handled to end the execution, so the condition needs to be detected before the exception.

Don't use composer/semver

composer/semver package requires phpunit/phpunit-mock-objects package which causes
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested. when you run composer.

Because we use only a single method (Composer\Semver\Constraint::versionCompare()) which is really a simple wrapper on version_compare(), it should be easy. Here's the function body.

 public function versionCompare($a, $b, $operator, $compareBranches = false)
    {
        if (!isset(self::$transOpStr[$operator])) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid operator "%s" given, expected one of: %s',
                $operator,
                implode(', ', self::getSupportedOperators())
            ));
        }
        $aIsBranch = 'dev-' === substr($a, 0, 4);
        $bIsBranch = 'dev-' === substr($b, 0, 4);
        if ($aIsBranch && $bIsBranch) {
            return $operator === '==' && $a === $b;
        }
        // when branches are not comparable, we make sure dev branches never match anything
        if (!$compareBranches && ($aIsBranch || $bIsBranch)) {
            return false;
        }
        return version_compare($a, $b, $operator);
    }

Rouncube-Calender Plugin

Hi,

I want to install roundcube calender plugin but i'm unable to find the plugin.
Please suggest me the plugin as well as steps

VersionContraint is deprecated

So, when using composer we get:

Deprecation Notice: The Composer\Package\LinkConstraint\VersionConstraint class is deprecated, use Composer\Semver\Constraint\Constraint instead. in phar:///www/htdocs/w00ee986/webmail/composer.phar/src/Composer/Package/LinkConstraint/VersionConstraint.php:17
Deprecation Notice: The Composer\Package\LinkConstraint\LinkConstraintInterface interface is deprecated, use Composer\Semver\Constraint\ConstraintInterface instead. in phar:///www/htdocs/w00ee986/webmail/composer.phar/src/Composer/Package/LinkConstraint/LinkConstraintInterface.php:17

wrong order in parameters

Version: "roundcube/plugin-installer": "dev-master"

I found out a small bug in Roundcube/Composer/PluginInstaller.php at line 168:
$constraint = new VersionConstraint($version, $operator);

Since the constructor of VersionConstraint declares its parameters as $operator and $version, in this order, this call causes an error when validating "extras". The fix is simple, just change the order at line 168 to comply with the constructor:
$constraint = new VersionConstraint($operator, $version);

Regards,

Cristiano

Composer crashes when clearing cache

Hi,

I'm setting up roundcube using Ansible. This setup is a bit old but worked fine a few minutes ago until suddenly (I had to run the playbook again) it crashed (and now keeps crashing) at the "clear cache" step.

The step in question is the following:

- name: Clear Composer cache
  shell: COMPOSER_ALLOW_SUPERUSER=1 php /root/composer.phar clearcache -n
           chdir=/var/www/roundcube

This should only clear the composer cache but it crashes with the following output:

Fatal error: Uncaught Error: Class \"Roundcube\\Composer\\PluginInstaller\" not found in phar:///root/composer.phar/src/Composer/Plugin/PluginManager.php:202
Stack trace:
#0 phar:///root/composer.phar/src/Composer/Plugin/PluginManager.php(267): Composer\\Plugin\\PluginManager->registerPackage()
#1 phar:///root/composer.phar/src/Composer/Plugin/PluginManager.php(77): Composer\\Plugin\\PluginManager->loadRepository()
#2 phar:///root/composer.phar/src/Composer/Factory.php(384): Composer\\Plugin\\PluginManager->loadInstalledPlugins()
#3 phar:///root/composer.phar/src/Composer/Factory.php(576): Composer\\Factory->createComposer()
#4 phar:///root/composer.phar/src/Composer/Console/Application.php(368): Composer\\Factory::create()
#5 phar:///root/composer.phar/src/Composer/Console/Application.php(486): Composer\\Console\\Application->getComposer()
#6 phar:///root/composer.phar/src/Composer/Console/Application.php(178): Composer\\Console\\Application->getPluginCommands()
#7 phar:///root/composer.phar/vendor/symfony/console/Application.php(117): Composer\\Console\\Application->doRun()
#8 phar:///root/composer.phar/src/Composer/Console/Application.php(113): Symfony\\Component\\Console\\Application->run()
#9 phar:///root/composer.phar/bin/composer(61): Composer\\Console\\Application->run()
#10 /root/composer.phar(24): require('...')
#11 {main}
thrown in phar:///root/composer.phar/src/Composer/Plugin/PluginManager.php on line 202

I'm currently using the latest 1.x version of composer because 2.x generates an additional deprecation warning. But I've tested this with latest 1.x and latest 2.x and both produce the same crash dump.

Here's the composer json I'm using:

{
    "name": "roundcube/roundcubemail",
    "description": "The Roundcube Webmail suite",
    "license": "GPL-3.0-or-later",
    "repositories": [
        {
            "type": "composer",
            "url": "https://plugins.roundcube.net/"
        },
        {
            "type": "vcs",
            "url": "https://github.com/roundcube/Net_Sieve.git"
        },
        {
            "type": "vcs",
            "url": "https://git.kolab.org/diffusion/PNL/php-net_ldap.git"
        }
    ],
    "require": {
        "php": ">=5.5.0",
        "pear/pear-core-minimal": "~1.10.1",
        "pear/auth_sasl": "~1.1.0",
        "pear/mail_mime": "~1.10.0",
        "pear/net_smtp": "~1.9.0",
        "pear/net_socket": "~1.2.2",
        "pear/net_idna2": "~0.2.0",
        "pear/crypt_gpg": "~1.6.3",
        "pear/net_sieve": "~1.4.3",
        "masterminds/html5": "~2.7.0",
        "roundcube/net_sieve": "~1.5.0",
        "endroid/qr-code": "~1.6.5",
        "alexandregz/twofactor_gauthenticator": "dev-master",
	    "roundcube/carddav": "dev-master",
        "guzzlehttp/guzzle": "^6.5.5"
    },
    "require-dev": {
        "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6 || ^7"
    },
    "suggest": {
        "pear/net_ldap2": "~2.2.0 required for connecting to LDAP address books",
        "bjeavons/zxcvbn-php": "^1.0 required for Zxcvbn password strength driver",
        "kolab/net_ldap3": "~1.1.1 required for connecting to LDAP"
    },
    "minimum-stability": "dev"
}

I'm pretty confused by this sudden crash because (as stated above) the setup worked fine a few minutes prior.

EDIT: I've read the comment in #16 suggesting to manually add the plugin-installer. That worked, but I'm still confused why this happened without any changes to the roundcube installation. The scripts download a fixed roundcube version (1.5-beta) and the logs show that this step was skipped (only the composer "reinstall" happens every run). The same playbook also installs a second roundcube instance with the same version, on the same host, using the same composer executable and this crash doesn't happen there.

EDIT 2: It seems that switching from 1.5-beta to 1.5-rc "fixes" the crash, cloning the plugin-installer manually is no longer required. (The other roundcube instance is still on 1.5-beta and still works without issues.)

RC master (1.5) install, +php8 & composer2, error : 'Loading "roundcube/plugin-installer" which is a legacy composer-installer'

I've installed RC master

git log -n1
	1 commit e62c0a8f9bf67edf652d9f598a7a40818fc3a3a8 (HEAD -> master, origin/master, origin/HEAD)
	2 Author: Aleksander Machniak <[email protected]>
	3 Date:   Mon May 31 12:42:57 2021 +0200
	4
	5     Small code improvement, use array_first()

on linux/Fedora34, with

php -v
	PHP 8.0.6 (cli) (built: May  4 2021 17:26:18) ( NTS gcc x86_64 )
	Copyright (c) The PHP Group
	Zend Engine v4.0.6, Copyright (c) Zend Technologies
		with Zend OPcache v8.0.6, Copyright (c), by Zend Technologies

node -v
	v14.17.0

npm -v
	6.14.13

yarn --version
	1.22.10

composer -n -V
	Composer version 2.0.12 2021-04-01 10:14:59

Reading @

"Installer Update for Composer 2.0"
https://roundcube.net/news/2020/11/04/installer-update-for-composer-v2

Exec'ing

composer require "roundcube/plugin-installer:>=0.2.0"
composer update

I can login to RC portal at this point.

On add of any plugin, e.g.

composer -n require alexandregz/twofactor_gauthenticator:dev-master

I still see refs to "legacy" plugin-installer

Loading "roundcube/plugin-installer" which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.
./composer.json has been updated
Loading "roundcube/plugin-installer" which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.
Running composer update alexandregz/twofactor_gauthenticator
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking alexandregz/twofactor_gauthenticator (dev-master 407d39e)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 20 installs, 0 updates, 0 removals
  - Syncing alexandregz/twofactor_gauthenticator (dev-master 407d39e) into cache
  - Installing alexandregz/twofactor_gauthenticator (dev-master 407d39e): Cloning 407d39ea4c from cache
Creating plugin config file
  - Installing phpdocumentor/reflection-docblock (2.0.5): Extracting archive
  - Installing phpunit/php-token-stream (1.4.12): Extracting archive
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing symfony/yaml (v3.4.47): Extracting archive
  - Installing sebastian/version (1.0.6): Extracting archive
  - Installing sebastian/global-state (1.1.1): Extracting archive
  - Installing sebastian/recursion-context (1.0.5): Extracting archive
  - Installing sebastian/exporter (1.2.2): Extracting archive
  - Installing sebastian/environment (1.3.7): Extracting archive
  - Installing sebastian/diff (1.4.1): Extracting archive
  - Installing sebastian/comparator (1.2.4): Extracting archive
  - Installing phpunit/php-text-template (1.2.1): Extracting archive
  - Installing doctrine/instantiator (1.4.0): Extracting archive
  - Installing phpunit/phpunit-mock-objects (2.3.8): Extracting archive
  - Installing phpunit/php-timer (1.0.8): Extracting archive
  - Installing phpunit/php-file-iterator (1.4.5): Extracting archive
  - Installing phpunit/php-code-coverage (2.2.4): Extracting archive
  - Installing phpspec/prophecy (v1.5.0): Extracting archive
  - Installing phpunit/phpunit (4.8.36): Extracting archive
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
6 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

composer update (install step removed packages) fails because plugin-installer invokes autoloader

Hello,

I have received reports of issues when upgrading to roundcube 1.6.0 (e.g. from 1.5.3), when the rcmcarddav plugin is also installed and upgraded during the process in the composer update --no-dev step. This problem will very likely apply with any other roundcube plugin installed using plugin-installer as well.

The problem seems to be the following:

  • Some packages that were required by roundcube 1.5 are not required by roundcube 1.6 anymore.
  • During the install step of composer update, these packages are removed first.
  • When rcmcarddav is upgraded, the plugin code of plugin-installer is invoked. It appears to use the composer autoloader, which at this point apparently has not been updated yet. The autoloader tries to load the files of the packages that have already been removed, causing the process to die.

Running composer update --no-dev --no-plugins shows that the problem does not occur then, which confirms that the autoloader is loaded because of the plugin-installer code. However, I guess the plugin-installer code does some required actions and therefore this is not a valid workaround.

I'm not sure if this is a problem with plugin-installer or with the composer install process itself, i.e. if composer should have updated the autoloader before calling the plugin code first, or whether the plugin code is not supposed to use the autoloader.

A full log of the composer call for reference:

Loading composer repositories with package information
Updating dependencies
Lock file operations: 4 installs, 6 updates, 4 removals
  - Removing endroid/qr-code (1.6.6)
  - Removing symfony/polyfill-intl-idn (v1.26.0)
  - Removing symfony/polyfill-intl-normalizer (v1.26.0)
  - Removing symfony/polyfill-php72 (v1.26.0)
  - Locking bacon/bacon-qr-code (2.0.7)
  - Locking dasprid/enum (1.0.3)
  - Upgrading guzzlehttp/guzzle (6.5.8 => 7.4.5)
  - Upgrading guzzlehttp/psr7 (1.9.0 => 2.4.0)
  - Upgrading mstilkerich/carddavclient (v1.2.1 => v1.2.2)
  - Locking psr/http-factory (1.0.1)
  - Upgrading roundcube/carddav (v4.4.1 => v4.4.2)
  - Upgrading sabre/vobject (4.4.2 => 4.4.3)
  - Locking symfony/deprecation-contracts (v2.5.2)
  - Upgrading symfony/yaml (v4.4.43 => v4.4.44)
Writing lock file
Installing dependencies from lock file
Package operations: 4 installs, 5 updates, 4 removals
  - Removing symfony/polyfill-php72 (v1.26.0)
  - Removing symfony/polyfill-intl-normalizer (v1.26.0)
  - Removing symfony/polyfill-intl-idn (v1.26.0)
  - Removing endroid/qr-code (1.6.6)
  - Installing dasprid/enum (1.0.3): Extracting archive
  - Installing bacon/bacon-qr-code (2.0.7): Extracting archive
  - Installing symfony/deprecation-contracts (v2.5.2): Extracting archive
  - Installing psr/http-factory (1.0.1): Extracting archive
  - Upgrading guzzlehttp/psr7 (1.9.0 => 2.4.0): Extracting archive
  - Upgrading guzzlehttp/guzzle (6.5.8 => 7.4.5): Extracting archive
  - Upgrading sabre/vobject (4.4.2 => 4.4.3): Extracting archive
  - Upgrading mstilkerich/carddavclient (v1.2.1 => v1.2.2): Extracting archive
    Update of roundcube/carddav failed
 8/8 [============================] 100%
In autoload_real.php line 59:

  require(/tmp/rcold/roundcube/vendor/composer/../symfony/polyfill-php72/bootstrap.php): failed to open stream: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.