mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-19 18:25:37 +02:00
feat: use bridge description and short name in search (#2952)
* refactor: search.js * feat: use bridge description and short name in search * fix bug in previous merge commit Also reformat string from tabs to spaces
This commit is contained in:
parent
eef45d4e8d
commit
502799a74c
5 changed files with 74 additions and 74 deletions
|
@ -264,7 +264,7 @@ abstract class BridgeAbstract implements BridgeInterface
|
|||
public function loadConfiguration()
|
||||
{
|
||||
foreach (static::CONFIGURATION as $optionName => $optionValue) {
|
||||
$section = (new ReflectionClass($this))->getShortName();
|
||||
$section = $this->getShortName();
|
||||
$configurationOption = Configuration::getConfig($section, $optionName);
|
||||
|
||||
if ($configurationOption !== null) {
|
||||
|
@ -384,7 +384,7 @@ abstract class BridgeAbstract implements BridgeInterface
|
|||
|
||||
$cache = $cacheFactory->create();
|
||||
// Create class name without the namespace part
|
||||
$scope = (new \ReflectionClass($this))->getShortName();
|
||||
$scope = $this->getShortName();
|
||||
$cache->setScope($scope);
|
||||
$cache->setKey($key);
|
||||
if ($cache->getTime() < time() - $duration) {
|
||||
|
@ -404,9 +404,14 @@ abstract class BridgeAbstract implements BridgeInterface
|
|||
$cacheFactory = new CacheFactory();
|
||||
|
||||
$cache = $cacheFactory->create();
|
||||
$scope = (new \ReflectionClass($this))->getShortName();
|
||||
$scope = $this->getShortName();
|
||||
$cache->setScope($scope);
|
||||
$cache->setKey($key);
|
||||
$cache->saveData($value);
|
||||
}
|
||||
|
||||
public function getShortName(): string
|
||||
{
|
||||
return (new \ReflectionClass($this))->getShortName();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue