Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | * first item is the callback function, it also can be a |
130 | 130 | * simple string with the name of a function in this class, |
131 | 131 | * following elements are parameters to the function. |
132 | | - * Note that callback functions will recieve this object as |
| 132 | + * Note that callback functions will receive this object as |
133 | 133 | * first parameter. |
134 | 134 | */ |
135 | 135 | public function addExtensionUpdate( Array $update ) { |
— | — | @@ -136,6 +136,16 @@ |
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
| 140 | + * Convenience wrapper for addExtensionUpdate() when adding a new table (which |
| 141 | + * is the most common usage of updaters in an extension) |
| 142 | + * @param $tableName String Name of table to create |
| 143 | + * @param $sqlPath String Full path to the schema file |
| 144 | + */ |
| 145 | + public function addExtensionTable( $tableName, $sqlPath ) { |
| 146 | + $this->extensionUpdates[] = array( 'addTable', $tableName, $sqlPath, true ); |
| 147 | + } |
| 148 | + |
| 149 | + /** |
140 | 150 | * Get the list of extension-defined updates |
141 | 151 | * |
142 | 152 | * @return Array |