• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP write_config_file函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中write_config_file函数的典型用法代码示例。如果您正苦于以下问题:PHP write_config_file函数的具体用法?PHP write_config_file怎么用?PHP write_config_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了write_config_file函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: build_config

/**
 * Entry point into the configuration process
 *
 * @return void
 */
function build_config()
{
    /* get the site settings */
    $settings = parse_ini_file(APP_PATH . 'hm3.ini');
    if (is_array($settings) && !empty($settings)) {
        /* determine compression commands */
        list($js_compress, $css_compress) = compress_methods($settings);
        /* get module detail */
        list($js, $css, $filters, $assets) = get_module_assignments($settings);
        /* combine and compress page content */
        combine_includes($js, $js_compress, $css, $css_compress);
        /* write out the hm3.rc file */
        write_config_file($settings, $filters);
        /* create the production version */
        create_production_site($assets, $settings);
    } else {
        printf("\nNo settings found in ini file\n");
    }
}
开发者ID:GordonDiggs,项目名称:hm3,代码行数:24,代码来源:config_gen.php


示例2: addcslashes

  * Create the autoconf.php file.
  */
 case "write_config":
     include "../includes/func.php";
     // special characters " and $ are escaped
     $database = $_REQUEST['database'];
     $hostname = $_REQUEST['hostname'];
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     $timezone = $_REQUEST['timezone'];
     $db_layer = $_REQUEST['db_layer'];
     $db_type = $_REQUEST['db_type'];
     $prefix = addcslashes($_REQUEST['prefix'], '"$');
     $lang = $_REQUEST['lang'];
     $salt = createPassword(20);
     write_config_file($database, $hostname, $username, $password, $db_layer, $db_type, $prefix, $lang, $salt, $timezone);
     break;
     /**
      * Create the database.
      */
 /**
  * Create the database.
  */
 case "make_database":
     $databaseName = $_REQUEST['database'];
     $hostname = $_REQUEST['hostname'];
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     $server_type = $_REQUEST['db_type'];
     $db_layer = $_REQUEST['db_layer'];
     $db_error = false;
开发者ID:lentschi,项目名称:kimai,代码行数:31,代码来源:processor.php


示例3: print_feedback

    if (isset($progress)) {
        print_feedback($progress);
    }
    print_errors($errors);
    echo '<input type="hidden" name="step" value="' . $step . '" />';
    unset($_POST['step']);
    unset($_POST['action']);
    unset($errors);
    print_hidden($step);
    echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>';
    echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';
} else {
    require 'include/config_template.php';
    $comments = '/*' . str_pad(' This file was generated by the AChecker ' . $new_version . ' installation script.', 70, ' ') . '*/
/*' . str_pad(' File generated ' . date('Y-m-d H:m:s'), 70, ' ') . '*/';
    if (!write_config_file('../include/config.inc.php', $comments)) {
        echo '<input type="hidden" name="step" value="' . $step . '" />';
        print_feedback($progress);
        $errors[] = 'include/config.inc.php cannot be written! Please verify that the file exists and is writeable. On Unix issue the command <kbd>chmod a+rw include/config.inc.php</kbd> to make the file writeable. On Windows edit the file\'s properties ensuring that the <kbd>Read-only</kbd> attribute is <em>not</em> checked and that <kbd>Everyone</kbd> access permissions are given to that file.';
        print_errors($errors);
        echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>';
        echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';
    } else {
        echo '<input type="hidden" name="step" value="' . $step . '" />';
        print_hidden($step);
        $progress[] = 'Data has been saved successfully.';
        @chmod('../include/config.inc.php', 0444);
        print_feedback($progress);
        echo '<p align="center"><input type="submit" class="button" value=" Next &raquo; " name="submit" /></p>';
    }
}
开发者ID:giuliaforsythe,项目名称:AChecker,代码行数:31,代码来源:step5.php


