Skip to content

Commit

Permalink
user agent (#14)
Browse files Browse the repository at this point in the history
* adds an HTTP Header User-Agent
  • Loading branch information
tsamaya authored Mar 11, 2024
1 parent 0c7b72b commit 5e195af
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
Expand Down
5 changes: 4 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.3.0 -- Mon Mar 11 2024
=====================================================
- add an HTTP header: User-Agent

3.2.2 -- Mon Feb 26 2024
=====================================================
- add setProxy method
Expand Down Expand Up @@ -33,7 +37,6 @@
returned. file_get_contents is only used when the curl fetching doesn't
work (rare)


2.0.3 -- Sat Apr 27 2019
=====================================================
- API returns HTTP 401 for invalid key
Expand Down
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Using docker
#
# ```bash
# docker build -t local/opencage-php .
#
# docker run -ti -v `pwd`:/usr/src/myapp local/opencage-php
#
# app@ee88ad785ca2:/usr/src/myapp$ composer install
# app@ee88ad785ca2:/usr/src/myapp$ ./vendor/bin/phpunit
# app@ee88ad785ca2:/usr/src/myapp$ SKIP_CURL=1 ./vendor/bin/phpunit
# app@ee88ad785ca2:/usr/src/myapp$ ./vendor/bin/phpcs .
# app@ee88ad785ca2:/usr/src/myapp$ ./vendor/bin/phpstan analyse --level 5 src tests demo
# ```

FROM ubuntu:22.04

ENV TZ=Europe/London

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update -qq && \
apt-get install -y -qq curl vim php-cli php-curl php-xml php-mbstring unzip

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN useradd --user-group --system --create-home --no-log-init app

COPY . /usr/src/myapp
WORKDIR /usr/src/myapp

RUN chown -R app:app /usr/src/myapp

USER app

VOLUME [ "/usr/src/myapp" ]

CMD ["/bin/bash"]
Loading

0 comments on commit 5e195af

Please sign in to comment.