本文整理汇总了PHP中Updater::getDbo方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::getDbo方法的具体用法?PHP Updater::getDbo怎么用?PHP Updater::getDbo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Updater
的用法示例。
在下文中一共展示了Updater::getDbo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
* Copyright (c) 2011, Oxwall Foundation
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'blogs');
$exArr = array();
try {
$groupId = Updater::getAuthorizationService()->findGroupIdByName('blogs');
if ($groupId) {
Updater::getDbo()->update("UPDATE `" . OW_DB_PREFIX . "base_authorization_action` SET `availableForGuest`=0 WHERE `name`='delete_comment_by_content_owner' AND `groupId`={$groupId}");
}
} catch (Exception $e) {
$exArr[] = $e;
}
示例2: array
<?php
/**
* Copyright (c) 2011 Sardar Madumarov
* All rights reserved.
* ATTENTION: This commercial software is intended for use with Oxwall Free Community Software http://www.oxwall.org/
* and is licensed under Oxwall Store Commercial License.
* Full text of this license can be found at http://www.oxwall.org/store/oscl
*/
/**
* @author Sardar Madumarov <madumarov@gmail.com>
* @package oaseo
* @since 1.0
*/
$dbo = Updater::getDbo();
$sqlErrors = array();
$queries = array("ALTER TABLE `" . OW_DB_PREFIX . "oaseo_meta` ADD `dispatchAttrs` TEXT NULL DEFAULT NULL", "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "oaseo_data` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `key` varchar(100) NOT NULL,\n `data` mediumtext NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1", "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "oaseo_sitemap_item` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `type` int(11) NOT NULL,\n `value` text NOT NULL,\n `addTs` int(11) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1", "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "oaseo_sitemap_page` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `url` varchar(255) NOT NULL,\n `title` text,\n `meta` text,\n `status` tinyint(1) NOT NULL DEFAULT '0',\n `processTs` int(11) NOT NULL DEFAULT '0',\n `broken` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `url_index` (`url`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1", "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "oaseo_sitemap_page_item` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `pageId` int(11) NOT NULL,\n `itemId` int(11) NOT NULL,\n `type` int(11) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `pageId` (`pageId`),\n KEY `itemId` (`itemId`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1");
foreach ($queries as $query) {
try {
$dbo->query($query);
} catch (Exception $e) {
$sqlErrors[] = $e;
}
}
$config = Updater::getConfigService();
if (!$config->configExists('oaseo', 'crawler_lock')) {
$config->addConfig('oaseo', 'crawler_lock', 0);
}
if (!$config->configExists('oaseo', 'update_info')) {
$config->addConfig('oaseo', 'update_info', 0);
}
示例3: ENUM
try {
$sql = "ALTER TABLE `" . OW_DB_PREFIX . "googlelocation_data` ADD `entityType` ENUM( 'user', 'event' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `entityId` ";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = "UPDATE `" . OW_DB_PREFIX . "googlelocation_data` SET `entityType` = 'user' ";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = "ALTER TABLE `" . OW_DB_PREFIX . "googlelocation_data` DROP INDEX `entityId` ";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = "ALTER IGNORE TABLE `" . OW_DB_PREFIX . "googlelocation_data` ADD INDEX `entityId` ( `entityId` , `entityType` ) ";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = " DELETE FROM g `" . OW_DB_PREFIX . "googlelocation_data` g\n LEFT JOIN `" . OW_DB_PREFIX . "base_user` u ON u.id = g.entityId\n WHERE g.entityType = 'user' AND u.id IS NULL ";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = " ALTER TABLE `" . OW_DB_PREFIX . "googlelocation_data` CHANGE `json` `json` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'googlelocation');
示例4: array
<?php
$tblPrefix = OW_DB_PREFIX;
$db = Updater::getDbo();
$queryList = array("ALTER TABLE `{$tblPrefix}base_comment_entity` ADD `pluginKey` VARCHAR( 100 ) NOT NULL AFTER `entityId`", "ALTER TABLE `{$tblPrefix}base_comment_entity` ADD INDEX ( `pluginKey` )", "ALTER TABLE `{$tblPrefix}base_plugin` DROP COLUMN `adsEnabled`");
$sqlErrors = array();
foreach ($queryList as $query) {
try {
$db->query($query);
} catch (Exception $e) {
$sqlErrors[] = $e;
}
}
$config = OW::getConfig();
if (!$config->configExists('base', 'default_avatar')) {
$config->addConfig('base', 'default_avatar', '', 'Default avatar');
}
UPDATE_LanguageService::getInstance()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'base');
if (!empty($sqlErrors)) {
//printVar($sqlErrors);
}
示例5: array
* licensed under The BSD license.
* ---
* Copyright (c) 2011, Oxwall Foundation
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$exArr = array();
$sql = "UPDATE `" . OW_DB_PREFIX . "base_comment_entity` \n SET `pluginKey` = :pluginKey \n WHERE `entityType` = :entityType";
try {
Updater::getDbo()->query($sql, array('pluginKey' => 'photo', 'entityType' => 'photo_comments'));
} catch (Exception $e) {
$exArr[] = $e;
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'photo');
示例6: int
}
try {
$sql = "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "skadate_current_location` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `userId` int(11) NOT NULL,\n `latitude` decimal(12,8) NOT NULL,\n `longitude` decimal(12,8) NOT NULL,\n `updateTimestamp` int(11) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `userId` (`userId`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
print_r($e);
}
try {
$sql = "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "skadate_avatar` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `avatarId` int(11) NOT NULL,\n `userId` int(11) NOT NULL,\n `hash` int(11) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `avatarId` (`avatarId`,`userId`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
print_r($e);
}
try {
$sql = "UPDATE `" . OW_DB_PREFIX . "base_plugin` SET developerKey=:dk WHERE `key`=:k";
Updater::getDbo()->query($sql, array("dk" => "99d6bdd5bb6468beaf118c4664dd92ff", "k" => "pcgallery"));
} catch (Exception $e) {
print_r($e);
}
if (!OW::getConfig()->configExists('skadate', 'update_gender_values')) {
OW::getConfig()->addConfig('skadate', 'update_gender_values', true);
} else {
OW::getConfig()->saveConfig('skadate', 'update_gender_values', true);
}
if (!Updater::getConfigService()->configExists('skadate', 'photo_filter_setting_matching')) {
Updater::getConfigService()->addConfig('skadate', 'photo_filter_setting_matching', false);
}
@mkdir(OW_DIR_USERFILES . 'plugins' . DS . 'skadate' . DS . 'avatars' . DS);
@chmod(OW_DIR_USERFILES . 'plugins' . DS . 'skadate' . DS . 'avatars' . DS, 0777);
@mkdir(OW_DIR_PLUGINFILES . 'skadate' . DS . 'avatars' . DS);
@chmod(OW_DIR_PLUGINFILES . 'skadate' . DS . 'avatars' . DS, 0777);
示例7: array
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$exArr = array();
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'ajaxim');
$moduleName = OW::getPluginManager()->getPlugin('ajaxim')->getModuleName();
try {
if (!Updater::getConfigService()->configExists('ajaxim', 'friends_only')) {
Updater::getConfigService()->addConfig('ajaxim', 'friends_only', 0);
}
} catch (Exception $e) {
$exArr[] = $e;
}
try {
Updater::getDbo()->update("REPLACE INTO `" . OW_DB_PREFIX . "base_preference_section` ( `name`, `sortOrder`) VALUES ('ajaxim', 0)");
} catch (Exception $e) {
$exArr[] = $e;
}
try {
Updater::getDbo()->update("REPLACE INTO `" . OW_DB_PREFIX . "base_preference` ( `key`, `defaultValue`, `sectionName`, `sortOrder`) VALUES ( 'ajaxim_user_settings_enable_sound', '1', 'ajaxim', 0 )");
} catch (Exception $e) {
$exArr[] = $e;
}
try {
OW::getPluginManager()->addPluginSettingsRouteName('ajaxim', 'ajaxim_settings');
} catch (Exception $e) {
$exArr[] = $e;
}
示例8: array
* This software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ and is
* licensed under The BSD license.
* ---
* Copyright (c) 2011, Oxwall Foundation
* All rights reserved.
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$exArr = array();
$sql = "UPDATE `" . OW_DB_PREFIX . "base_comment_entity` \n SET `pluginKey` = :pluginKey \n WHERE `entityType` = :entityType";
try {
Updater::getDbo()->query($sql, array('pluginKey' => 'links', 'entityType' => 'link'));
} catch (Exception $e) {
$exArr[] = $e;
}
示例9: array
<?php
/**
* Copyright (c) 2009, Skalfa LLC
* All rights reserved.
* ATTENTION: This commercial software is intended for use with Oxwall Free Community Software http://www.oxwall.org/
* and is licensed under Oxwall Store Commercial License.
* Full text of this license can be found at http://www.oxwall.org/store/oscl
*/
$sql = "SELECT `id` FROM `" . OW_DB_PREFIX . "base_billing_gateway` WHERE `gatewayKey` = 'billingccbill';";
try {
$id = Updater::getDbo()->queryForColumn($sql);
if ($id) {
$sql = "INSERT INTO `" . OW_DB_PREFIX . "base_billing_gateway_config` \n SET `gatewayId` = :id, `name` = :name, `value` = '';";
try {
Updater::getDbo()->insert($sql, array('gatewayId' => $id, 'name' => 'dpFormName'));
} catch (Exception $e) {
$exArr[] = $e;
}
try {
Updater::getDbo()->insert($sql, array('gatewayId' => $id, 'name' => 'edFormName'));
} catch (Exception $e) {
$exArr[] = $e;
}
}
} catch (Exception $e) {
$exArr[] = $e;
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'billingccbill');
示例10: array
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$errors = array();
try {
Updater::getDbo()->query("ALTER TABLE `" . OW_DB_PREFIX . "event_item` ADD `endDateFlag` BOOL NOT NULL DEFAULT '1'");
} catch (Exception $e) {
$errors[] = $e;
}
try {
Updater::getDbo()->query("ALTER TABLE `" . OW_DB_PREFIX . "event_item` ADD `startTimeDisabled` BOOL NOT NULL DEFAULT '0'");
} catch (Exception $e) {
$errors[] = $e;
}
try {
Updater::getDbo()->query("ALTER TABLE `" . OW_DB_PREFIX . "event_item` ADD `endTimeDisabled` BOOL NOT NULL DEFAULT '0'");
} catch (Exception $e) {
$errors[] = $e;
}
$sql = "UPDATE `" . OW_DB_PREFIX . "base_comment_entity` SET `pluginKey` = :pluginKey WHERE `entityType` = :entityType";
try {
Updater::getDbo()->query($sql, array('pluginKey' => 'event', 'entityType' => 'event'));
} catch (Exception $e) {
$errors[] = $e;
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'event');
@mkdir(OW_DIR_STATIC_PLUGIN . 'event' . DS, 0777);
@mkdir(OW_DIR_STATIC_PLUGIN . 'event' . DS . 'js' . DS, 0777);
@copy(OW_DIR_PLUGIN . 'event' . DS . 'static' . DS . 'js' . DS . 'event.js', OW_DIR_STATIC_PLUGIN . 'event' . DS . 'js' . DS . 'event.js');
示例11: catch
<?php
/**
* EXHIBIT A. Common Public Attribution License Version 1.0
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”);
* you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://www.oxwall.org/license. The License is based on the Mozilla Public License Version 1.1
* but Sections 14 and 15 have been added to cover use of software over a computer network and provide for
* limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent
* with Exhibit B. Software distributed under the License is distributed on an “AS IS” basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language
* governing rights and limitations under the License. The Original Code is Oxwall software.
* The Initial Developer of the Original Code is Oxwall Foundation (http://www.oxwall.org/foundation).
* All portions of the code written by Oxwall Foundation are Copyright (c) 2011. All Rights Reserved.
* EXHIBIT B. Attribution Information
* Attribution Copyright Notice: Copyright 2011 Oxwall Foundation. All rights reserved.
* Attribution Phrase (not exceeding 10 words): Powered by Oxwall community software
* Attribution URL: http://www.oxwall.org/
* Graphic Image as provided in the Covered Code.
* Display of Attribution Information is required in Larger Works which are defined in the CPAL as a work
* which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
*/
BOL_MobileWidgetService::getInstance()->deleteWidget('BASE_MCMP_JoinNowWidget');
$widget = BOL_MobileWidgetService::getInstance()->addWidget('BASE_MCMP_JoinNowWidget', false);
$placeWidget = BOL_MobileWidgetService::getInstance()->addWidgetToPlace($widget, BOL_MobileWidgetService::PLACE_MOBILE_INDEX);
BOL_MobileWidgetService::getInstance()->addWidgetToPosition($placeWidget, BOL_MobileWidgetService::SECTION_MOBILE_MAIN);
try {
Updater::getDbo()->query(" ALTER TABLE `" . OW_DB_PREFIX . "base_user` ADD KEY `activityStamp` (`activityStamp`); ");
} catch (Exception $e) {
Updater::getLogger()->addEntry(json_encode($e));
}
示例12: catch
<?php
$P = OW_DB_PREFIX;
try {
Updater::getDbo()->query("DELETE FROM `{$P}usercredits_action` WHERE actionKey='import_friend' AND pluginKey='contactimporter'");
} catch (Exception $e) {
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'contactimporter');
示例13: VARCHAR
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
try {
$sql = "SHOW COLUMNS FROM `" . OW_DB_PREFIX . "video_clip` LIKE 'plugin';";
$cols = Updater::getDbo()->queryForList($sql);
if (!count($cols)) {
$sql = "ALTER TABLE `" . OW_DB_PREFIX . "video_clip` ADD `plugin` VARCHAR(255) NULL DEFAULT 'video' ; ";
Updater::getDbo()->queryForList($sql);
}
} catch (Exception $e) {
}
@Updater::getLanguageService()->importPrefixFromZip(dirname(dirname(dirname(__FILE__))) . DS . 'langs.zip', 'spvideolite');
// refresh static cache
$plugin = OW::getPluginManager()->getPlugin('spvideolite');
$staticDir = OW_DIR_STATIC_PLUGIN . $plugin->getModuleName() . DS;
$pluginStaticDir = OW_DIR_PLUGIN . $plugin->getModuleName() . DS . 'static' . DS;
if (file_exists($staticDir)) {
UTIL_File::removeDir($staticDir);
}
mkdir($staticDir);
chmod($staticDir, 0777);
UTIL_File::copyDir($pluginStaticDir, $staticDir);
示例14: int
try {
$sql = "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "membership_user_trial` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `planId` int(11) NOT NULL,\n `userId` int(11) NOT NULL,\n `startStamp` int(11) NOT NULL,\n `expirationStamp` int(11) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `userId` (`userId`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = "ALTER TABLE `" . OW_DB_PREFIX . "membership_user` ADD `trial` TINYINT( 1 ) NULL DEFAULT '0'";
Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
$sql = "SELECT * FROM `" . OW_DB_PREFIX . "membership_type` WHERE `accountTypeId` IS NULL";
$msList = Updater::getDbo()->queryForList($sql);
if ($msList) {
$sql = "SELECT * FROM `" . OW_DB_PREFIX . "base_question_account_type` ORDER BY `sortOrder`";
$accTypes = Updater::getDbo()->queryForList($sql);
$acc = array_shift($accTypes);
$sql = "UPDATE `" . OW_DB_PREFIX . "membership_type`\n SET `accountTypeId` = :accId";
Updater::getDbo()->query($sql, array('accId' => $acc['id']));
if (count($accTypes)) {
foreach ($accTypes as $acc) {
$sql = "INSERT INTO `" . OW_DB_PREFIX . "membership_type`\n SET roleId = :roleId, `accountTypeId` = :accId";
foreach ($msList as $ms) {
Updater::getDbo()->query($sql, array('roleId' => $ms['roleId'], 'accId' => $acc['id']));
}
}
}
}
} catch (Exception $e) {
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'membership');
示例15: INDEX
<?php
try {
Updater::getDbo()->query("ALTER TABLE `" . OW_DB_PREFIX . "equestions_notification` ADD `special` TINYINT NULL ,ADD INDEX ( `special` )");
} catch (Exception $e) {
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'equestions');