-
-
Notifications
You must be signed in to change notification settings - Fork 150
Ease contribution with Devcontainer #1041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mk-mxp
wants to merge
3
commits into
exercism:main
Choose a base branch
from
mk-mxp:add-devcontainer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+47
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM mcr.microsoft.com/devcontainers/php:4-8.4-bookworm | ||
|
|
||
| RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get -y install --no-install-recommends jq \ | ||
| && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # ds is pinned to v1, since v2 (the only version building against PHP 8.4 via | ||
| # PECL/docker-php-ext-install) dropped Vector/Deque/Stack/Queue/PriorityQueue. | ||
| RUN curl -L -o install-php-extensions \ | ||
| https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ | ||
| && chmod +x install-php-extensions \ | ||
| && ./install-php-extensions gmp ds-^1@stable intl \ | ||
| && rm install-php-extensions | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "name": "Exercism PHP", | ||
| "build": { | ||
| "dockerfile": "Dockerfile" | ||
| }, | ||
| "containerEnv": { | ||
| "XDEBUG_MODE": "off" | ||
| }, | ||
| "postCreateCommand": "composer install", | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "bmewburn.vscode-intelephense-client" | ||
| ], | ||
| "settings": { | ||
| "php.suggest.basic": false | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,16 +5,26 @@ Exercism exercises in PHP | |
| Follow these instructions to contribute to the PHP track. | ||
| To solve the exercises, head to the [PHP track][exercism-track-home] and check the [documentation][exercism-track-installation]. | ||
|
|
||
| ## Quick Start with Dev Containers | ||
|
|
||
| This repo includes a [dev container](.devcontainer) that provides PHP 8.4, Composer, `jq` and all other dependencies out of the box. | ||
| Open the repo in [VS Code][vscode-devcontainers] (or [GitHub Codespaces][github-codespaces]) and select "Reopen in Container" - `composer install` runs automatically once it starts. | ||
|
|
||
| ## Install Dependencies | ||
|
|
||
| The following system dependencies are required: | ||
|
|
||
| - `composer`, as recommended in the [PHP track installation docs][exercism-track-installation-composer]. | ||
| - [`bash` shell][gnu-bash]. | ||
| - PHP V8.4+ CLI. | ||
| - PHP V8.4+ CLI, with the following extensions: | ||
| - `ds` (V1.x) | ||
| - `intl` | ||
| - Default modules: `Core`, `ctype`, `date`, `dom`, `fileinfo`, `filter`, `hash`, `iconv`, `json`, `libxml`, `mbstring`, `pcre`, `random`, `Reflection`, `SimpleXML`, `sodium`, `SPL`, `standard`, `tokenizer`, `xml`, `xmlreader`, `xmlwriter`, `zlib` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we just mention |
||
| - An active Internet connection for installing required tools / composer packages. | ||
| - [`jq`][jq], if you change the difficulty or add a practice exercise. | ||
|
|
||
| The [dev container](.devcontainer) already provides all of the above. | ||
|
|
||
| Run the following command to get started with this project: | ||
|
|
||
| ```shell | ||
|
|
@@ -98,7 +108,9 @@ Run `bin/order-exercises.sh` when you set the exercise difficulty to a sensible | |
| [exercism-track-home]: https://exercism.org/docs/tracks/php | ||
| [exercism-track-installation]: https://exercism.org/docs/tracks/php/installation | ||
| [exercism-track-installation-composer]: https://exercism.org/docs/tracks/php/installation#h-install-composer | ||
| [github-codespaces]: https://docs.github.com/en/codespaces/overview | ||
| [gnu-bash]: https://www.gnu.org/software/bash/ | ||
| [jq]: https://jqlang.org/ | ||
| [local-file-phpcs-config]: phpcs.xml | ||
| [psr-12]: https://www.php-fig.org/psr/psr-12 | ||
| [jq]: https://jqlang.org/ | ||
| [vscode-devcontainers]: https://code.visualstudio.com/docs/devcontainers/containers | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we instead upgrade the test runner and everything to V2 ? Or would you prefer doing this in the php 8.5 upgrade ?
Note that even if they were removed, new alternatives were provided https://github.com/php-ds/ext-ds/releases/tag/v2.0.0