liberty
[ class tree: liberty ] [ index: liberty ] [ all elements ]

Class: LibertySystem

Source Location: /liberty/LibertySystem.php

Class Overview

BitBase
   |
   --BitSingleton
      |
      --LibertySystem

System class for handling the liberty package


Variables

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: BitSingleton

BitSingleton::__construct()
BitSingleton::loadSingleton()

Class: BitBase

BitBase::BitBase()
During initialisation, we assign a name which is used by the class.
BitBase::__construct()
BitBase::clearFromCache()
BitBase::expunge()
Delete content object and all related records
BitBase::load()
BitBase::__destruct()

Class Details

[line 71]
System class for handling the liberty package



[ Top ]


Class Variables

$mContentStatus =

[line 81]


Type:   mixed


[ Top ]

$mContentTypes =

[line 84]


Type:   mixed


[ Top ]

$mDataTags =

[line 78]


Type:   mixed


[ Top ]

$mPluginFileName =

[line 87]


Type:   mixed


[ Top ]

$mPluginPath =

[line 92]


Type:   mixed


[ Top ]

$mPlugins = array()

[line 75]


Type:   mixed


[ Top ]

$mSystem =  LIBERTY_PKG_NAME

[line 91]


Type:   mixed


[ Top ]



Class Methods


static method getMimeThumbnailURL [line 790]

static Full getMimeThumbnailURL( string $pMimeType, [string $pExt = NULL])

Get the URL to the icon for the mime type passed in. This should probably check for files of multiple image types instead of just jpg



Tags:

return:  image HTML tag to mime icon
access:  public


Parameters:

string   $pMimeType   Mime type of the file
string   $pExt   Extension of the file - used to get backup mime icon

[ Top ]

constructor __construct [line 98]

LibertySystem __construct( [ $pExtras = TRUE])

Initiate Class



Overrides BitSingleton::__construct() (parent method not documented)

Parameters:

   $pExtras  

[ Top ]

method getAllMimeTemplates [line 527]

array getAllMimeTemplates( array $pTemplate)

getAllMimeTemplates will fetch templates of a given type from all active plugins



Tags:

return:  of resource paths to templates
access:  public


Parameters:

array   $pTemplate   Name of the template

[ Top ]

method getContentClassName [line 665]

string getContentClassName( $pContentTypeGuid, boolean $pPlural)

Get the display name of the content type



Tags:

return:  the display name of the content type


Parameters:

boolean   $pPlural   true will return the plural form of the content type display name
   $pContentTypeGuid  

[ Top ]

method getContentType [line 649]

string getContentType( $pContentTypeGuid, boolean $pPlural)

Get the display name of the content type



Tags:

return:  the display name of the content type


Parameters:

boolean   $pPlural   true will return the plural form of the content type display name
   $pContentTypeGuid  

[ Top ]

method getContentTypeDescription [line 698]

Content getContentTypeDescription( $pContentType $pContentType)

Get the description of a given content type



Tags:

return:  type description
access:  public


Parameters:

$pContentType   $pContentType   Content type GUID you want the description for

[ Top ]

method getContentTypeName [line 681]

string getContentTypeName( $pContentTypeGuid, [boolean $pPlural = FALSE])

Get the display name of the content type



Tags:

return:  the display name of the content type


Parameters:

boolean   $pPlural   true will return the plural form of the content type display name
   $pContentTypeGuid  

[ Top ]

method getMimeTemplate [line 510]

resource getMimeTemplate( string $pTemplate, [string $pGuid = LIBERTY_DEFAULT_MIME_HANDLER])

getMimeTemplate will fetch an appropriate template to display a given filetype



Tags:

return:  path to template
access:  public


Parameters:

string   $pTemplate   Basename of the template
string   $pGuid   GUID of plugin

[ Top ]

method getPluginFunction [line 472]

function getPluginFunction( string $pGuid, string $pFunctionName, [string $pGetDefault = FALSE], [string $pGetInactive = FALSE])

getPluginFunction



Tags:

return:  name on success, NULL on failure
access:  public


Parameters:

string   $pGuid   GUID of plugin used - if empty, we get all available functions of that type in all active plugins
string   $pFunctionName   Function type we want to use
string   $pGetDefault   Get default function for a given plugin type such as 'mime'
string   $pGetInactive   don't worry if plugin is active or not

[ Top ]

method getPluginFunctions [line 492]

array getPluginFunctions( string $pFunctionName)

getPluginFunctions Get a list of functions of a given type



Tags:

return:  of functions with the GUID as key
access:  public


Parameters:

string   $pFunctionName   Function type we want to get

[ Top ]

method getPluginInfo [line 454]

TRUE getPluginInfo( array $pGuid)

getPluginInfo



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
access:  public


Parameters:

array   $pGuid  

[ Top ]

method getPluginsOfType [line 544]

an getPluginsOfType( string $pPluginType)

getPluginsOfType will fetch all plugins of a given type



Tags:

return:  array of plugins of a given type
access:  public


Parameters:

string   $pPluginType  

[ Top ]

