mixster
2008-01-05 16:50:33
After reading omgh4x0rz 'Scar, files and the internet' tutorial, I decided to set myself a small task of setting up a piece of script that lets you automatically update a script. After about 2 hours of coding (both scar and php) I managed to string together a few simple scripts that do the job quite nicely. I also converted it into both a whole script and also a function (both in separate files) but both work with the same php file.
The main workings behind it is that the scar script (the script that will be downloaded) is placed into a text file. That file is then written into a string in the php script and then echo'ed (written). The echo is then recorded by scar into a string and is then written over the old file. There is also the option of enabling/disabling browsers ability to view the script and also an option for making a backup when updating the script (in case something goes wrong or the newest version has bugs etc.). Also, it can be used to install scripts as it writes them rather than just editing them.
Download one or both of the scar files (depending in whether you want the function or whole script version) and both the txt files (auto-update.txt has to be changed to .php as the forum won't let me upload it with a .php extension :()
If you run into any problems or tips on improving it, please reply here or send me a pm.
(Ironically, at the moment there isn't an auto-updating script/function for this script :p)
Update: Finished the auto-installer. It's still being tested just to make sure it works and will be uploaded shortly. Also made it so the php file reads .scar files, so you don't have to copy and paste your script into a text file.
Update2: Please re-download if you have the original scripts. Came accross a bug, but not sure whether or not it's present in the original scripts, so better ot be safe than sorry. Also The auto installer is now very nearly finished and should be up in the next 20 or so minutes
Update3: Auto installer was getting a bit complicated so I worked on improving the function auto updater. You can now use it to update multiple files easily and can also include it then use it in a script.
Update4: Auto installer initially complete. Comes with an easy to use and straightforward form. Only known bug at the moment is that if you choose to do a backup when the file doesn't exist it crashes (just go to the main() function at bottom and turn the last option to false instead of true then run the script and swap it back). The update script is based off the my latest auto update function script. Also, I plan on only updating the auto installer for a bit. I plan to make it able to create multiple updaters at once, all still accessible through the 2 main files then the uploaded scar files
The main workings behind it is that the scar script (the script that will be downloaded) is placed into a text file. That file is then written into a string in the php script and then echo'ed (written). The echo is then recorded by scar into a string and is then written over the old file. There is also the option of enabling/disabling browsers ability to view the script and also an option for making a backup when updating the script (in case something goes wrong or the newest version has bugs etc.). Also, it can be used to install scripts as it writes them rather than just editing them.
Download one or both of the scar files (depending in whether you want the function or whole script version) and both the txt files (auto-update.txt has to be changed to .php as the forum won't let me upload it with a .php extension :()
If you run into any problems or tips on improving it, please reply here or send me a pm.
(Ironically, at the moment there isn't an auto-updating script/function for this script :p)
Update: Finished the auto-installer. It's still being tested just to make sure it works and will be uploaded shortly. Also made it so the php file reads .scar files, so you don't have to copy and paste your script into a text file.
Update2: Please re-download if you have the original scripts. Came accross a bug, but not sure whether or not it's present in the original scripts, so better ot be safe than sorry. Also The auto installer is now very nearly finished and should be up in the next 20 or so minutes
Update3: Auto installer was getting a bit complicated so I worked on improving the function auto updater. You can now use it to update multiple files easily and can also include it then use it in a script.
Update4: Auto installer initially complete. Comes with an easy to use and straightforward form. Only known bug at the moment is that if you choose to do a backup when the file doesn't exist it crashes (just go to the main() function at bottom and turn the last option to false instead of true then run the script and swap it back). The update script is based off the my latest auto update function script. Also, I plan on only updating the auto installer for a bit. I plan to make it able to create multiple updaters at once, all still accessible through the 2 main files then the uploaded scar files