Removed hacks for Windows OS (Because it isn't work fine all the same)
This commit is contained in:
parent
7e735bbb3b
commit
8779880a8f
23 changed files with 36 additions and 240 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue