anewt-developers team mailing list archive
-
anewt-developers team
-
Mailing list archive
-
Message #00124
[Branch ~uws/anewt/anewt.uws] Rev 1719: [core] Rename Container to AnewtContainer (huge API break!)
------------------------------------------------------------
revno: 1719
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Sun 2009-08-02 18:32:09 +0200
message:
[core] Rename Container to AnewtContainer (huge API break!)
Yes, this is a very annoying change and affects almost all
modules. But I'm slightly refactoring Anewt and I want the
API to be clean and consistent... :)
modified:
autorecord/autorecord.lib.php
calendar/ical.lib.php
core/container.lib.php
core/container.test.php
core/module.doc.xml
database/sql-template.lib.php
database/test/postgresql.test.php
database/test/sqlite.test.php
doc/manual/examples/core-container-caching.php
doc/manual/examples/core-container-getters-and-setters.php
filters/filter.lib.php
form/controls/base.lib.php
form/controls/choice.lib.php
form/fieldset.lib.php
form/form.lib.php
image/drawingcontext.lib.php
image/image.lib.php
mail/mailmessage.lib.php
page/page.lib.php
renderer/grid/cell.lib.php
renderer/grid/column.lib.php
renderer/grid/grid.lib.php
renderer/renderer.lib.php
rss/rss.lib.php
session/module.doc.xml
smarty/smartytemplate.lib.php
textformatting/textformatter.lib.php
textile/textile.lib.php
urldispatcher/multi.lib.php
validator/base.lib.php
--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws
Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'autorecord/autorecord.lib.php'
--- autorecord/autorecord.lib.php 2009-07-26 14:38:59 +0000
+++ autorecord/autorecord.lib.php 2009-08-02 16:32:09 +0000
@@ -58,7 +58,7 @@
*
* <code>$my_instance = MyClass::db_find_one_by_id(12);</code>
*/
-abstract class AnewtAutoRecord extends Container
+abstract class AnewtAutoRecord extends AnewtContainer
{
/** \{
* \name Autorecord Registration
=== modified file 'calendar/ical.lib.php'
--- calendar/ical.lib.php 2009-07-20 20:39:48 +0000
+++ calendar/ical.lib.php 2009-08-02 16:32:09 +0000
@@ -41,7 +41,7 @@
* be serialized to a text/calendar (.ics) file, which can be imported into
* calendering applications such as Evolution, iCal or Outlook.
*/
-class iCalendar extends Container
+class iCalendar extends AnewtContainer
{
var $events = array(); /**< \private Array holding all events */
@@ -165,7 +165,7 @@
* Represents an event on a calendar. Several properties can be set: summary,
* description, date-start, date-end, all-day (boolean), location, url.
*/
-class iCalendarEvent extends Container {
+class iCalendarEvent extends AnewtContainer {
/**
* Construct creates a new iCalendar event.
*
=== modified file 'core/container.lib.php'
--- core/container.lib.php 2009-04-12 23:16:19 +0000
+++ core/container.lib.php 2009-08-02 16:32:09 +0000
@@ -15,7 +15,7 @@
* add, import and export data. See the core module documentation for more
* information on how to use this class efficiently.
*/
-class Container
+class AnewtContainer
{
/**
* Internal storage.
@@ -26,7 +26,7 @@
/**
- * Create a new Container instance.
+ * Create a new AnewtContainer instance.
*
* An optional parameter can be supplied to fill the container with initial
* values. This is the same as calling seed() manually. You may safely
@@ -59,11 +59,11 @@
* Return the data referenced by name.
*
* By default just returns the data referenced by $name. If you write
- * a class that extends Container, you can write special methods to override
- * the behaviour of the Container::get() function. In order to do this, you
- * can write a get_foo() method which will be invoked if you use \c
- * get('foo'). This allows for a consistent API, optional getter and setter
- * methods and on-the-fly generation of data.
+ * a class that extends AnewtContainer, you can write special methods to
+ * override the behaviour of the AnewtContainer::get() function. In order to
+ * do this, you can write a get_foo() method which will be invoked if you
+ * use \c get('foo'). This allows for a consistent API, optional getter and
+ * setter methods and on-the-fly generation of data.
*
* This method supports basic caching of values. If you write a get_foo_()
* method (note the trailing underscore!) and you call \c $obj->get('foo'),
@@ -120,8 +120,8 @@
* \param $default
* The default value, in case no value was set
*
- * \see Container::get
- * \see Container::setdefault
+ * \see AnewtContainer::get
+ * \see AnewtContainer::setdefault
* \see array_get_default
*/
function getdefault($name, $default=null)
@@ -139,7 +139,7 @@
*
* You can write special methods like \c set_foo() accepting a variable
* number of parameters to override the default behaviour of this methods.
- * See the documentation for Container::get() for more information.
+ * See the documentation for AnewtContainer::get() for more information.
*
* \param $name
* The name of the data to store (int or string).
@@ -190,8 +190,8 @@
* \param $default
* The default value to store, in case no value was set before
*
- * \see Container::set
- * \see Container::getdefault
+ * \see AnewtContainer::set
+ * \see AnewtContainer::getdefault
* \see array_set_default
*/
function setdefault($name, $default)
@@ -209,8 +209,8 @@
* Add data to a list.
*
* You can write special methods like \c add_foo() accepting a variable
- * number of parameters in classes extending Container. See the
- * documentation for Container::get() for more information.
+ * number of parameters in classes extending AnewtContainer. See the
+ * documentation for AnewtContainer::get() for more information.
*
* \param $name
* The name of the data to store (int or string).
@@ -218,8 +218,8 @@
* \param $value
* The value of the data to add.
*
- * \see Container::get
- * \see Container::set
+ * \see AnewtContainer::get
+ * \see AnewtContainer::set
*/
function add($name, $value)
{
@@ -246,8 +246,8 @@
* \param $name
* The name of the data to unset (int or string).
*
- * \see Container::get
- * \see Container::set
+ * \see AnewtContainer::get
+ * \see AnewtContainer::set
*/
function delete($name=null)
{
@@ -284,7 +284,7 @@
* \return
* True if the data is available, false otherwise.
*
- * \see Container::_isset
+ * \see AnewtContainer::_isset
*/
function is_set($name)
{
@@ -316,8 +316,8 @@
*
* \param $data
* An array or object containing data. Both numeric, associative and mixed
- * arrays are supported, as well as Container objects (or anything that
- * provides a valid to_array() method.
+ * arrays are supported, as well as AnewtContainer objects (or anything
+ * that provides a valid to_array() method.
*
* \param $keys
* Optional parameter that is used to selectively seed this container with
@@ -326,7 +326,7 @@
* with an $data object, the parameter is passed to $obj->to_array()
* unmodified.
*
- * \see Container::to_array
+ * \see AnewtContainer::to_array
*/
function seed($data, $keys=null)
{
@@ -370,7 +370,7 @@
* empty. Usually you don't need this method: use a new instance if you want
* to work with a different set of data.
*
- * \see Container::delete()
+ * \see AnewtContainer::delete()
*/
function clear()
{
@@ -386,7 +386,7 @@
* \return
* A numeric array with all keys.
*
- * \see Container::_keys
+ * \see AnewtContainer::_keys
*/
function keys()
{
@@ -436,7 +436,7 @@
* \return
* An associative array containing all the data from this container.
*
- * \see Container::_to_array
+ * \see AnewtContainer::_to_array
*/
function to_array($keys=null)
{
@@ -485,7 +485,7 @@
* These methods have roughly the same API as their magic counterparts, but
* don't call special getter and setter methods, so they work for simple
* values only. This is considerably faster if you're e.g. looping over many
- * Container instances and extracting some values.
+ * AnewtContainer instances and extracting some values.
*/
/**
@@ -497,7 +497,7 @@
* \return
* Associated value.
*
- * \see Container::get
+ * \see AnewtContainer::get
*/
function _get($name)
{
@@ -524,9 +524,9 @@
* \return
* The associated value or the default value supplied.
*
- * \see Container::getdefault
- * \see Container::_get
- * \see Container::get
+ * \see AnewtContainer::getdefault
+ * \see AnewtContainer::_get
+ * \see AnewtContainer::get
*/
function _getdefault($name, $default=null)
{
@@ -549,7 +549,7 @@
* \param $value
* The value of the data to store.
*
- * \see Container::set
+ * \see AnewtContainer::set
*/
function _set($name, $value)
{
@@ -567,7 +567,7 @@
* \param $value
* The value of the data to add.
*
- * \see Container::add
+ * \see AnewtContainer::add
*/
function _add($name, $value)
{
@@ -590,7 +590,7 @@
* \return
* True if set, false otherwise.
*
- * \see Container::is_set
+ * \see AnewtContainer::is_set
*/
function _isset($name)
{
@@ -618,7 +618,7 @@
* \return
* A numeric array with all internal keys.
*
- * \see Container::keys
+ * \see AnewtContainer::keys
*/
function _keys()
{
@@ -633,7 +633,7 @@
* \return
* Array (copy) containing the internal storage.
*
- * \see Container::to_array
+ * \see AnewtContainer::to_array
*/
function _to_array()
{
=== modified file 'core/container.test.php'
--- core/container.test.php 2009-04-12 22:40:12 +0000
+++ core/container.test.php 2009-08-02 16:32:09 +0000
@@ -6,13 +6,13 @@
/* Test constructor */
-$c = new Container(array('foo' => 'bar'));
+$c = new AnewtContainer(array('foo' => 'bar'));
assert('$c->get("foo") === "bar"');
/* Test clear() */
-$c = new Container();
+$c = new AnewtContainer();
$c->set('foo', 'foo_value');
$c->set('bar', 'bar_value');
$c->clear();
@@ -21,7 +21,7 @@
/* Test custom getters and setters */
-class TestContainer extends Container {
+class TestContainer extends AnewtContainer {
function get_foo() {
return 'foo_value';
}
@@ -71,7 +71,7 @@
/* Test delete() */
-$testdelete = new Container();
+$testdelete = new AnewtContainer();
assert('!$testdelete->is_set("bla")');
$testdelete->set('bla', 'woeiwoei');
@@ -82,7 +82,7 @@
/* Test underscores and dashes juggling */
-$c = new Container();
+$c = new AnewtContainer();
$c->set('foo_bar', 'baz');
assert('$c->get("foo-bar") === "baz"');
assert('$c->get("foo_bar") === "baz"');
@@ -96,7 +96,7 @@
/* Test getdefault() and setdefault() */
-$c = new Container();
+$c = new AnewtContainer();
assert('$c->getdefault("foo", "defaultvalue") === "defaultvalue"');
$c->set('foo', 'anothervalue');
=== modified file 'core/module.doc.xml'
--- core/module.doc.xml 2009-08-02 10:57:53 +0000
+++ core/module.doc.xml 2009-08-02 16:32:09 +0000
@@ -11,18 +11,18 @@
<anewt:class>AnewtException</anewt:class>
<anewt:class>AnewtRequest</anewt:class>
<anewt:class>AnewtURL</anewt:class>
- <anewt:class>Container</anewt:class>
+ <anewt:class>AnewtContainer</anewt:class>
</anewt:classes>
<p>The core module contains all basic routines offered by Anewt.
This module is loaded by default upon when Anewt is initialized.
Most functions are related to strings and arrays. The widely used
- <anewt:classref>Container</anewt:classref> object is in the core module as
- well. Additionally, some other useful functions are provided. This
- chapter only covers the basic functionality offered by the core
- module; see the API documentation and the source code (quite
- readable and pretty well documented, really) for a full
+ <anewt:classref>AnewtContainer</anewt:classref> object is in the
+ core module as well. Additionally, some other useful functions are
+ provided. This chapter only covers the basic functionality offered
+ by the core module; see the API documentation and the source code
+ (quite readable and pretty well documented, really) for a full
reference.</p>
<anewt:section>
@@ -141,83 +141,86 @@
<anewt:section>
- <anewt:title>The <anewt:classref>Container</anewt:classref> object</anewt:title>
-
- <p>The <anewt:classref>Container</anewt:classref> class is one of the most
- useful classes provided by Anewt. It allows you to implement
- <strong>flexible and extensible data objects</strong>. The
- <anewt:classref>Container</anewt:classref> class is intended to be extended
- by your own classes implementing your application logic. Your
- objects get the data handling functionality offered by the base
- <anewt:classref>Container</anewt:classref> class for free.</p>
-
- <p>The <anewt:classref>Container</anewt:classref> object is basically
- <strong>a wrapper around a hash</strong> (associative array)
- and can hold any data you provide, while adding the possibility to
- add very fine-grained control over which data can be kept in the
- object. This way you can easily start coding a fully functional
- class and add the necessary validation and output logic later. As
- long as you use your object in a standard way, calling code won't
- need any changes in case you decide to change the internal
- workings of your data object.</p>
-
- <p>The <anewt:classref>Container</anewt:classref> object can be used to
- create clever (or nasty) hacks to manipulate data. Many other
- Anewt modules (such as the the page and forms modules) heavily use
- the <anewt:classref>Container</anewt:classref> functionality.</p>
+ <anewt:title>The <anewt:classref>AnewtContainer</anewt:classref> object</anewt:title>
+
+ <p>The <anewt:classref>AnewtContainer</anewt:classref> class is one
+ of the most useful classes provided by Anewt. It allows you to
+ implement <strong>flexible and extensible data objects</strong>. The
+ <anewt:classref>AnewtContainer</anewt:classref> class is intended to
+ be extended by your own classes implementing your application logic.
+ Your objects get the data handling functionality offered by the base
+ <anewt:classref>AnewtContainer</anewt:classref> class for free.</p>
+
+ <p>The <anewt:classref>AnewtContainer</anewt:classref> object is
+ basically <strong>a wrapper around a hash</strong> (associative
+ array) and can hold any data you provide, while adding the
+ possibility to add very fine-grained control over which data can be
+ kept in the object. This way you can easily start coding a fully
+ functional class and add the necessary validation and output logic
+ later. As long as you use your object in a standard way, calling
+ code won't need any changes in case you decide to change the
+ internal workings of your data object.</p>
+
+ <p>The <anewt:classref>AnewtContainer</anewt:classref> object can be
+ used to create clever (or nasty) hacks to manipulate data. Many
+ other Anewt modules (such as the the page and forms modules) heavily
+ use the <anewt:classref>AnewtContainer</anewt:classref>
+ functionality.</p>
<anewt:section>
<anewt:title>Storing your data: getters and setters</anewt:title>
- <p>You can implement <strong>getter and setter
- methods</strong> to control which data can be retrieved from
- your object and which data can be stored in it. Note that you
- don't need to write getter and setter methods for each variable
- you want to store in the object: that's what the
- <anewt:classref>Container</anewt:classref> class does for you. The
- <anewt:functionref>Container::get()</anewt:functionref> and
- <anewt:functionref>Container::set()</anewt:functionref>
- functions accept any key/value pair, but call into your own
- functions if you have implemented those. Getter functions should
- be named <code>get_foo</code>, where <code>foo</code> is
- the key provided to the
- <anewt:functionref>Container::get()</anewt:functionref> function. The
- same idea goes for setter functions. Instead of calling the
- methods directly, you can also get and set the values by
- accessing those as instance properties. The example below shows
- some basic <anewt:classref>Container</anewt:classref> usage:</p>
+ <p>You can implement <strong>getter and setter methods</strong> to
+ control which data can be retrieved from your object and which
+ data can be stored in it. Note that you don't need to write getter
+ and setter methods for each variable you want to store in the
+ object: that's what the
+ <anewt:classref>AnewtContainer</anewt:classref> class does for
+ you. The
+ <anewt:functionref>AnewtContainer::get()</anewt:functionref> and
+ <anewt:functionref>AnewtContainer::set()</anewt:functionref>
+ functions accept any key/value pair, but call into your own
+ functions if you have implemented those. Getter functions should
+ be named <code>get_foo</code>, where <code>foo</code> is the key
+ provided to the
+ <anewt:functionref>AnewtContainer::get()</anewt:functionref>
+ function. The same idea goes for setter functions. Instead of
+ calling the methods directly, you can also get and set the values
+ by accessing those as instance properties. The example below shows
+ some basic <anewt:classref>AnewtContainer</anewt:classref>
+ usage:</p>
<anewt:example src="core-container-getters-and-setters">
<anewt:title>Basic container object usage with getter and setter methods</anewt:title>
</anewt:example>
<p>As you can see from the example, the
- <anewt:classref>Container</anewt:classref> class allows you to retrieve
- dynamically generated data from your objects, e.g. by performing
- some calculations with other data in the object. The setter
- method makes sure no invalid data can be set on your
- object.</p>
+ <anewt:classref>AnewtContainer</anewt:classref> class allows you
+ to retrieve dynamically generated data from your objects, e.g. by
+ performing some calculations with other data in the object. The
+ setter method makes sure no invalid data can be set on your
+ object.</p>
<p>For your convenience, a
- <anewt:functionref>Container::seed()</anewt:functionref> function
- is provided to fill the
- <anewt:classref>Container</anewt:classref> with
- data from an associative array. This is very useful to store the
- results of a database query: <code>$obj->seed($row_data)</code>
- is all you need to do.</p>
+ <anewt:functionref>AnewtContainer::seed()</anewt:functionref>
+ function is provided to fill the
+ <anewt:classref>AnewtContainer</anewt:classref> with data from an
+ associative array. This is very useful to store the results of a
+ database query: <code>$obj->seed($row_data)</code> is all you need
+ to do.</p>
<p>All magic methods offered by the
- <anewt:classref>Container</anewt:classref> class have
- <strong>non-magic equivalents</strong> with the same name
- starting with an underscore, e.g.
- <anewt:functionref>Container::_get()</anewt:functionref>,
- <anewt:functionref>Container::set()</anewt:functionref>, and
- <anewt:functionref>Container::_seed()</anewt:functionref>.
- These methods do not do any magic, but just store or retrieve
- data on the object without calling into getter and setter
- methods. This is considerably faster, but does not offer you as
- much flexibility.</p>
+ <anewt:classref>AnewtContainer</anewt:classref> class have
+ <strong>non-magic equivalents</strong> with the same name starting
+ with an underscore, e.g.
+ <anewt:functionref>AnewtContainer::_get()</anewt:functionref>,
+ <anewt:functionref>AnewtContainer::set()</anewt:functionref>, and
+ <anewt:functionref>AnewtContainer::_seed()</anewt:functionref>.
+ These methods do not do any magic, but just store or retrieve data
+ on the object without calling into getter and setter methods. This
+ is considerably faster, but does not offer you as much
+ flexibility.</p>
</anewt:section>
@@ -225,16 +228,16 @@
<anewt:title>Simple caching</anewt:title>
- <p>If your getter methods do computationally expensive
- operations, like querying data from a database or doing some
- heavy calculations, each <code>$obj->get('foo')</code> call will
- cause a lot of overhead. In some cases it might be worth using a
- <strong>simple caching mechanism</strong>: the dynamically
- generated value is stored in the container and used on
- subsequent <code>$obj->get('foo')</code> calls. To use caching,
- you append an underscore to your getter method's name, so that
- it becomes <code>get_foo_()</code> instead of
- <code>get_foo()</code>. See also the example below:</p>
+ <p>If your getter methods do computationally expensive operations,
+ like querying data from a database or doing some heavy
+ calculations, each <code>$obj->get('foo')</code> call will cause a
+ lot of overhead. In some cases it might be worth using a
+ <strong>simple caching mechanism</strong>: the dynamically
+ generated value is stored in the container and used on subsequent
+ <code>$obj->get('foo')</code> calls. To use caching, you append an
+ underscore to your getter method's name, so that it becomes
+ <code>get_foo_()</code> instead of <code>get_foo()</code>. See
+ also the example below:</p>
<anewt:example src="core-container-caching">
<anewt:title>Using simple caching in data objects</anewt:title>
@@ -248,19 +251,20 @@
<anewt:title>The <anewt:classref>AnewtRequest</anewt:classref> class</anewt:title>
- <p>The <anewt:classref>AnewtRequest</anewt:classref> class provides several
- static methods to retrieve information about the current request.
- The relative and canonical (full) URL's for the current request
- can be retrieved using the
- <anewt:functionref>AnewtRequest::relative_url()</anewt:functionref> and
- <anewt:functionref>AnewtRequest::canonical_url()</anewt:functionref> methods. Furthermore, the
- request type can easily be determined by calling the
- <anewt:functionref>AnewtRequest::method()</anewt:functionref>,
- <anewt:functionref>AnewtRequest::is_get()</anewt:functionref> and
- <anewt:functionref>AnewtRequest::is_post()</anewt:functionref>
- methods. In addition, several methods to extract GET, POST or
- cookie data (with type-safety) are available.
- </p>
+ <p>The <anewt:classref>AnewtRequest</anewt:classref> class provides
+ several static methods to retrieve information about the current
+ request. The relative and canonical (full) URL's for the current
+ request can be retrieved using the
+ <anewt:functionref>AnewtRequest::relative_url()</anewt:functionref>
+ and
+ <anewt:functionref>AnewtRequest::canonical_url()</anewt:functionref>
+ methods. Furthermore, the request type can easily be determined by
+ calling the
+ <anewt:functionref>AnewtRequest::method()</anewt:functionref>,
+ <anewt:functionref>AnewtRequest::is_get()</anewt:functionref> and
+ <anewt:functionref>AnewtRequest::is_post()</anewt:functionref>
+ methods. In addition, several methods to extract GET, POST or cookie
+ data (with type-safety) are available. </p>
<anewt:example src="core-request">
<anewt:title>Retrieving request information</anewt:title>
=== modified file 'database/sql-template.lib.php'
--- database/sql-template.lib.php 2009-07-20 21:12:42 +0000
+++ database/sql-template.lib.php 2009-08-02 16:32:09 +0000
@@ -26,9 +26,9 @@
* AnewtDatabaseSQLTemplate::fillv() is used).
*
* In named mode, placeholders look like <code>?int:name?</code>, and when
- * filling the template the values are provided as an associative array or as
- * a Container instance, and the placeholder name is used to obtain the value
- * from the associative array or Container. In this mode you can only pass
+ * filling the template the values are provided as an associative array or as an
+ * AnewtContainer instance, and the placeholder name is used to obtain the value
+ * from the associative array or AnewtContainer. In this mode you can only pass
* a single parameter to provide values, which means
* AnewtDatabaseSQLTemplate::fillv() must be used
* ( AnewtDatabaseSQLTemplate::fill() cannot). This also applies for the query
@@ -518,7 +518,7 @@
* \param $values
* Array with values to use for substitution. For positional placeholders
* this should be a numeric array. For named placeholders an associative
- * array or Container instance should be passed.
+ * array or AnewtContainer instance should be passed.
*
* \return
* The query containing all values, quoted correctly.
@@ -534,10 +534,10 @@
if ($this->named_mode)
{
/* Sanity checks */
- $values_is_container = ($values instanceof Container);
+ $values_is_container = ($values instanceof AnewtContainer);
if (!is_assoc_array($values) && !$values_is_container)
throw new AnewtDatabaseQueryException(
- 'SQL templates in named mode require a single associative array or Container instance when filled.');
+ 'SQL templates in named mode require a single associative array or AnewtContainer instance when filled.');
/* Fill the placeholders */
for ($i = 0; $i < $n_placeholders; $i++)
=== modified file 'database/test/postgresql.test.php'
--- database/test/postgresql.test.php 2009-07-18 16:39:42 +0000
+++ database/test/postgresql.test.php 2009-08-02 16:32:09 +0000
@@ -343,11 +343,11 @@
(
/* null */
array($null_values),
- array(new Container($null_values)),
+ array(new AnewtContainer($null_values)),
/* all at once */
array($actual_values),
- array(new Container($actual_values)),
+ array(new AnewtContainer($actual_values)),
);
}
=== modified file 'database/test/sqlite.test.php'
--- database/test/sqlite.test.php 2009-07-18 16:39:42 +0000
+++ database/test/sqlite.test.php 2009-08-02 16:32:09 +0000
@@ -218,11 +218,11 @@
(
/* null */
array($null_values),
- array(new Container($null_values)),
+ array(new AnewtContainer($null_values)),
/* all at once */
array($actual_values),
- array(new Container($actual_values)),
+ array(new AnewtContainer($actual_values)),
);
}
=== modified file 'doc/manual/examples/core-container-caching.php'
--- doc/manual/examples/core-container-caching.php 2009-03-30 22:02:27 +0000
+++ doc/manual/examples/core-container-caching.php 2009-08-02 16:32:09 +0000
@@ -1,4 +1,4 @@
-class Foo extends Container
+class Foo extends AnewtContainer
{
function get_foo_()
{
=== modified file 'doc/manual/examples/core-container-getters-and-setters.php'
--- doc/manual/examples/core-container-getters-and-setters.php 2009-04-12 22:38:28 +0000
+++ doc/manual/examples/core-container-getters-and-setters.php 2009-08-02 16:32:09 +0000
@@ -1,5 +1,5 @@
// The class used in the examples below:
-class Person extends Container
+class Person extends AnewtContainer
{
function get_fullname()
{
=== modified file 'filters/filter.lib.php'
--- filters/filter.lib.php 2007-08-01 10:01:29 +0000
+++ filters/filter.lib.php 2009-08-02 16:32:09 +0000
@@ -24,7 +24,7 @@
/**
* Basic filter class
*/
-class Filter extends Container {
+class Filter extends AnewtContainer {
/**
* Default initializer for the Filter. This is a do-nothing stub that is
* used as a fallback for Filters not specifying a init() method of their
=== modified file 'form/controls/base.lib.php'
--- form/controls/base.lib.php 2009-03-27 15:51:55 +0000
+++ form/controls/base.lib.php 2009-08-02 16:32:09 +0000
@@ -15,7 +15,7 @@
*
* Do not instantiate this class directly, use one of its descendants instead.
*/
-abstract class AnewtFormControl extends Container
+abstract class AnewtFormControl extends AnewtContainer
{
/**
* Reference to containing AnewtForm instance.
=== modified file 'form/controls/choice.lib.php'
--- form/controls/choice.lib.php 2009-08-02 10:42:23 +0000
+++ form/controls/choice.lib.php 2009-08-02 16:32:09 +0000
@@ -559,7 +559,7 @@
*
* \see AnewtFormControlChoice
*/
-class AnewtFormOption extends Container
+class AnewtFormOption extends AnewtContainer
{
/**
* \private
=== modified file 'form/fieldset.lib.php'
--- form/fieldset.lib.php 2009-01-18 00:30:53 +0000
+++ form/fieldset.lib.php 2009-08-02 16:32:09 +0000
@@ -19,7 +19,7 @@
* error properties, which are handled just like form and form control
* descriptions and error messages.
*/
-class AnewtFormFieldset extends Container
+class AnewtFormFieldset extends AnewtContainer
{
/**
* \private
=== modified file 'form/form.lib.php'
--- form/form.lib.php 2009-08-02 11:09:23 +0000
+++ form/form.lib.php 2009-08-02 16:32:09 +0000
@@ -36,7 +36,7 @@
*
* \todo Reference module documentation once it's written.
*/
-class AnewtForm extends Container
+class AnewtForm extends AnewtContainer
{
/**
* Numeric array to hold all children of this form.
=== modified file 'image/drawingcontext.lib.php'
--- image/drawingcontext.lib.php 2009-04-06 19:55:41 +0000
+++ image/drawingcontext.lib.php 2009-08-02 16:32:09 +0000
@@ -22,7 +22,7 @@
*
* \todo Add proper Doxygen method grouping marks.
*/
-class AnewtImageDrawingContext extends Container
+class AnewtImageDrawingContext extends AnewtContainer
{
/** AnewtImage instance this AnewtImageDrawingContext belongs to */
private $image = null;
=== modified file 'image/image.lib.php'
--- image/image.lib.php 2009-04-06 19:55:41 +0000
+++ image/image.lib.php 2009-08-02 16:32:09 +0000
@@ -14,7 +14,7 @@
* GD2 library bundled with PHP, but provides a decent API and many convenience
* methods for loading, saving, resampling, resizing and drawing.
*/
-class AnewtImage extends Container
+class AnewtImage extends AnewtContainer
{
/* Static methods */
=== modified file 'mail/mailmessage.lib.php'
--- mail/mailmessage.lib.php 2009-02-23 15:34:31 +0000
+++ mail/mailmessage.lib.php 2009-08-02 16:32:09 +0000
@@ -22,7 +22,7 @@
* \todo
* What to do with different encodings?
*/
-class AnewtMailMessage extends Container
+class AnewtMailMessage extends AnewtContainer
{
/* Static methods for parsing messages */
@@ -107,7 +107,7 @@
*/
public function __construct()
{
- $this->headers = new Container();
+ $this->headers = new AnewtContainer();
/* Default settings */
$this->_seed(array(
=== modified file 'page/page.lib.php'
--- page/page.lib.php 2009-08-02 10:55:41 +0000
+++ page/page.lib.php 2009-08-02 16:32:09 +0000
@@ -14,7 +14,7 @@
/**
* Class for building XHTML pages.
*/
-class AnewtPage extends Container
+class AnewtPage extends AnewtContainer
{
/** \private Page content */
private $_content;
=== modified file 'renderer/grid/cell.lib.php'
--- renderer/grid/cell.lib.php 2009-01-18 00:37:14 +0000
+++ renderer/grid/cell.lib.php 2009-08-02 16:32:09 +0000
@@ -12,7 +12,7 @@
* A cell renderer for the AnewtGridRenderer. This grid renderer just renders the
* data as a cell (without any special effects).
*/
-class AnewtGridCellRenderer extends Container
+class AnewtGridCellRenderer extends AnewtContainer
{
var $id; /**< The id of this cell renderer */
var $_column; /**< \private Reference to the parent column */
@@ -86,10 +86,10 @@
*
* Fetch default value from the row data, based on the cell renderer id.
* This method is used internally to fetch the cell data from the row data
- * object. Both associative arrays and Container objects are handled. Which
- * value is retrieved depends on the <code>id</code> of the cell renderer;
- * if you did not instantiate an AnewtGridCellRenderer yourself, this is
- * will be the same as the column <code>id</code>.
+ * object. Both associative arrays and AnewtContainer objects are handled.
+ * Which value is retrieved depends on the <code>id</code> of the cell
+ * renderer; if you did not instantiate an AnewtGridCellRenderer yourself,
+ * this is will be the same as the column <code>id</code>.
*
* Custom AnewtGridCellRenderer subclasses may use this method as
* a convenience method to get data from the row object prior to further
@@ -107,13 +107,13 @@
if (is_assoc_array($data))
$value = array_get_default($data, $this->id, null);
- /* Containers, */
- elseif ($data instanceof Container)
+ /* AnewtContainer instances, */
+ elseif ($data instanceof AnewtContainer)
$value = $data->getdefault($this->id, null);
/* ... but nothing else */
else
- trigger_error('AnewtGridCellRenderer::render_cell(): This cell renderer can only render associative arrays and Container objects.', E_USER_ERROR);
+ trigger_error('AnewtGridCellRenderer::render_cell(): This cell renderer can only render associative arrays and AnewtContainer instances.', E_USER_ERROR);
return $value;
}
=== modified file 'renderer/grid/column.lib.php'
--- renderer/grid/column.lib.php 2009-01-18 00:37:14 +0000
+++ renderer/grid/column.lib.php 2009-08-02 16:32:09 +0000
@@ -13,7 +13,7 @@
* some column-related properties, as well as a list of AnewtGridCellRenderer
* instances that do the actual rendering of data.
*/
-class AnewtGridColumn extends Container
+class AnewtGridColumn extends AnewtContainer
{
var $id; /**< The id of this grid column */
var $_cell_renderers = array(); /**< \private list of cell renderers */
=== modified file 'renderer/grid/grid.lib.php'
--- renderer/grid/grid.lib.php 2009-07-19 20:14:37 +0000
+++ renderer/grid/grid.lib.php 2009-08-02 16:32:09 +0000
@@ -20,7 +20,7 @@
* - Zebra-pattern row styling
* - Column highlighting
* - Custom cell renderers for the columns to allow custom cell rendering like
- * hyperlinked grid cells or lazy value retrieval from Container objects.
+ * hyperlinked grid cells or lazy value retrieval from AnewtContainer objects.
* - Multiple cell renderers per column to allow for advanced column views.
* - A summary row that can be used to display some text.
*
@@ -253,8 +253,8 @@
/**
* Add a row of data to the grid. The data can be anything except null.
* However, if you want to use default renderers (those suffice for most
- * simple cases), you should use a Container object or an associative array
- * for the $data parameter, since those can be rendered by the default
+ * simple cases), you should use an AnewtContainer object or an associative
+ * array for the $data parameter, since those can be rendered by the default
* AnewtGridCellRenderer using the id of the cell renderer as the property
* name of the object or as the key of the array.
*
=== modified file 'renderer/renderer.lib.php'
--- renderer/renderer.lib.php 2009-07-19 20:14:37 +0000
+++ renderer/renderer.lib.php 2009-08-02 16:32:09 +0000
@@ -15,7 +15,7 @@
* needs. The default render() method dispatches the actual rendering to your
* own custom functions.
*/
-abstract class AnewtRenderer extends Container
+abstract class AnewtRenderer extends AnewtContainer
{
/**
* Render to a string.
=== modified file 'rss/rss.lib.php'
--- rss/rss.lib.php 2009-08-02 10:55:41 +0000
+++ rss/rss.lib.php 2009-08-02 16:32:09 +0000
@@ -28,8 +28,8 @@
* RSS channel (feed).
*
* AnewtRssChannel instances handle a number of properties , which you can set
- * using regular Container::set() method calls. These will end up as elements of
- * your RSS channel.
+ * using regular AnewtContainer::set() method calls. These will end up as
+ * elements of your RSS channel.
*
* The required properties are:
*
@@ -72,7 +72,7 @@
*
* \see AnewtRssItem
*/
-class AnewtRssChannel extends Container
+class AnewtRssChannel extends AnewtContainer
{
/** \{
* \name Static helper methods
@@ -327,7 +327,7 @@
* RSS item.
*
* AnewtRssItem instances handle a number of properties, which you can set using
- * regular Container::set() method calls.
+ * regular AnewtContainer::set() method calls.
*
* The required properties are:
*
@@ -348,7 +348,7 @@
* \see AnewtRssChannel
* \see AnewtRssChannel::add_item
*/
-class AnewtRssItem extends Container
+class AnewtRssItem extends AnewtContainer
{
/** List of properties and their specification */
private $properties = array(
=== modified file 'session/module.doc.xml'
--- session/module.doc.xml 2008-04-20 14:01:47 +0000
+++ session/module.doc.xml 2009-08-02 16:32:09 +0000
@@ -26,7 +26,7 @@
at any time.</p>
<p>The API is quite simple and resembles the API offered by the
- <anewt:classref>Container</anewt:classref> class, but a bit simpler:</p>
+ <anewt:classref>AnewtContainer</anewt:classref> class, but a bit simpler:</p>
<dl>
=== modified file 'smarty/smartytemplate.lib.php'
--- smarty/smartytemplate.lib.php 2009-03-27 12:22:40 +0000
+++ smarty/smartytemplate.lib.php 2009-08-02 16:32:09 +0000
@@ -25,7 +25,7 @@
* Smarty template abstraction. This class wraps a Smarty instance with some
* Anewt-specific helper methods.
*/
-class SmartyTemplate extends Container
+class SmartyTemplate extends AnewtContainer
{
var $smarty; /**< Smarty instance */
=== modified file 'textformatting/textformatter.lib.php'
--- textformatting/textformatter.lib.php 2008-01-04 17:37:10 +0000
+++ textformatting/textformatter.lib.php 2009-08-02 16:32:09 +0000
@@ -34,7 +34,7 @@
* formatter that chooses between textile and raw, depending on the input
* looking like XHTML (using a very simple heuristic).
*/
-class TextFormatter extends Container { // {{{
+class TextFormatter extends AnewtContainer { // {{{
/* Static methods */
=== modified file 'textile/textile.lib.php'
--- textile/textile.lib.php 2008-08-21 14:09:09 +0000
+++ textile/textile.lib.php 2009-08-02 16:32:09 +0000
@@ -119,10 +119,10 @@
* start of a new block. This setting is compatible with other Textile
* implementations.
*
- * The above attributes can be queried and set using the standard Container::get
- * and Container::set methods.
+ * The above attributes can be queried and set using the standard
+ * AnewtContainer::get and AnewtContainer::set methods.
*/
-class AnewtTextile extends Container
+class AnewtTextile extends AnewtContainer
{
/** \private The block modifiers used in block continuation mode, if enabled */
var $_saved_block_modifiers = array();
=== modified file 'urldispatcher/multi.lib.php'
--- urldispatcher/multi.lib.php 2009-08-02 10:55:41 +0000
+++ urldispatcher/multi.lib.php 2009-08-02 16:32:09 +0000
@@ -53,7 +53,7 @@
* \see URLDispatcher
* \see create_include_function
*/
-class MultiURLDispatcher extends Container {
+class MultiURLDispatcher extends AnewtContainer {
var $prefix_to_dispatcher_mapping; /**< \private URL maps */
=== modified file 'validator/base.lib.php'
--- validator/base.lib.php 2008-10-26 16:01:57 +0000
+++ validator/base.lib.php 2009-08-02 16:32:09 +0000
@@ -16,7 +16,7 @@
* This class does nothing by default. Real validator implementations should
* subclass this class and implement at least the is_valid() method.
*/
-abstract class AnewtValidator extends Container
+abstract class AnewtValidator extends AnewtContainer
{
/**
* Create a new validator instance.