Exemple #1
0
<?php

/* Configure session cache */
session_cache_limiter('nocache');
session_start();
header('Content-type: text/plain; charset=UTF-8');
include_once "gda-utils.php";
include_once "gda-config.php";
if (!try_include("MDB2.php") && !try_include("PEAR" . DIRECTORY_SEPARATOR . "MDB2.php")) {
    $reply = new SimpleXMLElement("<reply></reply>");
    $node = $reply->addChild("status", "ERROR");
    $node->addAttribute("error", "The PEAR MDB2 extension is required");
    echo gda_add_hash($init_shared, $reply->asXml());
    session_destroy();
    exit(1);
}
if (!extension_loaded("SimpleXML")) {
    $reply = new SimpleXMLElement("<reply></reply>");
    $node = $reply->addChild("status", "ERROR");
    $node->addAttribute("error", "The SimpleXML extension is required");
    echo gda_add_hash($init_shared, $reply->asXml());
    session_destroy();
    exit(1);
}
$cmdfile = get_command_filename(session_id());
$replyfile = get_reply_filename(session_id());
umask(0);
$mode = 0600;
posix_mkfifo($cmdfile, $mode);
posix_mkfifo($replyfile, $mode);
if (!file_exists($cmdfile) || !file_exists($replyfile)) {
Exemple #2
0
<?php

session_cache_limiter('nocache');
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: public, no-cache');
include_once "gda-utils.php";
include_once "gda-exception.php";
include_once "gda-config.php";
$test_connections = false;
// set to true to enable each connection testing
echo "<h1>Gda connections tester</h1>\n\n";
if (!try_include("MDB2.php", true)) {
    echo "<b>ERROR:</b> The PEAR MDB2 extension is required\n";
    echo "<p>If you want to use the implementation provided in Libgda, then add a directive as following to the <tt>gda-config.php</tt> file:</p>";
    echo "<p><tt>set_include_path (get_include_path().\":PEAR_MDB2\");</tt></p>";
    echo "<p>Note that you still need to install the PEAR package (named 'php-pear' on a Debian system).</p>";
    exit(1);
}
if (!extension_loaded("SimpleXML")) {
    echo "<b>ERROR</b>: The SimpleXML extension is required\n";
    echo "<p>You need to configure PHP to include this extension.</p>";
    exit(1);
}
function handle_pear_error($res)
{
    if (PEAR::isError($res)) {
        $cause = "<p><b>Standard Message:</b> " . $res->getMessage() . "</p>\n" . "<p><b>User Information:</b> " . $res->getUserInfo() . "</p>\n" . "<p><b>Debug Information:</b> " . $res->getDebugInfo() . "</p>";
        throw new GdaException($cause, false);
    }
}
echo "\n";
Exemple #3
0
<?php

/* Configure session cache */
session_cache_limiter('nocache');
session_start();
header('Content-type: text/plain; charset=UTF-8');
include_once "gda-utils.php";
include_once "gda-exception.php";
include_once "gda-meta.php";
include_once "gda-config.php";
$debug = false;
if (!try_include("MDB2.php")) {
    $reply = new SimpleXMLElement("<reply></reply>");
    $node = $reply->addChild("status", "CLOSED");
    $node->addAttribute("error", "The PEAR MDB2 extension is required");
    echo gda_add_hash($init_shared, $reply->asXml());
    session_destroy();
    exit(1);
}
if (!extension_loaded("SimpleXML")) {
    $reply = new SimpleXMLElement("<reply></reply>");
    $node = $reply->addChild("status", "CLOSED");
    $node->addAttribute("error", "The SimpleXML extension is required");
    echo $reply->asXml();
    exit(1);
}
register_shutdown_function('shutdown');
$cmdfile = get_command_filename(session_id());
$replyfile = get_reply_filename(session_id());
if (isset($_SESSION["cncclosed"]) && $_SESSION["cncclosed"]) {
    /* just wait a little for the worker to terminate and return: