|
From: alex b. <en...@tu...> - 2001-08-25 21:37:08
|
look groovy to me...
commit away :)
_a
----- Original Message -----
From: "Andreas Aderhold" <a.a...@th...>
To: "Bcdev" <bin...@li...>
Cc: "bcgeneral" <bin...@li...>
Sent: Saturday, August 25, 2001 5:34 AM
Subject: [binarycloud-general] Datasources, Queries
> Hi All,
>
> i've made some changes to the datasources/qry format (to match each other
> and with lang)as well as implementing proper query loading. If you all
> concur I'll commit the files.
>
> Andi
>
> --
>
> ===================================================
> Datasources.php.xml
> ---------------------------------------------------
> <datasources>
> <datasource>
> <name>dummy</name>
> <default>false</default>
> <database>test</database>
> </datasource>
> <datasource>
> <name>query_example</name>
> <default>true</default>
> <database>test</database>
> <Type>mysql</Type>
> <Host>localhost</Host>
> <User>root</User>
> <Password>sql</Password>
> <IncludePath>BC_PATH."ext/metabase"</IncludePath>
> <Persistent>true</Persistent>
> </datasource>
> </datasources>
>
> ---------------------------------------------------
> will result in Datasources.php
> ---------------------------------------------------
> <?php
> global $QueryManager;
> $QueryManager->datasources = array(
> array(
> 'name' => "dummy",
> 'default' => false,
> 'database' => "test",
> ),
> array(
> 'name' => "query_example",
> 'default' => true,
> 'database' => "test",
> 'Type' => "mysql",
> 'Host' => "localhost",
> 'User' => "root",
> 'Password' => "sql",
> 'IncludePath' => BC_PATH."ext/metabase",
> 'Persistent' => true,
> ),
> );
>
> ===================================================
> Something.qry.xml
> ---------------------------------------------------
> <queries>
> <query>
> <name>user.news.tinylist</name>
> <sql>SELECT newsid, date, title FROM news ORDER BY date DESC</sql>
> </query>
> <query>
> <name>user.news.newsbyid</name>
> <sql>SELECT a.title, b.login, a.date, a.news FROM news a, users b WHERE
> a.userId = b.userId AND newsId = ?</sql>
> <argtypes>
> <type>integer</type>
> </argtypes>
> </query>
> </queries>
>
> ---------------------------------------------------
> will result in "Something.php", I guess:
> ---------------------------------------------------
> <?php
> global $QueryManager;
> $queries = array(
> array(
> 'name' => "user.news.tinylist",
> 'sql' => "SELECT newsid, date, title FROM news ORDER BY date DESC",
> ),
> array(
> 'name' => "user.news.newsbyid",
> 'sql' => "SELECT a.title, b.login, a.date, a.news FROM news a, users b
> WHERE a.userId = b.userId AND newsId = ?",
> 'argtypes' => array('integer'),
> ),
> );
>
> $QueryManager->LoadQueries($queries);
> unset($queries);
> ?>
>
>
> _______________________________________________
> binarycloud-general mailing list
> bin...@li...
> http://lists.sourceforge.net/lists/listinfo/binarycloud-general
>
|