Is there a way to have an extension or module automatically update its own files?
If we have the usual php files in admin/controller/extension/etc or catalog/controller/extension/etc can we automatically download new files from "the internet" and replace the existing files in those folders (or even add more files in different folders)?
A user-initiated update (where they click the Update button) is good enough as well.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Mostly 3.x but I'd like 2.x as well.
I think however that you have misunderstood, to some degree, what I'm asking.
You have a smartphone, you open the appstore and find an app you like so you download it. A few days later the app's developer updates it so you open the appstore again, click the update button next to the app's name and the appstore updates the app by downloading newer files from the internet and replacing the old ones.
I want this exact same functionality but without modifying core Opencart files, just having the extension itself update its own files.
some specialists would possibly be able, to develop an OC Version for you,
as well as an App, meeting such tasks.
The only problem could be, that you then have to get your own upgrades too,
and such would not come for free either ...
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Then, I understood your request perfectly as my last reply stands by providing the answer you were looking for.You have a smartphone, you open the appstore and find an app you like so you download it. A few days later the app's developer updates it so you open the appstore again, click the update button next to the app's name and the appstore updates the app by downloading newer files from the internet and replacing the old ones.
I want this exact same functionality but without modifying core Opencart files, just having the extension itself update its own files.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Can a basic, already installed extension replace/modify files in catalog\controller\extension\analytics and other such directories without outside help, the same way it does with system\storage\download directory?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Oh yes it's very nice, one day your user clicks the innocent "Update" button and suddenly destroys their website
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Yes. Why do you ask?nickpapoutsis wrote: ↑Mon Dec 23, 2019 3:41 amCan a basic, already installed extension replace/modify files in catalog\controller\extension\analytics and other such directories without outside help, the same way it does with system\storage\download directory?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
I'd like to implement an update mechanism for an extension I'm coding so whenever a new version gets released they can click a button and update (replace) all of the extension's files without having to go through the trouble of downloading files and then trying to install them over ftp or installer.
Most users can install an extension (one way or the other) but updates (esp. if you have to delete some file without replacing it) can be rather tricky and I'd prefer not having to offer that kind of support.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
We all know that's because there isn't really money to be made therenickpapoutsis wrote: ↑Tue Dec 24, 2019 5:04 pmthere's money to be made there but for now I'd rather not.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Money made on WordPress extension? Wow! You probably know some kind of a secret, because this is the worst selling platform ever created.nickpapoutsis wrote: ↑Tue Dec 24, 2019 5:04 pmThat's not a bad suggestion, there's money to be made there but for now I'd rather not.
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
What's the best way to download (and overwrite) a file to some admin or catalog subfolder?
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Smartphone apps are sandboxed and need to be signed for one thing. Further they go through a QC process before being accepted (even updates). What you're trying to accomplish on this framework is not advised. The fact you're asking how to do it, means you don't have the expertise and shouldn't even attempt it.nickpapoutsis wrote: ↑Sun Dec 22, 2019 11:05 pmMostly 3.x but I'd like 2.x as well.
I think however that you have misunderstood, to some degree, what I'm asking.
You have a smartphone, you open the appstore and find an app you like so you download it. A few days later the app's developer updates it so you open the appstore again, click the update button next to the app's name and the appstore updates the app by downloading newer files from the internet and replacing the old ones.
I want this exact same functionality but without modifying core Opencart files, just having the extension itself update its own files.
The amount of work to do this securely and manage it would exceed its value. What if you were somehow unknowingly breached and sent out exploited code to all your extension users or leave a gaping backdoor into peoples stores..?
This is an e-commerce framework: You are dealing with a platform that could house credit cards and personal information.
Do you really want that liability..?
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
* a curl library
* new controller library to overrule controller
*so model needs to be overruled to
* then server request task
* and you need to generate a db tabel to store the update and a table to find user versions
via file get/put contents
Code: Select all
$file_url = 'https://url';
$file_name = basename($file_url);
$dir = 'WHERE TO SAVE';
if(file_put_contents($dir.$file_name,file_get_contents($file_url))) error_log('File '.$file_name.' downloaded';}
Code: Select all
$file_url = 'https://url';
$ch = curl_init($file_url);
$dir = 'WHERE TO SAVE';
$file_name = basename($url);
$fp = fopen($dir.$file_name, 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
Apart from obvious security challenges (api etc.), if you need to overwrite multiple files and one fails, how do you revert back?
In other words, automated in-the-background updates need to be absolutely solid and fail-safe as they are unattended.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: Baidu [Spider], NicNie and 229 guests