This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To manually dump the database you can run the following one-liner code | |
mysqldump -u[user] -p[pass] [db] > [file_path] | |
But what if you want to automate the process, here are the steps: | |
1. Setup cron entry to your server | |
* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1 | |
2. Create a command BackupDatabase by running the following code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.host = functions.https.onRequest((req, res) => { | |
const userAgent = req.headers['user-agent'].toLowerCase(); | |
let indexHTML = fs.readFileSync('./hosting/index.html').toString(); | |
const path = req.path ? req.path.split('/') : req.path; | |
const ogPlaceholder = '<meta name="functions-insert-dynamic-og">'; | |
const metaPlaceholder = '<meta name="functions-insert-dynamic-meta">'; | |
const isBot = userAgent.includes('googlebot') || | |
userAgent.includes('yahoou') || | |
userAgent.includes('bingbot') || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$countryArray = array( | |
'AD'=>array('name'=>'ANDORRA','code'=>'376'), | |
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'), | |
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'), | |
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'), | |
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'), | |
'AL'=>array('name'=>'ALBANIA','code'=>'355'), | |
'AM'=>array('name'=>'ARMENIA','code'=>'374'), | |
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'), |