require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/class.db_auction_watch.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/class.db_feedback.php"; include $_SERVER['DOCUMENT_ROOT'] . "/config/env_variables.php"; set_time_limit(0); $csvFile = $_SERVER['DOCUMENT_ROOT'] . "/scripts/db_seed/items.csv"; $itemData = parse_csv_file($csvFile); //var_dump($itemData); /*$a = DbAuction::find(195); $a->setField("numBids", 100); /*return;*/ $faker = Faker\Factory::create(); $reportFrequencies = $_env_reportFrequencies; seedUsersItemsAndAuctions(1000, 20, 5); //now get the userIds and auctions for next steps $userIds = DbUser::listIds(); $auctions = DbAuction::withConditions()->getAsClasses(); seedAuctionBids(); //seedAuctionViews(); seedAuctionWatches(); $soldAuctions = getSoldAuctions($auctions); seedFeedbacks($soldAuctions); function parse_csv_file($csvfile) { $csv = array(); $rowcount = 0; if (($handle = fopen($csvfile, "r")) !== FALSE) { $max_line_length = defined('MAX_LINE_LENGTH') ? MAX_LINE_LENGTH : 10000; $header = fgetcsv($handle, $max_line_length); $header_colcount = count($header); while (($row = fgetcsv($handle, $max_line_length)) !== FALSE) {