Skip to content

Commit fe33ccd

Browse files
committed
Added support for Travis CI.
1 parent 71c0a64 commit fe33ccd

File tree

10 files changed

+349
-0
lines changed

10 files changed

+349
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dependencies/*
2+
build/*

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: php
2+
3+
php:
4+
- "7.2"
5+
6+
install:
7+
- ./scripts/composer.sh install --no-interaction
8+
9+
script:
10+
- ./scripts/print-info.sh
11+
- ./scripts/prepare-build.sh
12+
- ./scripts/phpunit.sh --coverage-clover ./build/logs/clover.xml
13+
14+
after_success:
15+
- travis_retry ./scripts/coveralls.sh

composer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name" : "jocic/encoders",
3+
"description" : "Encoders is a creatively named PHP library containing various binary-to-text encoding implementations.",
4+
"type" : "library",
5+
"license" : "MIT",
6+
"authors" : [{
7+
"name" : "Đorđe Jocić",
8+
"email" : "[email protected]"
9+
}],
10+
"keywords" : [
11+
"encoders"
12+
],
13+
"config" : {
14+
"vendor-dir" : "./dependencies"
15+
},
16+
"require" : {
17+
"php" : ">=7.0"
18+
},
19+
"require-dev" : {
20+
"php" : ">=7.2",
21+
"phpunit/phpunit" : "^7.5",
22+
"php-coveralls/php-coveralls": "^2.1"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Jocic\\" : "source/Jocic/"
27+
}
28+
}
29+
}

other/composer/1.8.0/composer.phar

1.8 MB
Binary file not shown.

other/composer/1.8.0/sha256.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0901a84d56f6d6ae8f8b96b0c131d4f51ccaf169d491813d2bcedf2a6e4cefa6

scripts/composer.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
3+
###################################################################
4+
# Script Author: Djordje Jocic #
5+
# Script Year: 2018 #
6+
# Script License: MIT License (MIT) #
7+
# =============================================================== #
8+
# Personal Website: http://www.djordjejocic.com/ #
9+
# =============================================================== #
10+
# Permission is hereby granted, free of charge, to any person #
11+
# obtaining a copy of this software and associated documentation #
12+
# files (the "Software"), to deal in the Software without #
13+
# restriction, including without limitation the rights to use, #
14+
# copy, modify, merge, publish, distribute, sublicense, and/or #
15+
# sell copies of the Software, and to permit persons to whom the #
16+
# Software is furnished to do so, subject to the following #
17+
# conditions. #
18+
# --------------------------------------------------------------- #
19+
# The above copyright notice and this permission notice shall be #
20+
# included in all copies or substantial portions of the Software. #
21+
# --------------------------------------------------------------- #
22+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #
23+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES #
24+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #
25+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
26+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #
27+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, RISING #
28+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR #
29+
# OTHER DEALINGS IN THE SOFTWARE. #
30+
###################################################################
31+
32+
##################
33+
# Core Variables #
34+
##################
35+
36+
source_dir="$(cd -- "$(dirname -- "$0")" && pwd -P)";
37+
38+
#################
39+
# PHP Variables #
40+
#################
41+
42+
php_command="$(command -v php)";
43+
44+
######################
45+
# Composer Variables #
46+
######################
47+
48+
composer_version="1.8.0";
49+
composer_location="./other/composer/$composer_version/composer.phar";
50+
51+
#########
52+
# Logic #
53+
#########
54+
55+
cd "$source_dir/../";
56+
57+
if [ -z "$php_command" ]; then
58+
echo "Error: You don't have PHP installed on your machine." && exit 1;
59+
elif [ ! -e "$composer_location" ]; then
60+
echo "Error: Composer executable is missing." && exit 1;
61+
fi
62+
63+
php "$composer_location" "$@" && exit $?;

scripts/coveralls.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
###################################################################
4+
# Script Author: Djordje Jocic #
5+
# Script Year: 2018 #
6+
# Script License: MIT License (MIT) #
7+
# =============================================================== #
8+
# Personal Website: http://www.djordjejocic.com/ #
9+
# =============================================================== #
10+
# Permission is hereby granted, free of charge, to any person #
11+
# obtaining a copy of this software and associated documentation #
12+
# files (the "Software"), to deal in the Software without #
13+
# restriction, including without limitation the rights to use, #
14+
# copy, modify, merge, publish, distribute, sublicense, and/or #
15+
# sell copies of the Software, and to permit persons to whom the #
16+
# Software is furnished to do so, subject to the following #
17+
# conditions. #
18+
# --------------------------------------------------------------- #
19+
# The above copyright notice and this permission notice shall be #
20+
# included in all copies or substantial portions of the Software. #
21+
# --------------------------------------------------------------- #
22+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #
23+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES #
24+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #
25+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
26+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #
27+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, RISING #
28+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR #
29+
# OTHER DEALINGS IN THE SOFTWARE. #
30+
###################################################################
31+
32+
##################
33+
# Core Variables #
34+
##################
35+
36+
source_dir="$(cd -- "$(dirname -- "$0")" && pwd -P)";
37+
38+
#################
39+
# PHP Variables #
40+
#################
41+
42+
php_command="$(command -v php)";
43+
44+
#######################
45+
# Coveralls Variables #
46+
#######################
47+
48+
coveralls_location="./dependencies/bin/php-coveralls";
49+
50+
#########
51+
# Logic #
52+
#########
53+
54+
cd "$source_dir/../";
55+
56+
if [ -z "$php_command" ]; then
57+
echo "Error: You don't have PHP installed on your machine." && exit 1;
58+
elif [ ! -e "$coveralls_location" ]; then
59+
echo "Error: You don't have PHP Coveralls installed - check Composer's dependencies." && exit 1;
60+
fi
61+
62+
php "$coveralls_location" "$@" && exit $?;

scripts/phpunit.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
###################################################################
4+
# Script Author: Djordje Jocic #
5+
# Script Year: 2018 #
6+
# Script License: MIT License (MIT) #
7+
# =============================================================== #
8+
# Personal Website: http://www.djordjejocic.com/ #
9+
# =============================================================== #
10+
# Permission is hereby granted, free of charge, to any person #
11+
# obtaining a copy of this software and associated documentation #
12+
# files (the "Software"), to deal in the Software without #
13+
# restriction, including without limitation the rights to use, #
14+
# copy, modify, merge, publish, distribute, sublicense, and/or #
15+
# sell copies of the Software, and to permit persons to whom the #
16+
# Software is furnished to do so, subject to the following #
17+
# conditions. #
18+
# --------------------------------------------------------------- #
19+
# The above copyright notice and this permission notice shall be #
20+
# included in all copies or substantial portions of the Software. #
21+
# --------------------------------------------------------------- #
22+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #
23+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES #
24+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #
25+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
26+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #
27+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, RISING #
28+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR #
29+
# OTHER DEALINGS IN THE SOFTWARE. #
30+
###################################################################
31+
32+
##################
33+
# Core Variables #
34+
##################
35+
36+
source_dir="$(cd -- "$(dirname -- "$0")" && pwd -P)";
37+
38+
#################
39+
# PHP Variables #
40+
#################
41+
42+
php_command="$(command -v php)";
43+
44+
#####################
45+
# PHPUnit Variables #
46+
#####################
47+
48+
phpunit_location="./dependencies/phpunit/phpunit/phpunit";
49+
50+
#########
51+
# Logic #
52+
#########
53+
54+
cd "$source_dir/../";
55+
56+
if [ -z "$php_command" ]; then
57+
echo "Error: You don't have PHP installed on your machine." && exit 1;
58+
elif [ ! -e "$phpunit_location" ]; then
59+
echo "Error: You don't have PHPUnit installed - check Composer's dependencies." && exit 1;
60+
fi
61+
62+
php "$phpunit_location" --configuration "./phpunit.xml" "$@" && exit $?;

scripts/prepare-build.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
###################################################################
4+
# Script Author: Djordje Jocic #
5+
# Script Year: 2018 #
6+
# Script License: MIT License (MIT) #
7+
# =============================================================== #
8+
# Personal Website: http://www.djordjejocic.com/ #
9+
# =============================================================== #
10+
# Permission is hereby granted, free of charge, to any person #
11+
# obtaining a copy of this software and associated documentation #
12+
# files (the "Software"), to deal in the Software without #
13+
# restriction, including without limitation the rights to use, #
14+
# copy, modify, merge, publish, distribute, sublicense, and/or #
15+
# sell copies of the Software, and to permit persons to whom the #
16+
# Software is furnished to do so, subject to the following #
17+
# conditions. #
18+
# --------------------------------------------------------------- #
19+
# The above copyright notice and this permission notice shall be #
20+
# included in all copies or substantial portions of the Software. #
21+
# --------------------------------------------------------------- #
22+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #
23+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES #
24+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #
25+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
26+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #
27+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, RISING #
28+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR #
29+
# OTHER DEALINGS IN THE SOFTWARE. #
30+
###################################################################
31+
32+
##################
33+
# Core Variables #
34+
##################
35+
36+
source_dir="$(cd -- "$(dirname -- "$0")" && pwd -P)";
37+
38+
#########
39+
# Logic #
40+
#########
41+
42+
cd "$source_dir/../";
43+
44+
mkdir -p "./build/logs";

scripts/print-info.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
3+
###################################################################
4+
# Script Author: Djordje Jocic #
5+
# Script Year: 2018 #
6+
# Script License: MIT License (MIT) #
7+
# =============================================================== #
8+
# Personal Website: http://www.djordjejocic.com/ #
9+
# =============================================================== #
10+
# Permission is hereby granted, free of charge, to any person #
11+
# obtaining a copy of this software and associated documentation #
12+
# files (the "Software"), to deal in the Software without #
13+
# restriction, including without limitation the rights to use, #
14+
# copy, modify, merge, publish, distribute, sublicense, and/or #
15+
# sell copies of the Software, and to permit persons to whom the #
16+
# Software is furnished to do so, subject to the following #
17+
# conditions. #
18+
# --------------------------------------------------------------- #
19+
# The above copyright notice and this permission notice shall be #
20+
# included in all copies or substantial portions of the Software. #
21+
# --------------------------------------------------------------- #
22+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, #
23+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES #
24+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND #
25+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT #
26+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, #
27+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, RISING #
28+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR #
29+
# OTHER DEALINGS IN THE SOFTWARE. #
30+
###################################################################
31+
32+
####################
33+
# System Variables #
34+
####################
35+
36+
kernel_name="$(uname -s)";
37+
kernel_version="$(uname -r)";
38+
architecture="$(uname -m)";
39+
hostname="$(uname -n)";
40+
41+
#################
42+
# PHP Variables #
43+
#################
44+
45+
php_command="$(command -v php)";
46+
php_version="$(php --version | sed -n 1p)";
47+
48+
###########################
49+
# Step 1 -System Details #
50+
###########################
51+
52+
printf "[+] System Details\n\n";
53+
54+
printf "Kernel Name: %s\n" "$kernel_name";
55+
printf "Kernel Version: %s\n" "$kernel_version";
56+
printf "System Architecture: %s\n" "$architecture";
57+
printf "Hostname: %s\n" "$hostname";
58+
59+
########################
60+
# Step 2 - PHP Details #
61+
########################
62+
63+
printf "\n[+] PHP Details\n\n";
64+
65+
printf "PHP Command: %s\n" "$php_command";
66+
67+
if [ -n "$php_command" ]; then
68+
69+
printf "PHP Version: %s\n" "$php_version";
70+
71+
fi

0 commit comments

Comments
 (0)