[core] makes 'bridge' and 'format' parameters value less verbose
remove the requirement for 'Format' and 'Bridge' suffixes: https://example.com/?action=display&bridge=Twitter&format=Atom&u=user Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
eb3392db82
commit
581bff166c
3 changed files with 16 additions and 14 deletions
lib
|
@ -122,6 +122,7 @@ class Format{
|
|||
throw new \InvalidArgumentException('Name format must be at least one uppercase follow or not by alphabetic characters.');
|
||||
}
|
||||
|
||||
$nameFormat=$nameFormat.'Format';
|
||||
$pathFormat = self::getDir() . $nameFormat . '.php';
|
||||
|
||||
if( !file_exists($pathFormat) ){
|
||||
|
@ -169,7 +170,7 @@ class Format{
|
|||
$dirFiles = scandir($pathDirFormat);
|
||||
if( $dirFiles !== false ){
|
||||
foreach( $dirFiles as $fileName ){
|
||||
if( preg_match('@^([^.]+)\.php$@U', $fileName, $out) ){ // Is PHP file ?
|
||||
if( preg_match('@^([^.]+)Format\.php$@U', $fileName, $out) ){ // Is PHP file ?
|
||||
$listFormat[] = $out[1];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue