/** * Returns structure of all tables right after installation. * @static * @return array $table=>$records */ public static function get_tablestructure() { $framework = self::get_framework(); $structurefile = self::get_dataroot() . '/' . $framework . '/tablestructure.ser'; if (!file_exists($structurefile)) { // Not initialised yet. return array(); } if (!isset(self::$tablestructure)) { $data = file_get_contents($structurefile); self::$tablestructure = unserialize($data); } if (!is_array(self::$tablestructure)) { testing_error(1, 'Can not read dataroot/' . $framework . '/tablestructure.ser or invalid format, reinitialize test database.'); } return self::$tablestructure; }