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


PHP PHPWS_DB::dropTable方法代码示例

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


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

示例1: phatform_uninstall

/**
 * Uninstall file for PhatForm v2
 *
 * Rewritten to work with phpwebsite 1.0
 * @version $Id$
 */
function phatform_uninstall(&$content)
{
    $db = new PHPWS_DB('mod_phatform_forms');
    $db->addColumn('id');
    $db->addColumn('archiveTableName');
    $db->addWhere('saved', 1);
    $result = $db->select();
    if (!empty($result)) {
        foreach ($result as $form) {
            if (empty($form['archiveTableName'])) {
                $table = 'mod_phatform_form_' . $form['id'];
                if (PHPWS_DB::isTable($table)) {
                    PHPWS_DB::dropTable($table);
                }
            } else {
                $table = $form['archiveTableName'];
                PHPWS_DB::dropTable($table);
            }
        }
        $content[] = dgettext('phatform', 'Removed all dynamic Form Generator tables.');
    }
    PHPWS_DB::dropTable('mod_phatform_forms');
    PHPWS_DB::dropTable('mod_phatform_options');
    PHPWS_DB::dropTable('mod_phatform_textfield');
    PHPWS_DB::dropTable('mod_phatform_textarea');
    PHPWS_DB::dropTable('mod_phatform_dropbox');
    PHPWS_DB::dropTable('mod_phatform_multiselect');
    PHPWS_DB::dropTable('mod_phatform_radiobutton');
    PHPWS_DB::dropTable('mod_phatform_checkbox');
    $content[] = dgettext('phatform', 'All Form Generator static tables removed.');
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:38,代码来源:uninstall.php

示例2: access_uninstall

/**
 * Uninstall file for access
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function access_uninstall(&$content)
{
    PHPWS_DB::dropTable('access_shortcuts');
    PHPWS_DB::dropTable('access_allow_deny');
    $content[] = dgettext('access', 'Access tables removed.');
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:uninstall.php

示例3: block_uninstall

/**
 * Uninstall file for block
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function block_uninstall(&$content)
{
    PHPWS_DB::dropTable('block');
    PHPWS_DB::dropTable('block_pinned');
    $content[] = dgettext('block', 'Block tables removed.');
    return true;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:uninstall.php

示例4: pagesmith_uninstall

/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function pagesmith_uninstall(&$content)
{
    PHPWS_DB::dropTable('ps_block');
    PHPWS_DB::dropTable('ps_text');
    PHPWS_DB::dropTable('ps_page');
    $content[] = 'Tables removed.';
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:uninstall.php

示例5: checkin_uninstall

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function checkin_uninstall(&$content)
{
    PHPWS_DB::dropTable('checkin_staff');
    PHPWS_DB::dropTable('checkin_reasons');
    PHPWS_DB::dropTable('checkin_visitor');
    PHPWS_DB::dropTable('checkin_rtos');
    return true;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:uninstall.php

示例6: menu_uninstall

/**
 * Uninstall file for menu
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function menu_uninstall(&$content)
{
    PHPWS_DB::dropTable('menu_links');
    PHPWS_DB::dropTable('menus');
    PHPWS_DB::dropTable('menu_assoc');
    $content[] = dgettext('menu', 'Menu tables removed.');
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:14,代码来源:uninstall.php

示例7: signup_uninstall

/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function signup_uninstall(&$content)
{
    PHPWS_DB::dropTable('signup_sheet');
    PHPWS_DB::dropTable('signup_peeps');
    PHPWS_DB::dropTable('signup_slots');
    $content[] = dgettext('signup', 'Signup tables dropped.');
    return true;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:12,代码来源:uninstall.php

示例8: wiki_uninstall

/**
 * Wiki for phpWebSite
 *
 * See docs/CREDITS for copyright information
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @package Wiki
 * @author Greg Meiste <greg.meiste+github@gmail.com>
 */
function wiki_uninstall(&$content)
{
    PHPWS_DB::dropTable('wiki_pages');
    PHPWS_DB::dropTable('wiki_images');
    PHPWS_DB::dropTable('wiki_interwiki');
    $content[] = dgettext('wiki', 'Wiki tables removed.');
    return TRUE;
}
开发者ID:Jopperi,项目名称:wiki,代码行数:30,代码来源:uninstall.php

示例9: analytics_uninstall

/**
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @package Global
 * @license http://opensource.org/licenses/lgpl-3.0.html
 */
function analytics_uninstall(&$content)
{
    PHPWS_DB::dropTable('analytics_tracker_owa');
    PHPWS_DB::dropTable('analytics_tracker_piwik');
    PHPWS_DB::dropTable('analytics_tracker_google');
    PHPWS_DB::dropTable('analytics_tracker');
    $content[] = dgettext('analytics', 'Analytics tables removed.');
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:15,代码来源:uninstall.php

示例10: calendar_uninstall

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function calendar_uninstall(&$content)
{
    PHPWS_Core::initModClass('calendar', 'Schedule.php');
    // Need functions to remove old event tables
    $db = new PHPWS_DB('calendar_schedule');
    $schedules = $db->getObjects('Calendar_Schedule');
    if (PHPWS_Error::isError($schedules)) {
        return $schedules;
    } elseif (empty($schedules)) {
        $result = PHPWS_DB::dropTable('calendar_schedule');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        $result = PHPWS_DB::dropTable('calendar_notice');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        $result = PHPWS_DB::dropTable('calendar_suggestions');
        if (PHPWS_Error::isError($result)) {
            return $result;
        }
        return true;
    }
    $error = false;
    foreach ($schedules as $sch) {
        $result = $sch->delete();
        if (PHPWS_Error::isError($result)) {
            PHPWS_Error::log($result);
            $error = true;
        }
    }
    $result = PHPWS_DB::dropTable('calendar_schedule');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    $result = PHPWS_DB::dropTable('calendar_notice');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    $result = PHPWS_DB::dropTable('calendar_suggestions');
    if (PHPWS_Error::isError($result)) {
        return $result;
    }
    if (PHPWS_DB::isTable('converted')) {
        $db2 = new PHPWS_DB('converted');
        $db2->addWhere('convert_name', array('schedule', 'calendar'));
        $db2->delete();
        $content[] = dgettext('calendar', 'Removed convert flag.');
    }
    if (!$error) {
        $content[] = dgettext('calendar', 'Calendar tables removed.');
    } else {
        $content[] = dgettext('calendar', 'Some errors occurred when uninstalling Calendar.');
    }
    return true;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:60,代码来源:uninstall.php

示例11: properties_uninstall

/**
 * See docs/AUTHORS and docs/COPYRIGHT for relevant info.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 *
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @package
 * @license http://opensource.org/licenses/gpl-3.0.html
 */
function properties_uninstall(&$content)
{
    PHPWS_DB::dropTable('properties');
    PHPWS_DB::dropTable('prop_contacts');
    PHPWS_DB::dropTable('prop_photo');
    PHPWS_DB::dropTable('prop_roommate');
    PHPWS_DB::dropTable('prop_report');
    PHPWS_DB::dropTable('prop_messages');
    PHPWS_DB::dropTable('prop_blocked');
    $content[] = 'Properties tables removed.';
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:31,代码来源:uninstall.php

示例12: pulse_update

/**
 * Description
 * @author Jeff Tickle <jtickle at tux dot appstate dot edu>
 */
function pulse_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.9.1', '<'):
            if (PHPWS_Error::logIfError(PHPWS_DB::dropTable('pulse_schedule'))) {
                $content[] = 'Could not drop pulse_schedule table.';
                return;
            }
            $result = PHPWS_DB::importFile(PHPWS_SOURCE_DIR . 'mod/pulse/boost/install.sql');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Could not run install.sql.';
                return;
            }
            $content[] = '<pre>Replaced pulse_schedule table</pre>';
        case version_compare($currentVersion, '2.0.0', '<'):
            if (PHPWS_Error::logIfError(PHPWS_DB::dropTable('pulse_schedule'))) {
                $content[] = 'Could not drop pulse_schedule table.';
                return;
            }
            $db = Database::newDB();
            $db->begin();
            try {
                $pulse = new \pulse\PulseSchedule();
                $st = $pulse->createTable($db);
            } catch (\Exception $e) {
                $error_query = $pulse->createQuery();
                if (isset($st) && $db->tableExists($st->getName())) {
                    $st->drop();
                }
                $content[] = 'Query:' . $error_query;
                $db->rollback();
                throw $e;
            }
            $db->commit();
            $content[] = 'New Pulse Schedule table created. ALL OLD SCHEDULES HAVE BEEN REMOVED!';
    }
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:42,代码来源:update.php

示例13: delete

 /**
  * Fully deletes this form and it's elements
  *
  * @access public
  */
 function delete()
 {
     if (is_array($this->_elements)) {
         foreach ($this->_elements as $value) {
             $elementInfo = explode(':', $value);
             $this->element = new $elementInfo[0]($elementInfo[1]);
             $this->element->kill();
         }
     }
     /* If the form is saved archive all data in it's table and remove the table. */
     if ($this->isSaved()) {
         $this->report = new PHAT_Report();
         PHPWS_DB::dropTable('mod_phatform_form_' . $this->getId());
     }
     Key::drop($this->_key_id);
     $this->kill();
     $_SESSION['PHAT_FormManager']->form = null;
     $_SESSION['PHAT_FormManager']->_list();
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:24,代码来源:Form.php

示例14: branch_uninstall

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function branch_uninstall(&$content)
{
    PHPWS_DB::dropTable('branch_sites');
    return TRUE;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:9,代码来源:uninstall.php

示例15: removePermissions

 public static function removePermissions($module)
 {
     $tableName = Users_Permission::getPermissionTableName($module);
     if (!PHPWS_DB::isTable($tableName)) {
         return FALSE;
     }
     $result = PHPWS_DB::dropTable($tableName, FALSE, FALSE);
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         return $result;
     }
     return TRUE;
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:13,代码来源:Permission.php


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