=============================
DEV INSTRUCTIONS
=============================
1. Install Prerequisites on host machine
 * Virtualbox & Extensions from website (apt packages outdated)
 * Vagrant (sudo apt-get install vagrant)

2. Install Vagrant, Plugin & Prep hosts file (host machine)
apt-get install vagrant;
vagrant plugin install vagrant-vbguest;
echo "192.168.33.10 mediacp.app" >> /etc/hosts;

3. Prep environment (host machine)
git clone git@bitbucket.org:castcontrol/mediacp.git

4. vagrant up

5.	Install MediaCP (within vagrant) on domain mediacp.app
vagrant ssh;
sudo su;
cd /root;rm -f init;wget http://install.mediacp.net/scripts/init;chmod +x init;./init MCP-Leased-XXXXXXX;

6. Post Install Configure htdocs to use our dev files
echo "" > /usr/local/mediacp/nginx/conf/security.conf; # Disable nginx security against vendor path for dev
sudo usermod -G mediacp vagrant;
echo "display_errors = On" >> /usr/local/mediacp/php/php.d/custom.ini;
mv /usr/local/mediacp/htdocs /usr/local/mediacp/htdocs.original;
ln -s /mediacp /usr/local/mediacp/htdocs;
cp -a /usr/local/mediacp/htdocs.original/files/ /usr/local/mediacp/htdocs/files/;
cp -a /usr/local/mediacp/htdocs.original/logs/ /usr/local/mediacp/htdocs/logs/;
mkdir -p /usr/local/mediacp/htdocs/temp/templates_c
touch /usr/local/mediacp/versions/mysql-enable-port; # Start mysql on port 3307
echo "CREATE USER 'root'@'%' IDENTIFIED BY '';" | /usr/local/mediacp/mysql/bin/mysql --protocol=SOCKET --socket=/usr/local/mediacp/mysql/data/mysql.sock --user=root --password= mediacp >/dev/null 2>&1
echo "GRANT ALL PRIVILEGES ON *.* to root@'%' WITH GRANT OPTION;" | /usr/local/mediacp/mysql/bin/mysql --protocol=SOCKET --socket=/usr/local/mediacp/mysql/data/mysql.sock --user=root --password= mediacp >/dev/null 2>&1
/usr/local/mediacp/service restart;

7. Run MediaCP Web Installation

8. Restore setup and other folder post install

9. Developer database.php useful variables
```
$setting['db_version'] = '2.13.8';
#$setting['display_limit'] = '3';
$setting['nosmartycompile'] = true;
if ( !defined('DEVELOPER_ENV') ) define('DEVELOPER_ENV',true);
if ( !defined('DEVELOPER_MODE_DISABLE_REPORTING_CACHE') ) define('DEVELOPER_MODE_DISABLE_REPORTING_CACHE',true);
if ( !defined('DUMMY_DATA') ) define('DUMMY_DATA',true);
if ( !defined('DISABLE_DEBUGBAR') ) define('DISABLE_DEBUGBAR',true);
define('NGINX_RTMP_DISCONNECT_TIMEOUT',5);
if ( !defined('DISABLE_CACHING') ) define('DISABLE_CACHING',true);
#$setting['debugging'] = 'allerrors';
#$setting['original_language_style'] = 1;
$setting['gettingstarted'] = 'yes';
#ini_set('default_charset', 'UTF-8');

$setting['historics_provider'] = 'Elasticsearch';
$setting['historics_provider'] = 'Mysql';
$setting['reporting_raw_dl'] = 'disabled';
define('PREVENT_HISTORICS_DELETION', true);
```

10. Install additional packages
```
# PHP 7.3
sudo apt -y update && apt -y install software-properties-common apt-transport-https ca-certificates lsb-release
sudo add-apt-repository ppa:ondrej/php
sudo apt -y update && apt -y install --no-install-recommends \
        php7.4 php7.4-gd php7.4-curl php7.4-common php7.4-dom php7.4-mysqli php7.4-vips \
        php8.3 php8.3-gd php8.3-curl php8.3-common php8.3-dom php8.3-mysqli php8.3-vips --no-install-recommends

# COMPOSER
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

```

11. Install XDEBUG
```
apt-get -y install php-dev autoconf automake;
tar -xvzf xdebug-3.4.4.tgz
```

# WINDOWS NPM INSTALL
1. Install node-v12
2. Install python 2.7
 pm install -g node-sass
npm install -g node-gyp
npm install -g webpack@4
npm install -g npmignore

npm install react-native-fs
npm install buffer