From: alex <bin...@li...> - 2001-08-24 19:29:48
|
alex Fri Aug 24 12:29:37 2001 EDT Modified files: /r2/binarycloud/base/init prepend.php /r2/binarycloud/user/htdocs index.xml.php Log: Added Andi's params function Index: r2/binarycloud/base/init/prepend.php diff -u r2/binarycloud/base/init/prepend.php:1.4 r2/binarycloud/base/init/prepend.php:1.5 --- r2/binarycloud/base/init/prepend.php:1.4 Mon Aug 20 12:30:29 2001 +++ r2/binarycloud/base/init/prepend.php Fri Aug 24 12:29:36 2001 @@ -1,7 +1,7 @@ <?php // {{{ Header /* - * -File $Id: prepend.php,v 1.4 2001/08/20 19:30:29 alex Exp $ + * -File $Id: prepend.php,v 1.5 2001/08/24 19:29:36 alex Exp $ * -License LGPL (http://www.gnu.org/copyleft/lesser.html) * -Copyright 2001, Intacct Corp. * -Author odysseas tsatalos, ody...@ya... @@ -18,6 +18,17 @@ // }}} // function import($_file) {{{ +/** + * This function allows developers to specify a package & class name, and + * have a class included from that. + * + * @param object The object instance this functions should applied to + * @param array The parameter array passed to the constructor + * @return bool True/false + * @author odysseas, ody...@bi... + * @access public + */ + function import($_file) { global $sImportMap; if ($sImportMap[$_file]) { return true; } @@ -35,6 +46,38 @@ } return false; } +// }}} + +// function extract_params {{{ +/** + * Non class method extract_params extracts the params passed to + * a module to class vars. + * Called within the constructor method of you module like: + * + * extract_params($this, $_params) + * + * It actually does the following: + * + * - copies $_params to $this->params + * - references each key of $this->params to $this->key + * + * @param object The object instance this functions should applied to + * @param array The parameter array passed to the constructor + * @return bool True/false + * @author Andreas Aderhold, an...@bi... + * @access public + */ + +function extract_params(&$_cls, $_params) { + if (!is_array($_params)) { + return; +} + $_cls->params = $_params; + foreach (array_keys($_cls->params) as $name) { + $_cls->$name =& $_cls->params[$name]; + } +} + // }}} ?> Index: r2/binarycloud/user/htdocs/index.xml.php diff -u r2/binarycloud/user/htdocs/index.xml.php:1.1 r2/binarycloud/user/htdocs/index.xml.php:1.2 --- r2/binarycloud/user/htdocs/index.xml.php:1.1 Thu Aug 23 17:09:11 2001 +++ r2/binarycloud/user/htdocs/index.xml.php Fri Aug 24 12:29:36 2001 @@ -1,101 +1,100 @@ -<?xml version="1.0" ?> -<!-- Header {{{ -******************************************************************************* -** -File $Id: index.xml.php,v 1.1 2001/08/24 00:09:11 alex Exp $ -** -License LGPL (http://www.gnu.org/copyleft/lesser.html) -** -Copyright 2001, The Turing Studio, Inc. -** -Author alex black, en...@tu... -****************************************************************************** -}}} --> -<page> - <init> - <ini>TRUE</ini> - <sess>TRUE</sess> - <lang>TRUE</lang> - <auth>FALSE</auth> - <perm>FALSE</perm> - <output>FALSE</output> - <debug>FALSE</debug> - <cache>TRUE</cache> - <database>TRUE</database> - </init> - <database> - <source>mysql_base</source> - </database> - <cache> - <expires>20</expires> - - </cache> - <templates> - <default> - <name>example</name> - <package>html.masters</package> - <type>html</type> - </default> - <other> - <name>other</name> - <package>html.masters</package> - <type>html</type> - </other> - </templates> - <modules> - <content> - <layout> - <name>example</name> - <package>html.layouts</package> - </layout> - <load> - <module> - <id>mooboo</id> - <name>OtherWorld</name> - <package>hello_world</package> - <load_order>3</load_order> - </module> - <module> - <id>some_other_unique_name</id> - <name>SetLangExample</name> - <package>set_lang_example</package> - <load_order>6</load_order> - </module> - <module> - <name>HelloWorld</name> - <package>hello_world</package> - <load_order>1</load_order> - <params> - <example>something I want this module to know</example> - <another>1</another> - </params> - </module> - <module> - <name>HelloWorld</name> - <package>hello_world</package> - <load_order>5</load_order> - </module> - <module> - <name>HelloWorld</name> - <package>hello_world</package> - <load_order>4</load_order> - </module> - <module> - <name>HelloWorld</name> - <package>hello_world</package> - <load_order>2</load_order> - </module> - </load> - </content> - <left> - <load> - <module> - <name>HelloWorld</name> - <package>hello_world</package> - <load_order>2</load_order> - </module> - <module> - <name>HelloWorld</name> - <package>hello_world</package> - <load_order>1</load_order> - </module> - </load> - </left> - </modules> -</page> +<?xml version="1.0" ?> +<!-- Header {{{ +******************************************************************************* +** -File $Id: index.xml.php,v 1.2 2001/08/24 19:29:36 alex Exp $ +** -License LGPL (http://www.gnu.org/copyleft/lesser.html) +** -Copyright 2001, The Turing Studio, Inc. +** -Author alex black, en...@tu... +****************************************************************************** +}}} --> +<page> + <init> + <ini>TRUE</ini> + <sess>TRUE</sess> + <lang>TRUE</lang> + <auth>FALSE</auth> + <perm>FALSE</perm> + <output>FALSE</output> + <debug>FALSE</debug> + <cache>TRUE</cache> + <database>TRUE</database> + </init> + <database> + <source>mysql_base</source> + </database> + <cache> + <expires>20</expires> + </cache> + <templates> + <default> + <name>example</name> + <package>html.masters</package> + <type>html</type> + </default> + <other> + <name>other</name> + <package>html.masters</package> + <type>html</type> + </other> + </templates> + <modules> + <content> + <layout> + <name>example</name> + <package>html.layouts</package> + </layout> + <load> + <module> + <id>mooboo</id> + <name>OtherWorld</name> + <package>hello_world</package> + <load_order>3</load_order> + </module> + <module> + <id>some_other_unique_name</id> + <name>SetLangExample</name> + <package>set_lang_example</package> + <load_order>6</load_order> + </module> + <module> + <name>HelloWorld</name> + <package>hello_world</package> + <load_order>1</load_order> + <params> + <example>something I want this module to know</example> + <another>1</another> + </params> + </module> + <module> + <name>HelloWorld</name> + <package>hello_world</package> + <load_order>5</load_order> + </module> + <module> + <name>HelloWorld</name> + <package>hello_world</package> + <load_order>4</load_order> + </module> + <module> + <name>HelloWorld</name> + <package>hello_world</package> + <load_order>2</load_order> + </module> + </load> + </content> + <left> + <load> + <module> + <name>HelloWorld</name> + <package>hello_world</package> + <load_order>2</load_order> + </module> + <module> + <name>HelloWorld</name> + <package>hello_world</package> + <load_order>1</load_order> + </module> + </load> + </left> + </modules> +</page> |
From: Andreas A. <a.a...@th...> - 2001-08-26 11:33:47
|
I modified datasources/query definitions, revised and commited the following files. Here we go: [/r2/binarycloud/user/conf/Datasources.xml.php/Datasources.php] - slight format changes too be consistent with lang, query etc - changed "Case" of metabase specific tags. i.e "IncludePath" instead of "includepath" - changed tag <database_name> to <database> [/r2/binarycloud/base/mgr/QueryManager.php] - general - changed 'QUERY' and 'ARGTYPES' records in query statements to lowercase to work with xml2php output - method PrepareConnection() - added proper support for datasources format - added support for "default" datasource used if no datasource name is supplied via init (i.e. missing in pagedef) - method _ProcessResult() - added strtolower for column-names in resultbuffer - method _LoadQueries() - changed method to support to load queries in query definition format [/r2/binarycloud/user/mod/query_example/*] - changed example and schemas to new conventions should work with oracle and mysql now - added qry/ directory and example query definitons - added demonstration of queryloading in example [/r2/binarycloud/user/htdocs/query_example.xml.php] - added xml page definition for query example [/r2/binarycloud/docs/specs/xml/datasources.xml] - documented changes Andi |