本文整理汇总了PHP中Updater::getStorage方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::getStorage方法的具体用法?PHP Updater::getStorage怎么用?PHP Updater::getStorage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Updater
的用法示例。
在下文中一共展示了Updater::getStorage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
require_once OW_DIR_SYSTEM_PLUGIN . "base" . DS . "classes" . DS . "file_storage.php";
require_once OW_DIR_SYSTEM_PLUGIN . "base" . DS . "classes" . DS . "amazon_cloud_storage.php";
$groupsQuery = "SELECT * FROM " . OW_DB_PREFIX . "groups_group WHERE imageHash IS NOT NULL";
$groups = OW::getDbo()->queryForList($groupsQuery);
$groupsPlugin = OW::getPluginManager()->getPlugin("groups");
foreach ($groups as $group) {
$smallPath = $groupsPlugin->getUserFilesDir() . 'group-' . $group["id"] . '-' . $group["imageHash"] . '.jpg';
$bigPath = $groupsPlugin->getUserFilesDir() . 'group-' . $group["id"] . '-big-' . $group["imageHash"] . '.jpg';
Updater::getStorage()->copyFile($smallPath, $bigPath);
}
示例2: array
$queryList = array("CREATE TABLE IF NOT EXISTS `{$tblPrefix}base_attachment` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `userId` int(11) NOT NULL,\n `addStamp` int(11) NOT NULL,\n `status` tinyint(1) NOT NULL DEFAULT '0',\n `fileName` varchar(100) DEFAULT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci", "ALTER IGNOER TABLE `{$tblPrefix}base_authorization_user_role` ADD UNIQUE `user2role` ( `userId` , `roleId` ) ");
foreach ($queryList as $query) {
try {
$db->query($query);
} catch (Exception $e) {
if (isset($logArray)) {
$logArray[] = $e;
} else {
$errors[] = $e;
}
}
}
$widget = BOL_ComponentAdminService::getInstance()->addWidget('BASE_CMP_QuickLinksWidget', false);
$placeWidget = BOL_ComponentAdminService::getInstance()->addWidgetToPlace($widget, BOL_ComponentAdminService::PLACE_DASHBOARD);
BOL_ComponentAdminService::getInstance()->addWidgetToPosition($placeWidget, BOL_ComponentAdminService::SECTION_RIGHT);
/* code to move all custom css files to clouds */
if (defined('OW_USE_AMAZON_S3_CLOUDFILES') && OW_USE_AMAZON_S3_CLOUDFILES || defined('OW_USE_CLOUDFILES') && OW_USE_CLOUDFILES) {
$storage = Updater::getStorage();
$themesList = BOL_ThemeService::getInstance()->findAllThemes();
/* @var $theme BOL_Theme */
foreach ($themesList as $theme) {
if (file_exists(OW_DIR_THEME_USERFILES . $theme->getCustomCssFileName()) && is_file(OW_DIR_THEME_USERFILES . $theme->getCustomCssFileName())) {
$storage->copyFile(OW_DIR_THEME_USERFILES . $theme->getCustomCssFileName(), OW_DIR_THEME_USERFILES . $theme->getCustomCssFileName());
}
}
}
Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_select_label');
Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_radio_label');
Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_age_label');
Updater::getLanguageService()->deleteLangKey('base', 'questions_question_presentation_birthdate_label');
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'base');
示例3:
<?php
/**
* 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.
*/
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'event');
if (defined('OW_PLUGIN_XP')) {
Updater::getStorage()->copyDir(OW_DIR_USERFILES . 'plugins' . DS . 'event' . DS, OW_DIR_USERFILES . 'plugins' . DS . 'event' . DS);
}