示例4: logfile

 if ((int) $revisionDB < 922) {
     logfile("-- update to r922");
     exec_query("ALTER TABLE `{$p}knd` ADD `knd_password` VARCHAR(255);", 1);
     exec_query("ALTER TABLE `{$p}knd` ADD `knd_secure` varchar(60) NOT NULL default '0';", 1);
 }
 if ((int) $revisionDB < 935) {
     logfile("-- update to r935");
     exec_query("CREATE TABLE `{$p}exp` (\n  `exp_ID` int(10) NOT NULL AUTO_INCREMENT,\n  `exp_timestamp` int(10) NOT NULL DEFAULT '0',\n  `exp_usrID` int(10) NOT NULL,\n  `exp_pctID` int(10) NOT NULL,\n  `exp_designation` text NOT NULL,\n  `exp_comment` text NOT NULL,\n  `exp_comment_type` tinyint(1) NOT NULL DEFAULT '0',\n  `exp_cleared` tinyint(1) NOT NULL DEFAULT '0',\n  `exp_value` decimal(10,2) NOT NULL DEFAULT '0.00',\n  PRIMARY KEY (`exp_ID`)\n) AUTO_INCREMENT=1;");
 }
 if ((int) $revisionDB < 1067) {
     logfile("-- update to r1067");
     /*
      *  Write new config file with password salt
      */
     $kga['password_salt'] = createPassword(20);
     if (write_config_file($kga['server_database'], $kga['server_hostname'], $kga['server_username'], $kga['server_password'], $kga['server_conn'], $kga['server_type'], $kga['server_prefix'], $kga['language'], $kga['password_salt'])) {
         echo '<tr><td>' . $kga['lang']['updater'][140] . '</td><td class="green">&nbsp;&nbsp;</td></tr>';
     } else {
         die($kga['lang']['updater'][130]);
     }
     /*
      *  Reset all passwords
      */
     $new_passwords = array();
     $result = mysql_query("SELECT * FROM {$p}usr");
     $users = array();
     while ($row = mysql_fetch_assoc($result)) {
         $users[] = $row;
     }
     foreach ($users as $user) {
         if ($user['usr_name'] == 'admin') {
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:31,代码来源:updater.php


示例5: write_config_file

             $days = (int) $_REQUEST['editLimitDays'];
             $editLimit = $hours + $days * 24;
             $editLimit *= 60 * 60;
             // convert to seconds
         }
         if ($editLimit === false || $editLimit === 0) {
             $config_data['editLimit'] = '-';
         } else {
             $config_data['editLimit'] = $editLimit;
         }
         if (!$database->configuration_edit($config_data)) {
             $errors[''] = $kga['lang']['error'];
         }
     }
     if (count($errors) == 0) {
         write_config_file($kga['server_database'], $kga['server_hostname'], $kga['server_username'], $kga['server_password'], $kga['server_conn'], $kga['server_type'], $kga['server_prefix'], $kga['language'], $kga['password_salt'], $_REQUEST['defaultTimezone']);
     }
     header('Content-Type: application/json;charset=utf-8');
     echo json_encode(array('errors' => $errors));
     break;
 case "toggleDeletedUsers":
     setcookie("adminPanel_extension_show_deleted_users", $axValue);
     break;
 case "createGlobalRole":
     $role_data['name'] = trim($axValue);
     $errors = array();
     if (!isset($kga['user'])) {
         $errors[] = $kga['lang']['errorMessages']['permissionDenied'];
     } else {
         if ($database->globalRole_find($role_data)) {
             $errors[] = $kga['lang']['errorMessages']['sameGlobalRoleName'];
开发者ID:lentschi,项目名称:kimai,代码行数:31,代码来源:processor.php


示例6: print_feedback

        echo '<input type="hidden" name="step" value="' . $step . '" />';
        print_feedback($progress);
        $errors[] = 'include/config.inc.php cannot be written! Please verify that the file exists and is writeable. On Unix issue the command <kbd>chmod a+rw include/config.inc.php</kbd> to make the file writeable. On Windows edit the file\'s properties ensuring that the <kbd>Read-only</kbd> attribute is <em>not</em> checked and that <kbd>Everyone</kbd> access permissions are given to that file.';
        print_errors($errors);
        echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>';
        echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';
    } else {
        echo '<input type="hidden" name="step" value="' . $step . '" />';
        print_hidden($step);
        $progress[] = 'Data has been saved successfully.';
        if (version_compare($_POST['step1']['old_version'], '1.5.2', '<')) {
            require AT_INCLUDE_PATH . 'install/config_template.php';
            $comments = '/*' . str_pad(' This file was generated by the ATutor 1.5.2 installation script.', 70, ' ') . '*/
		/*' . str_pad(' File generated ' . date('Y-m-d H:m:s'), 70, ' ') . '*/';
            $_POST['db_login'] = urldecode($_POST['db_login']);
            $_POST['db_password'] = urldecode($_POST['db_password']);
            write_config_file('../include/config.inc.php', $_POST['step1']['db_login'], $_POST['step1']['db_password'], $_POST['step1']['db_host'], $_POST['step1']['db_port'], $_POST['step1']['db_name'], $_POST['step1']['tb_prefix'], $comments, $_POST['step5']['content_dir'], $_POST['step1']['smtp'], $_POST['step1']['get_file']);
        }
        @chmod('../include/config.inc.php', 0444);
        if (file_exists('../../' . $_POST['step1']['old_path'] . '/include/config_multisite.inc.php')) {
            if (!copy('../../' . $_POST['step1']['old_path'] . '/include/config_multisite.inc.php', '../include/config_multisite.inc.php')) {
                $errors[] = 'Failed to copy Multisite configuration file to new site.';
            }
        }
        print_feedback($progress);
        echo '<p align="center"><input type="submit" class="button" value=" Next &raquo; " name="submit" /></p>';
    }
}
?>

</form>
开发者ID:vicentborja,项目名称:ATutor,代码行数:31,代码来源:ustep5.php


示例7: updateFavoriteEpisode

function updateFavoriteEpisode(&$fav, $title)
{
    global $config_values;
    if (!($guess = guess_match($title, TRUE))) {
        return;
    }
    if (preg_match('/^((\\d+x)?\\d+)p$/', $guess['episode'])) {
        $guess['episode'] = preg_replace('/^((?:\\d+x)?\\d+)p$/', '\\1', $guess['episode']);
        $PROPER = "p";
    } else {
        $PROPER = '';
    }
    if (preg_match('/(^)(\\d{8})$/', $guess['episode'], $regs)) {
        $curEpisode = $regs[2];
        $expectedEpisode = $regs[2] + 1;
    } else {
        if (preg_match('/^(\\d+)x(\\d+)$/i', $guess['episode'], $regs)) {
            $curEpisode = preg_replace('/(\\d+)x/i', "", $guess['episode']);
            $curSeason = preg_replace('/x(\\d+)/i', "", $guess['episode']);
            $expectedEpisode = sprintf('%02d', $fav['Episode'] + 1);
        } else {
            return;
        }
    }
    if ($fav['Episode'] && $curEpisode > $expectedEpisode) {
        $show = $guess['key'];
        $episode = $guess['episode'];
        $expected = $curSeason . "x" . $expectedEpisode;
        $oldEpisode = $fav['Episode'];
        $oldSeason = $fav['Season'];
        $newEpisode = $curEpisode + 1;
        $newSeason = $curSeason + 1;
        $msg = "Matched \"{$show} {$episode}\" but expected \"{$expected}\".\n";
        $msg .= "This usualy means that a double episode is downloaded before this one.\n";
        $msg .= "But it could mean that you missed an episode or that \"{$episode}\" is a special episode.\n";
        $msg .= "If this is the case you need to reset the \"Last Downloaded Episode\" setting to \"{$oldSeason} x {$oldEpisode}\" in the Favorites menu.\n";
        $msg .= "If you don't, the next match wil be \"Season: {$curSeason} Episode: {$newEpisode}\" or \"Season {$newSeason} Episode: 1\".\n";
        $subject = "TorrentWatch-X: got {$show} {$episode}, expected {$expected}";
        MailNotify($msg, $subject);
        $msg = escapeshellarg($msg);
        run_script('error', $title, $msg);
    }
    if (!isset($fav['Season'], $fav['Episode']) || $regs[1] > $fav['Season']) {
        $fav['Season'] = $regs[1];
        $fav['Episode'] = $regs[2] . $PROPER;
    } else {
        if ($regs[1] == $fav['Season'] && $regs[2] > $fav['Episode']) {
            $fav['Episode'] = $regs[2] . $PROPER;
        } else {
            $fav['Episode'] .= $PROPER;
        }
    }
    write_config_file();
}
开发者ID:thawkins,项目名称:torrentwatch-x,代码行数:54,代码来源:config_lib.php


示例8: catch

            $sth->execute();
            $sth = $dbHandle->prepare($index3);
            $sth->execute();
            echo "Database created <br>";
        } catch (PDOException $exception) {
            throw new Exception("Database unavailable", 503);
        }
    }
    //guessing fsroot
    // get the FSYNC_ROOT url
    //
    $fsRoot = "https://";
    if (!isset($_SERVER['HTTPS'])) {
        $fsRoot = "http://";
    }
    $fsRoot .= $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . "/";
    if (strpos($_SERVER['REQUEST_URI'], 'index.php') !== 0) {
        $fsRoot .= "index.php/";
    }
    // write settings.php, if not possible, display the needed contant
    //
    write_config_file($dbType, $dbHost, $dbName, $dbUser, $dbPass, $fsRoot);
    echo "<hr><hr> Finished the setup, please delete setup.php and go on with the FFSync<hr><hr>";
    echo <<<EOT
        <hr><hr>                                                                                                            
         <h4>This script has guessed the Address of your installation, this might not be accurate,<br/>
         Please check if this script can be reached by <a href="{$fsRoot}">{$fsRoot}</a> .<br/>
         If thats not the case you have to ajust the settings.php<br />
         </h4>
