generate_users.php 636 B

123456789101112131415
  1. <?php
  2. /**
  3. * Use this script (uncommenting the die(); line) to generate a file in
  4. * /tmp/data_users.php to replace the data_users.php file here with a much
  5. * larger number of (less realistic) users for testing purposes
  6. */
  7. die();
  8. $string = "\$users[] = array('username' => 'aaaX', 'pass' => 'aaaX', 'firstname' => 'AAAX', 'lastname' => 'BBBX', 'status' => 5, 'auth_source' => 'platform', 'email' => 'aaaX@example.com', 'creator_id' => 1, 'active' => 1);\n";
  9. $output = '';
  10. $outputFile = '/tmp/data_users.php';
  11. $fh = fopen($outputFile, 'a+');
  12. for ($i=1; $i < 5000; $i++) {
  13. fwrite($fh, str_replace('X', $i, $string));
  14. }
  15. fclose($fh);