本文整理汇总了PHP中build_product_datastore函数的典型用法代码示例。如果您正苦于以下问题:PHP build_product_datastore函数的具体用法?PHP build_product_datastore怎么用?PHP build_product_datastore使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build_product_datastore函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: step_1
/**
* Step #1 - Import Settings XML
*
*/
function step_1()
{
build_forum_permissions();
vBulletinHook::build_datastore($this->db);
build_product_datastore();
build_activitystream_datastore();
if (VB_AREA == 'Upgrade') {
$this->show_message($this->phrase['final']['import_latest_options']);
require_once DIR . '/includes/adminfunctions_options.php';
if (!($xml = file_read(DIR . '/install/vbulletin-settings.xml'))) {
$this->add_error(sprintf($this->phrase['vbphrase']['file_not_found'], 'vbulletin-settings.xml'), self::PHP_TRIGGER_ERROR, true);
return;
}
$this->show_message(sprintf($this->phrase['vbphrase']['importing_file'], 'vbulletin-settings.xml'));
xml_import_settings($xml);
$this->show_message($this->phrase['core']['import_done']);
} else {
$this->skip_message();
}
}
示例2: disable
/**
* Disable a product, not delete
*
*/
public function disable($productid = null)
{
$productid = $productid ? $productid : $this->productinfo['productid'];
$this->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "product\n\t\t\tSET active = 0\n\t\t\tWHERE productid = '" . $this->db->escape_string($productid) . "'\n\t\t");
vBulletinHook::build_datastore($this->db);
build_product_datastore();
// build bitfields to remove/add this products bitfields
require_once DIR . '/includes/class_bitfield_builder.php';
vB_Bitfield_Builder::save($this->db);
// Products can enable a cron entries, so we need to rebuild that as well
require_once DIR . '/includes/functions_cron.php';
build_cron_next_run();
// Purge cache -- doesn't apply to pre-vB4 versions
if (class_exists('vB_Cache')) {
vB_Cache::instance()->purge('vb_types.types');
}
// Reload blocks and block types -- doesn't apply to pre-vB4 versions
if (class_exists('vB_BlockManager')) {
$blockmanager = vB_BlockManager::create($this->registry);
$blockmanager->reloadBlockTypes();
$blockmanager->getBlocks(true, true);
}
}
示例3: vB_Database_Alter_MySQL
$db_alter = new vB_Database_Alter_MySQL($db);
if ($db_alter->fetch_table_info('language')) {
$phrasetypes = $db->query_read("\r\n\t\t\tSELECT fieldname\r\n\t\t\tFROM " . TABLE_PREFIX . "phrasetype\r\n\t\t\tWHERE product = '" . $db->escape_string($vbulletin->GPC['productid']) . "'\r\n\t\t");
while ($phrasetype = $db->fetch_array($phrasetypes)) {
$db_alter->drop_field("phrasegroup_{$phrasetype['fieldname']}");
}
}
delete_product($vbulletin->GPC['productid']);
build_all_styles();
vBulletinHook::build_datastore($db);
require_once DIR . '/includes/adminfunctions_language.php';
build_language();
build_options();
require_once DIR . '/includes/functions_cron.php';
build_cron_next_run();
build_product_datastore();
// build bitfields to remove/add this products bitfields
require_once DIR . '/includes/class_bitfield_builder.php';
vB_Bitfield_Builder::save($db);
// reload block types
$blockmanager = vB_BlockManager::create($vbulletin);
$blockmanager->reloadBlockTypes(true);
if (!defined('DISABLE_PRODUCT_REDIRECT')) {
define('CP_REDIRECT', 'index.php?loc=' . urlencode('plugin.php?do=product'));
}
print_stop_message('product_x_uninstalled', $vbulletin->GPC['productid']);
}
// #############################################################################
if ($_REQUEST['do'] == 'productdelete') {
$vbulletin->input->clean_array_gpc('r', array('productid' => TYPE_STR));
if (strtolower($vbulletin->GPC['productid']) == 'vbulletin') {
示例4: step_149
/**
* Step #149
*
*/
function step_149()
{
$this->show_message($this->phrase['core']['cache_update']);
// Update hidden profile cache to handle hidden AND required fields
require_once DIR . '/includes/adminfunctions_profilefield.php';
build_profilefield_cache();
$this->db->query_write("DELETE FROM " . TABLE_PREFIX . "datastore WHERE title = 'hidprofilecache'");
//require_once(DIR . '/includes/adminfunctions_attachment.php');
//build_attachment_permissions();
vBulletinHook::build_datastore($this->db);
build_product_datastore();
}
示例5: install_product
//.........这里部分代码省略.........
" . intval($faq['displayorder']) . ",
1,
'" . $db->escape_string($info['productid']) . "')
";
}
if ($sql)
{
/*insert query*/
$db->query_write("
REPLACE INTO " . TABLE_PREFIX . "faq
(faqname, faqparent, displayorder, volatile, product)
VALUES
" . implode(',', $sql) . "
");
}
}
// Check if the plugin system is disabled. If it is, enable it.
if (!$vbulletin->options['enablehooks'])
{
$db->query_write("
UPDATE " . TABLE_PREFIX . "setting
SET value = '1'
WHERE varname = 'enablehooks'
");
$rebuild['options'] = true;
}
// Now rebuild everything we need...
if ($rebuild['plugins'])
{
vBulletinHook::build_datastore($db);
if ($active)
{
$plugin_data = $db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "datastore
WHERE title IN ('pluginlist', 'pluginlistadmin')
");
while ($plugin_info = $db->fetch_array($plugin_data))
{
if ($plugin_info['title'] == 'pluginlist')
{
$vbulletin->pluginlist = unserialize($plugin_info['data']);
}
else if ($plugin_info['title'] == 'pluginlistadmin')
{
$vbulletin->pluginlistadmin = unserialize($plugin_info['data']);
}
}
// enable any hooks -- this is mainly necessary for importing templates (template_safe_functions hook)
if (!defined('DISABLE_HOOKS'))
{
if (!empty($vbulletin->pluginlistadmin) AND is_array($vbulletin->pluginlistadmin))
{
$vbulletin->pluginlist = array_merge($vbulletin->pluginlist, $vbulletin->pluginlistadmin);
unset($vbulletin->pluginlistadmin);
}
vBulletinHook::set_pluginlist($vbulletin->pluginlist);
}
}
}
if ($rebuild['templates'])
{
build_all_styles();
}
if ($rebuild['phrases'])
{
require_once(DIR . '/includes/adminfunctions_language.php');
build_language();
}
if ($rebuild['options'])
{
build_options();
}
if ($rebuild['cron'])
{
require_once(DIR . '/includes/functions_cron.php');
build_cron_next_run();
}
build_product_datastore();
// build bitfields to remove/add this products bitfields
vB_Bitfield_Builder::save($db);
// reload block types
$blockmanager = vB_BlockManager::create($vbulletin);
$blockmanager->reloadBlockTypes();
print_dots_stop();
$info['need_merge'] = ($rebuild['templates'] AND $installed_version);
return $info;
}
示例6: install_product
//.........这里部分代码省略.........
$scheduling['day'] = intval($scheduling['day']);
$scheduling['hour'] = intval($scheduling['hour']);
$scheduling['minute'] = explode(',', preg_replace('#[^0-9,-]#i', '', $scheduling['minute']));
if (count($scheduling['minute']) == 0) {
$scheduling['minute'] = array(0);
} else {
$scheduling['minute'] = array_map('intval', $scheduling['minute']);
}
/*insert query*/
$cronSql[] = array('weekday' => $scheduling['weekday'], 'day' => $scheduling['day'], 'hour' => $scheduling['hour'], 'minute' => serialize($scheduling['minute']), 'filename' => $cron['filename'], 'loglevel' => $cron['loglevel'], 'active' => $cron['active'], 'varname' => $cron['varname'], 'volatile' => 1, 'product' => $info['productid']);
$cronid = $assertor->assertQuery('replaceValues', array('values' => $cronSql, 'table' => 'cron', 'returnId' => true));
if ($cronid) {
build_cron_item($cronid);
}
$rebuild['cron'] = true;
}
}
// ############## import faq
if (isset($arr['faqentries']['faq']) and is_array($arr['faqentries']['faq'])) {
$faq_entries =& $arr['faqentries']['faq'];
if (!isset($faq_entries[0])) {
$faq_entries = array($faq_entries);
}
$sql = array();
foreach ($faq_entries as $faq) {
$sql[] = array('faqname' => $faq['faqname'], 'faqparent' => $faq['faqparent'], 'displayorder' => intval($faq['displayorder']), 'volatile' => 1, 'product' => $info['productid']);
}
if ($sql) {
/*insert query*/
$assertor->assertQuery('replaceValues', array('values' => $sql, 'table' => 'faq'));
}
}
// ############## import widgets
if (isset($arr['widgets']['widget']) and is_array($arr['widgets']['widget'])) {
$widgetImporter = new vB_Xml_Import_Widget($info['productid']);
$widgetImporter->importFromParsedXML($arr['widgets']);
}
// ############## import pagetemplates
if (isset($arr['pagetemplates']['pagetemplate']) and is_array($arr['pagetemplates']['pagetemplate'])) {
$pageTemplateImporter = new vB_Xml_Import_PageTemplate($info['productid']);
$pageTemplateImporter->importFromParsedXML($arr['pagetemplates']);
}
// ############## import page
if (isset($arr['pages']['page']) and is_array($arr['pages']['page'])) {
$pageImporter = new vB_Xml_Import_Page($info['productid']);
$pageImporter->importFromParsedXML($arr['pages']);
}
// ############## import channels
if (isset($arr['channels']['channel']) and is_array($arr['channels']['channel'])) {
$channelImporter = new vB_Xml_Import_Channel($info['productid']);
$channelImporter->importFromParsedXML($arr['channels']);
}
// ############## import routes
if (isset($arr['routes']['route']) and is_array($arr['routes']['route'])) {
$routeImporter = new vB_Xml_Import_Route($info['productid']);
$routeImporter->importFromParsedXML($arr['routes']);
}
if (isset($routeImporter)) {
// update pages and channels with new route ids
if (isset($pageImporter)) {
$pageImporter->updatePageRoutes();
}
if (isset($channelImporter)) {
$channelImporter->updateChannelRoutes();
}
}
// Check if the hook system is disabled. If it is, enable it.
if (!$vbulletin->options['enablehooks']) {
$assertor->update('setting', array('value' => 1), array('varname' => 'enablehooks'));
$rebuild['options'] = true;
}
// Now rebuild everything we need...
if ($rebuild['hooks']) {
vB_Api::instanceInternal("Hook")->buildHookDatastore();
}
if ($rebuild['templates']) {
if ($error = build_all_styles(0, 0, '', false, $verbose)) {
return $error;
}
}
if ($rebuild['phrases']) {
require_once DIR . '/includes/adminfunctions_language.php';
build_language();
}
if ($rebuild['options']) {
vB::getDatastore()->build_options();
}
if ($rebuild['cron']) {
require_once DIR . '/includes/functions_cron.php';
build_cron_next_run();
}
build_product_datastore();
// build bitfields to remove/add this products bitfields
vB_Bitfield_Builder::save();
if ($verbose) {
print_dots_stop();
}
$info['need_merge'] = ($rebuild['templates'] and $installed_version);
return $info;
}