本文整理汇总了PHP中Purchase::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::init方法的具体用法?PHP Purchase::init怎么用?PHP Purchase::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase::init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callcheckPlatform
public function callcheckPlatform()
{
include_once ENGINE_PATH . 'class/classProducts.php';
include_once ENGINE_PATH . 'class/classPurchase.php';
$products = new Products();
$platforms = $products->getProductsPlatforms($_POST['productId']);
$purchase = new Purchase();
$purchase->init($_POST['productId']);
$os = $purchase->checkOS($_SERVER['HTTP_USER_AGENT']);
$countplatform = count($platforms);
for ($i = 0; $i < $countplatform; $i++) {
if (stristr($platforms[$i]['os_value'], $os)) {
return 1;
}
}
return 0;
}
示例2: getProductInfo
public function getProductInfo($args)
{
include_once ENGINE_PATH . 'class/classPurchase.php';
$result = array();
$product_id = $args[0];
$build_info = $this->products->getProductBuildInfo($product_id);
$platforms = $this->products->getProductsPlatforms($product_id);
$platforms_tmp = array();
foreach ($platforms as $os) {
array_push($platforms_tmp, $os['os_value']);
}
$lang = $this->products->getProductLanguagesIds($product_id);
$result['name'] = $build_info['p_title'];
$result['nick'] = $build_info['p_nick'];
$result['download'] = $build_info['p_download'];
$result['softwareVersion'] = $build_info['p_version'];
$result['datePublished'] = $build_info['ctime'];
// $result['author'] = array('name'=>'Eltima Software', 'url'=>'www.eltima.com');
$result['fileSize'] = $build_info['size'];
$result['operatingSystems'] = implode(',', $platforms_tmp);
$result['inLanguage'] = implode(',', $lang);
$purchase = new Purchase();
if ($purchase->init($product_id)) {
$licenseData = $purchase->processLicenseData();
$result['licenses'] = $licenseData['lic'];
}
$result['Rating'] = mt_rand(450, 500) / 100;
$result['TotalVotes'] = mt_rand(10, 100);
return $result;
}