How can I manually update Joomla core files without overwriting third-party extensions? - joomla

When you install Joomla extensions, they may put files into the Components, Modules, Plugins, Media, Images, and possibly other directories. Also, they may save configuration information in some or all of these directories.
In other words, Joomla does not have a clean separation of Core, Third Party, and Local files. This makes it impossible to manually overwrite a Joomla installation, because you don't want to stomp on any of these files. (Coming from Drupal, this is craaazy-not-best-practice!)
Is there a way to manually update JUST the Joomla core files?
Is there a way to manually update JUST the 3rd-Party extension files? (Yeah, they might be all over the place!)
I'm presently cleaning up a bunch of sites infected with a base64_decode hack. Mixing core files with 3rd-Party with configuration, makes it very difficult to clean things up.

There is nothing wrong with the process of installing extension in Joomla. Each type of extension is separated as it should be to make life easier, not harder. Core files are not to be touched in any way, shape or form, so it simply does not matter of core components are in the same directory as 3rd party component (same goes for modules and plugins).
As for you question regarding manually updating core Joomla files, you can simply :
download a copy of the same Joomla version you're using from the official site,
remove the configuration.php file and "installation" folder from the zip
Upload the zip to the root of your site and extract.
This will replace all core files.
To update 3rd party extensions, all you have to do is download the extension from the developer's site and install it again. You do not have to uninstall them first.
The hacked sites you are cleaning up were most likely hacked due to the owner or webmaster not keeping Joomla itself and it's extension update to date.
You see, not that hard :)
Hope everything works out.

Related

How to export an extension from a developed Joomla website if we have access to Admin Panel of Joomla website and cPanel of hosting?

I have a Joomla Website developed by giving work to freelancers.
It has many modules, plugins and components which were developed.
Now I want to develop another website on Joomla. I want to use those extensions but don't have the installation zip files.
Is there a way to export them or to create them by exporting some files. Id yes - then specifically how?
The question is different from Is it possible to export already installed component in joomla 2.5? as there they are just asking about exporting a component whereas here the exporting has to extend to plugins and modules as well.
There's a tool for that: GreenCape/extension-export, called Extension Exporter. It was written for and tested on Joomla 3.8. Unlike other tools, it takes the extensions manifest file into account (especially for folder names).
(Disclaimer: I wrote it)
To nibra's answer:
This is very nice, thank you for sharing.
Remarks:
after installation, I couldn't enable your plugin, needed to set the $filterForm variable public in InstallerViewManage.php line 64
I could export my component, then removed, but when tried to install it back, it missed the router.php file, which I did not have on administrator side, so I needed to remove it from the exported installation XML file.
After that I could install my component successfully, but language file was missing, because my component is in Hungarian and no English language file was set for it.
Also it would be nice to dump the database tables with the component so I didnt need to export/import separately.
So this will be a great tool after a little manual finetune.
Thank you!

Move source code files to CodeIgniter folders

I am starting to work on some incomplete stuff in codeigniter. I had to install codeigniter on my machine. I have the source code files from the previous work, however I am confused how to move these files to CodeIgniter folder to access them as usual and start working on them.
I am not sure which files go to which folder in the CodeIgniter Folders available when downloaded.
Download and install Codeigniter on your machine first. Check out in which folders the controllers/models/views/configs reside.
Then you will have an idea which files reside where, if you still have some problems take a peek in the documentation.
CodeIgniter have and system a application folder.
I'd recommend a new download.
I doubt some change was made on system folder, so I think you can ignore it from your project and use the new downloaded one
The project is on the application and there you have some folders, as mentioned by gopi1410, that you need to take care, maybe there are libraries, models, controllers, configurations files, autoload, etc.
And tell us what it the version of you application. If it is a old version, there will be some problem using the new version system folder.

Problems Repackaging Mozilla Addon Builder Extension Files

