summaryrefslogtreecommitdiffstats
path: root/install.txt
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-05-22 14:51:15 +0200
committerRemi Collet <fedora@famillecollet.com>2010-05-22 14:51:15 +0200
commit1d9140560f969d4545e5b1ba762a90a5385f62f4 (patch)
tree9dce9dd2107e4669ff51db3562e3d66e872bfd16 /install.txt
parentf34b8b332def3600ef49feb1699fa9b1adb2369b (diff)
import current version
Diffstat (limited to 'install.txt')
-rw-r--r--install.txt127
1 files changed, 127 insertions, 0 deletions
diff --git a/install.txt b/install.txt
new file mode 100644
index 0000000..65a6a67
--- /dev/null
+++ b/install.txt
@@ -0,0 +1,127 @@
+<HTML><HEAD>
+ <TITLE>Installation Base pour RPM-PHP</TITLE>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+</HEAD><BODY><font face="Helvetica">
+<H1>Installation Base pour RPM-PHP</H1>
+<?php
+require "config.inc.php";
+
+function Action($Sql, $AbortIfError=false)
+{
+ global $db;
+
+ printf("<pre>%s</pre>\n", $Sql);
+ $nb=$db->exec($Sql);
+ if ($nb === false) {
+ $err=$db->errorInfo();
+ printf("<b>Erreur SQL</b> : %s\n", $err[2]);
+ if ($AbortIfError) die("<br />** Abandon **");
+ }
+ else {
+ $ret = $db->lastInsertId();
+ if ($nb) printf("Nombre de rangées affectées : %d</p>\n", $nb);
+ else if ($ret) printf("Valeur de l'index : %d</p>\n", $ret);
+ return ($ret);
+ }
+// else echo "OK.</p>\n";
+ return 0;
+
+}
+function Query ($Sql)
+{
+ global $db;
+
+ printf("<pre>%s</pre>\n", $Sql);
+ $res=$db->query($Sql);
+ if (!$res) {
+ $err=$db->errorInfo();
+ printf("<b>Erreur SQL</b> : %s\n", $err[2]);
+ } else {
+ echo "<table border='1' cellpadding='2'><tr>";
+ for ($i=0 ; $i<$res->columnCount() ; $i++) {
+ $meta=$res->getColumnMeta($i);
+ //echo "<th><pre>"; print_r($meta); echo "</pre></th>";
+ printf("<th>%s</th>", $meta["name"]);
+ }
+ while ($row = $res->fetch()) {
+ echo "<tr>";
+ // echo "<td><pre>"; print_r($row); echo "</pre></td>";
+ for ($i=0 ; $i<$res->columnCount() ; $i++) {
+ printf("<td>%s&nbsp;</td>", $row[$i]);
+ }
+ echo "</tr>";
+ }
+ echo "</tr>\n";
+ echo "</table>\n";
+ }
+}
+try {
+$db = new PDO ("mysql:host=" .MYHOST, MYUSER, MYPASS);
+
+printf("<p>Verion PHP : <b>%s</b><br />\n", phpversion());
+foreach ($db->query("SELECT VERSION() AS Version") as $Row)
+ printf ("Version du serveur : <b>%s</b></p>\n", $Row["Version"]);
+
+echo "<hr /><h3>Création du SCHEMA</h3>";
+
+Action("SET NAMES UTF8");
+Action("DROP DATABASE IF EXISTS " . MYBASE);
+Action("CREATE DATABASE " . MYBASE . " DEFAULT CHARACTER SET utf8");
+Action("USE " . MYBASE);
+
+$distros=array(
+ array("main"=>"EL-4", "sub"=>"base", "repo"=>"http://download.fedora.redhat.com/pub/epel/4/x86_64/"),
+ array("main"=>"EL-4", "sub"=>"testing", "repo"=>"http://download.fedora.redhat.com/pub/epel/testing/4/x86_64/"),
+
+ array("main"=>"EL-5", "sub"=>"base", "repo"=>"http://download.fedora.redhat.com/pub/epel/5/x86_64/"),
+ array("main"=>"EL-5", "sub"=>"testing", "repo"=>"http://download.fedora.redhat.com/pub/epel/testing/5/x86_64/"),
+
+ array("main"=>"F-8", "sub"=>"base", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/releases/8/Everything/x86_64/os/"),
+ array("main"=>"F-8", "sub"=>"updates", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/updates/8/x86_64/"),
+ array("main"=>"F-8", "sub"=>"testing", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/8/x86_64/"),
+
+ array("main"=>"F-9", "sub"=>"base", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/releases/9/Everything/x86_64/os/"),
+ array("main"=>"F-9", "sub"=>"updates", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/updates/9/x86_64/"),
+ array("main"=>"F-9", "sub"=>"testing", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/updates/testing/9/x86_64/"),
+
+ array("main"=>"rawhide", "sub"=>"", "repo"=>"http://download.fedora.redhat.com/pub/fedora/linux/development/x86_64/os/")
+ );
+
+Action("CREATE TABLE `repo` (
+ `ID` INT NOT NULL ,
+ `main` VARCHAR( 16 ) NOT NULL ,
+ `sub` VARCHAR( 16 ) NOT NULL ,
+ `url` VARCHAR( 200 ) NOT NULL ,
+ `stamp` int(11) DEFAULT NULL,
+ PRIMARY KEY ( `ID` )
+ ) ENGINE = MYISAM");
+
+Action("CREATE TABLE `rpm` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `arch` varchar(20) NOT NULL,
+ `epoch` varchar(20) NOT NULL,
+ `ver` varchar(20) NOT NULL,
+ `rel` varchar(20) NOT NULL,
+ `summary` varchar(200) NOT NULL,
+ `url` varchar(200) NOT NULL,
+ `location` varchar(200) NOT NULL,
+ `repo_main` varchar(16) NOT NULL,
+ `repo_sub` varchar(16) NOT NULL,
+ PRIMARY KEY (`ID`),
+ KEY `name` (`name`),
+ KEY `repo_main` (`repo_main`),
+ KEY `repo_sub` (`repo_sub`)
+) ENGINE=MyISAM");
+
+$id=1;
+foreach ($distros as $distro) {
+ Action("INSERT INTO repo SET ID=$id, main='".$distro["main"]."', sub='".$distro["sub"]."', url='".$distro["repo"]."'");
+ $id++;
+}
+Query("SELECT * FROM repo");
+}
+catch(PDOException $e) {
+ printf("ERREUR : %s\n", $e->getMessage());
+}
+?>