Example #1
0
function write_php_ini($array, $file)
{
    $res = "";
    foreach ($array as $key => $val) {
        $res .= "{$key} = " . (is_numeric($val) ? $val : "\"" . $val . "\"") . "\n";
    }
    echo $res;
    safefilerewrite($file, $res);
}
Example #2
0
function write_ini_file($array, $file)
{
    $res = array();
    foreach ($array as $key => $val) {
        $val = str_replace('\\', '/', $val);
        // Replacing windows OS backslash in that path, if any...
        $res[] = "{$key} = " . (is_numeric($val) ? $val : '"' . $val . '"');
    }
    safefilerewrite($file, implode("\n", $res));
}
function write_php_ini($fileName, $array)
{
    $res = array();
    foreach ($array as $key => $val) {
        if (is_array($val)) {
            $res[] = "[{$key}]";
            foreach ($val as $skey => $sval) {
                $res[] = "{$skey} = " . (is_numeric($sval) ? $sval : '"' . $sval . '"');
            }
        } else {
            $res[] = "{$key} = " . (is_numeric($val) ? $val : '"' . $val . '"');
        }
    }
    safefilerewrite($fileName, implode("\r\n", $res));
}
function write_hostapd_conf($array, $file)
{
    $res = array();
    foreach ($array as $key => $val) {
        if (is_array($val)) {
            $res[] = "[{$key}]";
            foreach ($val as $skey => $sval) {
                $res[] = "{$skey}={$sval}";
            }
        } else {
            $res[] = "{$key}={$val}";
        }
    }
    safefilerewrite($file, implode("\n", $res));
}
Example #5
0
function write_php_ini($array, $file)
{
    $res = array();
    $res[] = "[settings]";
    foreach ($array as $key => $val) {
        if (is_array($val)) {
            $res[] = [$key];
            foreach ($val as $skey => $sval) {
                $res[] = "{$skey} = " . (is_numeric($sval) ? $sval : $sval);
            }
        } else {
            $res[] = "{$key} = " . (is_numeric($val) ? $val : $val);
        }
    }
    safefilerewrite($file, implode("\r\n", $res));
}
Example #6
0
function write_slideDB($array, $file)
{
    $res = array();
    foreach ($array as $key => $val) {
        if (is_array($val)) {
            $res[] = "[{$key}]";
            foreach ($val as $skey => $sval) {
                $res[] = "{$skey} = " . (is_numeric($sval) ? $sval : '"' . $sval . '"');
            }
        } else {
            $res[] = "{$key} = " . (is_numeric($val) ? $val : '"' . $val . '"');
        }
        $res[] = "";
    }
    safefilerewrite($file, implode("\r", $res));
    //chmod($file,0777);
}
Example #7
0
    fclose($myfile);
    /*htaccess 設定檔寫入*/
    $settingstr = str_replace('%setup%', $_POST["dbname"], $settingstr);
    if ($_POST["mvc"] == 'true') {
        $settingstr = str_replace('%mvc%', "\n\tRewriteRule ^(.*)serback/ajx.php\$ serback/ajx.php [QSA,L]\n\tRewriteCond \$1 !^(ajax\\.php|favicon\\.ico|setup\\.php|_form_mail\\.php|verifycode\\.php|resize\\.php|mathcode\\.php|fileauth\\.php|index\\.php|css|serback|js|upload|images|includes|ckeditor|ckfinder|robots\\.txt|web|\$)\n    RewriteRule ^(.*)\$ index.php [L,QSA]", $settingstr);
    } else {
        $settingstr = str_replace('%mvc%', '', $settingstr);
    }
    $file = fopen(".htaccess", "w");
    fwrite($file, $settingstr);
    fclose($file);
    include_once "includes/main_inc.php";
    //--首頁開發訊息自動接收更新
    $aa = curl('http://www.104portal.com.tw/centerpoes.txt');
    if ($aa["code"] == '200') {
        safefilerewrite(ROOT_PATH . $admin_path . "centerpoes.php", $aa["data"]);
    }
}
if ($_POST["dbname"]) {
    $conn = ADONewConnection('mysqli');
    $conn->debug = false;
    $connect_check = $conn->PConnect($dbHost, $dbUser, $dbPass);
    if (!$connect_check) {
        echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script>alert("資料庫連線失敗,請確認是否已設定正確的主機資訊!!");//window.history.back(-1);</script>';
        exit;
    }
    $db_list = $conn->GetArray("show databases");
    if ($db_list) {
        foreach ($db_list as $k => $v) {
            $db_array[] = $v[0];
        }
Example #8
0
$tpl->assign("menu", $menu_html);
//menu
$tpl->assign("data", $data);
//別的頁面傳送來的data
$tpl->assign("close", $close);
//關閉功能
$tpl->assign("set", $set);
//網站設定
$tpl->assign('ini_webset', $ini_webset);
///--ini設定黨
$tpl->assign("search_form", ROOT_PATH . $admin_path . "templates/_search_form.html");
//搜尋form
$tpl->assign("page_table_html", ROOT_PATH . $admin_path . "templates/page_table.html");
//頁碼table
if ($include != true) {
    //--首頁開發訊息自動接收更新
    $aa = curl($ini_webset["web_set"]["info_page"]);
    if ($aa["code"] == '200') {
        safefilerewrite(ROOT_PATH . $admin_path . "templates/info.html", $aa["data"]);
    }
    $info["version"] = '後台系統 PHP 7.0.11 版 (sv2.2) [建置環境如採用5.6亦可運行]';
    $tpl->assign("info", $info);
    $tpl->assign("content", ROOT_PATH . $admin_path . "templates/info.html");
    $tpl->display(ROOT_PATH . $admin_path . "templates/index.html");
}
?>




function write_php_ini($array, $file)
{
    $res = array();
    foreach ($array as $key => $val) {
        if (is_array($val)) {
            $res[] = "[{$key}]";
            foreach ($val as $skey => $sval) {
                $res[] = "{$skey} = " . (is_numeric($sval) ? $sval : '"' . $sval . '"');
            }
        } else {
            $res[] = "{$key} = " . (is_numeric($val) ? $val : '"' . $val . '"');
        }
    }
    safefilerewrite($file, implode("\r\n", $res));
    //$_SESSION['debugVD'] .= "writing ".implode("\r\n", $res);
}