Loading Please wait...

Zigmoyd's loader Utilities.

This file is part of Zigmoyd PHP Framework. More...

Data Structures

class  zLoader
 Contains the methods to load module(s), View(s), plugin(s). More...

Functions

 load_module ($mod_name, $type=MOD_EXPLICIT)
 Loads a Module.
 load_plugin ($plugin_name, $type=PLUG_EXPLICIT)
 Loads Plugins.
 load_lib ($lib_name)
 Load a Lib.
 list_modules ()
 List's all the aviliable modules returns an array of all the aviliable modules.
 list_plugins ()
 List's all the aviliable plugins returns an array of all the aviliable plugins.

Variables

global $cld = array('pix', 'js', 'css', 'vbs', 'ldr')

Detailed Description

This file is part of Zigmoyd PHP Framework.

Copyright (C) 2008 Neel Basu (Sunanda Bose)

Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.

Zigmoyd is highly Modular even its own components are splitted into numerous Plugins that are preloaded or loaded on demand. It has several kinds of reusable Components plugins, Plugins, Libs.
Modules/Plugins are cross Projects. e.g. You cant make a module/plugin for a particular project only. All modules are stored into /usr/lib/module Directory and all are stored into /usr/lib/plugin Directory in Your Zigmoyd Installation Directory.
To Load a module You can simply do load_module('modue_name').
You can also load it through global $load variable $load->module('module_name').
You can also use $this->load->module('module_name') to load a module from your Controller.
To Load a plugin You can simply do load_plugin('plugin_name').
You can also load it through global $load variable $load->plugin('plugin_name').
You can also use $this->load->plugin('plugin_name') to load a plugin from your Controller.
Libs are not Cross Project. e.g. Libs are Project Specific.You can make a lib for a particular project only. Lib is also a file like Modules/Plugins. all Libs are located in usr/local/lib/ Directory in your Project's Directory.all libs have an extension .lib.php That are loaded using $this->load->lib('libName') from Controller.
can also be loaded through $load global variable using $load->lib('libName') from Controller. can also be loaded through load_lib('libName') function.

Actually a file is treated as a module/plugin. and you make a file on the module's /plugin's directory. and then list that file as a module/plugin in the list of active plugins in an Confuguration File. To create a module first create a file in /usr/lib/module (/usr/lib/plugin Directory in case of plugins) Directory in your Zigmoyd Installation directory. You can put functions/Classes/anything in it. Then activate that module by going to /etc/class.ini.php Configuration File which is a simple INI File. there you will find a [module] and a [plugin] block and at the end of that block write moduleName = path/to/module/file.php or pluginName = path/to/plugin/file.php

Warning:
remember this path/to/module/file.php or path/to/plugin/file.php is relative to /usr/lib/module and /usr/lib/plugin directory.
Copyright (C) 2008 Neel Basu (Sunanda Bose)

Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.


Function Documentation

list_modules (  ) 

List's all the aviliable modules returns an array of all the aviliable modules.

Returns:
array

Definition at line 97 of file load_func.php.

00097                        {
00098   global ${Z_LOADER_VAR_NAME};
00099   $load = &${Z_LOADER_VAR_NAME};
00100   return $load->listModules();
00101 }

list_plugins (  ) 

List's all the aviliable plugins returns an array of all the aviliable plugins.

Returns:
array

Definition at line 108 of file load_func.php.

00108                        {
00109   global ${Z_LOADER_VAR_NAME};
00110   $load = &${Z_LOADER_VAR_NAME};
00111   return $load->listPlugins();
00112 }

load_lib ( lib_name  ) 

Load a Lib.

Load's a Lib found in current project as libName.lib.php

Parameters:
$lib_name string Name of the lib to load
Returns:
boolean

Definition at line 86 of file load_func.php.

00086                             {
00087   global ${Z_LOADER_VAR_NAME};
00088   $load = &${Z_LOADER_VAR_NAME};
00089   return $load->lib($lib_name);
00090 }

load_module ( mod_name,
type = MOD_EXPLICIT 
)

Loads a Module.

Fires Error if the module doesn't exists. after successfull loading of a module you can use all the classes and functions in that module. e.g. load_module('zFaccess'); will load zFaccess module returns true if successfully loaded else returns false.

Parameters:
$mod_name string Name of the Module to load
$type int Optional MOD_EXPLICIT By default. Use MOD_INTERNAL for loading Abstract modules
Returns:
bool

Definition at line 59 of file load_func.php.

Referenced by zOrm_base::isValidEntry(), zOrm_base::isValidUpdate(), and zHttpAuth::validate().

00059                                                      {
00060   global ${Z_LOADER_VAR_NAME};
00061   $load = &${Z_LOADER_VAR_NAME};
00062   return $load->module($mod_name, $type);
00063 }

load_plugin ( plugin_name,
type = PLUG_EXPLICIT 
)

Loads Plugins.

Fires error if Plugin doesn't exists. after successful loading of a plugin you can use all the classes, functions in that plugin. load_plugin('weather'); will load weather Plugin.

Parameters:
$mod_name string Name of the Plugin to Load
$type int optinal PLUG_EXPLICIT by default use PLUG_INTERNAL to load abstract Plugins
Returns:
bool

Definition at line 74 of file load_func.php.

00074                                                          {
00075   global ${Z_LOADER_VAR_NAME};
00076   $load = &${Z_LOADER_VAR_NAME};
00077   return $load->plugin($plugin_name, $type);
00078 }


Variable Documentation

$cld = array('pix', 'js', 'css', 'vbs', 'ldr')

Definition at line 25 of file preloader.php.


Generated on Mon Oct 27 23:52:41 2008 for zigmoyd.kdevelop by doxygen 1.5.6