From 35f3b500afb0424a79a7ca87b7bce454a6897a0a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 5 Jan 2019 21:54:21 -0600 Subject: [PATCH] Add db seeder --- cli/db-seed.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 cli/db-seed.php diff --git a/cli/db-seed.php b/cli/db-seed.php new file mode 100644 index 00000000..cb3796b7 --- /dev/null +++ b/cli/db-seed.php @@ -0,0 +1,41 @@ +&1 | grep -v \'Warning\''); +echo "Sourcing data...\n"; +chdir($temporary_location); +exec("mysql -h mariadb -uroot -proot peq < peqbeta.sql 2>&1 | grep -v 'Warning'"); +exec("mysql -h mariadb -uroot -proot peq < player_tables.sql 2>&1 | grep -v 'Warning'"); +chdir($origin_directory); +echo "Seeding complete!\n"; + +/** + * Unlink + */ +array_map('unlink', glob($temporary_location . "*.*")); +rmdir($temporary_location);