@asmecher, I am not sure whether it is relevant here, but on another forum someone suggested to run a test script on my dev server. The script was:
function open($mode = ‘r’) {
echo FILE . ‘:’ . LINE . “HTTPFileWrapper::open start mode ={$mode}
\n”;
$realHost = $host = isset($this->info['host']) ? $this->info['host'] : $this->defaultHost;
$port = isset($this->info['port']) ? (int)$this->info['port'] : $this->defaultPort;
$path = isset($this->info['path']) ? $this->info['path'] : $this->defaultPath;
if (isset($this->info['query'])) $path .= '?' . $this->info['query'];
if (!empty($this->proxyHost)) {
$realHost = $host;
$host = $this->proxyHost;
$port = $this->proxyPort;
if (!empty($this->proxyUsername)) {
$this->headers['Proxy-Authorization'] = 'Basic ' . base64_encode($this->proxyUsername . ':' . $this->proxyPassword);
}
}
if (!($this->fp = fsockopen($host, $port)))
return false;
echo FILE . ‘:’ . LINE . “HTTPFileWrapper::open socket successfully opened
\n”;
$additionalHeadersString = '';
if (is_array($this->headers)) foreach ($this->headers as $name => $value) {
$additionalHeadersString .= "$name: $value\r\n";
}
$requestHost = preg_replace("!^.*://!", "", $realHost);
$request = 'GET ' . (empty($this->proxyHost)?$path:$this->url) . " HTTP/1.0\r\n" .
"Host: $requestHost\r\n" .
$additionalHeadersString .
"Connection: Close\r\n\r\n";
fwrite($this->fp, $request);
$response = fgets($this->fp, 4096);
// THIS IS THE KEY ONE
echo FILE . ‘:’ . LINE . “HTTPFileWrapper::open RESPONSE
\n”;
print_r($response);
die();
$rc = 0;
sscanf($response, “HTTP/%s %u %[^\r\n]\r\n”, $rc);
if ($rc == 200) {
while(fgets($this->fp, 4096) !== “\r\n”);
return true;
}
if(preg_match(’!^3\d\d$!’, $rc) && $this->redirects >= 1) {
for($response = ‘’, $time = time(); !feof($this->fp) && $time >= time() - 15; ) $response .= fgets($this->fp, 128);
if (preg_match(’!^(?:(?:Location)|(?:URI)|(?:location)): ([^\s]+)[\r\n]!m’, $response, $matches)) {
$this->close();
$location = $matches[1];
if (preg_match(’!^[a-z]+://!’, $location)) {
$this->url = $location;
} else {
$newPath = ($this->info[‘path’] !== ‘’ && strpos($location, ‘/’) !== 0 ? dirname($this->info[‘path’]) . ‘/’ : (strpos($location, ‘/’) === 0 ? ‘’ : ‘/’)) . $location;
$this->info[‘path’] = $newPath;
$this->url = $this->glue_url($this->info);
}
$returner =& FileWrapper::wrapper($this->url);
$returner->redirects = $this->redirects - 1;
return $returner;
}
}
$this->close();
return false;
}
===========================================================
When I ran this script in Chrome, I received a page that looked like what Plugin Gallery would load. It started like this:
FileWrapper:
C:\xampp\htdocs\journal\test2.php:451 Gallery contents
Hypothes.is GitHub - asmecher/hypothesis: A Hypothes.is integration plugin for OJS
This plugin integrates the Hypothes.is annotation tool into articles.
http://hypothes.is) in OJS articles, permitting annotation and commenting. (See the README document for notes on PDF support.)]]>
Public Knowledge Project pkp.contact@sfu.ca
https://github.com/asmecher/hypothesis/releases/download/ojs-3_0_2-0/hypothesis-ojs-3_0_2-0.tar.gz
3.0.2.0
Release of the Hypothes.is plugin for OJS 3.0.2.
https://github.com/asmecher/hypothesis/releases/download/ojs-3_1_0-0/hypothesis-ojs-3_1_0-0.tar.gz
3.1.0.0
3.1.0.1
Its source starts like this:
FileWrapper:
C:\xampp\htdocs\journal\test2.php:451 Gallery contents
<?xml version="1.0"?>
So, it’s almost like my server could talk to PKP and get info when it was using a separate script, but it doesn’t want to do it from inside OJS.