Esempio n. 1
0
    $error[] = 'YOURLS already installed.';
    // check if .htaccess exists, recreate otherwise. No error checking.
    if (!file_exists(YOURLS_ABSPATH . '/.htaccess')) {
        yourls_create_htaccess();
    }
}
// Start install if possible and needed
if (isset($_REQUEST['install']) && count($error) == 0) {
    // Create/update .htaccess file
    if (yourls_create_htaccess()) {
        $success[] = 'File <tt>.htaccess</tt> successfully created/updated.';
    } else {
        $warning[] = 'Could not write file <tt>.htaccess</tt> in YOURLS root directory. You will have to do it manually. See <a href="http://yourls.org/htaccess">how</a>.';
    }
    // Create SQL tables
    $install = yourls_create_sql_tables();
    if (isset($install['error'])) {
        $error = array_merge($error, $install['error']);
    }
    if (isset($install['success'])) {
        $success = array_merge($success, $install['success']);
    }
}
// Start output
yourls_html_head('install', 'Install YOURLS');
?>
<div id="login">
	<form method="post" action="?"><?php 
// reset any QUERY parameters
?>
		<p>
Esempio n. 2
0
<?php

define('YOURLS_ADMIN', true);
define('YOURLS_INSTALLING', true);
require_once __DIR__ . '/includes/load-yourls.php';
require_once YOURLS_INC . '/functions-install.php';
yourls_create_sql_tables();