QueryPath 2.0 Release (Developer Notes)

2 views
Skip to first unread message

Matt

unread,
Jul 30, 2009, 12:15:54 AM7/30/09
to devel-querypath
I have posted the general "2.0 is released" message to the support
list. You can download the new version at http://querypath.org.

Here are some additional details, though.

QP() IS AN ABSTRACT FACTORY

First and foremost, after long and hard consideration, I have made an
architectural change that I think will help those of you who are
customizing QueryPath: I have turned qp() into an abstract factory.
Coupled with the fact that I have removed the 'final' keyword from
QueryPath, that means you can now create your own QueryPath
subclasses, and FULLY integrate with the library.

Example:
<?php

// 1. Extend QueryPath:
class MyQueryPath extends QueryPath {
function foo() {
// Do something...
}
}

// 2. Tell QueryPath to use my extended version instead of the
original one.
QueryPathOptions::merge(array('QueryPath_class' => 'MyQueryPath'));

// 3. Use the new one:
qp($myDoc)->foo();
?>

In this example, I do three things:

1. Extend QueryPath with MyQueryPath.
2. Set a global option telling the QueryPath system to use the
MyQueryPath class instead of QueryPath
3. Use qp() to create a new instance of MyQueryPath.

CHANGELOG

Also, I have posted a comprehensive changelog at
http://querypath.org/content/querypath-20-changelog

Thank you all, especially the folks at Frame Weld (http://
frameweld.com) who made significant contributions to the 2.0
architecture. Also thanks to Ken Rickard, who tossed several thousand
poorly formatted HTML 2/3 documents at QueryPath and then reported the
bugs. (<MARQUEE> anyone?)
Reply all
Reply to author
Forward
0 new messages