From 42e6495ad11c6b6a4265e7ad378ba4dfde0e6df8 Mon Sep 17 00:00:00 2001
From: Christophe Nowicki
Date: Fri, 20 Aug 2004 09:45:38 +0000
Subject: new setup system
---
php/Attic/examples/sample-sp/admin_user.php | 4 +-
php/Attic/examples/sample-sp/assertionConsumer.php | 6 +-
php/Attic/examples/sample-sp/config.php.inc | 27 ----
php/Attic/examples/sample-sp/index.php | 43 ++++---
php/Attic/examples/sample-sp/login.php | 5 +-
php/Attic/examples/sample-sp/logout.php | 6 +-
php/Attic/examples/sample-sp/register.php | 6 +-
php/Attic/examples/sample-sp/setup.php | 140 ++++++++++++++++++---
8 files changed, 162 insertions(+), 75 deletions(-)
delete mode 100644 php/Attic/examples/sample-sp/config.php.inc
(limited to 'php')
diff --git a/php/Attic/examples/sample-sp/admin_user.php b/php/Attic/examples/sample-sp/admin_user.php
index 83e9b7b1..6893ad72 100644
--- a/php/Attic/examples/sample-sp/admin_user.php
+++ b/php/Attic/examples/sample-sp/admin_user.php
@@ -22,12 +22,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
- include "config.php.inc";
+ $config = unserialize(file_get_contents('config.inc'));
require_once 'DB.php';
- $db = &DB::connect($dsn);
+ $db = &DB::connect($config['dsn']);
if (DB::isError($db))
die($db->getMessage());
diff --git a/php/Attic/examples/sample-sp/assertionConsumer.php b/php/Attic/examples/sample-sp/assertionConsumer.php
index 7f19994a..2f434e24 100644
--- a/php/Attic/examples/sample-sp/assertionConsumer.php
+++ b/php/Attic/examples/sample-sp/assertionConsumer.php
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
- include "config.php.inc";
+ $config = unserialize(file_get_contents('config.inc'));
require_once 'DB.php';
@@ -35,7 +35,7 @@
lasso_init();
- $server_dump = file_get_contents($server_dump_filename);
+ $server_dump = file_get_contents($config['server_dump_filename']);
$server = lasso_server_new_from_dump($server_dump);
@@ -81,7 +81,7 @@
$options = array(
'debug' => 2,
);
- $db = &DB::connect($dsn, $options);
+ $db = &DB::connect($config['dsn'], $options);
if (DB::isError($db))
die($db->getMessage());
diff --git a/php/Attic/examples/sample-sp/config.php.inc b/php/Attic/examples/sample-sp/config.php.inc
deleted file mode 100644
index baf26b4a..00000000
--- a/php/Attic/examples/sample-sp/config.php.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
- $server_dump_filename = "lasso_server_dump.xml";
-
- $dsn = "pgsql://sp:sp@localhost/sp";
-?>
diff --git a/php/Attic/examples/sample-sp/index.php b/php/Attic/examples/sample-sp/index.php
index 0b36a188..b0e82797 100644
--- a/php/Attic/examples/sample-sp/index.php
+++ b/php/Attic/examples/sample-sp/index.php
@@ -26,15 +26,28 @@
$ret = @dl('lasso.' . PHP_SHLIB_SUFFIX);
if ($ret == FALSE)
{
- print "
The Lasso Extension is not available ";
- print "Please check your PHP extensions ";
- print "You can get more informations about Lasso at ";
- print "http://lasso.entrouvert.org/
";
- exit();
+?>
+
The Lasso Extension is not available
+Please check your PHP extensions
+You can get more informations about Lasso at
+http://lasso.entrouvert.org/