method getService [line 714]

Service getService( $pPackageName $pPackageName)

Get the service details of a given package



Tags:

return:  details if the package has them - FALSE if the package is not a service
access:  public


Parameters:

$pPackageName   $pPackageName   Package name of you want the service details for

[ Top ]

method hasService [line 741]

TRUE hasService( $pServiceName)

Check to see if a package has any service capabilities



Tags:

return:  on success, FALSE on failure
access:  public


Parameters:

   $pServiceName  

[ Top ]

method isPluginActive [line 261]

TRUE isPluginActive( $pPluginGuid $pPluginGuid)

Check to see if a given plugin is activ or not



Tags:

return:  if the plugin is active, FALSE if it's not


Parameters:

$pPluginGuid   $pPluginGuid   Plugin GUID of the plugin you want to check

[ Top ]

method loadActivePlugins [line 120]

none loadActivePlugins( )

Load only active plugins from disk



Tags:

access:  public


[ Top ]

method loadContentTypes [line 578]

none loadContentTypes( [ $pCacheTime = BIT_QUERY_CACHE_TIME])

Load all available content types into $this->mContentTypes



Parameters:

   $pCacheTime  

[ Top ]

method lookupMimeHandler [line 826]

handler lookupMimeHandler( &$pFileHash, string $pFileHash['mimetype'], string $pFileHash['tmp_name'])

Will return the plugin that is responsible for the given mime type



Tags:

return:  plugin guid TODO: Currently this will return the first found handler - might want to have a sort order?
access:  public


Parameters:

string   $pFileHash['mimetype']   (required if no tmp_name) Mime type of file that needs to be dealt with
string   $pFileHash['tmp_name']   (required if no mimetype) Full path to file that needs to be dealt with
   &$pFileHash  

[ Top ]

method registerContentType [line 598]

none registerContentType( $pGuid, $pTypeParams)

Register new content type



Tags:

access:  public


Parameters:

   $pGuid  
   $pTypeParams  

[ Top ]

method registerDataTag [line 273]

void registerDataTag( string $pTag, string $pPluginGuid)

Allow data plugins to register their tag



Tags:

access:  public


Parameters:

string   $pTag   Tag of plugin, e.g.: TOC
string   $pPluginGuid   GUID of plugin, e.g.: PLUGIN_GUID_TOC

[ Top ]

method registerPlugin [line 285]

none registerPlugin( $pGuid $pGuid, $pPluginParams $pPluginParams)

Allow plugins to register themselves using this function. Data is added directly to the list of existing plugins



Tags:

access:  public


Parameters:

$pGuid   $pGuid   GUID of plugin
$pPluginParams   $pPluginParams   Set of plugin parameters (see treasury/plugins/mime.*.php for example)

[ Top ]

method registerService [line 726]

none registerService( $pServiceName, $pPackageName, $pServiceHash, [ $pOptions = array()])

Register package as service - hash added to $this->mServices

$pServiceHash Service hash details. see existing service hashes found in <package>/bit_setup_inc.php for examples and details




Tags:

access:  public


Parameters:

   $pServiceName  
   $pPackageName  
   $pServiceHash  
   $pOptions  

[ Top ]

method requireHandlerFile [line 635]

TRUE requireHandlerFile( array $pContentTypeHash)

requireHandlerFile will require_once() the handler file if given the hash found in $gLibertySystem->mContentTypes[content_type_guid]



Tags:

return:  on success, FALSE on failure
access:  public


Parameters:

array   $pContentTypeHash   the hash found in $gLibertySystem->mContentTypes[content_type_guid]

[ Top ]

method resetAllPluginSettings [line 563]

TRUE resetAllPluginSettings( )

This function will purge all plugin settings set in kernel_config. useful when the path to plugins changes or plugins don't seem to be working



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
access:  public


[ Top ]

method scanAllPlugins [line 172]

TRUE scanAllPlugins( [string $pPluginsPath = NULL], [string $pPrefixPattern = NULL])

Load all plugins found in specified directory Use loadActivePlugins to load only the active plugins



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
access:  public


Parameters:

string   $pPluginsPath   Set the path where to scan for plugins
string   $pPrefixPattern   Perl regex for filenames can start with to prevent inclusion of unwanted filenames (e.g. (data\.|storage\.)). Final regex: /^{$pPrefixPattern}.*\.php$/

[ Top ]

method setActivePlugin [line 346]

TRUE setActivePlugin( array $pPluginGuid)

set a single plugin as active and store the appropriate information in the database



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
access:  public


Parameters:

array   $pPluginGuid   the plugin guid we want to set active

[ Top ]

method setActivePlugins [line 315]

TRUE setActivePlugins( array $pPluginGuids)

setActivePlugins



Tags:

return:  on success, FALSE on failure - mErrors will contain reason for failure
access:  public


Parameters:

array   $pPluginGuids   an array of all the plugin guids that are active. Any left out are *inactive*!

[ Top ]


Documentation generated on Wed, 29 Jul 2015 13:56:59 +0000 by phpDocumentor 1.5.0-lsces