本文整理匯總了PHP中VirtualHost::addParkedDomain方法的典型用法代碼示例。如果您正苦於以下問題:PHP VirtualHost::addParkedDomain方法的具體用法?PHP VirtualHost::addParkedDomain怎麽用?PHP VirtualHost::addParkedDomain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VirtualHost
的用法示例。
在下文中一共展示了VirtualHost::addParkedDomain方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
if (isset($cmdParameters['ns']) && is_array($cmdParameters['ns'])) {
$ns = $cmdParameters['ns'];
} elseif (isset($cmdParameters['ns'])) {
$ns = array($cmdParameters['ns']);
} else {
$ns = array();
}
// Set parameters - mail exchange server(s)
if (isset($cmdParameters['mx']) && is_array($cmdParameters['mx'])) {
$mx = $cmdParameters['mx'];
} elseif (isset($cmdParameters['mx'])) {
$mx = array($cmdParameters['mx']);
} else {
$mx = array();
}
$rc = $vhost->addParkedDomain($cmdParameters['add-pdomain'], $ns, $mx);
if ($rc === false) {
Log::error('Error while adding new parked domain');
exit(9);
}
} elseif (isset($cmdParameters['remove-pdomain'])) {
$rc = $vhost->removeParkedDomain($cmdParameters['remove-pdomain']);
if ($rc === false) {
Log::error('Error while removing parked domain');
exit(9);
}
} else {
Log::error('Parameter error');
exit(9);
}
exit;
示例2: exit
exit(9);
}
// Convert passwd to use the new uid/gid
$rc = convertPasswd($vhost->home . '/' . $vhost->unixName . '/etc/' . $vhost->domainName . '/passwd', $uid, $gid);
if ($rc === false) {
Log::error('Error while converting passwd format');
exit(9);
}
// Set ownership for passwd and shadow
touch($vhost->home . '/' . $vhost->unixName . '/etc/' . $vhost->domainName . '/passwd');
chgrp($vhost->home . '/' . $vhost->unixName . '/etc/' . $vhost->domainName . '/passwd', 'dovecot');
touch($vhost->home . '/' . $vhost->unixName . '/etc/' . $vhost->domainName . '/shadow');
chgrp($vhost->home . '/' . $vhost->unixName . '/etc/' . $vhost->domainName . '/shadow', 'dovecot');
// Create parked domains and insert to database
foreach ($parkedDomains as $p) {
$rc = $vhost->addParkedDomain($p);
if ($rc === false) {
Log::error('Error while adding new parked domain');
exit(9);
}
}
// Install forwarders
foreach ($forwarders as $d => $f) {
installForwarder($vhost, $d, $f);
}
// Run restorecon to make sure all SELinux contexts are correct
exec('/usr/sbin/restorecon -r ' . escapeshellarg($vhost->home));
// Access rights - needs to be reset because it is overwritten during the untar procedure
chmod($vhost->home . '/' . $vhost->unixName . '/etc', 0751);
// Install cron
if ($cron != '') {