Removed hacks for Windows OS (Because it isn't work fine all the same)

This commit is contained in:
Dmitry Khomutov 2017-02-01 22:27:47 +07:00
commit 8779880a8f
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
23 changed files with 36 additions and 240 deletions

View file

@ -22,16 +22,7 @@ class SshKey
public function generate()
{
$tempPath = sys_get_temp_dir() . '/';
// FastCGI fix for Windows machines, where temp path is not available to
// PHP, and defaults to the unwritable system directory. If the temp
// path is pointing to the system directory, shift to the 'TEMP'
// sub-folder, which should also exist, but actually be writable.
if (IS_WIN && $tempPath == getenv("SystemRoot") . '/') {
$tempPath = getenv("SystemRoot") . '/TEMP/';
}
$keyFile = $tempPath . md5(microtime(true));
$keyFile = $tempPath . md5(microtime(true));
if (!is_dir($tempPath)) {
mkdir($tempPath);

View file

@ -1,30 +0,0 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Helper;
/**
* Windows-specific extension of the CommandExecutor class.
* @package PHPCensor\Helper
*/
class WindowsCommandExecutor extends BaseCommandExecutor
{
/**
* Use 'where' on Windows to find a binary, rather than 'which'
* @param string $binary
* @return null|string
*/
protected function findGlobalBinary($binary)
{
$command = sprintf('where %s', $binary);
$result = shell_exec($command);
return trim($result);
}
}