Include sync as a package
What problem or bug does this solve? Now we can use sync as a standalone composer package.
@netandreus What problem is this solving? I'm not sure at first glance.
Do you happen to have any info on why the paths are checked in that way? I'm unfamiliar with what a standalone composer package is.
Let's try to introduce that we need to use libremail-sync like a common composer package for some project located in /var/www/mailsync/current. It's all about watcher app, we talked about earlier. Here is structure of my project. I use symfony 5 framework.
Here is this projects composer.json file, located in /var/www/mailsync/current/composer.json
{
"type": "project",
"license": "mit",
"minimum-stability": "dev",
"repositories": [
{
"type":"package",
"package": {
"name": "netandreus/zend_mail",
"version":"@dev",
"source": {
"url": "[email protected]:netandreus/zend-mail.git",
"type": "git",
"reference":"develop-lsub"
}
},
"comments": [
"netandreus(particlebits)/zend-mail requires zendframework/zend-stdlib ~2.5",
"but it is the cause of numerous errors, and i does not include it",
"other netandreus(particlebits)/zend-mail requirements included to this file"
]
},
{
"type":"package",
"package": {
"name": "netandreus/imap",
"version":"2.0",
"source": {
"url": "[email protected]:netandreus/imap.git",
"type": "git",
"reference":"develop-fixes"
}
}
}
],
"require": {
"php": "^7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"symfony/console": "5.0.*",
"symfony/dotenv": "5.0.*",
"symfony/flex": "^1.3.1",
"symfony/framework-bundle": "5.0.*",
"symfony/orm-pack": "^1.0",
"symfony/yaml": "5.0.*",
"netandreus/ima-sync": "dev-master"
},
"require-dev": {
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/",
"Zend\\Mail\\": "vendor/netandreus/zend_mail/src/",
"Pb\\Imap\\": "vendor/netandreus/imap/src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"install-sync": [
"ln -s -f ../vendor/netandreus/imap-sync/sync ./bin/sync"
],
"post-install-cmd": [
"@auto-scripts",
"@install-sync"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.0.*"
}
}
}
Some comments:
netandreus/imap-sync - is composer package, making from my fork of libremail sync (with all issues resolved). netandreus/zend_mail - fork of your project with my fixes netandreus/imap - fork of your project with my fixes If you accept my PR - I can you direct links to your repos.
Task We need to run composer script from /var/www/mailsync/current/vendor/netandreus/imap-sync/sync When it started, it find autoload file in /var/www/mailsync/current/vendor/netandreus/imap-sync/sync/autoload.php but there is no such file. Compiled autoload.php for all dependencies of main project located in /var/www/mailsync/current/vendor/composer/autoload.php
Problem That is the problem. We need to add ability to sync / libremail /server load autoload.php not only them source dir:
/var/www/mailsync/current/vendor/netandreus/imap-sync/vendor/autoload.php
but from dependent projects dir:
/var/www/mailsync/current/vendor/autoload.php