- SEE ALSO
Genezzo::Havok::SysHook - load the SysHook table
# don't say "use Genezzo::Havok::SysHook". Update the # dictionary havok table:
select HavokUse('Genezzo::Havok::SysHook') from dual;
Basic Havok module - load the SysHook table
create table sys_hook ( xid number, pkg char, hook char, replace char, xtype char, xname char, args char, owner char, creationdate char, version char );
- xid - a unique id number
- pkg - name of package for this hook
- hook - name of hook function
- replace - unique name for previous hook coderef. If blank or null, just replace existing hook, otherwise is variable name for previous version of the hook, and may get called from new hook
- xtype - the string "require" or "function"
- xname - if xtype = "require", then xname is a package name, like "Text::Soundex". if xtype = "function", xname is a function name. A function name may be qualified with a package.
- args - if xtype = "require", an (optional) blank-separated list of functions to import to the default Genezzo namespace. if xtype = "function", supply an actual function body in curly braces.
- owner - owner of the package or function
- creationdate - date row was created
insert into sys_hook values (1, 'Genezzo::Dict', 'dicthook1', 'Howdy_Hook', 'require', 'Genezzo::Havok::Examples', 'Howdy', 'SYSTEM', '2004-09-21T12:12');
The row causes SysHook to "require Genezzo::Havok::Examples", and calls the "Howdy" function from the hook function "dicthook1" in the package Genezzo::Dict. The previous coderef for the function "dicthook1" (if it exists) is assigned to $Genezzo::Havok::Examples::Howdy_Hook. The Howdy function can call &$Howdy_Hook() to activate the original "dicthook1" function.
Replacing system functions in an operational database has approximately the same level of risk exposure as running with the bulls at Pamplona with your pants around your ankles. Which is to say, "somewhat foolhardy".
- should be able to dynamically create hook vars, versus using existing "our" vars.
- should we do something smart on dictionary shutdown, like unload hooks? Or have a clever way to re-init and reload a hook?
Jeffrey I. Cohen, firstname.lastname@example.org
Copyright (c) 2005-2007 Jeffrey I Cohen. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Address bug reports and comments to: email@example.com
For more information, please visit the Genezzo homepage at http://www.genezzo.com