summaryrefslogtreecommitdiff
path: root/lib/tabledef.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-11-24 09:38:16 -0800
committerBrion Vibber <brion@pobox.com>2009-11-24 09:38:16 -0800
commit2da531d7d65044f3093eafd72b73a08e1cf67fd5 (patch)
tree3f6c77dc807728e1ec852ee2f2209623233d9617 /lib/tabledef.php
parent84ed094f40d4087704fc3354ea4c3743b1447331 (diff)
Break TableDef, ColumnDef classes to separate files so autoloader can find them.
With $config['db']['schemacheck'] set to 'script' in live deployment, Schema class wasn't being preloaded for us; the uses of TableDef by plugins for DataObject configuration would then fail because the class wasn't loaded. Broken to separate files, the autoloader can find all classes in either case. PHP Fatal error: Class 'TableDef' not found in /var/www/statusnet/plugins/OpenID/User_openid.php on line 43, referer: http://identi.ca/brionv/all
Diffstat (limited to 'lib/tabledef.php')
-rw-r--r--lib/tabledef.php63
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/tabledef.php b/lib/tabledef.php
new file mode 100644
index 000000000..3aace123b
--- /dev/null
+++ b/lib/tabledef.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Database schema utilities
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Database
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+/**
+ * A class encapsulating the structure of a table.
+ *
+ * @category Database
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+class TableDef
+{
+ /** name of the table */
+ public $name;
+ /** array of ColumnDef objects for the columns. */
+ public $columns;
+
+ /**
+ * Constructor.
+ *
+ * @param string $name name of the table
+ * @param array $columns columns in the table
+ */
+
+ function __construct($name=null,$columns=null)
+ {
+ $this->name = $name;
+ $this->columns = $columns;
+ }
+}