本文整理汇总了PHP中Setting::getServiceSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getServiceSetting方法的具体用法?PHP Setting::getServiceSetting怎么用?PHP Setting::getServiceSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::getServiceSetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doesExistTable
function doesExistTable($tablename)
{
global $database;
static $tables = array();
if (empty($tables)) {
$tables = POD::tableList($database['prefix']);
}
$dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', null, 'global');
if ($dbCaseInsensitive === null) {
if (in_array(POD::dbms(), array('MySQL', 'MySQLi'))) {
$result = POD::queryRow("SHOW VARIABLES LIKE 'lower_case_table_names'");
$dbCaseInsensitive = $result['Value'] == 1 ? 1 : 0;
} else {
$dbCaseInsensitive = 1;
}
Setting::setServiceSetting('lowercaseTableNames', $dbCaseInsensitive, true);
}
if ($dbCaseInsensitive == 1) {
$tablename = strtolower($tablename);
}
if (in_array($tablename, $tables)) {
return true;
}
return false;
}
示例2: getBlogVersion
function getBlogVersion()
{
if (defined('__TEXTCUBE_GAE__')) {
$version = Setting::getServiceSetting('blogVersion', null, true);
if (is_null($version)) {
$version = '0';
}
return $version;
}
if (!file_exists(__TEXTCUBE_CHECKUP_FILE__)) {
return '0.0';
}
return trim(file_get_contents(__TEXTCUBE_CHECKUP_FILE__));
}
示例3: dumbCronScheduler
function dumbCronScheduler($checkOnly = true)
{
$context = Model_Context::getInstance();
$now = Timestamp::getUNIXtime();
$dumbCronStamps = Setting::getServiceSetting('dumbCronStamps', serialize(array('1m' => 0, '5m' => 0, '30m' => 0, '1h' => 0, '2h' => 0, '6h' => 0, '12h' => 0, '24h' => 0, 'Daily' => 0)), true);
$dumbCronStamps = unserialize($dumbCronStamps);
$schedules = array('1m' => 60, '5m' => 60 * 5, '10m' => 60 * 10, '30m' => 60 * 30, '1h' => 60 * 60, '2h' => 60 * 60 * 2, '6h' => 60 * 60 * 6, '12h' => 60 * 60 * 12, '24h' => 60 * 60 * 24, 'Daily' => 60 * 60 * 24, '1w' => 60 * 60 * 24 * 7);
/* Events: Cron1m, Cron5m, Cron30m, Cron1h, Cron2h, Cron6h, Cron12h */
$log_file = __TEXTCUBE_CACHE_DIR__ . '/cronlog.txt';
$log = fopen($log_file, "a");
foreach ($schedules as $d => $diff) {
if (!isset($dumbCronStamps[$d])) {
$dumbCronStamps[$d] = 0;
}
if ($now > $diff + $dumbCronStamps[$d]) {
if ($checkOnly && eventExists("Cron{$d}")) {
fclose($log);
return true;
}
fireEvent("Cron{$d}", null, $now);
if ($d == '6h') {
importlib('model.blog.trash');
trashVan();
}
fwrite($log, date('Y-m-d H:i:s') . ' ' . $context->getProperty('blog.name') . " Cron{$d} executed ({$_SERVER['REQUEST_URI']})\r\n");
$dumbCronStamps[$d] = $now;
}
}
fclose($log);
/* Keep just 1000 lines */
$logcontent = explode("\r\n", file_get_contents($log_file));
$logcontent = implode("\r\n", array_slice($logcontent, -1000));
$log = fopen($log_file, "w");
fwrite($log, $logcontent);
fclose($log);
Setting::setServiceSetting('dumbCronStamps', serialize($dumbCronStamps), true);
return false;
}
示例4: removeBlog
function removeBlog($blogid)
{
$pool = DBModel::getInstance();
$ctx = Model_Context::getInstance();
if (Setting::getServiceSetting("defaultBlogId", 1, true) == $blogid) {
return false;
}
$targets = array('Attachments', 'BlogSettings', 'BlogStatistics', 'Categories', 'Comments', 'CommentsNotified', 'CommentsNotifiedQueue', 'DailyStatistics', 'Entries', 'EntriesArchive', 'FeedGroups', 'FeedReads', 'FeedStarred', 'FeedSettings', 'Filters', 'Links', 'LinkCategories', 'PageCacheLog', 'Plugins', 'RefererLogs', 'RefererStatistics', 'RemoteResponses', 'RemoteResponseLogs', 'SkinSettings', 'TagRelations', 'Privileges', 'XMLRPCPingSettings');
//Clear Tables
foreach ($targets as $t) {
$pool->reset($t);
$pool->setQualifier('blogid', 'eq', $blogid);
$pool->delete();
}
//Delete Tags
$tags = POD::queryColumn("SELECT DISTINCT tag FROM " . $ctx->getProperty('database.prefix') . "TagRelations WHERE blogid = {$blogid}");
if (count($tags) > 0) {
$tagliststr = implode(', ', $tags);
// Tag id used at deleted blog.
$nottargets = POD::queryColumn("SELECT DISTINCT tag FROM " . $ctx->getProperty('database.prefix') . "TagRelations WHERE tag in ( {$tagliststr} )");
// Tag id used at other blogs.
if (count($nottargets) > 0) {
$nottargetstr = implode(', ', $nottargets);
POD::execute("DELETE FROM " . $ctx->getProperty('database.prefix') . "Tags WHERE id IN ( {$tagliststr} ) AND id NOT IN ( {$nottargetstr} )");
} else {
POD::execute("DELETE FROM " . $ctx->getProperty('database.prefix') . "Tags WHERE id IN ( {$tagliststr} ) ");
}
}
//Delete Feeds
$feeds = POD::queryColumn("SELECT DISTINCT feeds FROM " . $ctx->getProperty('database.prefix') . "FeedGroupRelations WHERE blogid = {$blogid}");
if (count($feeds) > 0) {
foreach ($feeds as $feedId) {
deleteFeed($blogid, $feedId);
}
}
//Clear Plugin Database
// TODO : encapsulate with 'value'
$query = "SELECT name, value FROM " . $ctx->getProperty('database.prefix') . "ServiceSettings WHERE name like 'Database\\_%'";
$plugintablesraw = POD::queryAll($query);
foreach ($plugintablesraw as $table) {
$dbname = $ctx->getProperty('database.prefix') . substr($table['name'], 9);
POD::execute("DELETE FROM " . $ctx->getProperty('database.prefix') . "{$dbname} WHERE blogid = {$blogid}");
}
//Clear RSS Cache
if (file_exists(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml")) {
unlink(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml");
}
//Delete Attachments
Path::removeFiles(Path::combine(ROOT, 'attach', $blogid));
return true;
}
示例5: getScriptsOnFoot
function getScriptsOnFoot()
{
$context = Model_Context::getInstance();
ob_start();
if ($context->getProperty('service.reader') != false && gmmktime() - Setting::getServiceSetting('lastFeedUpdate', 0, true) > 180) {
?>
<script type="text/javascript">
updateFeed();
</script>
<?php
$view = ob_get_contents();
ob_end_clean();
return $view;
} else {
return '';
}
}
示例6: getPluginTableName
function getPluginTableName()
{
importlib('model.common.setting');
$context = Model_Context::getInstance();
$likeEscape = array('/_/', '/%/');
$likeReplace = array('\\_', '\\%');
$escapename = preg_replace($likeEscape, $likeReplace, $context->getProperty('database.prefix'));
$dbtables = POD::tableList($escapename);
$dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', true);
if ($dbCaseInsensitive === null) {
doesExistTable('');
// determine the table name rule. (lowercase only / mixed cases)
}
$definedTables = getDefinedTableNames();
$dbtables = array_values(array_diff($dbtables, $definedTables));
if ($dbCaseInsensitive == 1) {
$tempTables = $definedTables;
$definedTables = array();
foreach ($tempTables as $table) {
$table = strtolower($table);
array_push($definedTables, $table);
}
$tempTables = $dbtables;
$dbtables = array();
foreach ($tempTables as $table) {
$table = strtolower($table);
array_push($dbtables, $table);
}
$dbtables = array_values(array_diff($dbtables, $definedTables));
}
return $dbtables;
}
示例7: removeBlog
function removeBlog($blogid)
{
$pool = DBModel::getInstance();
$context = Model_Context::getInstance();
if (Setting::getServiceSetting("defaultBlogId", 1, true) == $blogid) {
return false;
}
$targets = array('Attachments', 'BlogSettings', 'BlogStatistics', 'Categories', 'Comments', 'CommentsNotified', 'CommentsNotifiedQueue', 'DailyStatistics', 'Entries', 'EntriesArchive', 'FeedGroups', 'FeedReads', 'FeedStarred', 'FeedSettings', 'Filters', 'Links', 'LinkCategories', 'PageCacheLog', 'Plugins', 'RefererLogs', 'RefererStatistics', 'RemoteResponses', 'RemoteResponseLogs', 'SkinSettings', 'TagRelations', 'Privileges', 'XMLRPCPingSettings');
//Clear Tables
foreach ($targets as $t) {
$pool->reset($t);
$pool->setQualifier('blogid', 'eq', $blogid);
$pool->delete();
}
//Delete Tags
$pool->reset("TagRelations");
$pool->setQualifier("blogid", "eq", $blogid);
$tags = $pool->getColumn("tag", "DISTINCT");
if (count($tags) > 0) {
$pool->reset("TagRelations");
// Tag id used at deleted blog.
$pool->setQualifier("tag", "hasoneof", $tags);
$nottargets = $pool->getColumn("tag", "DISTINCT");
// Tag id used at other blogs.
if (count($nottargets) > 0) {
$pool->reset("Tags");
$pool->setQualifier("id", "hasoneof", $tags);
$pool->setQualifier("id", "hasnoneof", $nottargets);
$pool->delete();
} else {
$pool->reset("Tags");
$pool->setQualifier("id", "hasoneof", $tags);
$pool->delete();
}
}
//Delete Feeds
$pool->reset("FeedGroupRelations");
$pool->setQualifier("blogid", "eq", $blogid);
$feeds = $pool->getColumn("feeds", "DISTINCT");
if (count($feeds) > 0) {
foreach ($feeds as $feedId) {
deleteFeed($blogid, $feedId);
}
}
//Clear Plugin Database
// TODO : encapsulate with 'value'
$pool->reset("ServiceSettings");
$pool->setQualifier("name", "like", "Database_");
$plugintablesraw = $pool->getAll();
foreach ($plugintablesraw as $table) {
$pool->reset(substr($table['name'], 9));
$pool->setQualifier("blogid", "eq", $blogid);
$pool->delete();
}
//Clear RSS Cache
if (file_exists(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml")) {
unlink(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml");
}
//Delete Attachments
Path::removeFiles(Path::combine(ROOT, 'attach', $blogid));
return true;
}
示例8: getDefaultCenterPanel
//.........这里部分代码省略.........
echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/trackback?status=received">' . _t('걸린글') . '</a>';
break;
case 'comment':
echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=comment">' . _t('댓글') . '</a>';
break;
case 'commentNotify':
echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/notify">' . _t('알리미') . '</a>';
break;
case 'guestbook':
echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=guestbook">' . _t('방명록') . '</a>';
break;
}
?>
</td>
<td class="title"><a href="<?php
echo $item['link'];
?>
"><?php
echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20));
?>
</a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
$noticeURL = TEXTCUBE_NOTICE_URL;
$noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss";
$noticeEntries = array();
if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) {
$noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')));
} else {
list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS);
if ($result == 0) {
$xmls = new XMLStruct();
$xmls->setXPathBaseIndex(1);
$noticeEntries = array();
if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) {
if ($xmls->getAttribute('/rss', 'version')) {
for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) {
$item = array('permalink' => rawurldecode($link));
$item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title");
if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) {
$item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate"));
} else {
if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) {
$item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date"));
} else {
$item['written'] = 0;
}
}
array_push($noticeEntries, $item);
}
}
}
Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries));
}
}
?>
<div id="textcube-notice">
<h4 class="caption"><span><a href="<?php
echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko");
示例9: trashVan
function trashVan()
{
$context = Model_Context::getInstance();
if (Timestamp::getUNIXtime() - Setting::getServiceSetting('lastTrashSweep', 0, true) > 43200) {
$pool = DBModel::getInstance();
$pool->reset('Comments');
$pool->setQualifier('isfiltered', 's', Timestamp::getUNIXtime() - $context->getProperty('service.trashtimelimit', 302400));
$pool->setQualifier('isfiltered', 'b', 0);
$pool->delete();
$pool->reset('RemoteResponses');
$pool->setQualifier('isfiltered', 's', Timestamp::getUNIXtime() - $context->getProperty('service.trashtimelimit', 302400));
$pool->setQualifier('isfiltered', 'b', 0);
$pool->delete();
$pool->reset('RefererLogs');
$pool->setQualifier('referred', 's', Timestamp::getUNIXtime() - 604800);
$pool->delete();
Setting::setServiceSetting('lastTrashSweep', Timestamp::getUNIXtime(), true);
}
if (Timestamp::getUNIXtime() - Setting::getServiceSetting('lastNoticeRead', 0, true) > 43200) {
Setting::removeServiceSetting('TextcubeNotice', true);
Setting::setServiceSetting('lastNoticeRead', Timestamp::getUNIXtime(), true);
}
}
示例10: empty
</span></h2>
<div id="team-blog-about" class="container">
<h3><?php
echo empty($blogsetting['title']) ? '<em>' . _t('비어 있는 타이틀') . '</em>' : '<a href="' . getDefaultUrl($bid) . '">' . $blogsetting['title'] . '</a>';
?>
</h3>
<div class="main-explain-box">
<p class="explain"><?php
echo empty($blogsetting['description']) ? '<em>' . _t('비어 있는 블로그 설명') . '</em>' : $blogsetting['description'];
?>
</p>
</div>
<?php
$isRepBlog = $bid == Setting::getServiceSetting("defaultBlogId", 1, true) ? true : false;
$pool->reset('Entries');
$pool->setQualifier('blogid', 'eq', $bid);
$pool->setQualifier('draft', 'eq', 0);
$numberOfEntries = $pool->getCount();
$pool->reset('RemoteResponses');
$pool->setQualifier('blogid', 'eq', $bid);
$pool->setQualifier('responsetype', 'eq', 'trackback', true);
$pool->setQualifier('isfiltered', 'eq', 0);
$numberOfTrackbacks = $pool->getCount();
$pool->reset('Comments');
$pool->setQualifier('blogid', 'eq', $bid);
$pool->setQualifier('isfiltered', 'eq', 0);
$numberOfComments = $pool->getCount();
$pool->reset('Attachments');
$pool->setQualifier('blogid', 'eq', $bid);
示例11: trashVan
function trashVan()
{
global $database;
requireModel('common.setting');
if (Timestamp::getUNIXtime() - Setting::getServiceSetting('lastTrashSweep', 0, true) > 86400) {
// var_dump(Timestamp::getUNIXtime());
// var_dump(Setting::getServiceSetting('lastTrashSweep',0, true));
POD::execute("DELETE FROM {$database['prefix']}Comments where isfiltered < " . Timestamp::getUNIXtime() . " - 1296000 AND isfiltered > 0");
POD::execute("DELETE FROM {$database['prefix']}RemoteResponses where isfiltered < " . Timestamp::getUNIXtime() . " - 1296000 AND isfiltered > 0");
POD::execute("DELETE FROM {$database['prefix']}RefererLogs WHERE referred < " . Timestamp::getUNIXtime() . " - 604800");
Setting::setServiceSetting('lastTrashSweep', Timestamp::getUNIXtime(), true);
}
if (Timestamp::getUNIXtime() - Setting::getServiceSetting('lastNoticeRead', 0, true) > 43200) {
Setting::removeServiceSetting('TextcubeNotice', true);
Setting::setServiceSetting('lastNoticeRead', Timestamp::getUNIXtime(), true);
}
}
示例12: getPluginTableName
function getPluginTableName()
{
requireModel('common.setting');
$ctx = Model_Context::getInstance();
$likeEscape = array('/_/', '/%/');
$likeReplace = array('\\_', '\\%');
$escapename = preg_replace($likeEscape, $likeReplace, $ctx->getProperty('database.prefix'));
$dbtables = POD::tableList($escapename);
$dbCaseInsensitive = Setting::getServiceSetting('lowercaseTableNames', true);
if ($dbCaseInsensitive === null) {
$result = POD::queryRow("SHOW VARIABLES LIKE 'lower_case_table_names'");
$dbCaseInsensitive = $result['Value'] == 1 ? 1 : 0;
Setting::setServiceSetting('lowercaseTableNames', $dbCaseInsensitive, true);
}
$definedTables = getDefinedTableNames();
$dbtables = array_values(array_diff($dbtables, $definedTables));
if ($dbCaseInsensitive == 1) {
$tempTables = $definedTables;
$definedTables = array();
foreach ($tempTables as $table) {
$table = strtolower($table);
array_push($definedTables, $table);
}
$tempTables = $dbtables;
$dbtables = array();
foreach ($tempTables as $table) {
$table = strtolower($table);
array_push($dbtables, $table);
}
$dbtables = array_values(array_diff($dbtables, $definedTables));
}
return $dbtables;
}
示例13: trashVan
function trashVan()
{
if (Timestamp::getUNIXtime() - Setting::getServiceSetting('lastTrashSweep', 0, true) > 86400) {
$pool = DBModel::getInstance();
$pool->reset('Comments');
$pool->setQualifier('isfiltered', 's', Timestamp::getUNIXtime() - 1296000);
$pool->setQualifier('isfiltered', 'b', 0);
$pool->delete();
$pool->reset('RemoteResponses');
$pool->setQualifier('isfiltered', 's', Timestamp::getUNIXtime() - 1296000);
$pool->setQualifier('isfiltered', 'b', 0);
$pool->delete();
$pool->reset('RefererLogs');
$pool->setQualifier('referred', 's', Timestamp::getUNIXtime() - 604800);
$pool->delete();
Setting::setServiceSetting('lastTrashSweep', Timestamp::getUNIXtime(), true);
}
if (Timestamp::getUNIXtime() - Setting::getServiceSetting('lastNoticeRead', 0, true) > 43200) {
Setting::removeServiceSetting('TextcubeNotice', true);
Setting::setServiceSetting('lastNoticeRead', Timestamp::getUNIXtime(), true);
}
}
示例14: getBlogURLRule
</form>
</div>
</div>
<?php
}
if ($service['type'] != 'single' && Acl::check("group.creators")) {
$urlRule = getBlogURLRule();
?>
<div id="part-setting-invite" class="part">
<h2 class="caption"><span class="main-text"><?php
echo _t('친구를 초대합니다');
?>
</span></h2>
<?php
if (!function_exists('mail') && !Setting::getServiceSetting('useCustomSMTP', 0, true)) {
?>
<div class="main-explain-box">
<p class="explain"><?php
echo _t('시스템에 자체에서 메일을 보낼 수가 없습니다. 외부 메일 서버를 지정해주세요.');
?>
<a href="<?php
echo $context->getProperty('uri.blog');
?>
/owner/control/server"><?php
echo _t('메일 서버 설정 바로가기');
?>
</a></p>
</div>
<?php
} else {
示例15: getNotify
public function getNotify($type)
{
$type = strtolower($type);
switch ($type) {
case "google":
return 1 === (int) Setting::getServiceSetting("SitemapNotifyGoogle") ? true : false;
break;
case "yahoo":
return 1 === (int) Setting::getServiceSetting("SitemapNotifyYahoo") ? true : false;
break;
case "msn":
return 1 === (int) Setting::getServiceSetting("SitemapNotifyMSN") ? true : false;
break;
case "ask":
return 1 === (int) Setting::getServiceSetting("SitemapNotifyASK") ? true : false;
break;
case "bing":
return 1 === (int) Setting::getServiceSetting("SitemapNotifyBing") ? true : false;
break;
default:
return false;
}
}