Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12420578
Application.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
Application.php
View Options
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Application class
*
* @package ObsidianWorkspaces
* @subpackage Apps
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*/
/**
* Application class
*
* This class describes an application
*/
abstract
class
Application
extends
Controller
{
/**
* @var string The application name
*/
public
static
$name
;
/**
* @var ApplicationContext The current application context
*/
public
$context
;
/**
* @var The collections, keys as collections roles and values as collections names.
*/
public
$collections
;
/**
* Initializes the controller resources
*/
public
function
initialize
()
{
$this
->
collections
=
$this
->
loadCollections
();
}
/**
* Loads the collection
*/
private
function
loadCollections
()
{
$workspaceCollections
=
$this
->
context
->
workspace
->
configuration
->
collections
;
foreach
(
$this
->
context
->
configuration
->
useCollections
as
$role
=>
$name
)
{
if
(!
array_key_exists
(
$name
,
$workspaceCollections
))
{
$name
=
WorkspaceConfiguration
::
getCollectionNameWithPrefix
(
$this
->
context
->
workspace
,
$name
);
if
(!
array_key_exists
(
$name
,
$workspaceCollections
))
{
throw
new
Exception
(
"Collection not found: $name"
);
}
}
$collections
[
$role
]
=
Collection
::
load
(
$name
,
$workspaceCollections
[
$name
]);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Nov 6, 11:26 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3134866
Default Alt Text
Application.php (1 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment