[ Index ]

PHP Cross Reference of Akelos Framework

title

Body

[close]

/ -> AkPlugin.php (summary)

(no description)

File Size: 296 lines (9 kb)
Included or required: 3 times
Referenced: 0 times
Includes or requires: 2 files
 AkActionView/AkHelperLoader.php
 AkClassExtender.php

Defines 2 classes

AkPlugin:: (4 methods):
  extendClassWithCode()
  observeModel()
  addHelper()
  getPath()

AkPluginLoader:: (8 methods):
  loadPlugins()
  extendClasses()
  instantiatePlugins()
  instantiatePlugin()
  getAvailablePlugins()
  getBasePath()
  _getPriorizedPlugins()
  _findPlugins()


Class: AkPlugin  - X-Ref

Base class that all Akelos plugins should extend

extendClassWithCode($class_name, $path_to_code, $priority = 100)   X-Ref
This method will add the functionality of the code available at $path_to_code which
inherits from $class_name to a new class named Extensible$class_name

You can extend the same object from multiple plugins. So you can doo something like

Example:

finder_on_steroids

@ app/vendor/plugins/finder_on_steroids/init.php

class FinderOnSteroidsPlugin extends AkPlugin {
function load(){
$this->extendClassWithCode('AkActiveRecord', 'lib/FinderOnSteroids.php');
}
}

@ app/vendor/plugins/finder_on_steroids/lib/FinderOnSteroids.php

class FinderOnSteroids extends AkActiveRecord {
function findSteroids(){
//
}
}

This will create a new class named ExtensibleAkActiveRecord class you can use
as parent of your ActiveRecord class at app/shared_model.php

param: string $class_name   Class name to extend
param: string $path_to_code Path to the source code file relative to your plugin base path.

observeModel($model_name, &$Observer, $priority = 100)   X-Ref
No description

addHelper($helper_name, $helper_path = null)   X-Ref
No description

getPath()   X-Ref
Gets the base path for a given plugin

return: string Plugin path

Class: AkPluginLoader  - X-Ref

The Plugin loader inspects for plugins, loads them in order and instantiates them.

loadPlugins()   X-Ref
Goes trough the plugins directory and loads them.

return: void  

extendClasses()   X-Ref
Extends core classes with plugin code. EXPERIMENTAL

return: void  

instantiatePlugins()   X-Ref
Short description for function

Long description (if any) ...

return: void  

instantiatePlugin($plugin_name)   X-Ref
Instantiates a plugin

If the plugin has a init.php file in its root path with a PluginNamePlugin class, it will instantiate the plugin
and add it to the plugin instance stack

param: string $plugin_name Plugin name
return: boolean Returns true if can instantiate the plugin and false if the plugin could not be intantiated.   

getAvailablePlugins()   X-Ref
Gets a list of available plugins.

If AK_PLUGINS is set to 'auto' it will get a list of existing directories at AK_PLUGINS_DIR

return: array    Array of existing plugins

getBasePath($plugin_name)   X-Ref
Gets a plugin base path.) ...

param: string $plugin_name Plugins name
return: string Plugin root path

_getPriorizedPlugins()   X-Ref
Gets a priorized list of plugins, where the priority is defined by the var $priority attribute

return: array   Priorized plugins

_findPlugins()   X-Ref
Loads a list of existing plugins to $this->_available_plugins by inspecting the plugins directory.

return: void   



Generated: Mon Oct 27 12:43:49 2008 Cross-referenced by PHPXref 0.6