Have made quite a bit of progress in my quest to figuring out the Mozilla extension platform, but am still struggling with a few issues.. Hoping someone here can point me in the right direction once again :)
Ok, so here is the issue... I have been messing around with the online addon builder app here: https://builder.addons.mozilla.org/
Great, this seems to be working ok for testing simple addons. But it includes so much extra junk - stuff I am not using and don't need there.
Now when I download the .xpi file, rename it to .zip, and extract it to work on the files, when I repackage it to a zip -> xpi, Firefox tells me the package is corrupt when I try to install.
I have deduced that this is because the package is "signed" or something, and when I repackage it myself this is not happening.
Whatever. This is getting ridiculous...
So I want to use the SDK to work locally, and then just include the SDK in the directory somehow. But it looks like I need to install python and run something in order to generate some files first blah blah blah.... are you joking me? I can't just code my app, then include the SDK files?
QUESTION:
How can I create my basic addon/extension with the online Addon Builder, then edit the files locally, repackage it, and use it?
Add-ons created with the SDK currently aren't signed (see bug 613618). There are a bunch of SHA256 checksums in the package manifest but nothing is verifying them (maybe they are meant for verification by external tools, I don't know). So this is not the problem you are experiencing.
Most likely issue is that when you repacked the ZIP file you didn't keep the directory structure. The install.rdf file needs to be at the top level of the package, not in some subdirectory. You can check it with the unzip -l mypackage.xpi - it should list install.rdf without any directory name.
Generally, I would advise against manipulating the XPI files. By removing unused modules you might be able to save 100 kB in download size, most likely less - somebody installing your add-on will not even notice the difference in download size. Modules that aren't used have zero impact on performance of your add-on. But you risk removing something that is actually used, maybe in a non-obvious way. And once AMO starts repacking SDK add-ons automatically they will replace your add-on by the standard package anyway.

ASP.NET MVC folder structure and NuGet

I want a custom directory structure for my Content in my MVC project for example:
\Content
--\js
--\css
--\img
Is it possible to tell a NuGet package to install scripts in the Content\js folder? For example the jQuery package so that the jquery-1.6.js file is installed in the Content\js folder?
A workaround is to use the Nuget Package Explorer and download the package you want into that. You can then edit the folders within the package using Package Explorer to suit your taste and save it into your own Nuget repository. This can be a file system folder or you can get more sophisticated here: Hosting Your Own NuGet Feeds.
Of course this means that you have to keep the packages in your private repository up to date. Clearly if you have a lot of packages to deal with this could become a problem. However it seems quite likely that a future release of Nuget will deal with the issue of local feeds because it's an issue for companies that 'restrict which third-party libraries their developers may use' as mentioned in the Hosting your own NuGet feeds reference above.
I believe the answer to that is "No." There are, however, some references to be able to set the root folder NuGet installs things into: http://nuget.codeplex.com/workitem/215 (see the comments)
How jQuery gets installed is determined by the package producer, which is the jQuery team in your case.
Where the jQuery package gets installed is up to you.
However, the where can only be adjusted in terms of the location of the installed package ($(SolutionDir)\packages folder is the default), and the target project where you install it into. From then on, the package producer takes over and decides where each piece of the package content ends up.
There are some good conventions for ASP.NET MVC, such as a Content folder, a Scripts folder, an App_Start folder (for WebActivator), etc. Think about the risks and extra effort involved of trying to move away from these conventions. Do they outweigh the benefits?
Now if you really want to use your own conventions, you could create your own package with your desired content structure and put the jQuery scripts where you want them in the consuming projects.
This means you would be using your own package with that specific version of jQuery. You just have to be careful to respect the licensing policy of the original package, and not to break any specific installation steps or requirements from the original package, which is fairly easy to do if you manually start changing package structure.
The answer to this is "no" because the "Content" folder is one of the Nuget's convention folders. However, if you rename your Content folder to, for instance, public and then have Nuget pack your public/js folder then when you bring the package in it will extract the files to the public/js folder.
Since I started to use Nuget I switched to using public for my public content instead of Content and rather use Content for files that I want to bring in untouched like source files (see here one usage of Content).

What files in Magento have no purpose being in source control?

I am looking to clean up the file that we store in source control (SVN) for the Magento projects we are working on.
Which files/folder are have no purpose being in SVN, ie the ones are not necessary for the site to function, or are only transient?
So far I have identified
var\cache
var\session
media\temp
var\locks
downloader\pearlib\download
downloader\pearlib\cache
There are some I am unsure about:
var\report
downloader\pearlib\docs
media\catalog\product\cache\
Can anyone provide a definitive list?
http://activecodeline.com/git-ignore-gitignore-file-for-magento-project answers a larger question, but could be helpful none-the-less.
There's a whole bunch of stuff in Magento that doesn't need to be in source control, as it will remain constant (as long as you follow some sane development practices.) The above link goes through all the directories that need not be tracked by source control.
I typically ignore these folders for development, but you may choose to store images if you think it's appropriate:
/var: This is always temp data or data that can be regenerated
/media: These are images and uploads, not really source code, but keep if you want
/downloader: I don't like to use Magento Connect and prefer to install things manually. You can always get Magento Connect elsewhere, so no need to keep it in the repo.
/includes/src: This is compiled source code, you can regenerate if needed. Not really that usefull since we have SSD disks and APC.
We usually have something like:
/app/etc/local.xml
/downloader
/var
/media
Media usually contains images that are configured in admin, like product/category images, logos, CMS images, merged JS/CSS and import/export data I believe.
Some extensions also have files in media that should be versioned (ex. product feed templates)
There is also an htaccess file in var and media so you have to include those.

Resources