本文整理匯總了PHP中Stats::store方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stats::store方法的具體用法?PHP Stats::store怎麽用?PHP Stats::store使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Stats
的用法示例。
在下文中一共展示了Stats::store方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
} else {
$colour = $settings['colour'];
}
}
// Default to 10 px height if they set no height.
$settings['currentHeight'] = isset($_GET['height']) && $_GET['height'] > $settings['minHeight'] ? $_GET['height'] : $settings['currentHeight'];
// Store Height
$store['height'] = $settings['currentHeight'];
// Stats class include
if (!(include_once './Stats.class.php')) {
die('Error including Stats.class.php');
}
// Instantiate instance of class
$stats = new Stats();
// Store the stats!
$stats->store($store);
// Set the content-type to png
header("Content-type: image/png");
// Create an image at the right dimensions.
$im = imagecreate(4, $settings['currentHeight']);
// Declare some colours
$white = imagecolorallocate($im, 255, 255, 255);
if (count($colour) == 4) {
$line = imagecolorallocatealpha($im, $colour[0], $colour[1], $colour[2], 127 - $colour[3] * 127);
} else {
$line = imagecolorallocatealpha($im, $colour[0], $colour[1], $colour[2], 100);
}
// Set the image to use white as transparent
imagecolortransparent($im, $white);
// Draw a line starting bottom left, for 2px along
imageline($im, 0, $settings['currentHeight'] - 1, 2, $settings['currentHeight'] - 1, $line);
示例2: updateStats
public function updateStats()
{
$stats = $this->driver->info();
Stats::store('stats', $stats);
}