本文整理汇总了PHP中EasyBlogHelper::getLocalVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getLocalVersion方法的具体用法?PHP EasyBlogHelper::getLocalVersion怎么用?PHP EasyBlogHelper::getLocalVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getLocalVersion方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstalledVersion
function getInstalledVersion()
{
static $version = false;
if (!$version) {
$version = EasyBlogHelper::getLocalVersion();
}
return (string) $version;
}
示例2: loadScript
public function loadScript($scripts)
{
$document = JFactory::getDocument();
$version = str_ireplace('.', '', EasyBlogHelper::getLocalVersion());
foreach ($scripts as $script) {
$document->addScript(JURI::root() . $script . '?' . $version);
}
}
示例3: __construct
public function __construct()
{
if (defined('EASYBLOG_COMPONENT_CLI')) {
$this->version = EASYBLOG_COMPONENT_VERSION;
} else {
$this->version = (string) EasyBlogHelper::getLocalVersion();
}
$this->resourceManifestFile = EASYBLOG_RESOURCES . '/default-' . $this->version . '.json';
}
示例4: checkOldVersionEasyBlog
/**
* @return bool
*/
public static function checkOldVersionEasyBlog()
{
if (file_exists(JPATH_ROOT . '/administrator/components/com_easyblog/includes/easyblog.php')) {
include_once JPATH_ROOT . '/administrator/components/com_easyblog/includes/easyblog.php';
}
if (file_exists(JPATH_ROOT . "/components/com_easyblog/helpers/helper.php") && !class_exists('EasyBlogHelper')) {
include_once JPATH_ROOT . "/components/com_easyblog/helpers/helper.php";
}
$local = EasyBlogHelper::getLocalVersion();
$version = $local instanceof SimpleXMLElement ? $local->__toString() : $local;
return version_compare($version, '5', '<');
}
示例5: __construct
function __construct($config = array())
{
// Include the tables in path
JTable::addIncludePath(EBLOG_TABLES);
$doc = JFactory::getDocument();
$version = str_ireplace('.', '', EasyBlogHelper::getLocalVersion());
$doc->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easyblog/assets/css/reset.css');
$doc->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_easyblog/assets/css/common.css');
$doc->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easyblog/assets/css/style.css');
EasyBlogHelper::loadHeaders();
parent::__construct();
}
示例6: __construct
public function __construct()
{
$config = EasyBlogHelper::getConfig();
// @legacy: If environment is set to production, change to static.
$environment = $config->get('easyblog_environment');
if ($environment == 'production') {
$environment = 'static';
}
$this->fullName = 'EasyBlog';
$this->shortName = 'eb';
$this->environment = $environment;
$this->mode = $config->get('easyblog_mode');
$this->version = (string) EasyBlogHelper::getLocalVersion();
$this->baseUrl = EasyBlogHelper::getBaseUrl();
$this->token = EasyBlogHelper::getToken();
$this->options = array("scriptVersioning" => (bool) $config->get('main_script_versioning'), "responsive" => (bool) $config->get('layout_responsive'));
parent::__construct();
}
示例7: getVersion
function getVersion()
{
$version = EasyBlogHelper::getLatestVersion();
$local = EasyBlogHelper::getLocalVersion();
// Test build only since build will always be incremented regardless of version
$localVersion = explode('.', $local);
$localBuild = $localVersion[2];
if (!$version) {
return JText::_('Unable to contact update servers');
}
$remoteVersion = explode('.', $version);
$build = $remoteVersion[2];
$html = '<span class="version_outdated">' . JText::sprintf('COM_EASYBLOG_VERSION_OUTDATED', $local, JRoute::_('index.php?option=com_easyblog&view=updater')) . '</span>';
if ($localBuild >= $build) {
$html = '<span class="version_latest">' . JText::sprintf('COM_EASYBLOG_VERSION_LATEST', $local) . '</span>';
}
$ajax = new Ejax();
if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
$ajax->script('$(\'#versionInfo\').append(\'' . $html . '\');');
} else {
$ajax->script('$(\'#submenu-box #submenu\').append(\'<li style="float: right; margin:5px 10px 0 0;">' . $html . '</li>\');');
}
$ajax->send();
}
示例8: extractFiles
public function extractFiles($folder, $filename)
{
$ajax = new Ejax();
JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator');
// This is where the patch files are stored.
$storage = JPATH_ROOT . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $folder;
// This is where the path file should be extracted into.
$filePath = $storage . DIRECTORY_SEPARATOR . $filename;
$connector = EasyBlogHelper::getHelper('Connectors');
$localbuild = EasyBlogHelper::getLocalVersion(true);
$infoServer = EBLOG_UPDATER_SERVER . 'from/' . $localbuild . '/info';
$connector->addUrl($infoServer);
$connector->addQuery('apikey', EasyBlogHelper::getConfig()->get('apikey'));
$connector->setMethod('POST');
$connector->execute();
$result = $connector->getResult($infoServer);
// @rule: Store info file in the path.
JFile::write($storage . DIRECTORY_SEPARATOR . 'info.json', $result);
require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'json.php';
$json = new Services_JSON();
$info = $json->decode($result);
// @rule: Get the md5 of the zip and test the validity of the zipped contents.
if ($info->md5 != md5_file($filePath)) {
// @TODO: Download corrupted
$ajax->script('$("#result-holder").append("<div>' . JText::_('COM_EASYBLOG_UPDATER_MD5_CHECKSUM_NOT_MATCH') . '</div>");');
return $ajax->send();
}
// @rule: Extract the archive
if (!JArchive::extract($filePath, $storage)) {
$ajax->script('$("#result-holder").append("<div>' . JText::_('COM_EASYBLOG_UPDATER_EXTRACTING_PATCH_FILE_ERROR') . '</div>");');
return $ajax->send();
}
// @rule: Delete the archive once the extraction is completed.
JFile::delete($filePath);
$ajax->script('$("#bar-progress").css("width" , "25%");');
$ajax->script('$("#bar-progress #progress-indicator").html("25%");');
$ajax->script('$("#result-holder").append("<div>' . JText::_('COM_EASYBLOG_UPDATER_EXTRACTING_PATCH_FILE_SUCCESSFULLY') . '</div>");');
$ajax->script('ejax.load("updater", "copyFiles" , "' . $folder . '","' . $filename . '");');
$ajax->send();
}