Exemplo n.º 1
0
function autoexport_route_update($id, $product, $vb_func)
{
	if ($id == -1)
	{	
		//inits classloader -- required to make vB_Cache work
		require_once(DIR . '/includes/class_bootstrap_framework.php');
		vB_Bootstrap_Framework::init();	
//		$timer = vB_Timer::get('timer');
//		$timer->start();

		if (is_array($product))
		{
			//makes sure that if we are passed a list of products
			//that we only process each product a single time.  
			//More is unnecesary and possibly counterproductive.
			//We will actually rely on the fact that we'll only
			//process a product once to avoid having to check if
			//products are the same before adding them to the list.
			$products = array_unique($product);
		}
		else 
		{
			$products = array($product);
		}

		foreach ($products AS $product)
		{
			if ($product == "vbulletin")
			{
				if (!is_array($vb_func))
				{
					$vb_func();
				}
				else 
				{
					//allow multiple callbacks for operations that 
					//touch multiple files.
					foreach($vb_func as $func)
					{
						$func();
					}
				}
			}
			else if (in_array($product, array('vbcms', 'vbblog'))) 
			{
				autoexport_write_product($product);
			}
		}

		
//		var_dump($timer->stop());
	}
}
Exemplo n.º 2
0
		else
		{
			$db->query_write("
				UPDATE " . TABLE_PREFIX . "productcode SET
					version = '" . $db->escape_string($productcode['version']) . "',
					installcode = '" . $db->escape_string($productcode['installcode']) . "',
					uninstallcode = '" . $db->escape_string($productcode['uninstallcode']) . "'
				WHERE productcodeid = $productcodeid
			");
		}
	}

	if (defined('DEV_AUTOEXPORT') AND DEV_AUTOEXPORT)
	{
		require_once(DIR . '/includes/functions_filesystemxml.php');
		autoexport_write_product($vbulletin->GPC['productid']);
	}

	define('CP_REDIRECT', 'plugin.php?do=productedit&productid=' . $vbulletin->GPC['productid']);
	print_stop_message('product_x_updated', $vbulletin->GPC['productid']);
}

// #############################################################################

if ($_POST['do'] == 'productkill')
{
	$vbulletin->input->clean_array_gpc('p', array(
		'productid' => TYPE_STR
	));

	if (strtolower($vbulletin->GPC['productid']) == 'vbulletin')
Exemplo n.º 3
0
function autoexport_route_update($id, $product, $vb_func)
{
    if ($id == -1) {
        if (is_array($product)) {
            //makes sure that if we are passed a list of products
            //that we only process each product a single time.
            //More is unnecesary and possibly counterproductive.
            //We will actually rely on the fact that we'll only
            //process a product once to avoid having to check if
            //products are the same before adding them to the list.
            $products = array_unique($product);
        } else {
            $products = array($product);
        }
        foreach ($products as $product) {
            if ($product == "vbulletin") {
                if (!is_array($vb_func)) {
                    $vb_func();
                } else {
                    //allow multiple callbacks for operations that
                    //touch multiple files.
                    foreach ($vb_func as $func) {
                        $func();
                    }
                }
            } else {
                if (in_array($product, array('vbcms', 'vbblog'))) {
                    autoexport_write_product($product);
                }
            }
        }
    }
}