{"id":20102091,"url":"https://github.com/doiftrue/wordpress-composer-repo","last_synced_at":"2025-05-06T07:31:04.996Z","repository":{"id":196394111,"uuid":"696000894","full_name":"doiftrue/wordpress-composer-repo","owner":"doiftrue","description":"Composer repository for WordPress core","archived":false,"fork":false,"pushed_at":"2024-09-10T21:53:03.000Z","size":95,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-11T02:14:25.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doiftrue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-24T21:04:25.000Z","updated_at":"2024-09-10T21:53:06.000Z","dependencies_parsed_at":"2024-05-28T20:06:18.062Z","dependency_job_id":"33cdcfe6-e373-49ff-9236-4e4dfcb28315","html_url":"https://github.com/doiftrue/wordpress-composer-repo","commit_stats":null,"previous_names":["doiftrue/wordpress-composer-repo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doiftrue%2Fwordpress-composer-repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doiftrue%2Fwordpress-composer-repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doiftrue%2Fwordpress-composer-repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doiftrue%2Fwordpress-composer-repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doiftrue","download_url":"https://codeload.github.com/doiftrue/wordpress-composer-repo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224494499,"owners_count":17320724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:28:53.747Z","updated_at":"2024-11-13T17:28:54.274Z","avatar_url":"https://github.com/doiftrue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Composer Repository for WordPress core installation\n==================================================\n\nThis repository simply generates a `packages.json` file that can be utilized as an additional Composer repository.\n\n\u003e [!NOTE]\n\u003e **OFFICIAL WordPress.org files:** Each repository contains URLs to the WordPress zip archives hosted on WordPress.org. Examples:\n\u003e - https://downloads.wordpress.org/release/wordpress-6.3.1.zip\n\u003e - https://downloads.wordpress.org/release/wordpress-6.3.1-new-bundled.zip\n\u003e - https://downloads.wordpress.org/release/wordpress-6.3.1-no-content.zip\n\n\u003e [!IMPORTANT]  \n\u003e This repository packages is designated with `type: wordpress-dropin` (rather than `type: wordpress-core`). This is a non-standard way, but it allows to use the default [composer/installers](https://github.com/composer/installers) package. This package, in turn, allows you to install WordPress Core in the desired folder.\n\nThere are three types of Repos\n-------------------------------\n- `full` - with akismet and hello.php plugins.\n- `new-bundled` - without akismet and hello.php plugins.\n- `no-content` - without wp-content folder.\n\nThe URL of each composer repository are:\n- `https://raw.githubusercontent.com/doiftrue/wordpress-composer-repo/main/repo`\n- `https://raw.githubusercontent.com/doiftrue/wordpress-composer-repo/main/repo/new-bundled`\n- `https://raw.githubusercontent.com/doiftrue/wordpress-composer-repo/main/repo/no-content`\n\nYou should add a new composer repository to your `composer.json` file to tell the composer which URL can be used to download a specific version of WP core.\n\n\nUsage\n-----\n\n### Option 1: Install WP into the Root dir (where other project files is)\n\n\u003e [!WARNING]\n\u003e Do not use `composer/installers` for this type of installation. Instead, utilize a custom command for `post-autoload-dump` event to copy the required core files. This is because, during a future update, the composer will overwrite all files in your project.\n\n```json\n{\n    \"repositories\": [\n        {\n            \"type\": \"composer\",\n            \"url\": \"https://raw.githubusercontent.com/doiftrue/wordpress-composer-repo/main/repo/new-bundled\"\n        }\n    ],\n    \"require\": {\n        \"wordpress/wordpress\": \"~6.3.0\"\n    },\n    \"scripts\": {\n        \"post-autoload-dump\": \"rsync -a --exclude={wp-content/,wp-config-sample.php} ./vendor/wordpress/wordpress/* ./\"\n    }\n}\n```\n\nCommand under `post-autoload-dump` copies the `vendor/wordpress/wordpress` files to the current root directory. It requires: `linux` system with `rsync` package installed.\n\nNOTE: The `post-autoload-dump` command runs automatically after `composer install` or `composer update`.\n\n\n#### Alternative Option \n\nIf the `composer/installers` package is used, then the composer will install WP-Core into the `wp-content` folder, which is not what we want. To work around this issue use the following `composer.json`:\n\n```json\n{\n    \"repositories\": [\n        {\n            \"type\": \"composer\",\n            \"url\": \"https://raw.githubusercontent.com/doiftrue/wordpress-composer-repo/main/repo/no-content\"\n        }\n    ],\n    \"require\": {\n        \"wordpress/wordpress\": \"^6\",\n         \"composer/installers\": \"*\"\n    },\n\t\"extra\": {\n\t\t\"installer-paths\": {\n\t\t\t\"vendor/wordpress-core\": [ \"wordpress/wordpress\" ]\n\t\t}\n\t},\n    \"scripts\": {\n        \"post-autoload-dump\": \"sh ./dev/sh/composer-post-install.sh\"\n    },\n    \"config\": {\n        \"allow-plugins\": {\n            \"composer/installers\": true\n        }\n    }\n}\n```\nNow, on any composer changes the `post-autoload-dump` action will be triggered and the `dev/sh/composer-post-install.sh` file will be executed. So let's create this file with the following code:\n\n```sh\n#!/usr/bin/env sh\n\nwp_core_dir=./vendor/wordpress-core\npublic_dir=./public_html\n\necho 'Copy WP core files'\necho '------------------'\n\nfile_list=$(\n  find $wp_core_dir -maxdepth 1 \\\n  \\( -name 'wp-*' -o -name 'xmlrpc.php' -o -name 'index.php' \\) \\\n  -not -name 'wp-config-sample.php' \\\n  -not -name 'wp-content'\n)\n\nfor source_file in $file_list; do\n\tdest_file=\"$public_dir/$(basename \"$source_file\")\"\n\techo \"$source_file \u003e\u003e\u003e $dest_file\"\n\tcp -ur \"$source_file\" \"$dest_file\"\ndone\n\necho '------'\necho 'Copied'\n```\n\nNow, after either `compose install` or `composer update` the `dev/sh/composer-post-install.sh` script will be executed and all WP core files will be copied from the `vendor/wordpress-core` to the site `public_html` folder (other files in this folder will not be touched). \nNOTE: You may have another name for the `public_html` folder rename it in the code above.\n\n\n### Option 2: Install WP core files only into a separate `wp` folder\n\nHere we append `/no-content` to the repository URL. This will result in downloading WordPress core files without the `wp-content` folder.\n\nIn this scenario, you can utilize the [composer/installers](https://github.com/composer/installers) package to place WordPress core files in the desired folder (the `wp/` folder in this example).\n\n```json\n{\n    \"repositories\": [\n        {\n            \"type\": \"composer\",\n            \"url\": \"https://raw.githubusercontent.com/doiftrue/wordpress-composer-repo/main/repo/no-content\"\n        }\n    ],\n    \"require\": {\n        \"wordpress/wordpress\": \"~6.3.0\",\n        \"composer/installers\": \"*\"\n    },\n    \"extra\": {\n        \"installer-paths\": {\n            \"wp/\": [ \"wordpress/wordpress\" ]\n        }\n    },\n    \"config\": {\n        \"allow-plugins\": {\n            \"composer/installers\": true\n        }\n    }\n}\n```\n\n\nVersioning Info\n---------------\n\nWP Versions Schema: `6.3.1` = `MAJOR.MINOR.PATCH`.\n\nExamples:\n- `\"dev-master\"` - the latest development version.\n- `\"~6.3.0\"` - allows update PATCHs (last number) only. Same as `\"6.3.*\"`.\n- `\"^6.3.0\"` - allows update MINORs and PATCHs (all numbers except first). Same as `\"^6\"`.\n\n\n\n\nDocs\n----\nhttps://getcomposer.org/doc/05-repositories.md#hosting-your-own\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoiftrue%2Fwordpress-composer-repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoiftrue%2Fwordpress-composer-repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoiftrue%2Fwordpress-composer-repo/lists"}