本文整理汇总了PHP中vB_Bitfield_Builder::return_data方法的典型用法代码示例。如果您正苦于以下问题:PHP vB_Bitfield_Builder::return_data方法的具体用法?PHP vB_Bitfield_Builder::return_data怎么用?PHP vB_Bitfield_Builder::return_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vB_Bitfield_Builder
的用法示例。
在下文中一共展示了vB_Bitfield_Builder::return_data方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
/**
* Parse XML
*
* @param string location of XML
*/
public function parse($xml)
{
print_dots_start('<b>' . $this->vbphrase['importing_product'] . "</b>, {$this->vbphrase[please_wait]}", ':', 'dspan');
$this->xmlobj = new vB_XML_Parser($xml);
if ($this->xmlobj->error_no == 1) {
print_dots_stop();
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
if (!($this->productobj = $this->xmlobj->parse())) {
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('xml_error_x_at_line_y', $this->xmlobj->error_string(), $this->xmlobj->error_line()));
}
// ############## general product information
$this->productinfo['productid'] = substr(preg_replace('#[^a-z0-9_]#', '', strtolower($this->productobj['productid'])), 0, 25);
$this->productinfo['title'] = $this->productobj['title'];
$this->productinfo['description'] = $this->productobj['description'];
$this->productinfo['version'] = $this->productobj['version'];
$this->productinfo['active'] = $this->productobj['active'];
$this->productinfo['url'] = $this->productobj['url'];
$this->productinfo['versioncheckurl'] = $this->productobj['versioncheckurl'];
if (!$this->productinfo['productid']) {
print_dots_stop();
if (!empty($this->productobj['plugin'])) {
throw new vB_Exception_AdminStopMessage('this_file_appears_to_be_a_plugin');
} else {
throw new vB_Exception_AdminStopMessage('invalid_file_specified');
}
}
if (strtolower($this->productinfo['productid']) == 'vbulletin') {
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', 'vBulletin'));
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields) {
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors) {
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('bitfield_conflicts_x', '<li>' . implode('</li><li>', $bfobj->errors) . '</li>'));
}
}
return true;
}
示例2: implode
/**
* Fetches an array describing the bits in the requested bitfield
*
* @param string Represents the array key required... use x|y|z to fetch ['x']['y']['z']
*
* @return array Reference to the requested array from includes/xml/bitfield_{product}.xml
*/
function &fetch_bitfield_definitions($string)
{
static $bitfields = null;
if ($bitfields === null) {
require_once DIR . '/includes/class_bitfield_builder.php';
$bitfields = vB_Bitfield_Builder::return_data();
}
$keys = "['" . implode("']['", preg_split('#\\|#si', $string, -1, PREG_SPLIT_NO_EMPTY)) . "']";
eval('$return =& $bitfields' . $keys . ';');
return $return;
}
示例3: install_product
/**
* Installs a product from the xml text
*
* This function depends on the vb class loader, which requires that the
* framework init is called.
*
* @return bool True if the product requires a template merge, false otherwise
*/
function install_product($xml, $allow_overwrite)
{
global $vbphrase;
global $vbulletin;
global $db;
require_once(DIR . '/includes/class_bitfield_builder.php');
require_once(DIR . '/includes/class_xml.php');
require_once(DIR . '/includes/class_block.php');
//share some code with the main xml style import
require_once(DIR . '/includes/adminfunctions_template.php');
print_dots_start('<b>' . $vbphrase['importing_product'] . "</b>, $vbphrase[please_wait]", ':', 'dspan');
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no == 1)
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
if(!$arr = $xmlobj->parse())
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage(
array('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line()));
}
// ############## general product information
$info = array(
'productid' => substr(preg_replace('#[^a-z0-9_]#', '', strtolower($arr['productid'])), 0, 25),
'title' => $arr['title'],
'description' => $arr['description'],
'version' => $arr['version'],
'active' => $arr['active'],
'url' => $arr['url'],
'versioncheckurl' => $arr['versioncheckurl']
);
if (!$info['productid'])
{
print_dots_stop();
if (!empty($arr['plugin']))
{
throw new vB_Exception_AdminStopMessage('this_file_appears_to_be_a_plugin');
}
else
{
throw new vB_Exception_AdminStopMessage('invalid_file_specified');
}
}
if (strtolower($info['productid']) == 'vbulletin')
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', 'vBulletin'));
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields)
{
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors)
{
print_dots_stop();
throw new vB_Exception_AdminStopMessage(array(
'bitfield_conflicts_x',
'<li>' . implode('</li><li>', $bfobj->errors) . '</li>'
));
}
}
// get system version info
$system_versions = array(
'php' => PHP_VERSION,
'vbulletin' => $vbulletin->options['templateversion'],
'products' => fetch_product_list(true)
);
$mysql_version = $db->query_first("SELECT VERSION() AS version");
$system_versions['mysql'] = $mysql_version['version'];
// ############## import dependencies
if (is_array($arr['dependencies']['dependency']))
{
$dependencies =& $arr['dependencies']['dependency'];
if (!isset($dependencies[0]))
{
$dependencies = array($dependencies);
}
//.........这里部分代码省略.........
示例4: array
// ############## general product information
$info = array('productid' => substr(preg_replace('#[^a-z0-9_]#', '', strtolower($arr['productid'])), 0, 25), 'title' => $arr['title'], 'description' => $arr['description'], 'version' => $arr['version'], 'active' => $arr['active'], 'url' => $arr['url'], 'versioncheckurl' => $arr['versioncheckurl']);
if (!$info['productid']) {
print_dots_stop();
if (!empty($arr['plugin'])) {
print_stop_message('this_file_appears_to_be_a_plugin');
} else {
print_stop_message('invalid_file_specified');
}
}
if (strtolower($info['productid']) == 'vbulletin') {
print_dots_stop();
print_stop_message('product_x_installed_no_overwrite', 'vBulletin');
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields) {
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors) {
print_dots_stop();
print_stop_message('bitfield_conflicts_x', '<li>' . implode('</li><li>', $bfobj->errors) . '</li>');
}
}
// get system version info
$system_versions = array('php' => PHP_VERSION, 'vbulletin' => $vbulletin->options['templateversion'], 'products' => fetch_product_list(true));
$mysql_version = $db->query_first("SELECT VERSION() AS version");
$system_versions['mysql'] = $mysql_version['version'];
// ############## import dependencies
if (is_array($arr['dependencies']['dependency'])) {
$dependencies =& $arr['dependencies']['dependency'];
if (!isset($dependencies[0])) {
示例5: install_product
/**
* Installs a product from the xml text
*
* This function depends on the vb class loader, which requires that the
* framework init is called.
*
* @return bool True if the product requires a template merge, false otherwise
*/
function install_product($xml, $allow_overwrite = false, $verbose = true)
{
global $vbphrase;
global $vbulletin;
$assertor = vB::getDbAssertor();
require_once DIR . '/includes/class_bitfield_builder.php';
require_once DIR . '/includes/class_xml.php';
//share some code with the main xml style import
require_once DIR . '/includes/adminfunctions_template.php';
if ($verbose) {
print_dots_start('<b>' . $vbphrase['importing_product'] . "</b>, {$vbphrase['please_wait']}", ':', 'dspan');
}
$xmlobj = new vB_XML_Parser($xml);
if ($xmlobj->error_no() == 1) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage('no_xml_and_no_path');
}
if (!($arr = $xmlobj->parse())) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage(array('xml_error_x_at_line_y', $xmlobj->error_string(), $xmlobj->error_line()));
}
// ############## general product information
$info = array('productid' => substr(preg_replace('#[^a-z0-9_]#', '', strtolower($arr['productid'])), 0, 25), 'title' => $arr['title'], 'description' => $arr['description'], 'version' => $arr['version'], 'active' => $arr['active'], 'url' => $arr['url'], 'versioncheckurl' => $arr['versioncheckurl']);
if (!$info['productid']) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage('invalid_file_specified');
}
if (strtolower($info['productid']) == 'vbulletin') {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage(array('product_x_installed_no_overwrite', 'vBulletin'));
}
// check for bitfield conflicts on install
$bitfields = vB_Bitfield_Builder::return_data();
if (!$bitfields) {
$bfobj =& vB_Bitfield_Builder::init();
if ($bfobj->errors) {
if ($verbose) {
print_dots_stop();
}
throw new vB_Exception_AdminStopMessage(array('bitfield_conflicts_x', '<li>' . implode('</li><li>', $bfobj->errors) . '</li>'));
}
}
// get system version info
$system_versions = array('php' => PHP_VERSION, 'vbulletin' => $vbulletin->options['templateversion'], 'products' => fetch_product_list(true));
$mysql_version = $assertor->getRow('mysqlVersion');
$system_versions['mysql'] = $mysql_version['version'];
// ############## import dependencies
if (isset($arr['dependencies']['dependency']) and is_array($arr['dependencies']['dependency'])) {
$dependencies =& $arr['dependencies']['dependency'];
if (!isset($dependencies[0])) {
$dependencies = array($dependencies);
}
$dependency_errors = array();
$ignore_dependency_errors = array();
// let's check the dependencies
foreach ($dependencies as $dependency) {
// if we get an error, we haven't met this dependency
// if we go through without a problem, we have automatically met
// all dependencies for this "class" (mysql, php, vb, a specific product, etc)
$this_dependency_met = true;
// build a phrase for the version compats -- will look like (minver / maxver)
if ($dependency['minversion']) {
$compatible_phrase = construct_phrase($vbphrase['compatible_starting_with_x'], htmlspecialchars_uni($dependency['minversion']));
} else {
$compatible_phrase = '';
}
if ($dependency['maxversion']) {
$incompatible_phrase = construct_phrase($vbphrase['incompatible_with_x_and_greater'], htmlspecialchars_uni($dependency['maxversion']));
} else {
$incompatible_phrase = '';
}
if ($compatible_phrase or $incompatible_phrase) {
$required_version_info = "({$compatible_phrase}";
if ($compatible_phrase and $incompatible_phrase) {
$required_version_info .= ' / ';
}
$required_version_info .= "{$incompatible_phrase})";
}
// grab the appropriate installed version string
if ($dependency['dependencytype'] == 'product') {
// group dependencies into types -- individual products get their own group
$dependency_type_key = "product-{$dependency['parentproductid']}";
// undocumented feature -- you can put a producttitle attribute in a dependency so the id isn't displayed
$parent_product_title = !empty($dependency['producttitle']) ? $dependency['producttitle'] : $dependency['parentproductid'];
//.........这里部分代码省略.........