From 25e01fe02fb4bb6c6f05977324ccd464139e0aba Mon Sep 17 00:00:00 2001 From: Charles Pick Date: Tue, 28 Nov 2023 18:28:05 +0000 Subject: [PATCH 1/2] #214 Add php snippet --- .devcontainer/Dockerfile | 15 ++++++++++----- .devcontainer/devcontainer.json | 2 +- snippet-playground/php/.gitignore | 5 +++++ snippet-playground/php/composer.json | 5 +++++ snippet-playground/php/main.php | 11 +++++++++++ 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 snippet-playground/php/.gitignore create mode 100644 snippet-playground/php/composer.json create mode 100644 snippet-playground/php/main.php diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 891ceb0f..0f11c542 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -20,6 +20,10 @@ RUN apt-get install -y ruby ruby-dev # Install Java RUN apt-get install -y default-jdk +# Install PHP +RUN apt-get install -y php-cli php-xml php-mbstring +COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer + # Copy Go from the golang stage. COPY --from=golang /usr/local/go /usr/local/go ENV PATH="/usr/local/go/bin:${PATH}" @@ -32,11 +36,12 @@ WORKDIR /home/node # Install dotnet RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ - && chmod +x dotnet-install.sh \ - && ./dotnet-install.sh --channel 7.0 + && chmod +x dotnet-install.sh \ + && ./dotnet-install.sh --channel 7.0 ENV PATH="$PATH:/home/node/.dotnet" RUN mkdir -p .config/git \ - && echo ".vscode/*" >> .config/git/ignore \ - && echo "*.code-workspace" >> .config/git/ignore \ - && echo ".history/" >> .config/git/ignore + && echo ".vscode/*" >> .config/git/ignore \ + && echo "*.code-workspace" >> .config/git/ignore \ + && echo ".history/" >> .config/git/ignore + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1e1ff02c..d4ad6f94 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,6 +19,6 @@ ] } }, - "postCreateCommand": "cd /workspaces/api-docs/snippet-playground/javascript && npm i seamapi && cd /workspaces/api-docs/snippet-playground/csharp && ./init.sh", + "postCreateCommand": "cd /workspaces/api-docs/snippet-playground/javascript && npm i seamapi && cd /workspaces/api-docs/snippet-playground/csharp && ./init.sh && cd /workspaces/api-docs/snippet-playground/php && composer update", "remoteUser": "node" } diff --git a/snippet-playground/php/.gitignore b/snippet-playground/php/.gitignore new file mode 100644 index 00000000..74af4349 --- /dev/null +++ b/snippet-playground/php/.gitignore @@ -0,0 +1,5 @@ +* +!.gitignore +!README.md +!main.php +!composer.json diff --git a/snippet-playground/php/composer.json b/snippet-playground/php/composer.json new file mode 100644 index 00000000..726a83ce --- /dev/null +++ b/snippet-playground/php/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "seamapi/seam": "dev-main" + } +} diff --git a/snippet-playground/php/main.php b/snippet-playground/php/main.php new file mode 100644 index 00000000..95558703 --- /dev/null +++ b/snippet-playground/php/main.php @@ -0,0 +1,11 @@ +devices->list(); + +print_r($devices); From eeacf201e1be5e7ab63471ae0a8cb7425b83bf01 Mon Sep 17 00:00:00 2001 From: Charles Pick Date: Tue, 28 Nov 2023 18:32:30 +0000 Subject: [PATCH 2/2] #214 Add extremely basic README for running php snippet --- snippet-playground/php/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 snippet-playground/php/README.md diff --git a/snippet-playground/php/README.md b/snippet-playground/php/README.md new file mode 100644 index 00000000..5e0d501d --- /dev/null +++ b/snippet-playground/php/README.md @@ -0,0 +1,3 @@ +# Running PHP + +Just run `php main.php`