Page MenuHomePhabricator

konto_check parameter inconsitency
Closed, ResolvedPublic

Description

We use multiple different ways to install the konto_check into our application servers.
Depending on the method used, different function signatures are the result. This leads to our application code being frowned upon by code anlaysis tools, when it uses these functions in a "wrong" fashion.

Detected in https://github.com/wmde/FundraisingFrontend/pull/920

Event Timeline

Pablo-WMDE moved this task from Todo to Doing on the WMDE-Fundraising-Funban-1 board.

test.php

<?php
$r = new \ReflectionFunction('lut_init');
$params = $r->getParameters();
foreach ($params as $param) {
    var_dump($param->getName(), $param->isOptional());
}

prod

pgrass@ds83-169-58-59:~$ hostname 
ds83-169-58-59.dedicated.hosteurope.de
pgrass@ds83-169-58-59:~$ php test.php 
string(6) "z_arg1"
bool(true)
string(6) "z_arg2"
bool(true)
string(6) "z_arg3"
bool(true)
string(6) "z_arg4"
bool(true)

test

pgrass@ds83-169-58-60:~$ hostname 
ds83-169-58-60.dedicated.hosteurope.de
pgrass@ds83-169-58-60:~$ php test.php 
string(6) "z_arg1"
bool(true)
string(6) "z_arg2"
bool(true)
string(6) "z_arg3"
bool(true)
string(6) "z_arg4"
bool(true)

stan

pagr@C217:~/projects/FundraisingFrontend$ docker run -v $PWD:/app --entrypoint php --rm wmde/fundraising-frontend-phpstan test.php
bool(false)
string(6) "z_arg1"
bool(true)
string(6) "z_arg2"
bool(true)
string(6) "z_arg3"
bool(true)
string(6) "z_arg4"
bool(true)

vagrant (& travis)

vagrant@vagrant:/vagrant$ php test.php 
NULL
bool(false)
NULL
bool(false)
NULL
bool(false)
Pablo-WMDE renamed this task from konto_check paramter inconsitency to konto_check parameter inconsitency.Jul 18 2017, 8:11 AM
Pablo-WMDE lowered the priority of this task from High to Lowest.

Approach: Merge & mend shell-based installations of konto_check (currently there are redundant scripts for travis & vagrant), keep 3rd way for prod systems (ansible) for the moment.