Exemplo n.º 1
0
 public function __construct()
 {
     global $setting;
     error_reporting(E_ALL ^ E_NOTICE);
     date_default_timezone_set($setting['gen']['timezone']);
     set_error_handler("ErrorHandler");
     header("Content-Type: text/html; charset=" . $setting['gen']['charset']);
     set_time_limit(30);
     ini_set('memory_limit', '128M');
     ini_set('magic_quotes_runtime', 0);
     ini_set('mysql.connect_timeout', 300);
     ini_set('default_socket_timeout', 300);
     if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
         strip_slash($_POST);
         strip_slash($_GET);
         strip_slash($_COOKIE);
     }
     return;
 }
Exemplo n.º 2
0
 * Proceed with installation.
 */
echo "Installing the PayPal PHP SDK ...\n";
/**
 * Local or remote.
 */
echo "Do you want to install the SDK on a remote FTP server (y or n)? ";
$remote = strtolower(substr(trim(fgets(STDIN)), 0, 1));
if ($remote == 'y') {
    install_remote();
} else {
    /**
     * Install web files.
     */
    echo "Where would you like the PayPal web samples installed? ";
    $php_web_dir = strip_slash(trim(fgets(STDIN)));
    if (!is_dir($php_web_dir)) {
        // Create if it does not exist.
        echo "Creating {$php_web_dir}...\n";
        mkdir($php_web_dir, 0755);
    }
    echo "Installing web samples to {$php_web_dir}\n";
    install_web($php_web_dir);
}
echo "\n\nInstallation Complete!\n\n";
exit(0);
/**
 * Utility functions below
 */
function error_message($msg)
{
Exemplo n.º 3
0
 */
echo "This installer will overwrite any existing files in the target directory.\nContinue (y or n)? ";
$stdin = fopen("php://stdin", "r");
$confirm = strtolower(substr(trim(fgets($stdin)), 0, 1));
if ($confirm != "y") {
    exit(1);
}
/**
 * Proceed with installation.
 */
echo "Installing the PayPal PHP WPS Toolkit ...\n";
/**
 * Install web files.
 */
echo "Where would you like the PayPal web samples installed? ";
$php_web_dir = strip_slash(trim(fgets($stdin)));
fclose($stdin);
if (!is_dir($php_web_dir)) {
    // Create if it does not exist.
    echo "Creating {$php_web_dir}...\n";
    mkdir($php_web_dir, 0755);
}
echo "Installing web samples to {$php_web_dir}\n";
install_web($php_web_dir);
echo "\n\nInstallation Complete!\n\n";
exit(0);
/**
 * Utility functions below
 */
function error_message($msg)
{
Exemplo n.º 4
0
}
$new_lng = array_merge($new_lng, $language);
if (is_null($cur_lng)) {
    $cur_lng = $setting['gen']['language'];
}
if ($method == "update" && count($_POST) > 0) {
    $log_info = $setting['language']['admin_web_language_update'];
    if (empty($cur_lng)) {
        $cur_lng = "default";
    }
    if (!empty($_POST['lng_new_idx'])) {
        $cur_lng = $_POST['lng_new_idx'];
        $language_info = array("author" => $_POST['lng_new_author'], "email" => $setting['web']['email'], "update" => date("Y-m-d"), "for" => $mystep_ver);
    }
    $language_info = var_export($language_info, true);
    strip_slash($_POST['language']);
    $language = var_export($_POST['language'], true);
    $content = <<<mystep
<?php
\$language_info = {$language_info};

\$language = {$language};
?>
mystep;
    WriteFile($lng_dir . $cur_lng . ".php", $content, "wb");
    write_log($log_info, "cur_lng=" . $cur_lng);
    $goto_url = $setting['info']['self'] . "?cur_lng=" . $cur_lng;
} else {
    $tpl_info['idx'] = "web_language";
    $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
    $tpl_tmp->Set_Variable('title', $setting['language']['admin_web_language_title']);