當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBUtil::metaTables方法代碼示例

本文整理匯總了PHP中DBUtil::metaTables方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBUtil::metaTables方法的具體用法?PHP DBUtil::metaTables怎麽用?PHP DBUtil::metaTables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBUtil的用法示例。


在下文中一共展示了DBUtil::metaTables方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: upgrade

 /**
  * upgrade the module from an old version
  *
  * This function must consider all the released versions of the module!
  * If the upgrade fails at some point, it returns the last upgraded version.
  *
  * @param        string   $oldVersion   version number string to upgrade from
  * @return       mixed    true on success, last valid version string or false if fails
  */
 public function upgrade($oldversion)
 {
     // Upgrade dependent on old version number
     switch ($oldversion) {
         case '3.6':
             // Rename 'thelang' block.
             $table = 'blocks';
             $sql = "UPDATE {$table} SET bkey = 'lang' WHERE bkey = 'thelang'";
             \DBUtil::executeSQL($sql);
             // Optional upgrade
             if (in_array(\DBUtil::getLimitedTablename('message'), \DBUtil::metaTables())) {
                 $this->migrateMessages();
             }
             $this->migrateBlockNames();
             $this->migrateExtMenu();
         case '3.7':
         case '3.7.0':
             if (!\DBUtil::changeTable('blocks')) {
                 return false;
             }
         case '3.7.1':
             $this->newBlockPositions();
         case '3.8.0':
             // update empty filter fields to an empty array
             $entity = $this->name . '\\Entity\\Block';
             $dql = "UPDATE {$entity} p SET p.filter = 'a:0:{}' WHERE p.filter = '' OR p.filter = 's:0:\"\";'";
             $query = $this->entityManager->createQuery($dql);
             $query->getResult();
         case '3.8.1':
             // future upgrade routines
     }
     // Update successful
     return true;
 }
開發者ID:planetenkiller,項目名稱:core,代碼行數:43,代碼來源:Installer.php

示例2: upgrade

    /**
     * upgrade the module from an old version
     *
     * This function must consider all the released versions of the module!
     * If the upgrade fails at some point, it returns the last upgraded version.
     *
     * @param  string $oldVersion version number string to upgrade from
     * @return mixed  true on success, last valid version string or false if fails
     */
    public function upgrade($oldversion)
    {
        // Upgrade dependent on old version number
        switch ($oldversion) {
            case '3.6':
                // Rename 'thelang' block.
                $table = 'blocks';
                $sql = "UPDATE $table SET bkey = 'lang' WHERE bkey = 'thelang'";
                DBUtil::executeSQL($sql);
                // Optional upgrade
                if (in_array(DBUtil::getLimitedTablename('message'), DBUtil::metaTables())) {
                    $this->migrateMessages();
                }
                $this->migrateBlockNames();
                $this->migrateExtMenu();

            case '3.7':
            case '3.7.0':
                if (!DBUtil::changeTable('blocks')) {
                    return false;
                }

            case '3.7.1':
                $this->newBlockPositions();

            case '3.8.0':
                // update empty filter fields to an empty array
                $entity = $this->name . '_Entity_Block';
                $dql = "UPDATE $entity p SET p.filter = 'a:0:{}' WHERE p.filter = '' OR p.filter = 's:0:\"\";' OR p.filter = 'a:3:{s:4:\"type\";s:0:\"\";s:9:\"functions\";s:0:\"\";s:10:\"customargs\";s:0:\"\";}'";
                $query = $this->entityManager->createQuery($dql);
                $query->getResult();

            case '3.8.1':
                // register ui_hooks for HTML block editing
                HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());
            case '3.8.2':
                // future upgrade routines
        }

        // Update successful
        return true;
    }
開發者ID:projectesIF,項目名稱:Sirius,代碼行數:51,代碼來源:Installer.php

示例3: mediashare_upgrade

/**
 * Module upgrade
 */
function mediashare_upgrade($oldVersion)
{
    // Upgrade dependent on old version number
    switch ($oldVersion) {
        case '1.0.0':
        case '1.0.1':
            if (!mediashare_upgrade_to_1_0_2()) {
                return '1.0.1';
            }
        case '1.0.2':
        case '2.0.0':
        case '2.0.1':
        case '2.1.0':
            if (!mediashare_upgrade_to_2_1_1()) {
                return '2.1.0';
            }
        case '2.1.1':
        case '2.1.2':
            if (!mediashare_upgrade_to_2_2_0()) {
                return '2.1.2';
            }
        case '2.2.0':
            if (!mediashare_upgrade_to_2_3_0()) {
                return '2.2.0';
            }
        case '2.3.0':
        case '3.0.0':
        case '3.0.1':
        case '3.1.0':
        case '3.1.1':
        case '3.2.0':
        case '3.3.0':
            if (!mediashare_upgrade_to_3_4_0()) {
                return '3.3.0';
            }
        case '3.4.0':
            if (!mediashare_upgrade_to_3_4_1()) {
                return '3.4.0';
            }
        case '3.4.1':
            mediashare_upgrade_to_3_4_2();
        case '3.4.2':
        case '4.0.0':
        case '4.0.1':
            $tables = DBUtil::metaTables();
            $ptable = DBUtil::getLimitedTablename('mediashare_photoshare');
            if (in_array($ptable, $tables) && !DBUtil::dropTable('mediashare_photoshare')) {
                return '4.0.1';
            }
        case '4.0.2':
        case '4.1':
            // future
    }
    // Update successful
    return true;
}
開發者ID:ro0f,項目名稱:Mediashare,代碼行數:59,代碼來源:pninit.php


注:本文中的DBUtil::metaTables方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。