Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6c11207

Browse files
committed
attempts to fix tests on Travis
1 parent2ff1870 commit6c11207

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

‎src/Symfony/Component/Process/Process.php‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,27 @@ class Process
120120
159 =>'Bad syscall',
121121
);
122122

123+
/**
124+
* Returns whether PTY is supported on the current operating system.
125+
*
126+
* @return Boolean
127+
*/
128+
publicstaticfunctionisPtySupported()
129+
{
130+
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
131+
returnfalse;
132+
}
133+
134+
$proc = @proc_open('echo 1',array(array('pty'),array('pty'),array('pty')),$pipes);
135+
if (is_resource($proc)) {
136+
proc_close($proc);
137+
138+
returntrue;
139+
}
140+
141+
returnfalse;
142+
}
143+
123144
/**
124145
* Constructor.
125146
*
@@ -1183,7 +1204,7 @@ private function getDescriptors()
11831204
array('file','/dev/tty','w'),
11841205
array('file','/dev/tty','w'),
11851206
);
1186-
}elseif ($this->pty) {
1207+
}elseif ($this->pty &&self::isPtySupported()) {
11871208
$descriptors =array(
11881209
array('pty'),
11891210
array('pty'),

‎src/Symfony/Component/Process/Tests/AbstractProcessTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public function testTTYCommand()
205205
*/
206206
publicfunctiontestPTYCommand()
207207
{
208-
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
209-
$this->markTestSkipped('Windows does nothave PTY support.');
208+
if ( ! Process::isPtySupported()) {
209+
$this->markTestSkipped('PTY is notsupported on this operating system.');
210210
}
211211

212212
$process =$this->getProcess('echo "foo"');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp