1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-08 09:36:39 +02:00

[core] Apply some fixes

This commit is contained in:
logmanoriginal
2016-09-10 21:01:02 +02:00
parent 62eec43980
commit ab16af631e
10 changed files with 153 additions and 136 deletions

View File

@@ -36,8 +36,7 @@ EOD;
$pathBridge = self::getDir() . $nameBridge . '.php';
if(!file_exists($pathBridge)){
throw new \Exception('The bridge you looking for does not exist.'
. ' It should be at path '
throw new \Exception('The bridge you looking for does not exist. It should be at path '
. $pathBridge);
}

View File

@@ -348,7 +348,7 @@ abstract class BridgeAbstract implements BridgeInterface {
if(is_null($context)){
$context = stream_context_create($contextOptions);
} else {
$prevContext=$context;
$prevContext = $context;
if(!stream_context_set_option($context, $contextOptions)){
$context = $prevContext;
}

View File

@@ -10,8 +10,8 @@ class Cache {
static public function create($nameCache){
if(!static::isValidNameCache($nameCache)){
throw new \InvalidArgumentException('Name cache must be at least'
. ' one uppercase follow or not by alphanumeric or dash characters.');
throw new \InvalidArgumentException('Name cache must be at least one
uppercase follow or not by alphanumeric or dash characters.');
}
$pathCache = self::getDir() . $nameCache . '.php';
@@ -72,7 +72,7 @@ class Cache {
static public function purge(){
$cacheTimeLimit = time() - 60*60*24;
$cacheTimeLimit = time() - 86400; // 86400 -> 24h
$cachePath = 'cache';
if(file_exists($cachePath)){
$cacheIterator = new RecursiveIteratorIterator(

View File

@@ -10,8 +10,8 @@ class Format {
static public function create($nameFormat){
if(!preg_match('@^[A-Z][a-zA-Z]*$@', $nameFormat)){
throw new \InvalidArgumentException('Name format must be at least '
. 'one uppercase follow or not by alphabetic characters.');
throw new \InvalidArgumentException('Name format must be at least
one uppercase follow or not by alphabetic characters.');
}
$nameFormat = $nameFormat . 'Format';

View File

@@ -7,8 +7,7 @@ abstract class FormatAbstract implements FormatInterface {
$contentType,
$charset,
$items,
$extraInfos
;
$extraInfos;
public function setCharset($charset){
$this->charset = $charset;

View File

@@ -73,7 +73,7 @@ CARD;
$card .= HTMLUtils::getFormHeader($bridgeName);
foreach($parameter as $id=>$inputEntry){
foreach($parameter as $id => $inputEntry){
$additionalInfoString = '';
if(isset($inputEntry['required']) && $inputEntry['required'] === true)

View File

@@ -19,9 +19,8 @@ require __DIR__ . '/HTMLUtils.php';
$vendorLibSimpleHtmlDom = __DIR__ . PATH_VENDOR . '/simplehtmldom/simple_html_dom.php';
if( !file_exists($vendorLibSimpleHtmlDom) ){
throw new \HttpException('"PHP Simple HTML DOM Parser" library is missing.'
. ' Get it from http://simplehtmldom.sourceforge.net and place the script'
. ' "simple_html_dom.php" in '
throw new \HttpException('"PHP Simple HTML DOM Parser" library is missing.
Get it from http://simplehtmldom.sourceforge.net and place the script "simple_html_dom.php" in '
. substr(PATH_VENDOR,4)
. '/simplehtmldom/'
, 500);