Skip to content

Commit

Permalink
Merge 6fe53ba into 58e1bf1
Browse files Browse the repository at this point in the history
  • Loading branch information
adatzer authored Feb 17, 2021
2 parents 58e1bf1 + 6fe53ba commit 3596dd4
Show file tree
Hide file tree
Showing 26 changed files with 162 additions and 81 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: cd

on:
push:
tags:
- '*.*.*'

jobs:
release:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
extensions: mbstring
coverage: xdebug

- name: Start mountebank container with imposter
run: |
docker run -d --rm --mount type=bind,source=$(pwd)/tests/mountebank_mocks,destination=/imposters -p 2525:2525 -p 4545:4545 bbyars/mountebank --configfile /imposters/imposter.json
while ! nc -z localhost 2525; do sleep 0.1; done
- name: Composer
run: |
composer self-update
composer install
- name: Test and send coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
php vendor/bin/phpunit
php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: Get tag and tracker versions
id: version
run: |
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/*/}
echo "##[set-output name=PHP_TRACKER_VERSION;]$(cat src/Constants.php | sed -n -e 's/^.*TRACKER_VERSION[[:blank:]]*= "php-\(.*\)";/\1/p')"
- name: Fail if version mismatch
if: ${{ steps.version.outputs.TAG_VERSION != steps.version.outputs.PHP_TRACKER_VERSION }}
run: |
echo "Tag version (${{ steps.version.outputs.TAG_VERSION }}) doesn't match version in project (${{ steps.version.outputs.PHP_TRACKER_VERSION }})"
exit 1
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: ${{ contains(steps.version.outputs.TAG_VERSION, '-rc') }}
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.2'
extensions: mbstring
coverage: xdebug

- name: Start mountebank container with imposter
run: |
docker run -d --rm --mount type=bind,source=$(pwd)/tests/mountebank_mocks,destination=/imposters -p 2525:2525 -p 4545:4545 bbyars/mountebank --configfile /imposters/imposter.json
while ! nc -z localhost 2525; do sleep 0.1; done
- name: Composer
run: |
composer self-update
composer install
- name: Test and send coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
php vendor/bin/phpunit
php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Version 0.3.1 (2021-02-17)
--------------------------
Update copyright notices to 2021 (#92)
Fix expected hash in Dockerfile (#90)
Migrate to GitHub actions (#88)
Upgrade ramsey/uuid version constraint to allow v3 or v4 (#87)

Version 0.3.0 (2019-06-06)
--------------------------
Fix coverall setup (#79)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \
WORKDIR /usr/bin

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Make sure `docker` & `docker-compose` are installed.

## Copyright and license

The Snowplow PHP Tracker is copyright 2014-2019 Snowplow Analytics Ltd.
The Snowplow PHP Tracker is copyright 2014-2021 Snowplow Analytics Ltd.

Licensed under the **[Apache License, Version 2.0][license]** (the "License");
you may not use this software except in compliance with the License.
Expand Down Expand Up @@ -67,4 +67,4 @@ limitations under the License.
[license]: https://www.apache.org/licenses/LICENSE-2.0

[tracker-classificiation]: https://github.com/snowplow/snowplow/wiki/Tracker-Maintenance-Classification
[early-release]: https://img.shields.io/static/v1?style=flat&label=Snowplow&message=Early%20Release&color=014477&labelColor=9ba0aa&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAeFBMVEVMaXGXANeYANeXANZbAJmXANeUANSQAM+XANeMAMpaAJhZAJeZANiXANaXANaOAM2WANVnAKWXANZ9ALtmAKVaAJmXANZaAJlXAJZdAJxaAJlZAJdbAJlbAJmQAM+UANKZANhhAJ+EAL+BAL9oAKZnAKVjAKF1ALNBd8J1AAAAKHRSTlMAa1hWXyteBTQJIEwRgUh2JjJon21wcBgNfmc+JlOBQjwezWF2l5dXzkW3/wAAAHpJREFUeNokhQOCA1EAxTL85hi7dXv/E5YPCYBq5DeN4pcqV1XbtW/xTVMIMAZE0cBHEaZhBmIQwCFofeprPUHqjmD/+7peztd62dWQRkvrQayXkn01f/gWp2CrxfjY7rcZ5V7DEMDQgmEozFpZqLUYDsNwOqbnMLwPAJEwCopZxKttAAAAAElFTkSuQmCC
[early-release]: https://img.shields.io/static/v1?style=flat&label=Snowplow&message=Early%20Release&color=014477&labelColor=9ba0aa&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAeFBMVEVMaXGXANeYANeXANZbAJmXANeUANSQAM+XANeMAMpaAJhZAJeZANiXANaXANaOAM2WANVnAKWXANZ9ALtmAKVaAJmXANZaAJlXAJZdAJxaAJlZAJdbAJlbAJmQAM+UANKZANhhAJ+EAL+BAL9oAKZnAKVjAKF1ALNBd8J1AAAAKHRSTlMAa1hWXyteBTQJIEwRgUh2JjJon21wcBgNfmc+JlOBQjwezWF2l5dXzkW3/wAAAHpJREFUeNokhQOCA1EAxTL85hi7dXv/E5YPCYBq5DeN4pcqV1XbtW/xTVMIMAZE0cBHEaZhBmIQwCFofeprPUHqjmD/+7peztd62dWQRkvrQayXkn01f/gWp2CrxfjY7rcZ5V7DEMDQgmEozFpZqLUYDsNwOqbnMLwPAJEwCopZxKttAAAAAElFTkSuQmCC
4 changes: 2 additions & 2 deletions Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Worker.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"require": {
"php": ">=7.2",
"rmccue/requests": ">=1.7",
"ramsey/uuid": "3.8.0"
"ramsey/uuid": "^3 || ^4"
},
"require-dev": {
"phpunit/phpunit": "^8.1.4",
Expand Down
8 changes: 4 additions & 4 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Constants.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

Expand Down Expand Up @@ -46,7 +46,7 @@ class Constants {
* - SSL: the default for whether or not to use SSL Encryption
* - Type: the default for what type of request the emitter will be making (POST or GET)
*/
const TRACKER_VERSION = "php-0.3.0";
const TRACKER_VERSION = "php-0.3.1";
const DEFAULT_BASE_64 = true;
const DEBUG_LOG_FILES = true;
const CONTEXT_SCHEMA = "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1";
Expand Down Expand Up @@ -79,7 +79,7 @@ class Constants {
/**
* Settings for the Asynchronous Rolling Curl Emitter
* - Buffer: the amount of events that will occur before sending begins
* - Amount: the amount of times we need to reach the buffer limit
* - Amount: the amount of times we need to reach the buffer limit
* before we initiate sending
* - Window: the amount of concurrent curl requests being made
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Emitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
Emitter.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -17,7 +17,7 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

Expand Down Expand Up @@ -241,7 +241,7 @@ public function closeFile($file_path) {
} catch (ErrorException $e) {
return $e->getMessage();
}
}
}

/**
* Attempts to copy a file to a new directory
Expand All @@ -263,7 +263,7 @@ public function copyFile($path_from, $path_to) {
* Attempts to delete a file
*
* @param string $file_path - The path of the file we want to delete
* @return
* @return
*/
public function deleteFile($file_path) {
try {
Expand Down
6 changes: 3 additions & 3 deletions src/Emitters/CurlEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
CurlEmitter.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

Expand Down Expand Up @@ -70,7 +70,7 @@ public function __construct($uri, $protocol = NULL, $type = NULL, $buffer_size =
* - Or force the execution of the curl emitter
*
* @param $buffer - An array of events we are going to convert into curl resources
* @param bool $curl_send - Whether or not we are going to send the buffered curl
* @param bool $curl_send - Whether or not we are going to send the buffered curl
* objects before we reach the limit
* @return bool|string - Either true or an error string
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Emitters/FileEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
FileEmitter.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -16,15 +16,15 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

namespace Snowplow\Tracker\Emitters;
use Snowplow\Tracker\Emitter;

class FileEmitter extends Emitter {

// Emitter Parameters

private $type;
Expand All @@ -34,7 +34,7 @@ class FileEmitter extends Emitter {
private $fatal_error_occured = false;

// Worker Parameters

private $worker = 0;
private $worker_paths = array();

Expand Down
6 changes: 3 additions & 3 deletions src/Emitters/SocketEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
SocketEmitter.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

Expand All @@ -25,7 +25,7 @@
use Exception;

class SocketEmitter extends Emitter {

// Emitter Parameters

private $uri;
Expand Down
8 changes: 4 additions & 4 deletions src/Emitters/SyncEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
SyncEmitter.php
Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
This program is licensed to you under the Apache License Version 2.0,
and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
language governing permissions and limitations there under.
Authors: Joshua Beemster
Copyright: Copyright (c) 2014-2019 Snowplow Analytics Ltd
Copyright: Copyright (c) 2014-2021 Snowplow Analytics Ltd
License: Apache License Version 2.0
*/

Expand All @@ -26,9 +26,9 @@
use Exception;

class SyncEmitter extends Emitter {

// Emitter Parameters

private $type;
private $url;

Expand Down
Loading

0 comments on commit 3596dd4

Please sign in to comment.