Skip to content

Commit 5e195af

Browse files
authored
user agent (#14)
* adds an HTTP Header User-Agent
1 parent 0c7b72b commit 5e195af

File tree

5 files changed

+122
-63
lines changed

5 files changed

+122
-63
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Set up PHP ${{ matrix.php-version }}
2828
uses: shivammathur/setup-php@v2

CHANGES.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
3.3.0 -- Mon Mar 11 2024
2+
=====================================================
3+
- add an HTTP header: User-Agent
4+
15
3.2.2 -- Mon Feb 26 2024
26
=====================================================
37
- add setProxy method
@@ -33,7 +37,6 @@
3337
returned. file_get_contents is only used when the curl fetching doesn't
3438
work (rare)
3539

36-
3740
2.0.3 -- Sat Apr 27 2019
3841
=====================================================
3942
- API returns HTTP 401 for invalid key

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Using docker
2+
#
3+
# ```bash
4+
# docker build -t local/opencage-php .
5+
#
6+
# docker run -ti -v `pwd`:/usr/src/myapp local/opencage-php
7+
#
8+
# app@ee88ad785ca2:/usr/src/myapp$ composer install
9+
# app@ee88ad785ca2:/usr/src/myapp$ ./vendor/bin/phpunit
10+
# app@ee88ad785ca2:/usr/src/myapp$ SKIP_CURL=1 ./vendor/bin/phpunit
11+
# app@ee88ad785ca2:/usr/src/myapp$ ./vendor/bin/phpcs .
12+
# app@ee88ad785ca2:/usr/src/myapp$ ./vendor/bin/phpstan analyse --level 5 src tests demo
13+
# ```
14+
15+
FROM ubuntu:22.04
16+
17+
ENV TZ=Europe/London
18+
19+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
20+
21+
RUN apt-get update -qq && \
22+
apt-get install -y -qq curl vim php-cli php-curl php-xml php-mbstring unzip
23+
24+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
25+
26+
RUN useradd --user-group --system --create-home --no-log-init app
27+
28+
COPY . /usr/src/myapp
29+
WORKDIR /usr/src/myapp
30+
31+
RUN chown -R app:app /usr/src/myapp
32+
33+
USER app
34+
35+
VOLUME [ "/usr/src/myapp" ]
36+
37+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)