forked from blallo/rss-bridge
enable proxy usage for individual bridge
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
b43e8ef689
commit
3dd63ab6fd
3 changed files with 24 additions and 7 deletions
|
@ -111,6 +111,10 @@ try{
|
||||||
} else {
|
} else {
|
||||||
$bridge->setCache($cache); // just add disable cache to your query to disable caching
|
$bridge->setCache($cache); // just add disable cache to your query to disable caching
|
||||||
}
|
}
|
||||||
|
if(isset($_REQUEST['_p'])){
|
||||||
|
$bridge->useProxy=true;
|
||||||
|
}
|
||||||
|
$bridge->setDatas($_REQUEST);
|
||||||
$bridge->loadMetadatas();
|
$bridge->loadMetadatas();
|
||||||
$bridge->setDatas($_REQUEST);
|
$bridge->setDatas($_REQUEST);
|
||||||
// Data transformation
|
// Data transformation
|
||||||
|
|
|
@ -21,6 +21,7 @@ abstract class BridgeAbstract implements BridgeInterface{
|
||||||
public $uri = "";
|
public $uri = "";
|
||||||
public $description = 'No description provided';
|
public $description = 'No description provided';
|
||||||
public $maintainer = 'No maintainer';
|
public $maintainer = 'No maintainer';
|
||||||
|
public $useProxy = false;
|
||||||
public $parameters = array();
|
public $parameters = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +112,7 @@ abstract class BridgeAbstract implements BridgeInterface{
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if(defined('PROXY_URL')) {
|
if(defined('PROXY_URL') && $this->useProxy) {
|
||||||
$contextOptions['http']['proxy'] = PROXY_URL;
|
$contextOptions['http']['proxy'] = PROXY_URL;
|
||||||
$contextOptions['http']['request_fulluri'] = true;
|
$contextOptions['http']['request_fulluri'] = true;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,12 @@ CARD;
|
||||||
$card .= HTMLUtils::getFormHeader($bridgeName);
|
$card .= HTMLUtils::getFormHeader($bridgeName);
|
||||||
|
|
||||||
if ($isActive){
|
if ($isActive){
|
||||||
|
if(defined('PROXY_URL')){
|
||||||
|
$idArg = 'arg-' . urlencode($bridgeName) . '-' . urlencode('proxy') . '-' . urlencode('_p');
|
||||||
|
$card .= '<input id="' . $idArg . '" type="checkbox" name="_p" />' . PHP_EOL;
|
||||||
|
$card .= '<label for="' .$idArg. '">Enable proxy ('.PROXY_URL.')</label><br />' . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
$card .= HTMLUtils::getHelperButtonsFormat($formats);
|
$card .= HTMLUtils::getHelperButtonsFormat($formats);
|
||||||
} else {
|
} else {
|
||||||
$card .= '<span style="font-weight: bold;">Inactive</span>';
|
$card .= '<span style="font-weight: bold;">Inactive</span>';
|
||||||
|
@ -100,6 +106,12 @@ CARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isActive){
|
if ($isActive){
|
||||||
|
if(defined('PROXY_URL')){
|
||||||
|
$idArg = 'arg-' . urlencode($bridgeName) . '-' . urlencode('proxy') . '-' . urlencode('_p');
|
||||||
|
$card .= '<input id="' . $idArg . '" type="checkbox" name="_p" />' . PHP_EOL;
|
||||||
|
$card .= '<label for="' .$idArg. '">Enable proxy ('.PROXY_URL.')</label><br />' . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
$card .= HTMLUtils::getHelperButtonsFormat($formats);
|
$card .= HTMLUtils::getHelperButtonsFormat($formats);
|
||||||
} else {
|
} else {
|
||||||
$card .= '<span style="font-weight: bold;">Inactive</span>';
|
$card .= '<span style="font-weight: bold;">Inactive</span>';
|
||||||
|
|
Loading…
Reference in a new issue