Ejemplo n.º 1
0
/**
 * get ADOdb-connection
 *
 * @return ADOdb-connection or false
 */
function getdb()
{
    global $db;
    if (isset($db)) {
        return $db;
    } else {
        initializeDatabase();
        return $db;
    }
}
Ejemplo n.º 2
0
 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.

 To read the license please visit http://www.gnu.org/copyleft/gpl.html

*******************************************************************************/
// config
include_once "config.php";
// db
include_once 'db.php';
// settings functions
include_once "settingsfunctions.php";
// initialize database
initializeDatabase();
// load global settings
loadSettings();
//__________________________________________________________________________________________________
// The lines between these ___ are from functions.php, function.php contains some auth. code which i didnt feel would add much to this, so have decided to leave out.
//
$cfg["torrent_file_path"] = $cfg["path"] . ".torrents/";
//**************************************************************************
// getAliasName()
// Create Alias name for Text file and Screen Alias
function getAliasName($inName)
{
    $alias = str_replace("/", '', $inName);
    $alias = preg_replace("/[^0-9a-z.]+/i", '_', $alias);
    $alias = str_replace(".url", "", $alias);
    return $alias;
Ejemplo n.º 3
0
$database = getDatabaseConfig($database_driver);
$connectionParams = $database['database'];
if ($argv[2] != 'none') {
    composerSetup();
    composerInstall();
}
require __DIR__ . '/autoload.php';
out('update permissions...');
updatePermissions($argv);
createConfigFiles($database_driver);
if (!in_array('--skip-createdb', $argv)) {
    createDatabase($connectionParams);
}
if (!in_array('--skip-initdb', $argv)) {
    $app = createApplication();
    initializeDatabase($app);
}
out('EC-CUBE3 install finished successfully!', 'success');
$root_urlpath = getenv('ROOT_URLPATH');
if (PHP_VERSION_ID >= 50400 && empty($root_urlpath)) {
    out('PHP built-in web server to run applications, `php -S localhost:8080 -t html`', 'info');
    out('Open your browser and access the http://localhost:8080/', 'info');
}
exit(0);
function displayHelp($argv)
{
    echo <<<EOF
EC-CUBE3 Installer
------------------
Usage:
{$argv[0]} [mysql|pgsql|sqlite3] [none] [options]