[php:core] add public static function getConnectorUrl()

This commit is contained in:
nao-pon
2016-11-03 20:56:50 +09:00
parent 68234b9934
commit ded56b8a3f
4 changed files with 21 additions and 52 deletions
+1 -17
View File
@@ -123,7 +123,7 @@ class elFinderVolumeFlysystemGoogleDriveNetmount extends \Hypweb\elFinderFlysyst
if ($options['user'] === 'init') {
if (empty($options['url'])) {
$options['url'] = $this->getConnectorUrl();
$options['url'] = elFinder::getConnectorUrl();
}
$callback = $options['url']
@@ -320,22 +320,6 @@ class elFinderVolumeFlysystemGoogleDriveNetmount extends \Hypweb\elFinderFlysyst
return $res;
}
/**
* Get script url
*
* @return string full URL
* @author Naoki Sawada
*/
private function getConnectorUrl()
{
$url = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off')? 'https://' : 'http://')
. $_SERVER['SERVER_NAME'] // host
. ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']) // port
. $_SERVER['REQUEST_URI']; // path & query
list($url) = explode('?', $url);
return $url;
}
/**
* @inheritdoc
*/