[PHP] Username checks #1408 (#1892)

* Reverted path changes. Removed additional files in php petstore-security-test folder. Generated new samples.

* Batch and Shell scripts modified to use the same specification files for sample generation. Sample files generated.

* Input file path in PHP client batch file equalized with the input path in the shell script file. Samples generated.

* Added a missing bracket in the PHP client mustache template.

* AbstractPhpCodegen apiDocPath and modelDocPath creation adjusted to always use slash instead of system seperator, since the values will just be used in Markdown files.

* Unnecessary samples removed.

* Fixed unnecessary diversions between Windows and Linux/Mac paths in PHP codegen.

* New samples generated after rebase.

* Fixed a sample in TypeScript Angular v2 which caused CI to break.
This commit is contained in:
Julian
2019-03-07 09:07:58 +01:00
committed by William Cheng
parent 8a0248eee0
commit c00a439dcd
67 changed files with 2950 additions and 3649 deletions

View File

@@ -581,7 +581,7 @@ use {{invokerPackage}}\ObjectSerializer;
{{#isBasic}}
{{^isBasicBearer}}
// this endpoint requires HTTP basic authentication
if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
{{/isBasicBearer}}