Skip to content
Snippets Groups Projects
Commit 7a4bee34 authored by lucha's avatar lucha
Browse files

include r2db package

I am still not sure if we want to use Composer to manage the
dependences of r2db, which is only flexihash. It might be easier to
simply add flexihash to the repository of r2db, which we never have
updated in 7+ years. That way we would not need to include the vendor/
folder into the Noblogs production enviroment.
parent 4e502b24
Branches
No related tags found
No related merge requests found
This is an attempt to re-structure the ai/noblogs-wp> repository using Composer. This is an attempt to re-structure the ai/noblogs-wp> repository using Composer ([e.g](https://www.smashingmagazine.com/2019/03/composer-wordpress/))
Some rough ideas on how the situation could be improved: Some rough ideas on how the situation could be improved:
- the ```upstream``` branch should disappear. We should not have to care ourselves on keeping a sync of Wordpress source code - the ```upstream``` branch should disappear. We should not have to care ourselves on keeping a sync of Wordpress source code
- we should really just keep the patches and our contributions - we should really just keep the patches and our contributions
- we need to be able to build a docker container in the end - we need to be able to build a docker container in the end
- How do we generate the patches? We need to keep the source code of wordpress in the git repo after all, to be able to use git diff.
## About drop-in plugins ## About mu-plugins and drop-in plugins
Drop-in plugins, such as ```Hyperdb```, do not have to be installed in the plugins directory, but we have instead to place files directly into wp-content. Drop-in plugins, such as ```Hyperdb```, do not have to be installed in the plugins directory, but we have instead to place files directly into wp-content.
We have to thus manually specify where they have to go. Similarly, mu-plugins are distributed as regular plugins (```wpackagist``` does not have a nice way to select stuff as mu-plugins), but they cannot be dropped in the mu-plugins directory: instead, a single file from their source has to be moved there.
In order to solve this two problems, we install these plugins outside of the ```app``` sub-directory (since we do not need to distribute them in production), and we manually specify which file we need to move where, using ```dropin-paths```.
## Gitlab as Composer registry/repository
It might happen [soon](https://gitlab.com/gitlab-org/gitlab/-/issues/15886), in Gitlab version 13.1.
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
{ {
"type": "composer", "type": "composer",
"url" : "https://wpackagist.org" "url" : "https://wpackagist.org"
},
{
"type": "vcs",
"url": "git@git.autistici.org:lucha/r2db.git"
} }
], ],
"require": { "require": {
...@@ -23,24 +27,30 @@ ...@@ -23,24 +27,30 @@
"koodimonni/composer-dropin-installer": "^1.2", "koodimonni/composer-dropin-installer": "^1.2",
"johnpbloch/wordpress": "^5.4", "johnpbloch/wordpress": "^5.4",
"bjornjohansen/wplang": "^0.1.1", "bjornjohansen/wplang": "^0.1.1",
"wpackagist-theme/minimalism": "1.0.3", "wpackagist-theme/minimalism": "1.0.3",
"wpackagist-plugin/hyperdb": "^1.6", "wpackagist-plugin/disable-wordpress-updates": "^1.6",
"wpackagist-plugin/disable-wordpress-updates": "^1.6" "wpackagist-plugin/hyperdb": "^1.6"
}, },
"config": {
"vendor-dir": "app/vendor"
},
"extra": { "extra": {
"wordpress-install-dir": "web/wp", "wordpress-install-dir": "app/wp",
"installer-paths": { "installer-paths": {
"web/vendor/{$name}": ["wpackagist-plugin/hyperdb"], "mu-plugins-src/{$name}": ["wpackagist-plugin/hyperdb", "wpackagist-plugin/disable-wordpress-updates"],
"web/vendor/{$name}/": ["type:wordpress-muplugin"], "app/content/mu-plugins/{$name}/" : ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"], "app/content/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"] "app/content/themes/{$name}/": ["type:wordpress-theme"]
}, },
"wordpress-language-dir": "web/app/languages", "wordpress-language-dir": "content/languages/",
"wordpress-languages": [ "en_GB", "it_IT" ], "wordpress-languages": [ "en_GB", "it_IT" ],
"patches-file": "composer.patches.json", "patches-file": "composer.patches.json",
"dropin-paths": { "dropin-paths": {
"web/app": ["package:wpackagist-plugin/hyperdb:db.php"], "app/content/": ["package:wpackagist-plugin/hyperdb:db.php"],
"web/app/mu-plugins" : ["package:wpackagist-plugin/disable-wordpress-updates:disable-updates.php"] "app/content/mu-plugins/" : ["package:wpackagist-plugin/disable-wordpress-updates:disable-updates.php"]
} }
},
"require-dev": {
"lucha/r2db": "dev-master"
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "d57c53958c37d8c03057c125316c013b", "content-hash": "89537593d5cc46b09253a3c802eec2a3",
"packages": [ "packages": [
{ {
"name": "bjornjohansen/wplang", "name": "bjornjohansen/wplang",
...@@ -463,10 +463,96 @@ ...@@ -463,10 +463,96 @@
"homepage": "https://wordpress.org/themes/minimalism/" "homepage": "https://wordpress.org/themes/minimalism/"
} }
], ],
"packages-dev": [], "packages-dev": [
{
"name": "flexihash/flexihash",
"version": "v2.0.2",
"source": {
"type": "git",
"url": "https://github.com/pda/flexihash.git",
"reference": "497ba5782606d998f8ab0b4e5942e3a799bec018"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pda/flexihash/zipball/497ba5782606d998f8ab0b4e5942e3a799bec018",
"reference": "497ba5782606d998f8ab0b4e5942e3a799bec018",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "~1.0",
"squizlabs/php_codesniffer": "^2.3",
"symfony/config": "^2.0.0",
"symfony/console": "^2.0.0",
"symfony/filesystem": "^2.0.0",
"symfony/stopwatch": "^2.0.0",
"symfony/yaml": "^2.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Flexihash\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Annesley",
"email": "paul@annesley.cc",
"homepage": "http://paul.annesley.cc"
},
{
"name": "Dom Morgan",
"email": "dom@d3r.com",
"homepage": "https://d3r.com"
}
],
"description": "Flexihash is a small PHP library which implements consistent hashing",
"homepage": "https://github.com/pda/flexihash",
"time": "2016-04-22T21:03:23+00:00"
},
{
"name": "lucha/r2db",
"version": "dev-master",
"source": {
"type": "git",
"url": "git@git.autistici.org:lucha/r2db.git",
"reference": "24bf8c45749c08e155dc31dbcd3d070fbc12024f"
},
"require": {
"flexihash/flexihash": "^2.0"
},
"type": "library",
"autoload": {
"files": [
"db-hash.php",
"db-backends.php"
]
},
"license": [
"MIT"
],
"authors": [
{
"name": "lucha",
"email": "lucha@paranoici.org"
}
],
"description": "r2db wordpress database",
"time": "2020-05-23T21:30:55+00:00"
}
],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {
"lucha/r2db": 20
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment