本文整理汇总了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);
}