本文整理汇总了PHP中filesystem::chmod方法的典型用法代码示例。如果您正苦于以下问题:PHP filesystem::chmod方法的具体用法?PHP filesystem::chmod怎么用?PHP filesystem::chmod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filesystem
的用法示例。
在下文中一共展示了filesystem::chmod方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filesystem
require_once '../classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path']);
}
if (!class_exists('DB')) {
require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], true, $config['dbprefix']);
$db->pre = $db->prefix();
$db->errlogfile = '../' . $db->errlogfile;
}
// admin
$file = '../admin/data/hooks.txt';
$edit = file_get_contents($file);
$edit = preg_replace("~(-editprofile_abos_end[\r\n]+)~i", "\\1-editprofile_pic3_start\r\n-editprofile_pic3_end\r\n", $edit);
$edit = preg_replace("~(-misc_rules_end[\r\n]+)~i", "\\1-misc_board_rules_start\r\n-misc_board_rules_prepared\r\n-misc_board_rules_end\r\n", $edit);
$filesystem->chmod($file, 0666);
$filesystem->file_put_contents($file, $edit);
$file = '../admin/data/lang_email.php';
$edit = file($file);
$edit = array_map("trim", $edit);
$edit[] = "new_topic\tNotification about new topics for the board team";
$edit[] = "new_reply\tNotification about new replies for the board team";
$filesystem->chmod($file, 0666);
$filesystem->file_put_contents($file, implode("\n", $edit));
// classes
if (file_exists('../classes/function.cache.php')) {
$filesystem->unlink('../classes/function.cache.php');
}
// data
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
示例2: header
if (!isset($_GET['dirperms']) || !isset($_GET['fileperms']) || !isset($_SESSION['flist'])) {
header("Location: ./404.php");
exit;
}
if (!isset($_GET['getcwd'])) {
$getcwd = OPEN;
} else {
$getcwd = ___realpath(trim($_GET['getcwd']));
}
xhtml_head("批量改权");
if (count($_SESSION['flist']) < 1) {
echo "<div class=\"error\">\n";
echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,文件清单为空!\n";
echo "</div>\n";
} else {
$i = 0;
$fs = new filesystem();
echo "<div class=\"like\">\n";
echo "<a href=\"./index.php?path=" . urlencode($getcwd) . "\">文件列表</a>(操作结果)\n";
echo "</div>";
while ($i < count($_SESSION['flist'])) {
$fs->chpath($tmp = $_SESSION['flist'][$i]);
if ($fs->chmod(trim($_GET['dirperms']), trim($_GET['fileperms']))) {
echo "<div class=\"love\">[{$i}][√] - {$tmp}</div>\n";
} else {
echo "<div class=\"error\">[{$i}][×] - {$tmp}</div>\n";
}
$i++;
}
}
xhtml_footer();
示例3: manageconfig
$config['dbsystem'] = 'mysql';
}
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('host', str);
$c->updateconfig('dbuser', str);
$c->updateconfig('dbpw', str);
$c->updateconfig('database', str);
$c->updateconfig('pconnect', int);
$c->updateconfig('dbprefix', str);
$c->updateconfig('dbsystem', str);
$c->savedata();
$errlog = '../data/errlog_' . $config['dbsystem'] . '.inc.php';
if (!file_exists($errlog)) {
$filesystem->file_put_contents($errlog, '');
$filesystem->chmod($errlog, 0666);
}
?>
<div class="bfoot center">Database Settings saved!</div>
<?php
}
require '../data/config.inc.php';
$prefix = preg_replace("/\\W+/i", '', $config['dbprefix']);
if ($prefix != $config['dbprefix']) {
?>
<div class="bbody">The prefix is not valid!</div>
<div class="bfoot center"><a class="submit" href="index.php?package=install&step=<?php
echo $step - 1;
?>
">Go back</a> <a class="submit" href="index.php?package=install&step=<?php
echo $step;
示例4: count
foreach ($replicable as $rep) {
if ($dirs[$rep[1]] === null) {
$dirs[$rep[1]] = array();
$dir = dir($rep[1]);
while (false !== ($entry = $dir->read())) {
if (is_id($entry) && is_dir($rep[1] . '/' . $entry)) {
$dirs[$rep[1]][$entry] = $rep[1] . '/' . $entry . '/';
}
}
$dir->close();
}
$content = file_get_contents($rep[0]);
foreach ($dirs[$rep[1]] as $path) {
$target = $path . $rep[3];
if (file_exists($target)) {
$filesystem->chmod($target, 0666);
} elseif (!@is_dir(dirname($target))) {
$filesystem->mkdir(dirname($target), 0777);
}
$filesystem->file_put_contents($target, $content);
}
}
?>
<div class="bfoot">Source file updater - Step <?php
echo $sub;
?>
of <?php
echo count($tar_packs);
?>
- Currently extracting: <?php
echo $tar_packs[$sub];
示例5: array
// MySQL
$db->query("ALTER TABLE `{$db->pre}spider` CHANGE `last_visit` `last_visit` text NOT NULL default ''", __LINE__, __FILE__);
echo "- Database table updated.<br />";
// templates
$dir = "../templates/";
$tplids = array();
$d = dir($dir);
while (false !== ($entry = $d->read())) {
if (is_dir($dir . $entry) && preg_match('/^\\d{1,}$/', $entry) && $entry != '.' && $entry != '..') {
$tplids[] = $entry;
}
}
$d->close();
foreach ($tplids as $id) {
$tpldir = $dir . $id;
$filesystem->chmod($tpldir . '/header.html', 0666);
$header = file_get_contents($tpldir . '/header.html');
$header = str_ireplace("<!--[if lt IE 7]>", "<!--[if IE]>", $header);
$filesystem->file_put_contents($tpldir . '/header.html', $header);
}
echo "- Templates updated.<br />";
$ini = array('global' => array('language' => array('post_settings' => 'Options:', 'pm_not_found' => 'Private Message not found.'), 'language_de' => array('register_resend_desc' => 'Sollten Sie sich bereits registriert - aber den Bestätigungslink der Registrierungs-E-Mail noch nicht angeklickt haben, konnte Ihre Registrierung nicht vollständig abgeschlossen werden. Sie haben hier die Möglichkeit, Ihnen diese E-Mail erneut zuschicken zu lassen, ohne den Registrierungsvorgang wiederholen zu müssen. Dazu tragen Sie lediglich den bereits von Ihnen beantragten Benutzernamen ein - und die E-Mail wird Ihnen erneut an Ihre bereits bei der Registrierung angegebene E-Mail-Adresse übersandt.', 'pm_not_found' => 'Die PN wurde nicht gefunden.')));
$c = new manageconfig();
$codes = array();
$keys = array('language', 'language_de');
foreach ($keys as $entry) {
if (preg_match('~language_(\\w{2})_?(\\w{0,2})~i', $entry, $code)) {
if (!isset($codes[$code[1]])) {
$codes[$code[1]] = array();
}
if (isset($code[2])) {
示例6: filesystem
$ftp->quit();
?>
</pre></div>
<div class="bbody">Directory "install" does not exist. Please check the path.</div>
<div class="bfoot center"><a class="submit" href="index.php?package=install&step=<?php
echo $step - 1;
?>
">Go back</a></div>
<?php
} else {
$ftp->quit();
$dataGiven = true;
require_once 'install/classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path'], $config['fpath']);
$filesystem->chmod('data/config.inc.php', 0666);
include 'install/classes/class.phpconfig.php';
$c = new manageconfig();
$c->getdata('data/config.inc.php');
$c->updateconfig('ftp_server', str);
$c->updateconfig('ftp_user', str);
$c->updateconfig('ftp_pw', str);
$c->updateconfig('ftp_path', str);
$c->updateconfig('ftp_port', int);
$c->savedata();
?>
</pre></div>
<div class="bfoot center">FTP Settings saved!<br />Connection: OK!</div>
<?php
}
}
示例7: filesystem
}
echo "- Source files loaded<br />";
if (!class_exists('filesystem')) {
require_once '../classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path']);
}
if (!class_exists('DB')) {
require_once '../classes/database/' . $config['dbsystem'] . '.inc.php';
$db = new DB($config['host'], $config['dbuser'], $config['dbpw'], $config['database'], $config['pconnect'], true, $config['dbprefix']);
$db->pre = $db->prefix();
$db->errlogfile = '../' . $db->errlogfile;
}
echo "- FTP class loaded, Database connection started.<br />";
// Hooks
$filesystem->chmod('../admin/data/hooks.txt', 0666);
$hooks = file_get_contents('../admin/data/hooks.txt');
$hooks = str_replace("-register_form_end", "-register_form_end\n-register_resend_start\n-register_resend_form_start\n-register_resend_form_end\n-register_resend2_start\n-register_resend2_check\n-register_resend2_end", $hooks);
$filesystem->file_put_contents('../admin/data/hooks.txt', $hooks);
$hooks = file_get_contents('../admin/data/hooks.txt');
if (strpos($hooks, 'register_resend_form_start') !== false) {
echo "- Hooks added.<br />";
} else {
echo "- Hooks could not be added. Ask the support for help.<br />";
}
// Config
$c = new manageconfig();
$c->getdata('../data/config.inc.php');
$c->updateconfig('version', str, VISCACHA_VERSION);
$c->updateconfig('sessionmails', int, $config['sessionmails'] == 1 ? 0 : 1);
$c->updateconfig('email_check_mx', int, 0);