Prepare LOCALHOST environment with GITHUB files

This will go through how to setup your localhost using github files. 



Open PHPstorm and navigate to VCS -> Checkout from Version Control -> GitHub

# 2 > Choose GITHUB File

1 -Git Repository URL - select the file From the drop down list

2 - Parent Directory - add the path of the project

3 - Directory Name - Type the project name ( use the same name as the git file)

4 - Click 'Clone'

Note: If the file is already checkedout with the same prjoectName, message will display to choose another directory. 

# 3 > Setup Database

1 - Navigate to back-end -> app -> config -> database.php

2 - in database.php, modify public $local as shown below.

public $local = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '',
//'host' => 'localhost',
'login' => 'local',
'password' => 'undologic',
'database' => 'test_projectName',
'encoding' => 'utf8'

Follow the conventions to create login, password and database.



# 4 > Setup Phpmyadmin
1 - Navigate to http://localhost/phpmyadmin

2 - if user account has not been created, follow step 

 A - Setup user account - Locally we want to create a basic user account so all our projects between all our developers have the same           credentials.  Because this is NOT online, it's ok to use a basic password: However online you must NOT use a basic password

Click 'User Accounts"

Click 'Add user account',    and add  user: local,  pass: undologic and  hostname: local / localhost

Give all permissions for global privileges



# 5 > Phpmyadmin - create new database

in phpmyadmin click databases

1 - add the new database (test_projectName) under databasename
2 - select "utf8_general_ci"  in collation drop down list
3 - Click Create

# 6 > Import SQL via Command Line
Importing SQL files using PHPmyAdmin is not very stable, so for large SQL files we recommend importing your SQL files using the Command line
-> Open a terminal window
-> Our example will assume that the file is in our downloads directory (if it is in another location simply change the path)
-> Find the correct database (This will display all the databases on your computer: note the correct one for the next step)

C:\xampp\mysql\bin\mysql --host=localhost -ulocal -pundologic -e "show databases;"

(C:\xampp\mysql\bin\mysql -> path where mysql is located in windows, host -> in this example its localhost, ulocal -> local is the username, pundologic ->  udologic is the password in this example)

We now have a clean database ready to go
-> Let's import the large SQL file now

C:\xampp\mysql\bin\mysql --host=localhost -ulocal -pundologic test_projectbrowser < C:\Users\User\Downloads/projectBrowser-full.sql

If you are importing a very large file allow time to pass
-> The command line will appear to be frozen, but it is working, when done you will see the terminal again and you can type again

-> If any errors occur due to space issue, in xamp control panel, click mysql config and select my.ini

-> in my.ini file,

 look for max_allowed_packet and innodb_log_file_size and change to bigger size (eg. 640M)