当前位置: 首页>>代码示例>>PHP>>正文


PHP OSCOM::getVersion方法代码示例

本文整理汇总了PHP中osCommerce\OM\Core\OSCOM::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP OSCOM::getVersion方法的具体用法?PHP OSCOM::getVersion怎么用?PHP OSCOM::getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osCommerce\OM\Core\OSCOM的用法示例。


在下文中一共展示了OSCOM::getVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public static function execute()
 {
     $OSCOM_Cache = Registry::get('Cache');
     $result = array('entries' => array());
     if ($OSCOM_Cache->read('coreupdate-availablepackages', 360)) {
         $versions = $OSCOM_Cache->getCache();
     } else {
         $versions = HttpRequest::getResponse(array('url' => 'http://www.oscommerce.com/version/online_merchant/3', 'method' => 'get'));
         $OSCOM_Cache->write($versions);
     }
     $versions_array = explode("\n", $versions);
     $counter = 0;
     foreach ($versions_array as $v) {
         $v_info = explode('|', $v);
         if (version_compare(OSCOM::getVersion(), $v_info[0], '<')) {
             $result['entries'][] = array('key' => $counter, 'version' => $v_info[0], 'date' => DateTime::getShort(DateTime::fromUnixTimestamp(DateTime::getTimestamp($v_info[1], 'Ymd'))), 'announcement' => $v_info[2], 'update_package' => isset($v_info[3]) ? $v_info[3] : null);
             $counter++;
         }
     }
     usort($result['entries'], function ($a, $b) {
         return version_compare($a['version'], $b['version'], '>');
     });
     $result['total'] = count($result['entries']);
     return $result;
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:25,代码来源:getAvailablePackages.php

示例2: execute

 public static function execute(ApplicationAbstract $application)
 {
     if (!CoreUpdate::localPackageExists() || CoreUpdate::getPackageInfo('version_from') != OSCOM::getVersion()) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_wrong_version_to_update_from'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     if (CoreUpdate::canApplyPackage()) {
         if (CoreUpdate::applyPackage()) {
             CoreUpdate::deletePackage();
             // Refresh access list for new/deleted Applications
             $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
         } else {
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         }
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_check_target_permissions'), 'error');
         OSCOM::redirect(OSCOM::getLink(null, null, 'Apply&v=' . $_GET['v']));
     }
     OSCOM::redirect(OSCOM::getLink());
 }
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:21,代码来源:Process.php

示例3:

<?php

/**
 * osCommerce Online Merchant
 * 
 * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
 * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
 */
use osCommerce\OM\Core\OSCOM;
?>

<p align="center">osCommerce Online Merchant Copyright &copy; 2000-2011 <a href="http://www.oscommerce.com" target="_blank">osCommerce</a> (<a href="http://www.oscommerce.com/about/copyright" target="_blank">Copyright Policy</a>, <a href="http://www.oscommerce.com/about/trademark" target="_blank">Trademark Policy</a>)<br />osCommerce is a registered trademark of Harald Ponce de Leon</p>

<div style="text-align: center; padding: 5px;"><span class="poweredByButton"><a href="http://www.oscommerce.com" target="_blank"><span class="poweredBy">Powered By</span><span class="osCommerce"><?php 
echo 'osCommerce Online Merchant v' . OSCOM::getVersion();
?>
</span></a></span></div>
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:17,代码来源:footer.php

示例4:

?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<form id="liveSearchForm">
  <?php 
echo HTML::inputField('search', null, 'id="liveSearchField" class="searchField" placeholder="' . OSCOM::getDef('placeholder_search') . '"') . HTML::button(array('type' => 'button', 'params' => 'onclick="osC_DataTable.reset();"', 'title' => OSCOM::getDef('button_reset')));
?>

  <span style="float: right;"><?php 
echo HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'triangle-1-w', 'title' => OSCOM::getDef('button_back'))) . (CoreUpdate::getPackageInfo('version_from') == OSCOM::getVersion() ? ' ' . HTML::button(array('href' => OSCOM::getLink(null, null, 'Apply&Process&v=' . $_GET['v']), 'icon' => 'disk', 'title' => OSCOM::getDef('button_apply_update'))) : '');
?>
</span>
</form>

<div style="padding: 20px 5px 5px 5px; height: 16px;">
  <span id="batchTotalPages"></span>
  <span id="batchPageLinks"></span>
</div>

<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable" id="coreUpdateDataTable">
  <thead>
    <tr>
      <th><?php 
echo OSCOM::getDef('table_heading_files');
?>
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:31,代码来源:package_contents.php


注:本文中的osCommerce\OM\Core\OSCOM::getVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。