public static
Hawk\Plugin
|
#
get( string $name )
Get a plugin instance from it name
Get a plugin instance from it name
Parameters
- $name
- The plugin name to instance
Returns
|
public static
Hawk\Plugin
|
#
current( )
Get the plugin containing the file where this function is called
Get the plugin containing the file where this function is called
Returns
|
public static
Hawk\Plugin
|
#
getFilePlugin( string $file )
Get the plugin contaning a given filename
Get the plugin contaning a given filename
Parameters
- $file
- The filename to get the containing plugin of
Returns
|
public static
array
|
#
getAll( boolean $includeMain = true, boolean $loadConf = false )
Get all the plugins
Parameters
- $includeMain
- If true, include main plugins to the returned list
- $loadConf
- If set to true, load the plugins conf in the database
Returns
array The list of plugin instances
|
public static
array
|
#
getActivePlugins( boolean $includeMain = true )
Get all the active plugins
Get all the active plugins
Parameters
- $includeMain
- If set to true, include main plugins in the returned array
Returns
array The list of plugin instances
|
public static
array
|
#
getMainPlugins( )
Get the main plugins
Returns
array The list of plugin instances
|
public
string
|
#
getName( )
Get the plugin name
Returns
string The plugin name
|
public
boolean
|
#
isMainPlugin( )
Check if the plugin is a main plugin
Check if the plugin is a main plugin
Returns
boolean True if the plugin is a main plugin (main, install or admin), else False
|
public
array
|
#
getOptions( )
Get the plugin options
Returns
array The plugin options, where keys are the options names, and values, the values for each option
|
public
mixed
|
#
getDefinition( string $prop = null )
Get the plugin data from the manifest
Get the plugin data from the manifest
Parameters
- $prop
If set, the method will return the value of the definition property $prop.
If not set, it will return the whole definition array
Returns
mixed The plugin definition property if $prop is set,
or the whole plugin definition if $prop is not set
|
public
string
|
#
getRootDir( )
Return the root directory of the plugin
Return the root directory of the plugin
Returns
string the root directory of the plugin
|
public
string
|
#
getStartFile( )
Returns the start file of the plugin.
The start file is the file start.php, at the root of the plugin directory,
that defines the routes, widgets, and event listenter of the plugin.
Returns the start file of the plugin.
The start file is the file start.php, at the root of the plugin directory,
that defines the routes, widgets, and event listenter of the plugin.
Returns
string The file path of the plugin start file
|
public
string
|
#
getControllersDir( )
Returns the directory of the plugin containing the controllers
Returns the directory of the plugin containing the controllers
Returns
string The directory containing controllers classes of the plugin
|
public
string
|
#
getLangDir( )
Return the directory containing the plugin language files
Return the directory containing the plugin language files
Returns
string The directory contaning the plugin language files
|
public
string
|
#
getModelsDir( )
Return the directory containing the plugin models
Return the directory containing the plugin models
Returns
string The directory containing models classes of the plugin
|
public
string
|
#
getWidgetsDir( )
Return the directory containing the plugin widgets
Return the directory containing the plugin widgets
Returns
string The directory containing the widgets classes of the plugin
|
public
string
|
#
getViewsDir( )
Return the directory containing the plugin views
Return the directory containing the plugin views
Returns
string The directory contaning the plugin views
|
public
string
|
#
getView( string $view )
Return the full path of a view in the plugin
Return the full path of a view in the plugin
Parameters
- $view
- The basename of the view file to get in the plugin
Returns
string The full path of the view file
|
public
string
|
#
getStaticDir( )
Return the directory containing the plugin static files (js, css, images)
Return the directory containing the plugin static files (js, css, images)
Returns
string The directory path
|
public
string
|
#
getPublicStaticDir( )
Return the directory containing the plugin public static files (acessible by HTTP requests)
Return the directory containing the plugin public static files (acessible by HTTP requests)
Returns
string The directory path
|
public
string
|
#
getStaticUrl( string $basename = '' )
Return the url of a static file in the plugin, or the directory containing static files if $basename is empty
Return the url of a static file in the plugin, or the directory containing static files if $basename is empty
Parameters
- $basename
- The file to get the URL of
Returns
string The URL
|
public
string
|
#
getJsDir( )
Return the directory containing the plugin JavaScript files
Return the directory containing the plugin JavaScript files
Returns
string The directory path
|
public
string
|
#
getPublicJsDir( )
Return the directory containing the plugin public JavaScript files (accessible by HTTP requests)
Return the directory containing the plugin public JavaScript files (accessible by HTTP requests)
Returns
string The directory path
|
public
string
|
#
getJsUrl( string $basename = '' )
Return the URL of a public javascript file,
or the URL of the directory containing public javascript files if $basename is empty
Return the URL of a public javascript file,
or the URL of the directory containing public javascript files if $basename is empty
Parameters
- $basename
- The Javascript file basename
Returns
string The URL
|
public
string
|
#
getLessDir( )
Return the directory containing the plugin CSS files
Return the directory containing the plugin CSS files
Returns
string The directory contaning the plugin CSS files
|
public
string
|
#
getPublicCssDir( )
Return the directory containing the plugin public CSS files (accessible by HTTP requests)
Return the directory containing the plugin public CSS files (accessible by HTTP requests)
Returns
string The directory path
|
public
string
|
#
getCssUrl( string $basename = "" )
Return the URL of a public CSS file,
or the URL of the directory containing public CSS files if $basename is empty
Return the URL of a public CSS file,
or the URL of the directory containing public CSS files if $basename is empty
Parameters
- $basename
- The Less file basename
Returns
string The URL
|
public
string
|
#
getUserfilesDir( )
Return the directory containing the plugin files due to user actions
Return the directory containing the plugin files due to user actions
Returns
string The directory contaning the user files of the plugin
|
public
string
|
#
getPublicUserfilesDir( )
Return the directory containing the public (accessible by HTTP requests) plugin files due to user actions
Return the directory containing the public (accessible by HTTP requests) plugin files due to user actions
Returns
string The directory contaning the user files of the plugin
|
public
string
|
#
getUserfilesUrl( string $basename = '' )
Return the URL of a static userfile,
or the URL of the directory contaning the userfiles, if $basename is empty
Return the URL of a static userfile,
or the URL of the directory contaning the userfiles, if $basename is empty
Parameters
- $basename
- The basename of the file to get the access URL
Returns
string The URL
|
public
boolean
|
#
isInstalled( )
Check if the plugin is installed. The plugin is installed if it appears in the database
Check if the plugin is installed. The plugin is installed if it appears in the database
Returns
boolean True if the plugin is installed, False else
|
public static
|
#
getNamespaceByName( string $name )
Get a plugin namespace by it name
Get a plugin namespace by it name
Parameters
|
public
string
|
#
getNamespace( )
Get the namespace used for all files in the plugin. The namespace is generated from the plugin name
Get the namespace used for all files in the plugin. The namespace is generated from the plugin name
Returns
string The plugin namespace
|
public
Hawk\PluginInstaller
|
|
public
|
|
public
|
|
public
boolean
|
#
isActive( )
Check if the plugin is active
Check if the plugin is active
Returns
boolean True if the plugin is active, False else
|
public
|
#
activate( )
Activate the plugin in the database
Activate the plugin in the database
|
public
|
|
public
|
#
update( string $version )
Update the plugin to a given version
Update the plugin to a given version
Parameters
- $version
- The version to update the plugin
|
public
|
#
delete( )
Compelete deletion of plugin
Compelete deletion of plugin
|