Skip to content

Commit

Permalink
Merge pull request #151 from p0lemic/allow-reload-sifo-urls
Browse files Browse the repository at this point in the history
Add reload urls method
  • Loading branch information
p0lemic authored Apr 11, 2023
2 parents cfb152a + 6ea6737 commit 20ca350
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
57 changes: 57 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Sifo/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ protected function __construct( $instance_name )
* @param string $instance_name Instance Name, needed to determine correct paths.
* @return Config
*/
public static function getInstance( $instance_name = null )
public static function getInstance( $instance_name = null, $force = false )
{
// Load instance from bootsrap
if ( !isset( $instance_name ) )
{
$instance_name = Bootstrap::$instance;
}

if ( !isset ( self::$instance[$instance_name] ) )
if ( !isset ( self::$instance[$instance_name] ) || $force === true )
{
self::$instance[$instance_name] = new self( $instance_name );
}
Expand Down
10 changes: 10 additions & 0 deletions src/Sifo/Urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ public function getUrlConfig()
return $this->url_instance_config;
}

public function reloadUrlConfig($instance_name = null)
{
if ( null === $instance_name )
{
$instance_name = Bootstrap::$instance;
}

self::$instance[$instance_name] = new Urls( $instance_name );
}

/**
* Returns information that helps to determine how urls must be processed.
*
Expand Down

0 comments on commit 20ca350

Please sign in to comment.