EOT;
}
开发者ID:dipolukarov,项目名称:FSyncMS,代码行数:31,代码来源:setup.php


示例9: parse_options

function parse_options()
{
    global $html_out, $config_values;
    $filler = "<br>";
    array_keys($_GET);
    $commands = array_keys($_GET);
    if (empty($commands)) {
        return FALSE;
    }
    if (preg_match("/^\\//", $commands[0])) {
        $commands[0] = preg_replace("/^\\//", '', $commands[0]);
    }
    switch ($commands[0]) {
        case 'getClientData':
            if ($_REQUEST['recent']) {
                $response = getClientData(1);
            } else {
                $response = getClientData(0);
            }
            echo $response;
            exit;
        case 'delTorrent':
            $response = delTorrent($_REQUEST['delTorrent'], $_REQUEST['trash'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'stopTorrent':
            $response = stopTorrent($_REQUEST['stopTorrent'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'startTorrent':
            $response = startTorrent($_REQUEST['startTorrent'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'moveTo':
            $response = moveTorrent($_REQUEST['moveTo'], $_REQUEST['torHash'], $_REQUEST['batch']);
            echo "{$response}";
            exit;
        case 'updateFavorite':
            $response = update_favorite();
            if (preg_match("/^Error:", $response)) {
                echo "<div id=\"fav_error\" class=\"dialog_window\" style=\"display: block\">{$response}</div>";
            }
            break;
        case 'updateFeed':
            update_feed();
            break;
        case 'clearCache':
            clear_cache();
            break;
        case 'setGlobals':
            update_global_config();
            write_config_file();
            break;
        case 'matchTitle':
            $feedLink = $_GET['rss'];
            foreach ($config_values['Feeds'] as $key => $feed) {
                if ($feed['Link'] == "{$feedLink}") {
                    $idx = $key;
                }
            }
            if ($config_values['Feeds'][$idx]['seedRatio']) {
                $seedRatio = $config_values['Feeds'][$idx]['seedRatio'];
            } else {
                $seedRatio = $config_values['Settings']['Default Seed Ratio'];
            }
            if (!$seedRatio) {
                $seedRatio = -1;
            }
            if ($tmp = guess_match(html_entity_decode($_GET['title']), TRUE)) {
                $_GET['name'] = trim(strtr($tmp['key'], "._", "  "));
                if ($config_values['Settings']['MatchStyle'] == "glob") {
                    $_GET['filter'] = trim(strtr($tmp['key'], " ._", "???"));
                    $_GET['filter'] .= '*';
                } else {
                    $_GET['filter'] = trim($tmp['key']);
                }
                $_GET['quality'] = $tmp['data'];
                $_GET['feed'] = $_GET['rss'];
                $_GET['button'] = 'Add';
                $_GET['savein'] = 'Default';
                $_GET['seedratio'] = $seedRatio;
            } else {
                $_GET['name'] = $_GET['title'];
                $_GET['filter'] = $_GET['title'];
                $_GET['quality'] = 'All';
                $_GET['feed'] = $_GET['rss'];
                $_GET['button'] = 'Add';
                $_GET['savein'] = 'Default';
                $_GET['seedratio'] = $seedRatio;
            }
            if ($config_values['Settings']['Default Feed All'] && preg_match('/^(\\d+)x(\\d+)p?$|^(\\d{8})$/i', $tmp['episode'])) {
                $_GET['feed'] = 'All';
            }
            $response = update_favorite();
            if ($response) {
                echo "{$response}";
            }
            //break;
            exit;
        case 'hide':
//.........这里部分代码省略.........
开发者ID:thawkins,项目名称:torrentwatch-x,代码行数:101,代码来源:torrentwatch.php


示例10: array

                                 'permissions' => PHOTO_UPLOAD_PERMISSION,
                                 'interactive' => false),
                'RaceCrew' => array('password' => 'murphy',
                                    'permissions' =>
                                    VIEW_RACE_RESULTS_PERMISSION | VIEW_AWARDS_PERMISSION
                                    | CHECK_IN_RACERS_PERMISSION | REVERT_CHECK_IN_PERMISSION
                                    | ASSIGN_RACER_IMAGE_PERMISSION | PHOTO_UPLOAD_PERMISSION
                                    | EDIT_RACER_PERMISSION | REGISTER_NEW_RACER_PERMISSION),
                'RaceCoordinator' => array('password' => 'doyourbest',
                                           'permissions' => -1)
\t       );
\$post_setup_role = 'RaceCoordinator';
?>

END;
            $ok = write_config_file($config_roles, $content);
        }
        if ($ok) {
            echo "<success/>\n";
            // Setup permissions were granted temporarily because there was no
            // configuration present.  Now that there is, remove the special setting_up
            // flag and log in (without password) as the race coordinator (or whatever
            // other role the config file specifies).
            unset($_SESSION['setting_up']);
            @(include_once local_file_name($config_roles));
            if (!isset($post_setup_role)) {
                $post_setup_role = 'RaceCoordinator';
            }
            $_SESSION['role'] = $post_setup_role;
            $role = $roles[$post_setup_role];
            if ($role) {
开发者ID:jeffpiazza,项目名称:derbynet,代码行数:31,代码来源:setup-action.php


示例11: write_csv_dataset

    return $unique_id;
}
function write_csv_dataset($data_string)
{
    $unique_id = uniqid();
    $data_file = "./uploads/" . $unique_id . ".csv";
    $handle = fopen($data_file, 'w') or die('Cannot open file:  ' . $data_file);
    fwrite($handle, $data_string);
    fclose($handle);
    return $unique_id;
}
if (isset($_POST['json_string']) && isset($_POST['action'])) {
    $json_string = $_POST['json_string'];
    $action = $_POST['action'];
    if ($action == "write_config") {
        echo write_config_file($json_string);
    } else {
        if ($action == "write_pasted_data") {
            echo write_pasted_data($json_string);
        } else {
            if ($action == "write_dataset") {
                echo write_dataset($json_string);
            } else {
                if ($action == "write_csv_dataset") {
                    echo write_csv_dataset($json_string);
                } else {
                    echo "all your bases are belong to us";
                }
            }
        }
    }
开发者ID:razvanaldo,项目名称:oinoi,代码行数:31,代码来源:file_writer.php


示例12: urldecode

     $smtp = $_POST['step1']['smtp'];
     $get_file = $_POST['step1']['get_file'];
 } else {
     if ($_POST['step2']['db_login']) {
         $db_login = $_POST['step2']['db_login'];
         $db_pwd = $_POST['step2']['db_password'];
         $db_host = $_POST['step2']['db_host'];
         $db_port = $_POST['step2']['db_port'];
         $db_name = $_POST['step2']['db_name'];
         $tb_prefix = $_POST['step2']['tb_prefix'];
         $content_dir = $_POST['step4']['content_dir'];
         $smtp = $_POST['step3']['smtp'];
         $get_file = $_POST['step4']['get_file'];
     }
 }
 if (!write_config_file('../include/config.inc.php', $db_login, $db_pwd, $db_host, $db_port, $db_name, $tb_prefix, $comments, $content_dir, $smtp, $get_file)) {
     echo '<input type="hidden" name="step" value="' . $step . '" />';
     print_feedback($progress);
     $errors[] = 'include/config.inc.php cannot be written! Please verify that the file exists and is writeable. On Unix issue the command <kbd>chmod a+rw include/config.inc.php</kbd> to make the file writeable. On Windows edit the file\'s properties ensuring that the <kbd>Read-only</kbd> attribute is <em>not</em> checked and that <kbd>Everyone</kbd> access permissions are given to that file.';
     print_errors($errors);
     echo '<p><strong>Note:</strong> To change permissions on Unix use <kbd>chmod a+rw</kbd> then the file name.</p>';
     echo '<p align="center"><input type="submit" class="button" value=" Try Again " name="retry" />';
 } else {
     /* if header img and logo were carried forward AND the upgrade was from 1.4.3 to 1.5 then */
     if (($_POST['step1']['header_img'] != '' || $_POST['step1']['header_logo'] != '') && $new_version == '1.5' && $_POST['step1']['old_version'] == '1.4.3') {
         $db = mysql_connect($_POST['step1']['db_host'] . ':' . $_POST['step1']['db_port'], $_POST['step1']['db_login'], urldecode($_POST['step1']['db_password']));
         mysql_select_db($_POST['step1']['db_name'], $db);
         $sql = "INSERT INTO " . $_POST['step1']['tb_prefix'] . "themes VALUES ('ATutor_alt', '1.5', 'default_oldheader', NOW() , 'Backwards compatible default theme', 2)";
         @mysql_query($sql, $db);
         $sql = "UPDATE " . $_POST['step1']['tb_prefix'] . "themes SET status=0, version='1.5' WHERE dir_name = 'default'";
         @mysql_query($sql, $db);
开发者ID:vicentborja,项目名称:ATutor,代码行数:31,代码来源:step5.php


示例13: exec_query

// release of kimai 1.1.0
if ((int) $revisionDB < 1390) {
    Kimai_Logger::logfile("-- update to r1390");
    exec_query("DELETE FROM `{$p}configuration` WHERE `option` = 'show_sensible_data'");
}
if ((int) $revisionDB < 1391) {
    Kimai_Logger::logfile("-- update to r1391");
    exec_query("INSERT INTO `{$p}configuration` (`option`,`value`) VALUES('table_time_format', '%H:%M')");
}
if ((int) $revisionDB < 1392) {
    Kimai_Logger::logfile("-- update to r1392");
    $charset = '';
    if ($kga['utf8']) {
        $charset = 'utf8';
    }
    $success = write_config_file($kga['server_database'], $kga['server_hostname'], $kga['server_username'], $kga['server_password'], $charset, $kga['server_prefix'], $kga['language'], $kga['password_salt'], $kga['defaultTimezone']);
    if ($success) {
        $level = 'green';
        $additional = 'charset: ' . $charset;
    } else {
        $level = 'red';
        $additional = 'Unable to write config file.';
    }
    printLine($level, 'Store charset in configuration file <i>autoconf.php</i>.', $additional);
}
if ((int) $revisionDB < 1393) {
    Kimai_Logger::logfile("-- update to r1393");
    exec_query("ALTER TABLE `{$p}users` CHANGE `mail` `mail` VARCHAR(160) NULL");
    exec_query("ALTER TABLE `{$p}timeSheet` CHANGE `fixedRate` `fixedRate` DECIMAL(10,2) NULL");
}
// ================================================================================
开发者ID:kimai,项目名称:kimai,代码行数:31,代码来源:updater.php


示例14: wbo

    }
    if ($dbInstalled) {
        echo "DB is already installed!<br>";
    } else {
        echo "Now going to install the new database! Type is: {$dbType}<br>";
        try {
            $create_statement = " create table wbo ( username varchar(100), id varchar(65), collection varchar(100),\n                 parentid  varchar(65), predecessorid int, modified real, sortindex int,\n                 payload text, payload_size int, ttl int, primary key (username,collection,id))";
            $create_statement2 = " create table users ( username varchar(255), md5 varchar(64), primary key (username)) ";
            $index1 = 'create index parentindex on wbo (username, parentid)';
            $index2 = 'create index predecessorindex on wbo (username, predecessorid)';
            $index3 = 'create index modifiedindex on wbo (username, collection, modified)';
            $sth = $dbHandle->prepare($create_statement);
            $sth->execute();
            $sth = $dbHandle->prepare($create_statement2);
            $sth->execute();
            $sth = $dbHandle->prepare($index1);
            $sth->execute();
            $sth = $dbHandle->prepare($index2);
            $sth->execute();
            $sth = $dbHandle->prepare($index3);
            $sth->execute();
            echo "Database created <br>";
        } catch (PDOException $exception) {
            throw new Exception("Database unavailable", 503);
        }
    }
    // write settings.php, if not possible, display the needed contant
    //
    write_config_file($dbType, $dbHost, $dbName, $dbUser, $dbPass);
    echo "<hr><hr> Finished the setup, please delete setup.php and go on with the FFSync<hr><hr>";
}
开发者ID:nafets,项目名称:FSyncMS,代码行数:31,代码来源:setup.php


示例15: write_config_file

if ((int)$revisionDB < 1379) {

    if(!isset($defaultTimezone) && isset($kga['defaultTimezone'])) {
        $defaultTimezone = $kga['defaultTimezone'];
    }
    if(!isset($defaultTimezone)) {
        $defaultTimezone = null;
    }

    $success = write_config_file(
        $kga['server_database'],
        $kga['server_hostname'],
        $kga['server_username'],
        $kga['server_password'],
        'mysql',
        '',
        $kga['server_prefix'],
        $kga['language'],
        $kga['password_salt'],
        $defaultTimezone);

    if ($success) {
        $level = 'green';
    } else {
        $level = 'red';
    }

    printLine($level,'Updated autoconf.php to use MYSQL configuration in <i>autoconf.php</i>.');
}
开发者ID:revcozmo,项目名称:kimai,代码行数:29,代码来源:updater.php


示例16: addcslashes

  */
 case "write_config":
     include "../includes/func.php";
     // special characters " and $ are escaped
     $database = $_REQUEST['database'];
     $hostname = $_REQUEST['hostname'];
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     $charset = 'utf8';
     $prefix = addcslashes($_REQUEST['prefix'], '"$');
     $lang = $_REQUEST['lang'];
     $salt = createPassword(20);
     $timezone = $_REQUEST['timezone'];
     $kimaiConfig = new Kimai_Config(array('server_prefix' => $server_prefix, 'server_hostname' => $hostname, 'server_database' => $database, 'server_username' => $username, 'server_password' => $password, 'server_charset' => $charset, 'defaultTimezone' => $timezone, 'password_salt' => $salt));
     Kimai_Registry::setConfig($kimaiConfig);
     write_config_file($database, $hostname, $username, $password, $charset, $prefix, $lang, $salt, $timezone);
     break;
     /**
      * Create the database.
      */
 /**
  * Create the database.
  */
 case 'make_database':
     $databaseName = $_REQUEST['database'];
     $hostname = $_REQUEST['hostname'];
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     $db_error = false;
     $result = false;
     $database = new Kimai_Database_Mysql($result, false);
开发者ID:kimai,项目名称:kimai,代码行数:31,代码来源:processor.php


示例17: QuickDB

            $db = new QuickDB($_SESSION['db_host'], $_SESSION['db_username'], $_SESSION['db_password'], $_SESSION['db_name'], false, false);
            $dbms_schema = 'schemas/mysql_schema.sql';
        }
        $remove_remarks = "remove_remarks";
        $delimiter = ";";
        $sql_query = @file_get_contents($dbms_schema);
        $remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, $delimiter);
        foreach ($sql_query as $sql) {
            $db->execute($sql);
        }
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "db_initial_values.php";
        foreach ($sql_ary as $sql) {
            $db->execute($sql);
        }
        write_config_file();
        $rename = write_functions_file();
        update_config_file();
        $success = true;
    }
    if (!$success) {
        $next = array('0' => 'Install', '1' => 'onClick="document.forms[\'final_form\'].submit();"');
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "layout" . DIRECTORY_SEPARATOR . "pages_final_confirm.php";
    }
    if ($success) {
        require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "includes/functions_php.php";
        $header = htmlspecialchars('<link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="' . $_SESSION['config_path'] . 'external.php?type=css" charset="utf-8" />
<script type="text/javascript" src="' . $_SESSION['config_path'] . 'includes/js/jquery.js"></script>
<script type="text/javascript" src="' . $_SESSION['config_path'] . 'includes/js/jquery-ui.js"></script>');
        $footer = htmlspecialchars('<script type="text/javascript" src="' . $_SESSION['config_path'] . 'external.php?type=djs" charset="utf-8"></script>
<script type="text/javascript" src="' . $_SESSION['config_path'] . 'external.php?type=js" charset="utf-8"></script>');
开发者ID:juliushermosura,项目名称:globeloop,代码行数:31,代码来源:index.php


示例18: write_config_file

 $_config .= "\$timeautoclose= " . $_POST['auto_close'] . ";\n";
 $_config .= "\$autochecklink = " . (isset($_POST['autochecklink']) && $_POST['autochecklink'] == 'on' ? 'true' : 'false') . "; // Auto check submited link in audl\n\n";
 $_config .= "\$mip_enabled= " . (isset($_POST['mip_enabled']) && $_POST['mip_enabled'] == 'on' ? 'true' : 'false') . "; //If you need to disable multiple ip support, set to false\n";
 $_config .= "\$mip_arotate= " . (isset($_POST['mip_arotate']) && $_POST['mip_arotate'] == 'on' ? 'true' : 'false') . "; //Auto change to next ip after start transload process\n\n";
 $_config .= "\$secretkey = '" . $_POST['secretkey'] . "';//Place your Secret Key\n";
 $_config .= "\$iframealocate = " . $_POST['iframealocate'] . ";//how many iframe to allocate in audl for manual method.\n";
 $_config .= "\$pointboost = " . $_POST['pointbooster'] . ";//boost your RS-Point with this feature!!\n";
 $_config .= "\$autosubmit = true;\n\n";
 $_config .= "\$timezone = " . $_POST['timezone'] . "; // set Timezone. It is GMT+(7) for Indonesia.\n";
 $_config .= "\$lang = '" . $arlang[$_POST['language']] . "'; // set Language.\n\n";
 //$_config .= "\$arCSS = getArrayfromfile(IMAGE_DIR, 'style_sujancok_', '.css');\n";
 $_config .= "\$csstype = '" . $arCSS[$_POST['theme']] . "'; // set Theme to your RL. eg. _default\n";
 $_config .= "?>";
 $close_config_page = false;
 // SAVING CONFIG
 $buffer_TEXT .= write_config_file($fileconfig, $_config);
 if ($close_config_page) {
     if ($saved_success) {
         $arfield = array("oth" => "", "acc" => "", "up" => "");
         foreach ($ar_chkbox_othr_acc as $key => $_opremix) {
             $arfield["oth"] .= "'" . $_opremix . "'" . ($key != count($ar_chkbox_othr_acc) - 1 ? ", " : "");
         }
         foreach ($ar_chkbox_acc as $key => $_premix) {
             $arfield["acc"] .= "'" . $_premix . "'" . ($key != count($ar_chkbox_acc) - 1 ? ", " : "");
         }
         foreach ($ar_chkbox_up_acc as $key => $_upremix) {
             $arfield["up"] .= "'" . $_upremix . "'" . ($key != count($ar_chkbox_up_acc) - 1 ? ", " : "");
         }
         $buff_cleancookie_js = "\n<script type=\"text/javascript\">\n var tmpCk = new Object();\n  tmpCk['custom_rlck'] = Array('rl_ajax');\n  tmpCk['arfield_oth'] = Array(" . $arfield["oth"] . ");\n  tmpCk['arfield_acc'] = Array(" . $arfield["acc"] . ");\n  tmpCk['arfield_up'] = Array(" . $arfield["up"] . ");\n for(var subCok in tmpCk){\n  ckRec = tmpCk[subCok];\n  for(var i=0; i<ckRec.length; i++){deleteCookie(ckRec[i], dirpath, '');} \n }\n try{document.getElementById('btn_back').focus()}catch(e){};\n</script>";
         $buffer_TEXT .= $buff_cleancookie_js;
     }
开发者ID:ahmednitul,项目名称:movie-thumbnailer,代码行数:31,代码来源:xpanel.php



注:本文中的write_config_file函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP write_configure函数代码示例发布时间:2022-05-23
下一篇:
PHP write_config函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap