summaryrefslogtreecommitdiffstats
path: root/backend/php-file
diff options
context:
space:
mode:
authorondrej.zara <none@none>2008-12-04 08:13:14 +0000
committerondrej.zara <none@none>2008-12-04 08:13:14 +0000
commit3e17dc90adcb2e93d9b3eb5f59adecb1c7981b84 (patch)
tree08d0f7d5f9cc5749e941bdebc63b8f9a2bffd537 /backend/php-file
parent6bcb4d2789f2524b62a93c85bb3aae8c95d4f902 (diff)
downloadwwwsqldesigner-3e17dc90adcb2e93d9b3eb5f59adecb1c7981b84.zip
wwwsqldesigner-3e17dc90adcb2e93d9b3eb5f59adecb1c7981b84.tar.gz
wwwsqldesigner-3e17dc90adcb2e93d9b3eb5f59adecb1c7981b84.tar.bz2
initial code from release 2.3.1
--HG-- extra : convert_revision : svn%3Ab267cdba-c1da-11dd-874b-8bacd04a0a74/trunk%402
Diffstat (limited to 'backend/php-file')
-rw-r--r--backend/php-file/data/default30
-rw-r--r--backend/php-file/index.php35
2 files changed, 65 insertions, 0 deletions
diff --git a/backend/php-file/data/default b/backend/php-file/data/default
new file mode 100644
index 0000000..a6de8b9
--- /dev/null
+++ b/backend/php-file/data/default
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" ?><sql><datatypes db="mysql">
+ <group label="Numeric" color="rgb(238,238,170)">
+ <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
+ <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
+ <type label="Single precision" length="0" sql="FLOAT" quote=""/>
+ <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
+ </group>
+
+ <group label="Character" color="rgb(255,200,200)">
+ <type label="Char" length="1" sql="CHAR" quote="'"/>
+ <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
+ <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
+ <type label="Binary" length="1" sql="BINARY" quote="'"/>
+ <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
+ <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
+ </group>
+
+ <group label="Date &amp; Time" color="rgb(200,255,200)">
+ <type label="Date" length="0" sql="DATE" quote="'"/>
+ <type label="Time" length="0" sql="TIME" quote="'"/>
+ <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
+ <type label="Year" length="0" sql="YEAR" quote=""/>
+ <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
+ </group>
+
+ <group label="Miscellaneous" color="rgb(200,200,255)">
+ <type label="ENUM" length="1" sql="ENUM" quote=""/>
+ <type label="SET" length="1" sql="SET" quote=""/>
+ </group>
+</datatypes><table x="50" y="50" name="Producer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="574" y="66" name="Consumer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="195" y="333" name="Product"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Producer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Producer" row="id" /></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="383" y="227" name="Garbage"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Product" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Product" row="id" /></row><row name="id_Consumer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Consumer" row="id" /></row><row name="consumed" null="0" autoincrement="0"><datatype>TIMESTAMP</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql> \ No newline at end of file
diff --git a/backend/php-file/index.php b/backend/php-file/index.php
new file mode 100644
index 0000000..054ce47
--- /dev/null
+++ b/backend/php-file/index.php
@@ -0,0 +1,35 @@
+<?php
+ $a = (isset($_GET["action"]) ? $_GET["action"] : false);
+ switch ($a) {
+ case "list":
+ $files = glob("data/*");
+ foreach ($files as $file) {
+ $name = basename($file);
+ echo $name."\n";
+ }
+ break;
+ case "save":
+ $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
+ $keyword = "data/".basename($keyword);
+ $f = fopen($keyword, "w");
+ $data = file_get_contents("php://input");
+ if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
+ $data = stripslashes($data);
+ }
+ fwrite($f, $data);
+ fclose($f);
+ header("HTTP/1.0 201 Created");
+ break;
+ case "load":
+ $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
+ $keyword = "data/".basename($keyword);
+ if (!file_exists($keyword)) {
+ header("HTTP/1.0 404 Not Found");
+ } else {
+ header("Content-type: text/xml");
+ echo file_get_contents($keyword);
+ }
+ break;
+ default: header("HTTP/1.0 501 Not Implemented");
+ }
+?>