Where put batch process in a joomla - joomla

I have a Joomla website and I have to make a Batch process to run every day at midnight. The thing is that I don't know where I should put the process. I thought I'd make a new component but it isn't a component.
Any suggestion?

You'll need to use a CRON job, or check the Joomla Extensions Directory for something that might be helpful. To my knowledge processing on Joomla depends on a user displaying a page for anything to be triggered for execution

If it's Joomla 2.5+ you can use cron to trigger a Joomla platform app - like the ones you find in the /cli/ directory.
Lots of extensions do it, the most famous one is probably Akeeba Backup.

Related

Joomla 2.5.16 take up to 2min to load

A relative asked me to fixed a Joomla website (v2.5.16) who has been hacked last year, probably due to lack of update (is up to date now), unfortunately I have no information about this. The issue is that the front end take 2~ min to load. The administration is loading normally so whatever the issue is, it depend of the front end. I already disabled all modules one by one and switched the template with another one to make sure that thebug is not in template or plugins folders, without success.
I must add that the problem is "probably" more recent than the hack, according to this person. So maybe there was a script somewhere reaching a random server which may not work anymore.
PS : the website is on a shared hosting. I have the FTP access but no ssh.
I know that I don't give any details which can lead to resolve this, but I need more a method to track what can go wrong and where than a solution.
Thanks in advance,
We have written a lengthy post explaining why a website might be slow: http://www.itoctopus.com/20-questions-you-should-be-asking-yourself-if-your-joomla-website-is-slow
From the looks of it, it might that the website is still hacked. Try overwriting the Joomla files with a fresh Joomla install and see if that addresses the problem.
Solving this issue will probably involve some or all of the following:
updating Joomla and all third party extensions to the latest versions
checking for and fixing malicious files using http://myjoomla.com or
https://sucuri.net or similar
analysing the performance of the website using http://gtmetrix.com
(it's free) or similar to pinpoint and fix what is taking the most time to
load
If the website has been hacked, you may need to reset passwords etc once the malicious files have been removed. See https://joomla.stackexchange.com/a/180/120 for more information about securing the website once it is fixed.

how to update my own joomla 1.5 components?

how to update my own joomla 1.5 components?
i have 2 components i made with my team, that we use on our web site. (on joomla 1.5..... we didn't upgrade for the moment)
we often make updates to fix bugs, to add new featers etc...
to put update on production server , we use FTp, and we change the files that have to be changed........ needless to say, how bad it is.....
i am looking for joomla component, plugin .... to make me able to make updates on my components/template , faster and safer (i imagine, a Zip file containing what have to be changed, and a rollback function, that allow to restore a version if there is problems)
All i found is components that allow to update the joomla core (to 2.5 for exemple).
any idea?
You could use Akeeba Live Update. It's basically a 1 click update system that downloads the update zip you upload to the FTP or other host, then unzips it, updating the extension. The first time you try it out, it might be a bit hard to get used to and will probably take a little trial and error, however its the best and I think only out there at the moment. The likes of Kunena also use this system.

How to make a working Copy of Joomla 1.5

I am running Joomla 1.5
I duplicated the entire Joomla directory from the command line via "cp"
I duplicated the entire MySQL database form within phpMyAdmin
When I run the dup'd site I don't get my selected template, I get the out-of-the-box default template. So I went into Template Manager and made my template the default.
Next the menus are whacky.
So before I proceed to set everything manually, one-by-one, if there something I am missing here as to why when I make an exact copy of everything the new Joomla site does not look exactly like the current one?
Thanks for helping me.
It should work. I assume you followed Copying a Joomla website? Make sure you follow that exactly.
But I strongly recommend using Akeeba backup instead. I use it for all my sites and it just works. It is a free extension that does it all for you. Might take some initial setup but after that you are set.

Appropriate/best practice way to execute some PHP unrelated to database when a module is first installed?

I'm creating a module that requires a few things to be done (once only) when the module is installed. There may be a number of things that need to be done, but the most basic thing that I need to do is make an API call to a server to let the external server know that the module was installed, and to get a few updated configuration items.
I read this this question on stackoverflow however in my situation I truly am interested in executing code that has nothing to do with the database, fixtures, updating tables, etc. Also, just to be clear this module has no affect (effect?) on the front end. FYI, I've also read this spectacular article by Alan Storm, but this really only drives home the point in my mind that the install/upgrade scripts are not for executing random PHP.
In my mind, I have several possible ways to accomplish this:
I do what I fear is not a best practice and add some PHP to my setup/install script to execute this php
I create some sort of cronjob that will execute the task I need once only (not sure how this would work, but it seems like it might be a "creative" solution - of course if cron is not setup properly then this will fail, which is not good
I create a core_config_data flag ('mynamespace/mymodule/initialized') that I set once my script has run, and I check on every area of the adminhtml that my module touches (CMS/Pages and my own custom adminhtml controller). This seems like a good solution except for all of the extra overhead every time CMS/Pages is hit or my controller is hit, checking this core_config_data setting. The GOOD thing about this solution would be that if something were to fail with my API call, I can set this flag to false and it will run again, display the appropriate message, and continue to run until it succeeds (or have additional logic that will stop the initialization code after XX number of attempts)
Are any of these options the "best" way, and is there any sort of precedent for this somewhere, such as a respected extension or from Magento themselves?
Thanks in advance for your time!
You raise an interesting question.
At the moment, I am not aware of a means to go about executing any arbitrary PHP on module installation, the obvious method (rightly/wrongly) would be to use the installer setup/upgrade script as per 1 of your Q.
2 and 3 seem like a more resource intensive approach, ie. needlessly checking on every page load (cache or not).
There is also the approach of using ./pear to install your module (assuming you packaged it using Magento). I had a very quick look through ./downloader/pearlib/php/pearmage.php but didn't see any lines which execute (vs copying files). I would have imagined this is the best place to execute something on install (other than 1 mentioned above).
But, I've never looked into this, so I'm fairly interested in other possible answers.

Joomla Component Automated Update

I develop a Joomla component. At the moment whenever I release a new version I ask the user to download a zip file and to manually upload the changed files via FTP. While this is ok for small releases, when a lot of files have been modified it is a slow, painful and error prone process. As alarming as it may be, many users installed Joomla via Fantastico one-click install and are not familiar with or comfortable using FTP.
I have recently added support for Joomla 1.6 which seems to provide a nice update facility for automated updates. Unfortunately the documentation seems to be lacking, e.g. what is the tags element, can the download type not be "full" and if so what would that look like?
Can any one explain the update process better or provide any good examples?
Joomla 1.5 is going to be around for a long time, is there a similar update process for 1.5?
For Joomla 1.5 at least, there is no need to use FTP for updating. In your XML manifest you can set the component to update. Rather than download, upzip, and FTP up, all your users would need to do is download the entire package, then install via the Joomla admin.
I am not sure about 1.6, your best bet would be to take apart a 1.6 component. It is my understanding that it is a rather simple process.

Resources