X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fcreatesim.php;h=882d744564dbb4c4398cf9741fe7d6eafc90d739;hb=894b221e8aec57768d6804ee3bf53c85196e09bf;hp=592853f8633e679798ec3b322c466fd6af023e27;hpb=ec6a38a62786c85e8ee30c5726ea81f82465b39d;p=quix0rs-gnu-social.git diff --git a/scripts/createsim.php b/scripts/createsim.php index 592853f863..882d744564 100644 --- a/scripts/createsim.php +++ b/scripts/createsim.php @@ -41,9 +41,12 @@ require_once INSTALLDIR.'/scripts/commandline.inc'; 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) @@ -73,6 +76,9 @@ function newNotice($i, $tagmax) } $notice = Notice::saveNew($user->id, $content, 'system'); + + $user->free(); + $notice->free(); } function newSub($i) @@ -85,7 +91,7 @@ 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); @@ -102,10 +108,13 @@ function newSub($i) $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)