示例#1
0
function install()
{
    try {
        Auth::generatePrivateKey();
        write_setup();
        setup_database();
        write_config();
    } catch (RuntimeException $e) {
        return $e->getMessage();
    }
    return 'success';
}
示例#2
0
文件: install.php 项目: TheNAF/naflm
 *  OBBLM 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, see <http://www.gnu.org/licenses/>.
 *   
 */
define('T_NO_STARTUP', true);
require 'header.php';
// Includes and constants.
HTMLOUT::frame_begin(false, false);
title('OBBLM setup');
if (isset($_POST['setup']) || $argv[1] == 'setup') {
    $setupOK = setup_database();
    if ($setupOK) {
        echo "<br><b><font color='green'>Finished</font></b>";
        $helpURL = DOC_URL;
        echo <<<EOL
<br><br>
<b>What now?</b><br>
&mdash; Please remove the <i>install.php</i> file from your OBBLM folder and <a href='index.php'>continue to the main page</a>.<br> 
&mdash; Once at the main page login using the coach account 'root' with password 'root'<br>
&mdash; From there you may enter the <i>administration</i> section and add new users (coaches) including changing the root password.<br>
&mdash; For further help visit the <a href='{$helpURL}'>OBBLM wiki</a>.<br>
<br>
<b>Need help? Encountering errors?</b><br>
&mdash; If you are encountering errors please visit <a href='http://code.google.com/p/obblm/issues/list'>code.google.com/p/obblm</a> and create a bug report.<br>
EOL;
        echo "<br><br>";
示例#3
0
<?php

######################################
# Import EURES jobs from scraped data into database
######################################
ini_set('max_execution_time', 0);
ini_set('memory_limit', '-1');
include "config.inc.php";
include "functions.php";
require 'scraperwiki/scraperwiki.php';
require 'scraperwiki/simple_html_dom.php';
include 'geocoderParser/GGeocoderParserLib.v1.php';
date_default_timezone_set("Europe/Dublin");
setup_database(true);
$country_dirs = array('BG', 'CY', 'CZ', 'CH', 'DK', 'DE', 'EE', 'FI', 'FR', 'GR', 'HU', 'IR', 'IS', 'IT', 'LI', 'LT', 'LU', 'LV', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'UK');
//$debug_countries = array("DE");
//$debug_files = array("10000-1069568588","10000-1069592591");
echo PHP_EOL . "= IMPORT =" . PHP_EOL . PHP_EOL;
if (sizeof($debug_countries) > 0) {
    $country_dirs = $debug_countries;
}
foreach ($country_dirs as $country_dir) {
    $dir = $JOBS_DIR . $country_dir;
    if (is_dir($dir)) {
        if ($handle = opendir($dir)) {
            echo "Directory: " . $dir . PHP_EOL;
            while (false !== ($file = readdir($handle))) {
                if (!is_dir($file)) {
                    if (sizeof($debug_files) > 0 && !in_array($file, $debug_files)) {
                        continue;
                    }
示例#4
0
                    username VARCHAR(20),
                    email VARCHAR(255),
                    password VARCHAR(255))
');
        $db->exec('
CREATE TABLE IF NOT EXISTS comments (
                    id INTEGER PRIMARY KEY,
                    data TEXT,
                    picture_id INTEGER,
                    owner_id INTEGER)
');
        $db->exec('
CREATE TABLE IF NOT EXISTS pictures (
                    id INTEGER PRIMARY KEY,
                    data BLOB,
                    owner_id INTEGER,
                    time DATE)
');
        $db->exec('
CREATE TABLE IF NOT EXISTS likes (
                    id INTEGER PRIMARY KEY,
                    picture_id INTEGER,
                    owner_id INTEGER)
');
        $db = null;
    } catch (PDOException $e) {
        die($e->getMessage());
    }
}
setup_database();