Each time I process a post, the code runs thru a function in my own MyController extends AppController
class. That function calls this function to obtain a unique context number. The idea is that this number should be retained from one post to the next (or one run thru the Controller class function to the next). But instead the Configure::check()
always fails and the unique32 is always created anew, so this function always returns 1.
Does anyone know how to make the Configure::write()
get retained from one post to the next?
public function getUnique32() {
if (!Configure::check('unique32')) {
$unique32 = 0;
echo "unique32 starts at 0";
} else {
$unique32 = Configure::read('unique32');
echo "unique32 is $unique32";
}
if (++$unique32 >= 0xffffffff) {
$unique32 = 0;
echo "unique32 is reset to 0";
}
Configure::write('unique32', $unique32);
return $unique32;
}