Skip to content

Commit

Permalink
Update: support for multiple PHP versions and Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
oesantaa committed Dec 26, 2023
1 parent 86bbf68 commit 18475a9
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 167 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
.phpunit.cache/
composer.lock
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Use an official PHP image as a starting point
FROM php:8.3-cli

# Download and install Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
php -r "unlink('composer-setup.php');"

# Install the zip extension
RUN apt-get update \
&& apt-get install -y libzip-dev zip \
&& docker-php-ext-install zip

# Install the zip extension for alpine linux distributions
#RUN apk update && \
# apk add --no-cache libzip-dev zip && \
# docker-php-ext-install zip

# Set the working directory to the root of your project
WORKDIR /app

# Copy the composer.json and composer.lock file to the container
COPY composer.json ./

# Install the dependencies
RUN composer install

# Copy the rest of your application to the container
COPY . .

# Default command to run when container starts
CMD ["php", "index.php"]
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ Send SMS messages through the LabsMobile platform and the PHP library.
## Requirements

- A user account with LabsMobile. Click on the link to create an account [here][signUp].
- This library supports PHP:
- PHP 7.2
- PHP 7.3
- PHP 7.4
- PHP 8.0
- PHP 8.1
- PHP 8.2
- PHP 8.3
- This library supports php v5.4 and higher versions of php.
- From php v5.4 to php v 7.1 it is recommended to use Composer 2.2.22.

## Installation

Expand Down
82 changes: 41 additions & 41 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"name": "labsmobile/sms-php",
"description": "Send SMS messages through the LabsMobile platform and the PHP library.",
"type": "library",
"license": "MIT",
"keywords": [
"php",
"composer",
"sms",
"httpclient",
"sms-api",
"sms-messages",
"sms-client",
"sms-notifications",
"smsapi",
"sms-php",
"labsmobile"
],
"autoload": {
"psr-4": {
"Labsmobile\\SmsPhp\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Labsmobile\\SmsPhp\\Tests\\": "tests/"
}
},
"authors": [
{
"name": "LabsMobile",
"email": "support@labsmobile.com",
"homepage": "https://www.labsmobile.com/"
}
],
"require-dev": {
"phpunit/phpunit": "^8.5"
},
"require": {
"php": "^7.2.0",
"guzzlehttp/guzzle": "^7.8",
"ext-json": "*"
"name": "labsmobile/sms-php",
"description": "Send SMS messages through the LabsMobile platform and the PHP library.",
"type": "library",
"license": "MIT",
"keywords": [
"php",
"composer",
"sms",
"httpclient",
"sms-api",
"sms-messages",
"sms-client",
"sms-notifications",
"smsapi",
"sms-php",
"labsmobile"
],
"autoload": {
"psr-4": {
"Labsmobile\\SmsPhp\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Labsmobile\\SmsPhp\\Tests\\": "tests/"
}
},
"authors": [
{
"name": "LabsMobile",
"email": "support@labsmobile.com",
"homepage": "https://www.labsmobile.com/"
}
],
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.7 || ^6.0 || ^7.0 || ^8.0"
},
"require": {
"php": ">=5.4.0, <=8.3.0",
"guzzlehttp/guzzle": "^5.0 || ^6.0 || ^7.0 || ^7.2",
"ext-json": "*"
}
}
Loading

0 comments on commit 18475a9

Please sign in to comment.