No worries anymore for updated php files when uploading newly generated appgini files.
Posted: 2022-07-31 21:26
Good morning everybody.
This will be my first post even though I'm using appgini for years, I liked to stay in the background. A few times I communicated with Ahmed and talked about how I secure all my updated files when I update them with the newly generated appgini files.
Let me explain my outlay here first.
On my Windows10 Pro home computer, I run a WAMP stack for testing the appgini generated programs, after which I upload them to my server through FTP. On my live server (Ubuntu 20.04) I run the created programs and the public has access to them. On the server, I make all my updates to the php files, so they suit special needs and layouts. However, each time I make updates to the appgini application on my home computer and generate the new files after which I upload all the files again through FTP to my server, the updated server files are overridden and I have to manually update all the php files again.
Well, I'm lazy, and over time there are so many files that I made upgrades to, that it is hard to keep track of them all, and of what the upgrades were when I edited the file(s).
I explained to Ahmed my solution and he opted for the possibility to share my way with the rest of the appgini community. So here we go.
Let's explain the way I do it using an example.
I want to have a background picture on the login page so I do what is described in another post and edit the "/hooks/footer-extras.php" file and include the code needed to do this. I know that with the next update, this file will be overridden by a new generated appgini php file, so I make a backup copy of the file I altered and name it "footer-extras.php.backup". This backup file is located in the same /hooks folder.
Next I go to my crontab and enter there a line that tells the server to copy the "/hooks/footer-extras.php.backup" and override the "/hooks/footer-extras.php" file. The time setting for this cron job is set to every minute.
So in short......
I changed something to the appgini application on my home computer and generated the new files. I FTP upload these new files to my server and within a minute all my individual file enhancements that I made to the php files on the server are back through my cronjob.
No need to keep track of what files I updated and what updates I had put in them. As this is an automatic cron process that is executed every minute.
This is just the way I do it, and I hope that this trick will help some of you out too.
Cheers
No need to work harder,.... just be smarter....
This will be my first post even though I'm using appgini for years, I liked to stay in the background. A few times I communicated with Ahmed and talked about how I secure all my updated files when I update them with the newly generated appgini files.
Let me explain my outlay here first.
On my Windows10 Pro home computer, I run a WAMP stack for testing the appgini generated programs, after which I upload them to my server through FTP. On my live server (Ubuntu 20.04) I run the created programs and the public has access to them. On the server, I make all my updates to the php files, so they suit special needs and layouts. However, each time I make updates to the appgini application on my home computer and generate the new files after which I upload all the files again through FTP to my server, the updated server files are overridden and I have to manually update all the php files again.
Well, I'm lazy, and over time there are so many files that I made upgrades to, that it is hard to keep track of them all, and of what the upgrades were when I edited the file(s).
I explained to Ahmed my solution and he opted for the possibility to share my way with the rest of the appgini community. So here we go.
Let's explain the way I do it using an example.
I want to have a background picture on the login page so I do what is described in another post and edit the "/hooks/footer-extras.php" file and include the code needed to do this. I know that with the next update, this file will be overridden by a new generated appgini php file, so I make a backup copy of the file I altered and name it "footer-extras.php.backup". This backup file is located in the same /hooks folder.
Next I go to my crontab and enter there a line that tells the server to copy the "/hooks/footer-extras.php.backup" and override the "/hooks/footer-extras.php" file. The time setting for this cron job is set to every minute.
So in short......
I changed something to the appgini application on my home computer and generated the new files. I FTP upload these new files to my server and within a minute all my individual file enhancements that I made to the php files on the server are back through my cronjob.
No need to keep track of what files I updated and what updates I had put in them. As this is an automatic cron process that is executed every minute.
This is just the way I do it, and I hope that this trick will help some of you out too.
Cheers
No need to work harder,.... just be smarter....