Skip to content

Commit bdf9e9f

Browse files
Fix json error under Windows OS (//C://var//www)
1 parent 4867346 commit bdf9e9f

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

opcache.php

+18-4
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,24 @@ public function getScriptStatusRows()
109109
asort($dirs);
110110

111111
$basename = '';
112-
while (true) {
113-
if (count($this->_d3Scripts) !=1) break;
114-
$basename .= DIRECTORY_SEPARATOR . key($this->_d3Scripts);
115-
$this->_d3Scripts = reset($this->_d3Scripts);
112+
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
113+
$first = true;
114+
while (true) {
115+
if (count($this->_d3Scripts) !=1) break;
116+
if ($first) {
117+
$basename .= key($this->_d3Scripts);
118+
$first = false;
119+
} else {
120+
$basename .= '/' . key($this->_d3Scripts);
121+
}
122+
$this->_d3Scripts = reset($this->_d3Scripts);
123+
}
124+
} else {
125+
while (true) {
126+
if (count($this->_d3Scripts) !=1) break;
127+
$basename .= DIRECTORY_SEPARATOR . key($this->_d3Scripts);
128+
$this->_d3Scripts = reset($this->_d3Scripts);
129+
}
116130
}
117131

118132
$this->_d3Scripts = $this->_processPartition($this->_d3Scripts, $basename);

0 commit comments

Comments
 (0)