Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / ExportPlugin.class.php
blob0af20d3c28aec425b7859b4aa81e417eeef52692
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the export plugins
6 * @package PhpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /* This class extends the PluginObserver class */
13 require_once 'PluginObserver.class.php';
15 /**
16 * Provides a common interface that will have to be implemented by all of the
17 * export plugins. Some of the plugins will also implement other public
18 * methods, but those are not declared here, because they are not implemented
19 * by all export plugins.
21 * @package PhpMyAdmin
23 abstract class ExportPlugin extends PluginObserver
25 /**
26 * Array containing the specific export plugin type properties
28 * @var array
30 protected $properties;
32 /**
33 * Common methods, must be overwritten by all export plugins
37 /**
38 * Outputs export header
40 * @return bool Whether it succeeded
42 abstract public function exportHeader ();
44 /**
45 * Outputs export footer
47 * @return bool Whether it succeeded
49 abstract public function exportFooter ();
51 /**
52 * Outputs database header
54 * @param string $db Database name
56 * @return bool Whether it succeeded
58 abstract public function exportDBHeader ($db);
60 /**
61 * Outputs database footer
63 * @param string $db Database name
65 * @return bool Whether it succeeded
67 abstract public function exportDBFooter ($db);
69 /**
70 * Outputs CREATE DATABASE statement
72 * @param string $db Database name
74 * @return bool Whether it succeeded
76 abstract public function exportDBCreate($db);
78 /**
79 * Outputs the content of a table
81 * @param string $db database name
82 * @param string $table table name
83 * @param string $crlf the end of line sequence
84 * @param string $error_url the url to go back in case of error
85 * @param string $sql_query SQL query for obtaining data
87 * @return bool Whether it succeeded
89 abstract public function exportData ($db, $table, $crlf, $error_url, $sql_query);
92 /**
93 * The following methods are used in export.php or in db_operations.php,
94 * but they are not implemented by all export plugins
98 /**
99 * Exports routines (procedures and functions)
101 * @param string $db Database
103 * @return bool Whether it succeeded
105 public function exportRoutines($db)
111 * Outputs table's structure
113 * @param string $db database name
114 * @param string $table table name
115 * @param string $crlf the end of line sequence
116 * @param string $error_url the url to go back in case of error
117 * @param string $export_mode 'create_table','triggers','create_view',
118 * 'stand_in'
119 * @param string $export_type 'server', 'database', 'table'
120 * @param bool $relation whether to include relation comments
121 * @param bool $comments whether to include the pmadb-style column comments
122 * as comments in the structure; this is deprecated
123 * but the parameter is left here because export.php
124 * calls exportStructure() also for other export
125 * types which use this parameter
126 * @param bool $mime whether to include mime comments
127 * @param bool $dates whether to include creation/update/check dates
129 * @return bool Whether it succeeded
131 public function exportStructure(
132 $db,
133 $table,
134 $crlf,
135 $error_url,
136 $export_mode,
137 $export_type,
138 $relation = false,
139 $comments = false,
140 $mime = false,
141 $dates = false
147 * Returns a stand-in CREATE definition to resolve view dependencies
149 * @param string $db the database name
150 * @param string $view the view name
151 * @param string $crlf the end of line sequence
153 * @return string resulting definition
155 public function getTableDefStandIn($db, $view, $crlf)
161 * Outputs triggers
163 * @param string $db database name
164 * @param string $table table name
166 * @return string Formatted triggers list
168 protected function getTriggers($db, $table)
174 * Initialize the specific variables for each export plugin
176 * @return void
178 protected function initSpecificVariables()
184 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
188 * Gets the export specific format plugin properties
190 * @return array
192 public function getProperties()
194 return $this->properties;
198 * Sets the export plugins properties and is implemented by each export
199 * plugin
201 * @return void
203 abstract protected function setProperties();