* @var Array applications (each element is an instance of ApplicationConfiguration)
*/
public $applications = [];
/**
* @var Array authentication methods for this workspace (each element is an instance of AuthenticationMethod)
*/
public $authenticationMethods;
/**
* Determines if internal Obsidian Workspaces authentication can be used to login on this workspace URL
*
* @return boolean True if an user not logged in Obsidian Workspaces going to a workspace URL should be offered to login through Obsidian ; otherwise, false.
* Get applications controllers binds for this workspace
*/
public function getControllersBinds () {
$controllers = [];
foreach ($this->applications as $application) {
$controllers[$application->bind] = $application;
}
return $controllers;
}
/**
* Determines if the URL fragment matches a controller binded to it.
*
* @param ApplicationConfiguration $applicationConfiguration The application configuration
* @return boolean true if the URL fragment matches an application controller's bind
*/
public function hasControllerBind ($url, &$applicationConfiguration) {
foreach ($this->applications as $application) {
if ($application->bind == $url) {
$applicationConfiguration = $application;
return true;
}
}
return false;
}
/**
* Loads a WorkspaceConfiguration instance from an object
*
* @param object $data The object to deserialize
* @return WorkspaceConfiguration The deserialized instance
*/
public static function loadFromObject ($data) {
$instance = new WorkspaceConfiguration();
//Applications array
if (property_exists($data, 'applications')) {
foreach ($data->applications as $application) {
$controllerClass = $application->name;
if (!class_exists($controllerClass)) {
- throw new Exception("Application controller doesn't exist: $controllerClass. If you've just added application code, update includes/autoload.php file to register your new classes.");
+ trigger_error("Application controller doesn't exist: $controllerClass. If you've just added application code, update includes/autoload.php file to register your new classes.", E_USER_WARNING);