本文整理汇总了PHP中replaceLine函数的典型用法代码示例。如果您正苦于以下问题:PHP replaceLine函数的具体用法?PHP replaceLine怎么用?PHP replaceLine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了replaceLine函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseIOSVideoUrlByContent
public function parseIOSVideoUrlByContent($content, $p_coding, $p_script)
{
$videoUrlParam = getBody($content, $this->p_videocodeApiUrlParamstart, $this->p_videocodeApiUrlParamend);
$videoUrlParam = replaceLine($videoUrlParam);
// var_dump($videoUrlParam);
$p_videoUrlApi = replaceStr($this->p_videocodeApiUrl, "{PROD_ID}", $videoUrlParam);
$videoUrlApiCode = getPageWindow($p_videoUrlApi, $this->p_code);
$videoAddressUrl = getBody($videoUrlApiCode, $this->p_videourlstart, $this->p_videourlend);
return $videoAddressUrl;
}
示例2: configure_amavis
public function configure_amavis()
{
global $conf;
// amavisd user config file
$configfile = 'fedora_amavisd_conf';
if (is_file($conf["amavis"]["config_dir"] . '/amavisd.conf')) {
copy($conf["amavis"]["config_dir"] . '/amavisd.conf', $conf["amavis"]["config_dir"] . '/amavisd.conf~');
}
if (is_file($conf["amavis"]["config_dir"] . '/amavisd.conf~')) {
exec('chmod 400 ' . $conf["amavis"]["config_dir"] . '/amavisd.conf~');
}
if (!is_dir($conf["amavis"]["config_dir"])) {
mkdir($conf["amavis"]["config_dir"]);
}
$content = rf("tpl/" . $configfile . ".master");
$content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content);
$content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content);
$content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
$content = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $content);
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
$content = str_replace('{hostname}', $conf['hostname'], $content);
$content = str_replace('/var/spool/amavisd/clamd.sock', '/var/run/clamav/clamd.sock', $content);
wf($conf["amavis"]["config_dir"] . '/amavisd.conf', $content);
// Adding the amavisd commands to the postfix configuration
$postconf_commands = array('content_filter = amavis:[127.0.0.1]:10024', 'receive_override_options = no_address_mappings');
// Make a backup copy of the main.cf file
copy($conf["postfix"]["config_dir"] . '/main.cf', $conf["postfix"]["config_dir"] . '/main.cf~2');
// Executing the postconf commands
foreach ($postconf_commands as $cmd) {
$command = "postconf -e '{$cmd}'";
caselog($command . " &> /dev/null", __FILE__, __LINE__, "EXECUTED: {$command}", "Failed to execute the command {$command}");
}
// Append the configuration for amavisd to the master.cf file
if (is_file($conf["postfix"]["config_dir"] . '/master.cf')) {
copy($conf["postfix"]["config_dir"] . '/master.cf', $conf["postfix"]["config_dir"] . '/master.cf~');
}
$content = rf($conf["postfix"]["config_dir"] . '/master.cf');
// Only add the content if we had not addded it before
if (!stristr($content, "127.0.0.1:10025")) {
unset($content);
$content = rf("tpl/master_cf_amavis.master");
af($conf["postfix"]["config_dir"] . '/master.cf', $content);
}
unset($content);
removeLine('/etc/sysconfig/freshclam', 'FRESHCLAM_DELAY=disabled-warn # REMOVE ME', 1);
replaceLine('/etc/freshclam.conf', 'Example', '# Example', 1);
}
示例3: empty
}
if (isset($_POST['coupon'])) {
$cc = $_POST['codecoupon'];
$disc = $_POST['discount'];
$dd = $_POST['date'];
$use = $_POST['use'];
if (empty($cc) || empty($disc) || empty($dd)) {
$msg = $lang['alert_one_or_more_fields_are_required'];
}
if (file_exists("db/coupon/sessions.dat")) {
$content = @file_get_contents("db/coupon/sessions.dat");
}
$list = empty($content) ? 'null' : $content;
$data = $cp_id . '|' . $cc . '|' . $disc . '|' . strtotime($dd) . '|' . $use . '|' . $list . '|';
if ($_POST['update'] == 'update') {
replaceLine('db/coupon/' . $CouponData . '.dat', $cp_id, $data);
$dir = 'ok';
} else {
if (empty($msg)) {
$fp = fopen("db/coupon/{$CouponData}.dat", "a");
fwrite($fp, $data . "\n");
fclose($fp);
if (file_exists("db/coupon/sessions.dat")) {
@unlink("db/coupon/sessions.dat");
}
$dir = 'new';
if (file_exists("db/coupon/sessions.dat")) {
@unlink("db/coupon/sessions.dat");
}
}
}
示例4: password_encode
$address2 = "null";
}
if (empty($_POST['state'])) {
$state = "null";
}
if (empty($_POST['password'])) {
$password = $data[14];
} else {
$password = password_encode($key, $password);
}
$profile = $data[0] . '|' . $data[1] . '|' . $data[2] . '|' . $data[3] . '|' . $data[4] . '|' . $company . '|' . $email . '|' . $phone . '|' . $address . '|' . $address2 . '|' . $city . '|' . $state . '|' . $zip . '|' . $country . '|' . $password . '|';
if ($email != $data[6]) {
if (file_exists("{$AdminFolder}/db/newsletter/{$NewsletterData}.dat")) {
$ct = @file_get_contents("{$AdminFolder}/db/newsletter/{$NewsletterData}.dat");
if (preg_match('|\\b' . preg_quote($data[6]) . '\\b|i', $ct)) {
$ns = str_replace($data[6], $email, $ct);
$fp = fopen("{$AdminFolder}/db/newsletter/{$NewsletterData}.dat", "w");
fwrite($fp, $ns);
fclose($fp);
}
}
$_SESSION["checkout"] = $data[1];
}
replaceLine($CustomersFile, $_POST['update'], $profile);
header("location: checkout.php");
}
}
$meta_title = $title . "-" . $lang['profile_title'];
$include = "lib/display_profile.php";
$design = $template;
include "templates/" . $design . "/index.php";
示例5: configure_apache
public function configure_apache()
{
global $conf;
if ($conf['apache']['installed'] == false) {
return;
}
//* Create the logging directory for the vhost logfiles
if (!is_dir($conf['ispconfig_log_dir'] . '/httpd')) {
mkdir($conf['ispconfig_log_dir'] . '/httpd', 0755, true);
}
if (is_file($conf['suphp']['config_file'])) {
$content = rf($conf['suphp']['config_file']);
if (!preg_match('|^x-httpd-suphp=php:/usr/bin/php-cgi$|m', $content)) {
$content = preg_replace('/;Handler for php-scripts/', ";Handler for php-scripts\nx-httpd-suphp=php:/usr/bin/php-cgi", $content);
$content = preg_replace('/;?umask=\\d+/', 'umask=0022', $content);
}
$this->write_config_file($conf['suphp']['config_file'], $content);
}
//* Enable ISPConfig default vhost settings
$default_vhost_path = $conf['apache']['vhost_conf_dir'] . '/' . $conf['apache']['vhost_default'];
if (is_file($default_vhost_path)) {
$content = rf($default_vhost_path);
$content = preg_replace('/^#?\\s*NameVirtualHost.*$/m', 'NameVirtualHost *:80', $content);
$content = preg_replace('/<VirtualHost[^>]+>/', '<VirtualHost *:80>', $content);
$this->write_config_file($default_vhost_path, $content);
}
//* Generate default ssl certificates
if (!is_dir($conf['apache']['ssl_dir'])) {
mkdir($conf['apache']['ssl_dir']);
}
if ($conf['services']['mail'] == true) {
copy($conf['postfix']['config_dir'] . "/smtpd.key", $conf['apache']['ssl_dir'] . "/server.key");
copy($conf['postfix']['config_dir'] . "/smtpd.cert", $conf['apache']['ssl_dir'] . "/server.crt");
} else {
if (!is_file($conf['apache']['ssl_dir'] . '/server.crt')) {
exec("openssl req -new -outform PEM -out {$conf['apache']['ssl_dir']}/server.crt -newkey rsa:2048 -nodes -keyout {$conf['apache']['ssl_dir']}/server.key -keyform PEM -days 365 -x509");
}
}
//* Copy the ISPConfig configuration include
$content = $this->get_template_file('apache_ispconfig.conf', true);
$records = $this->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = " . $conf["server_id"] . " AND virtualhost = 'y'");
if (is_array($records) && count($records) > 0) {
foreach ($records as $rec) {
$content .= "NameVirtualHost " . $rec["ip_address"] . ":80\n";
$content .= "NameVirtualHost " . $rec["ip_address"] . ":443\n";
}
}
$this->write_config_file($conf['apache']['vhost_conf_dir'] . '/000-ispconfig.conf', $content);
//* Gentoo by default does not include .vhost files. Add include line to config file.
$content = rf($conf['apache']['config_file']);
if (strpos($content, 'Include /etc/apache2/vhosts.d/*.vhost') === false) {
$content = preg_replace('|(Include /etc/apache2/vhosts.d/\\*.conf)|', "\$1\nInclude /etc/apache2/vhosts.d/*.vhost", $content);
}
$this->write_config_file($conf['apache']['config_file'], $content);
//* make sure that webalizer finds its config file when it is directly in /etc
if (is_file('/etc/webalizer.conf') && !is_dir('/etc/webalizer')) {
mkdir('/etc/webalizer', 0755);
symlink('/etc/webalizer.conf', '/etc/webalizer/webalizer.conf');
}
if (is_file('/etc/webalizer/webalizer.conf')) {
replaceLine('/etc/webalizer/webalizer.conf', '#IncrementalName', 'IncrementalName webalizer.current', 0, 0);
replaceLine('/etc/webalizer/webalizer.conf', '#Incremental', 'Incremental yes', 0, 0);
replaceLine('/etc/webalizer/webalizer.conf', '#HistoryName', 'HistoryName webalizer.hist', 0, 0);
}
//* add a sshusers group
if (!is_group('sshusers')) {
$command = 'groupadd sshusers';
caselog($command . ' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: {$command}", "Failed to execute the command {$command}");
}
}
示例6: install_ispconfig
//.........这里部分代码省略.........
$content = rf("tpl/apache_ispconfig.vhost.master");
$content = str_replace('{vhost_port}', $conf['apache']['vhost_port'], $content);
// comment out the listen directive if port is 80 or 443
if ($conf['apache']['vhost_port'] == 80 or $conf['apache']['vhost_port'] == 443) {
$content = str_replace('{vhost_port_listen}', '#', $content);
} else {
$content = str_replace('{vhost_port_listen}', '', $content);
}
if (is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_comment}', '', $content);
} else {
$content = str_replace('{ssl_comment}', '#', $content);
}
$content = str_replace('/var/www/', '/srv/www/', $content);
wf("{$vhost_conf_dir}/ispconfig.vhost", $content);
if (!is_file('/srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter')) {
exec('mkdir -p /srv/www/php-fcgi-scripts/ispconfig');
exec('cp tpl/apache_ispconfig_fcgi_starter.master /srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('chmod +x /srv/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter');
exec('ln -s /usr/local/ispconfig/interface/web /srv/www/ispconfig');
exec('chown -R ispconfig:ispconfig /srv/www/php-fcgi-scripts/ispconfig');
}
//copy('tpl/apache_ispconfig.vhost.master', "$vhost_conf_dir/ispconfig.vhost");
//* and create the symlink
if ($this->install_ispconfig_interface == true && $this->is_update == false) {
if (@is_link("{$vhost_conf_enabled_dir}/ispconfig.vhost")) {
unlink("{$vhost_conf_enabled_dir}/ispconfig.vhost");
}
if (!@is_link("{$vhost_conf_enabled_dir}/000-ispconfig.vhost")) {
exec("ln -s {$vhost_conf_dir}/ispconfig.vhost {$vhost_conf_enabled_dir}/000-ispconfig.vhost");
}
}
// Fix a setting in vhost master file for suse
replaceLine('/usr/local/ispconfig/server/conf/vhost.conf.master', "suPHP_UserGroup", " suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>", 0);
}
if ($conf['nginx']['installed'] == true) {
//* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_dir = $conf['nginx']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enabled_dir'];
// Dont just copy over the virtualhost template but add some custom settings
$content = rf('tpl/nginx_ispconfig.vhost.master');
$content = str_replace('{vhost_port}', $conf['nginx']['vhost_port'], $content);
if (is_file($install_dir . '/interface/ssl/ispserver.crt') && is_file($install_dir . '/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_on}', ' ssl', $content);
$content = str_replace('{ssl_comment}', '', $content);
$content = str_replace('{fastcgi_ssl}', 'on', $content);
} else {
$content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $content);
$content = str_replace('{fastcgi_ssl}', 'off', $content);
}
$socket_dir = escapeshellcmd($conf['nginx']['php_fpm_socket_dir']);
if (substr($socket_dir, -1) != '/') {
$socket_dir .= '/';
}
if (!is_dir($socket_dir)) {
exec('mkdir -p ' . $socket_dir);
}
$fpm_socket = $socket_dir . 'ispconfig.sock';
//$content = str_replace('{fpm_port}', $conf['nginx']['php_fpm_start_port'], $content);
$content = str_replace('{fpm_socket}', $fpm_socket, $content);
wf($vhost_conf_dir . '/ispconfig.vhost', $content);
unset($content);
// PHP-FPM
// Dont just copy over the php-fpm pool template but add some custom settings
$content = rf('tpl/php_fpm_pool.conf.master');
示例7: fopen
$fi = fopen($file, "w");
fwrite($fi, $content);
fclose($fi);
}
}
}
if (isset($_SESSION["checkout"])) {
$DataCustomers = data($CustomersFile, $regex);
} else {
die("Invalid request");
}
if (isset($_SESSION['use'])) {
$regex = $_SESSION['use'];
$DataCoupon = data("{$AdminFolder}/db/coupon/{$CouponData}.dat", $regex);
$replacement = $DataCoupon[0] . '|' . $DataCoupon[1] . '|' . $DataCoupon[2] . '|' . $DataCoupon[3] . '|0|' . $DataCoupon[5] . '|';
replaceLine("{$AdminFolder}/db/coupon/{$CouponData}.dat", $regex, $replacement);
}
@($_SESSION["idcustomer"] = $DataCustomers[1]);
@($_SESSION["paymentmode"] = $_POST['payment']);
@($total_weight = $_POST["total_weight"]);
@($SubTotal = $_POST["sub_total"]);
@($discount = $_POST["discount"]);
@($shipping = $_POST["shipping"]);
@($NetTotal = $_POST["net_total"]);
@($tax = $_POST["tax"]);
@($shipping_mode = $_POST["shipping_mode"]);
@($memo = $_POST["memo"]);
@($ShippingDate = "null");
@($tracking = "null");
$IDcustomer = $DataCustomers[1];
$firstN = $DataCustomers[4];
示例8: foreach
if (md5(strtoupper($_POST['code'])) != $_SESSION['__img_code__']) {
$msg[] = $lang['alert_authentification_captcha'];
}
}
$ct = @file_get_contents("{$AdminFolder}/db/newsletter/{$NewsletterData}.dat");
$Nfile = "{$AdminFolder}/db/newsletter/{$NewsletterData}.dat";
if (empty($msg)) {
if (!preg_match('|\\b' . preg_quote($email) . '\\b|i', $ct) && !empty($_POST['email'])) {
$msg[] = $lang['alert_register_email_does_not_exist'];
}
}
$_SESSION['email'] = $email;
foreach ($_POST as $key => $val) {
if (preg_match('#[\\x00-\\x1F\\x7F-\\x9F/\\\\]#', $val)) {
$msg[] = $lang['not_authorized_characters'];
}
}
$email = $_SESSION['email'];
if (empty($msg)) {
replaceLine($Nfile, $email);
$_SESSION = array();
header("location: unsubscribe.php?m=1");
}
}
if ($_GET['m'] == 1) {
$msg2 = '<strong><font color="#009900">' . $lang['unsubscribe_newsletter_success'] . '</strong></font>';
}
$meta_title = $title . "-" . $lang['unsubscribe_newsletter_title'];
$include = "lib/display_unsubscribe.php";
$design = $template;
include "templates/" . $design . "/index.php";
示例9: fclose
fclose($fp);
} elseif (file_exists("../db/rp/{$item_id}.dat") && empty($_POST['multiple'])) {
unlink("../db/rp/{$item_id}.dat");
}
$sd = preg_replace("/<[^>]*>/", "", $description);
$sd = mynl2br($sd, " ");
$sd = preg_replace('/\\s\\s+/', ' ', $sd);
$sd = substr($sd, 0, 3069) . '...';
$di = $id . '|' . $item_id . '|' . $title . '|' . $price . '|' . $discount . '|' . $category . '|' . $subcategory . '|' . $sp_offer . '|' . $sd . '|';
if (!empty($_POST['multiple'])) {
$rp = $_POST['multiple'];
} else {
$rp = '';
}
if ($_POST['update'] == 'update') {
replaceLine('../db/' . $ItemsData . '.dat', $item_id, $di);
$dir = 'ok';
} else {
$fp = fopen("../db/{$ItemsData}.dat", "a");
fwrite($fp, $di . "\n");
fclose($fp);
$dir = 'new';
}
unset($_SESSION["item_id"]);
unset($_SESSION["upload"]);
unset($_SESSION["edit"]);
unset($_SESSION["subcat"]);
header("location: items.php?msg={$dir}");
exit;
}
?>
示例10: explode
$dt = explode('|', $line);
return $dt;
} else {
return false;
}
}
$status = $_POST['status'];
$ShippingDate = strtotime($_POST['shipping_date']);
$tracking = $_POST['tracking'];
$total = number_format($_POST['total'], 2, '.', ',');
if (isset($_POST['update_order']) && strlen($_POST['update_order']) == 32) {
@copy('db/orders/' . $OrdersData . '.dat', 'backup/orders/' . $OrdersData . '.dat');
@($data = db($OrdersFile, $_POST['update_order']));
@($cu = db($CustomersFile, $_POST['update_customer']));
$order = $data[0] . '|' . $data[1] . '|' . $data[2] . '|' . $data[3] . '|' . $data[4] . '|' . $data[5] . '|' . $data[6] . '|' . $data[7] . '|' . $data[8] . '|' . $data[9] . '|' . $data[10] . '|' . $data[11] . '|' . $data[12] . '|' . $status . '|' . $data[14] . '|' . $data[15] . '|' . $data[16] . '|' . $data[17] . '|' . $ShippingDate . '|' . $tracking . '|';
replaceLine($OrdersFile, $_POST['update_order'], $order);
$OrderDate = date('j M, Y', $data[3]);
if (isset($_POST['emailconfirm'])) {
if (file_exists("db/shipping/{$ShippingSetupData}.dat")) {
@($fp = fopen("db/shipping/{$ShippingSetupData}.dat", "r"));
$datasetup = fgets($fp, 255);
fclose($fp);
$setup = explode('|', $datasetup);
}
$filename = "db/orders/sc/" . $data[0] . ".dat";
if (file_exists($filename)) {
$tab = array();
$ShoppingCart = '';
$tab = file($filename);
for ($i = 0; $i < sizeof($tab); $i++) {
@(list($id1, $id_item, $category, $subcategory, $title1, $filename, $digital, $folder, $currency, $weight, $price, $quantity, $option1, $option2, $tax, $ship, $discount1, $discount2, $ip_name) = explode('|', $tab[$i]));
示例11: parseAndroidVideoUrlByContent
public function parseAndroidVideoUrlByContent($content, $p_coding, $p_script)
{
$vid = getBody($content, $this->contentparmStart, $this->contentparaend);
$vid = replaceLine($vid);
return $this->getAndroidVideoUrl($vid, $p_coding, $p_script);
}
示例12: configure_nginx
public function configure_nginx()
{
global $conf;
if ($conf['nginx']['installed'] == false) {
return;
}
//* Create the logging directory for the vhost logfiles
if (!@is_dir($conf['ispconfig_log_dir'] . '/httpd')) {
mkdir($conf['ispconfig_log_dir'] . '/httpd', 0755, true);
}
//* make sure that webalizer finds its config file when it is directly in /etc
if (@is_file('/etc/webalizer.conf') && !@is_dir('/etc/webalizer')) {
mkdir('/etc/webalizer');
symlink('/etc/webalizer.conf', '/etc/webalizer/webalizer.conf');
}
if (is_file('/etc/webalizer/webalizer.conf')) {
// Change webalizer mode to incremental
replaceLine('/etc/webalizer/webalizer.conf', '#IncrementalName', 'IncrementalName webalizer.current', 0, 0);
replaceLine('/etc/webalizer/webalizer.conf', '#Incremental', 'Incremental yes', 0, 0);
replaceLine('/etc/webalizer/webalizer.conf', '#HistoryName', 'HistoryName webalizer.hist', 0, 0);
}
// Check the awsatst script
if (!is_dir('/usr/share/awstats/tools')) {
exec('mkdir -p /usr/share/awstats/tools');
}
if (!file_exists('/usr/share/awstats/tools/awstats_buildstaticpages.pl') && file_exists('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl')) {
symlink('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl', '/usr/share/awstats/tools/awstats_buildstaticpages.pl');
}
if (file_exists('/etc/awstats/awstats.conf.local')) {
replaceLine('/etc/awstats/awstats.conf.local', 'LogFormat=4', 'LogFormat=1', 0, 1);
}
//* add a sshusers group
$command = 'groupadd sshusers';
if (!is_group('sshusers')) {
caselog($command . ' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: {$command}", "Failed to execute the command {$command}");
}
/*
$row = $this->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$conf["server_id"]."");
$ip_address = gethostbyname($row["server_name"]);
$server_name = $row["server_name"];
//setup proxy.conf
$configfile = 'proxy.conf';
if(is_file($conf["nginx"]["config_dir"].'/'.$configfile)) copy($conf["nginx"]["config_dir"].'/'.$configfile,$conf["nginx"]["config_dir"].'/'.$configfile.'~');
if(is_file($conf["nginx"]["config_dir"].'/'.$configfile.'~')) exec('chmod 400 '.$conf["nginx"]["config_dir"].'/'.$configfile.'~');
$content = rf("tpl/nginx_".$configfile.".master");
wf($conf["nginx"]["config_dir"].'/'.$configfile,$content);
exec('chmod 600 '.$conf["nginx"]["config_dir"].'/'.$configfile);
exec('chown root:root '.$conf["nginx"]["config_dir"].'/'.$configfile);
//setup conf.d/cache.conf
$configfile = 'cache.conf';
if(is_file($conf["nginx"]["config_dir"].'/conf.d/'.$configfile)) copy($conf["nginx"]["config_dir"].'/conf.d/'.$configfile,$conf["nginx"]["config_dir"].'/conf.d/'.$configfile.'~');
if(is_file($conf["nginx"]["config_dir"].'/conf.d/'.$configfile.'~')) exec('chmod 400 '.$conf["nginx"]["config_dir"].'/conf.d/'.$configfile.'~');
$content = rf("tpl/nginx_".$configfile.".master");
wf($conf["nginx"]["config_dir"].'/conf.d/'.$configfile,$content);
exec('chmod 600 '.$conf["nginx"]["config_dir"].'/conf.d/'.$configfile);
exec('chown root:root '.$conf["nginx"]["config_dir"].'/conf.d/'.$configfile);
//setup cache directories
mkdir('/var/cache/nginx/cache');
exec('chown www-data:www-data /var/cache/nginx/cache');
mkdir('/var/cache/nginx/temp');
exec('chown www-data:www-data /var/cache/nginx/temp');
*/
}
示例13: explode
@($amount = $_POST['amount']);
$ShipMode = explode(',', $ship);
$ShipAmount = explode(',', $amount);
if (count($ShipMode) != count($ShipAmount)) {
$msg = $lang["add_shipping_fields"];
$minimum1 = $minimum;
$maximum1 = $maximum;
$ShipMode1 = $ship;
$amount1 = $amount;
}
$id = md5(uniqid(rand()));
$page_id = empty($_POST['page_id']) ? $id : $_POST['page_id'];
if (isset($_POST['shipping']) && empty($msg)) {
$data = $page_id . '|' . $minimum . '|' . $maximum . '|' . $local_select . '|' . $setup[3] . '|' . $ship . '|' . $amount . '|' . $setup[0] . '|' . $setup[1] . '|';
if ($_POST['update'] == 'update') {
replaceLine('db/shipping/' . $local_select . '.dat', $page_id, $data);
$dir = 'ok';
} else {
$fp = fopen('db/shipping/' . $local_select . '.dat', 'a');
fwrite($fp, $data . "\n");
fclose($fp);
$dir = 'new';
}
header("location: shipping.php?msg={$dir}");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="js/BarMenu.js"></script>
示例14: fopen
if (preg_match('|\\b' . preg_quote($pattern) . '\\b|i', $data[2], $match)) {
$line = $replacement;
$exist = true;
}
$content .= $line;
}
if (isset($exist)) {
$fi = fopen($file, "w");
fwrite($fi, $content);
fclose($fi);
}
}
}
if (isset($_GET['delete'])) {
$delete = $_GET['delete'];
replaceLine($filename, $delete, "");
Header("Refresh: 0; URL=\"{$url}\"");
}
if (isset($_POST['search'])) {
if (strlen($_POST['search']) < 2 && !empty($_POST['search'])) {
$_GET['msg'] = 'minimum';
}
if (empty($_POST['search'])) {
$_GET['msg'] = 'empty';
}
}
if (isset($_POST['search']) && empty($msg)) {
$result = array();
$pattern = $_POST['search'];
if (file_exists($filename)) {
@($fp = fopen($filename, 'r'));
示例15: configure_apache
public function configure_apache()
{
global $conf;
if (file_exists('/etc/apache2/mods-available/fcgid.conf')) {
replaceLine('/etc/apache2/mods-available/fcgid.conf', 'MaxRequestLen', 'MaxRequestLen 15728640', 0, 1);
}
parent::configure_apache();
}