function newUser($i)
{
global $userprefix;
- User::register(array('nickname' => sprintf('%s%d', $userprefix, $i),
- 'password' => sprintf('password%d', $i),
- 'fullname' => sprintf('Test User %d', $i)));
+ $user = User::register(array('nickname' => sprintf('%s%d', $userprefix, $i),
+ 'password' => sprintf('password%d', $i),
+ 'fullname' => sprintf('Test User %d', $i)));
+ if (!empty($user)) {
+ $user->free();
+ }
}
function newNotice($i, $tagmax)
}
$notice = Notice::saveNew($user->id, $content, 'system');
+
+ $user->free();
+ $notice->free();
}
function newSub($i)
$from = User::staticGet('nickname', $fromnick);
if (empty($from)) {
- throw new Exception("Cannot find user '$fromnick'.");
+ throw new Exception("Can't find user '$fromnick'.");
}
$t = rand(0, $i - 1);
$to = User::staticGet('nickname', $tunic);
if (empty($to)) {
- throw new Exception("Cannot find user '$tunic'.");
+ throw new Exception("Can't find user '$tunic'.");
}
subs_subscribe_to($from, $to);
+
+ $from->free();
+ $to->free();
}
function main($usercount, $noticeavg, $subsavg, $tagmax)
{
+ global $config;
+ $config['site']['dupelimit'] = -1;
+
$n = 1;
newUser(0);