[cvs] [Wiki] changed: ChucksHorde4Thoughts
Chuck Hagenbuch
chuck at horde.org
Sat Nov 21 17:43:13 UTC 2009
chuck Sat, 21 Nov 2009 12:43:13 -0500
Modified page: http://wiki.horde.org/ChucksHorde4Thoughts
New Revision: 1.36
Change log: we have dependency injection now
@@ -54,62 +54,30 @@
+++ Developer docs (PHPDoc alternatives)
-
-
* http://ajaxian.com/archives/beautiful-code-documentation
-
* http://sphinx.pocoo.org/
-
-
-
-
++ Debug support
-
-
* http://code.google.com/p/webgrind/
-
*
http://www.sitepoint.com/blogs/2008/05/13/useful-in-browser-development-tools-for-php/
-
* http://badapi.trib.tv/
-
* http://bergie.iki.fi/blog/sql-level_debugging_with_midgard.html
-
* http://code.google.com/p/formaldehyde/
-
* Debug "wrapper" drivers - encapsulate another driver and delegate
all calls, but provide before/after hooks for any function along with
timing, profiling, reporting of calls and arguments, etc.
-
-
-
-
++ URLs
-
-
* We should sign (with a timestamp and HMAC, per
Horde::signQueryString) all URLs that perform destructive actions.
-
-
-
-
++ Configuration
-
-
* use Horde_Policy
-
* Allow conf.d directory styles, like Apache2 config (see
http://bugs.horde.org/ticket/4747).
-
* Use return $... in PHP config files to avoid defining local-scope
variables? (http://www.urdalen.com/blog/?p=257)
-
-
-
-
++ Permissions
@@ -192,48 +160,8 @@
* http://wiki.apache.org/hadoop/ProjectDescription
* http://code.google.com/p/the-cassandra-project/
-
-
-
-
-
-++ Object instantiation (sometimes known as dependency injection)
-
-
-
-* http://bergie.iki.fi/blog/midcom_3_and_context_injectors.html
-
-* http://www.sitepoint.com/blogs/2008/02/04/dealing-with-dependencies/
-
-* http://usrportage.de/archives/897-Antipattern-the-verbose-constructor.html
-
-*
http://usrportage.de/archives/904-Antipattern-chaining-stateless-protocol-requests.html
-
-
-
-<code>
-
-horde_ctx::getQueue
-
-$horde-> (no, no global variable)
-
-Horde::$queue (__getStatic?)
-
-Horde::queue() (__callStatic, include extra $args)
-
-Horde_Factory::make(...)
-
- ::makeQueue() (using __callStatic to introspect)
-
-Horde_Builder
-
-</code>
-
-
-
-
++ Idea sources
@@ -2959,177 +2887,5 @@
// Start from the Nth page of this article list
-$query->setOffset($_REQUEST["startfrom"]);
-
-
-
-// Execute the query returning an array of matching MidgardArticle objects
-
-// The MidgardArticles are the full article objects with all regular methods
-
-$articles = $query->execute();
-
-
-
-if (!$articles)
-
-{
-
- // Handle error
-
-}
-
-
-
-// And then display your articles
-
-print_r($articles);
-
-?>
-
-
-
-Query Builder in action
-
-Thanks to Jukka's efforts, we have already working MidgardQueryBuilder.
-
-
-
-Let's start with simple example.
-
-
-
-/* Define which MgdSchema type should be used and returned by QB */
-
-$qb = new midgardquerybuilder("NewMidgardArticle");
-
-
-
-/* Define constraints */
-
-$qb->addConstraint("topic", "<", 2);
-
-$qb->addConstraint("title", "=", "News");
-
-
-
-/* Execute SQL query and return array*/
-
-$f = $qb->execute();
-
-
-
-MySQL query executed:
-
-
-
-SELECT article.id FROM article_i,article
-
-WHERE
-
-article.topic < 2 AND article_i.title = 'News'
-
-AND article.id=article_i.sid
-
-
-
-
-
-As you notice, title property is defined in article_i table while
topic property is defined in article table.
-
-Query Builder follows class' tables definition and is able to search
for objects which has more than one table as storage.
-
-$qb->execute(); returned array with only one object ( due to record
returned by SELECT ), so
-
-
-
-print_r($f[0]);
-
-
-
-
-
- NewMidgardArticle Object
-
- (
-
- [sitegroup] => 0
-
- [author] => 0
-
- [owner] => 0
-
- [realm] => article
-
- [guid] => cedda8cb461c9f846c73f043aaf888e9
-
- [changed] =>
-
- [updated] =>
-
- [action] => create
-
- [errno] => 0
-
- [errstr] =>
-
- [id] => 28
-
- [calstart] => 0000-00-00
-
-
-
-etc etc etc
-
-
-
-Let's try to use datetime fields:
-
-
-
-
-
-$qb = new midgardquerybuilder("NewMidgardArticle");
-
-$qb->addConstraint("revised", ">", "2003-04-30 09:46:00");
-
-$f = $qb->execute();
-
-
-
-MySQL query executed:
-
-
-
-SELECT article.id FROM article_i,article
-
-WHERE
-
-article.revised > '2003-04-30 09:46:00'
-
-AND article.id=article_i.sid
-
-
-
-
-
-Now $qb->execute() returned array with 5 objects. I do not want to
-
-print'em all , so let's look at revised properties if were selected
-
-correctly:
-
-
-
-print_r($f);
-
-
-
-Array(
-
-
-
- [0] => NewMidgardArticle Object
-
-
+$query->setOffset($_REQUEST["startfrom"
More information about the cvs
mailing list