This file is where all your functions belonging to a class should go. It's basically the module version of a model for a component, so tasks such as performing database queries etc. The benefits of this file is that it keeps all the core functionality in 1 location. If a module already contains this file, 1 simple rule, do not remove it.
Regarding how Joomla loads configuration.php in index.php, at line 29
if (file_exists(__DIR__ . '/defines.php'))
include_once __DIR__ . '/defines.php';
require_once JPATH_BASE . '/includes/defines.php';
You can put a custom defines.php in the Joomla root directory, then ...
Technically in PHP you can also do this:
if ($my_parameter = $this->params->get('my_parameter', 'default_value'))
$xpto = $my_parameter;
This assigns the variable and then checks that the variable is 'true', which in PHP means that it isn't null, false, '', or 0. So depending on your default value, the if statement could be ...
Basically, mod_mymodule.php is a bootstrap page of your module.
Here you will include helper file and call necessary function which resides in helper.php.
you can put HTML code in tmpl/default.php page and php code in helper and mod_mymodule.php page.
For more detail please see this.
I don't know if there's any difference in speed, but I find the first method easier to read. The reason to use DIRECTORY_SEPARATOR is to stay platform independent. Your second example:
would render like this on on Windows:
and like this on most other systems:
I always disable any of the core components that I won't use and this is a safe approach. I wouldn't recommend to uninstall at this phase until Joomla removes them from the core as it happened with WebLinks.
For a component being part of the core means that they will be back with the next Joomla update - plus if they are not present, there is some ...
All of my demonstrations will assume this line is already declared:
$db = JFactory::getDBO();
I will also provide a "guinea pig" table as a demo reference and playground for researchers when sample data is necessary for context. (db-fiddle.com demo)
CREATE TABLE IF NOT EXISTS `#__calendar` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`month` varchar(100) ...
I suspect that modifying Joomla's root composer.json file will come with Joomla 4. In the meantime, I think the best way to use composer packages is to include a composer.phar in a custom system plugin and then call the autoloader on the onAfterRoute event. Then it's globally available or if you want to only load the autoloader for 1 component for example ...
There are many resources you can find regarding a Joomla hacked site, either by googling it, or simply searching in this site.
Here are some links:
What to do if my Joomla website got hacked?
How to secure a new Joomla installation?
Joomla Security CheckList
Make sure you read them carefully and take all actions that apply to secure your site.
This is a risk when you don't know how the previous programmer developed the website.
First of all check all extensions installed and if they are updated.
If not, check if the extension has an available update and it's still supported... alternatively look for a similar extension to switch with.
Check also the template version (responsive?) and if it ...
I'd suggest placing it in your view file:
This means that is anyone wishes to override your component views, they can, for example, remove your CSS file being referenced and use their own.
Locked ones are required for Joomla to work, so you shouldn't unpublish or uninstall them.
The others may be required for some third party extensions to work (as they are part of core Joomla, the assumption that they exist may be made by some developers.)
I have uninstalled some of these in the past without problem, but now tend to use ACL instead - day-to-...