Skip to content

Commit

Permalink
Add Travis config for PHP syntax checking
Browse files Browse the repository at this point in the history
This adds continuous-integration configuration
for checking PHP syntax.

Refs: #817
  • Loading branch information
samwilson committed Jul 14, 2018
1 parent e8df728 commit 6b28ea5
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Expand Up @@ -16,4 +16,8 @@

# Eclipse
.settings
.project
.project

# Composer
vendor/

14 changes: 14 additions & 0 deletions .travis.yml
@@ -0,0 +1,14 @@
language: php

php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'

install:
- composer install

script:
- composer validate
- vendor/bin/parallel-lint . --exclude vendor/ --exclude include/random_compat/
13 changes: 13 additions & 0 deletions composer.json
@@ -0,0 +1,13 @@
{
"name": "piwigo/piwigo",
"description": "A full featured open source photo gallery for the web.",
"license": "GPL-2.0-only",
"require-dev": {
"jakub-onderka/php-parallel-lint": "^1.0"
},
"config": {
"platform": {
"php": "5.6"
}
}
}
69 changes: 69 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions include/ws_protocols/xmlrpc_encoder.php
Expand Up @@ -21,6 +21,8 @@
// | USA. |
// +-----------------------------------------------------------------------+

if (!function_exists('xmlrpc_encode'))
{
function xmlrpc_encode($data)
{
switch (gettype($data))
Expand Down Expand Up @@ -59,6 +61,7 @@ function xmlrpc_encode($data)
return $return;
}
}
}

class PwgXmlRpcEncoder extends PwgResponseEncoder
{
Expand Down
3 changes: 2 additions & 1 deletion tools/test_piwigo.php
Expand Up @@ -276,7 +276,8 @@ function add_picture($option, $cookies, $pwg_token)
;';

$res = $mysqli->query($query);
if (($row = $res->fetch_row())[0] > 0) {
$row = $res->fetch_row();
if ($row[0] > 0) {
echo "Add a Picture OK!\n";
}
else {
Expand Down

0 comments on commit 6b28ea5

Please sign in to comment.