How to reuse custom module with all in one installation in magento 1.9 - magento

I created a custom module that represents a custom payment method, the steps I follow are;
1) Create a module architecture in /app/local/NameSpace/MyModule
2) Create an xml file in /etc/modules to configure my module
3) Create templates /design/frontend/base/default/template/mymodule
The module works well, but i want to reuse the module in other projects with all in one installation. now, i want to know if i must develop a script to copy the xml file in /etc/modules and templates manually? or there is an existing solution in magento 1.9 to do this operation?
Thanks in advance,

You want to create a Magento Connect package. There's a UI for doing this under the System Magento menu (although the UI is sort of terrible) and some googling around should set you right. Once you have a connect package, you can install it into any system via the /downloader UI (also available via the System menu) or the ./mage CLI command.
Also -- if you choose "Magento Other" as the role for all your files, your resulting tgz archive can simply get uncompressed/unarchived into any Magento system's root folder. Also of interest -- my script for creating Connect Packages from raw tar archives.

Related

Package manager - how to extend module with ability of module update

When I use some package manager like Composer I want to use some 3rd-party module and to have an ability for example to change some views (templates) of this module, and simultaneously to have an ability to update this module trough composer.
How can I do this?
If not - may be it is question to think about to integrate to package managers some pattern to have an ability do this well ?
Pattern - I mean some rules with that programmers will be able to show some files that will be able to be edited by consumer and to do it, developer should do some api for it by some standartized method that will be written in rules, f.e. in some composer config of his module developer will write, what files should be duplicated to userpath. After install, these files will be copied and user will be able to change it, and composer will do it able modules to see these files in users folder. And after update this user folder will not rewrite these edited files... Something like that or maybe somehow more flexibly
How to modify views of packages installed by composer in Laravel:
https://laravel.com/docs/5.0/packages#views
Customized views should be placed in folder /resources/views/vendor/
with same names as original
This is the first place where views are searched by framework

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!

Way to load locally developed magento extension

I am developing a magento extension. After getting help from stackoverflow, I am able to create a package extension which is stored in [magento]/var/connect folder. I noticed that package.xml, myextension.xml and myextension-1.0.0.0.1.tgz files are created therein.
I created another magento instance locally where I want to load that package and test. It's not possible to get my extension verified by magento team and then use it quickly or is it? I copied those package files under /var/connect of the test instance but I cannot see that appear in admin-> system -> magento connect -> package extensions.
Any idea how I can do that? All I need is he ability to let my customer have my zip files(package files), then they will upload somewhere. Any help would be appreciated.
You can upload packaged Magento extension by going to:
System > Magento Connect > Magento Connect Manager
then uploading the package under the Direct package file upload section.
Furthermore, if you decide not to package your extension, just copy the working file structure of your extension to it's own folder, and you can simply drop your extension files into the working root directory of compatibility Magento installs. Just be sure your extension file structures are correct. EX: app/code/local/MyNamespace/MyExtension etc.

How to create a folder withing a setup script of custom Magento module?

I am developing an extension, which can be installed by copying the extension folder into Magento folder. This extension includes a folder within Magento media folder, which should be writable by Magento. Since the folder can be copied with the rights different from the rights, which Magento runs on, I am looking for the way of creating this folder in the setup script.
It looks like a bad practice to me to run this code within the script for sql or entity setup. Is there any way in Magento to do such task in appropriate setup script or should I make the perfectionist in me shut up and simply put the code in the sql setup script?
if you want to create a folder for custom extension in magento use this code.
$customDir = Mage::getBaseDir('media').DS.'foldername';
$ioFile = new Varien_Io_File();
$ioFile->checkAndCreateFolder($customDir);
You can use Varien_Io_File::checkAndCreateFolder() to check and create directory not in setup script, but in the place of the actual usage of the folder.
I think it is not Magento-esque to create those folders in a setup script. It is more logical to just pack them with your extension and let the user put them in the correct place. Imho.
To make sure about the rights, you can test them in the code and produce an error message if incorrect, and make sure you mention it in the manual to the user.

How do I install Magento Bitcoin currency extension?

How do I install the Magento Bitcoin currency extension on a Linux box with standard LAMP stack?
I have already searched, read the documentation, and put the files in the root Magento directory (just as the instructions say to do: https://github.com/ticean/magento-bitcoin/wiki/Installation).
Copy files from /lib/ into your /lib/.
Then everything in /app/ into your /app/.
Make sure to upload /design/ into the correct template you are using.
Code is going into /community/, NOT core or local.
Finally, ScaleWorks_Bitcoin.xml goes into /app/etc/modules.
Verify that Magento can see the module in Admin -> Config -> Advanced. Does the module show up on that list?

Resources