X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fcreatesim.php;h=882d744564dbb4c4398cf9741fe7d6eafc90d739;hb=72f72d17dbc2ddf5228d97079f992a99f2821373;hp=71ed3bf7227ff2feb5ce4427c183c07be44a03f4;hpb=a08c76a4342cfb4b3d772f6880ba0b8f3153b246;p=quix0rs-gnu-social.git diff --git a/scripts/createsim.php b/scripts/createsim.php index 71ed3bf722..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) @@ -101,11 +107,14 @@ function newSub($i) $to = User::staticGet('nickname', $tunic); - if (empty($from)) { + if (empty($to)) { throw new Exception("Can't find user '$tunic'."); } subs_subscribe_to($from, $to); + + $from->free(); + $to->free(); } function main($usercount, $noticeavg, $subsavg, $tagmax)