本文整理汇总了PHP中Craft::getSiteName方法的典型用法代码示例。如果您正苦于以下问题:PHP Craft::getSiteName方法的具体用法?PHP Craft::getSiteName怎么用?PHP Craft::getSiteName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Craft
的用法示例。
在下文中一共展示了Craft::getSiteName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Dump all tables
*
* @return string
*/
public function run()
{
$this->_currentVersion = 'v' . Craft::getVersion() . '.' . Craft::getBuild();
$result = $this->_processHeader();
foreach (craft()->db->getSchema()->getTables() as $tableName => $val) {
$result .= $this->_processTable($tableName);
}
$result .= $this->_processConstraints();
$result .= $this->_processFooter();
$fileName = IOHelper::cleanFilename(Craft::getSiteName()) . '_' . gmdate('ymd_His') . '_' . $this->_currentVersion . '.sql';
$filePath = craft()->path->getDbBackupPath() . strtolower($fileName);
IOHelper::writeToFile($filePath, $result);
return $filePath;
}
示例2: getSiteName
/**
* Returns the site name.
*
* @return string
*/
public function getSiteName()
{
return Craft::getSiteName();
}
示例3: getGlobals
/**
* Returns a list of global variables to add to the existing list.
*
* @return array An array of global variables
*/
public function getGlobals()
{
// Keep the 'blx' variable around for now
$craftVariable = new CraftVariable();
$globals['craft'] = $craftVariable;
$globals['blx'] = $craftVariable;
$globals['now'] = DateTimeHelper::currentUTCDateTime();
$globals['loginUrl'] = UrlHelper::getUrl(craft()->config->getLoginPath());
$globals['logoutUrl'] = UrlHelper::getUrl(craft()->config->getLogoutPath());
if (Craft::isInstalled()) {
$globals['siteName'] = Craft::getSiteName();
$globals['siteUrl'] = Craft::getSiteUrl();
$globals['user'] = craft()->userSession->getUser();
if (craft()->request->isSiteRequest()) {
foreach (craft()->globals->getAllSets() as $globalSet) {
$globalSet->locale = craft()->language;
$globals[$globalSet->handle] = $globalSet;
}
}
} else {
$globals['siteName'] = null;
$globals['siteUrl'] = null;
$globals['user'] = null;
}
return $globals;
}