Drupal Features Path To Module - php

I'm trying to do versioning with GIT and I'm trying to figure out the features module. The Drupal configuration has all its modules stored in the site that it belongs so.
Ex with Google Maps:
sites/theme/modules/googlemaps
But I've been saving the features in the default all directory. Ex:
sites/all/modules/googlemaps
Should the googlemaps feature and module be stored in the same path? I ask because I noticed certain things don't seem to be refelected when pushed and pulled.And is there a good tutorial on how to use features with git?

Drupal best practices encourage storing all non core modules in "sites/all/modules"
Only if you have a multi-site install and want to add a specific piece of code to one of the sites should you store something in "sites/sitename.com/modules".
As far as features go the modules directory doesn't care how you nest the modules as long as they are under the "sites/all/modules" directory. So you want to create 4 seperate directories to store your modules in:
"sites/all/modules/contrib" - this stores all downloaded community modules
"sites/all/modules/custom" - this stores your custom modules
"sites/all/modules/features" - this stores all of your generated features
"sites/all/modules/patched" - if for some reason you need to patch a contrib module drop it in here with the patch and some notes so you will know how to update the module later.
So to answer your question directly. You should store features inside the "sites/all/modules" directory.
Edit:
This question inspired me to write a blog post on my company blog to expound on the strategy above a little further. Check it out at clikfocus.com

Related

Social Engine Customization

We(small group) have a SocialEngine based project and we made lots and lots of changes in 4.6.0 version including core modules, now we struggle to update to 4.8.0 which is a pain in the ass so question:
Which logic to implement in new version of social engine where will be stored our modified code that will help for future update?
We are trying using Decorator Pattern, creating another folder(modules2) for example there creating clones of modules and using only modified files(which is currently unsuccessfully).
You can to compare your files with the latest upgrade package files with Softwares like WinMerge and copy new changes in SocialEngine core to your modified files. Don't forget the database queries in application/MODULE_NAME/settings/my-upgrade sql file of each module. It's gonna take time but I don't think there's any easier solutions.
See, thats where git or subversion comes handy , you exactly know where the code is changed .

Can a CMS be powered by a Git repository?

I made a one-off CMS for a client of mine a while ago, however it was powerful enough that I used it again on a number other projects. Now that I need to manage it, I want to be able to update all of the deployments via a single update.
I'm wondering if I might be able to have the CMS simply include files from a GitHub repository. Is there a way to do this? Something like:
<?php
require('URL TO MEDIA UPLOAD MODULE AT GITHUB');
require('URL TO PAGE MANAGEMENT MODULE AT GITHUB');
//etc...
?>
Eventually the CMS will have a number of different modules for a number of different business types (real estate, retail products & services, etc) that will be included based on the modules listed for the specific deployments needs.
I just want to store everything in one place and have each deployment updated when I commit a change to the repo.
Is this possible? If not, any suggestions?
I have no idea about storing files on Github.
However, I do have another suggestion to get to your goal:
If your projects reside on the same server and you have root access to the server, you could have the core files in 1 location. With symlinks you can have the projects make use of that same directory. You will never have to deploy again since you only have to update 1 set of files.
Just make sure that theres a way to store/load the templates and individual user settings apart from the core files.

What is use of /app/code/local/ folder in magento ? Can we put our core php file in it?

I am developing mobile application for existing magento website and the mobile application has its own web admin and web admin developed in core php (not in magento). Can we put the core php web admin code to magento /app/code/local/ folder ? and is it work with magento ?
Please help me on this.
We can consider Magento as an application that is constituted by modules. Each of this module does different functionalities, but still they are independent to each other. This property makes Magento highly extendable and powerful.
By default, Magento comes with lot of such individual modules. These modules are located inside app/code/core. Note that, this folder only holds Model and Controller logic parts. View logics are separated from this and it normally lies in app/design and skin folders.
If you need to extend Magento core functionality or if you need to add any new functionality, you have two options available.
Use an extension
Develop your own custom modules
For extension/pluggin, Magento uses app/code/community directory. This way core modules are seperated from extensions and it gives us lot of flexibility.
When you use your own modules to add any functionality, you probably need to add your module in app/code/local. This way, custom modules are seperated from both core and extensions.
When Magento looks for a module, it will first check that module in local directory. If it is not there, then it will check in community directory. If it is not there, again it will check in core directory. Finally it will check it in lib directory. This callback mechanism is the core concept that you need to understand , before start to develop your own extensions.
It is not necessary to put your custom module in app/code/local directory. You can put it in community or in core directory. This is because, the callback mechanism can pick up your module, irrespective of these three locations. However as I said earlier, three of this directories has its own purpose. So better use them properly as it demands.
Hope that makes lot of sense
From Magento Wiki,
Every custom module will be created in the directory:
/app/code/local
And this is the directory structure that you use to create one:
/app/code/local/<Namespace>/<Module>/
That way, we can have multiple modules under a single namespace.
Naresh, /app/code/local/ is used to put your custom developed plugin/extension for magento. it's main aim to have custom developed code and core code separate.
If in future you upgrade the version of magento than it overwrite/delete the code written in /app/code/core/ but leave the code as it is in /app/code/local/ and it's place where you can override the core block/helper/model as well.
you can't copy your code directly in to core, you have to create module/plugin to club your existing code with magento.

File structure for custom modules in Drupal 7

Note: I have already posted this question on [SE's drupal] but didnt got any positive response there so i am posting same question here again.
I want to organize non-core(modules that are not bundled with core) modules in Drupal 7. This is my proposed structure:
Contributed modules - downloaded modules that are untouched
Custom modules - downloaded modules that are modified to suit the requirement
local modules - self-developed modules
I GUESS, the best approach for this is to make three folders within sites/all/modules like below:
sites/all/modules/contrib
sites/all/modules/custom
sites/all/modules/local
Now, there are two ways to install a module:
Manually
From the admin panel
While installing the new module manually, everything is fine. I can just go to the directory and place the module there. But how to install a newly downloaded module in `sites/all/modules/contrib from admin-panel. Moreover, is there any better approach for organizing non-core modules?
Finally after banging head on google for hours, asking question on SO and SE's drupal and communicating with other users via comments, I cracked it...
Well, the directory structure is still debatable but satisfactory for me. But the answer to the most imp question is "DRUSH".
Refer this and this node from Drupal. Collectively, it has everything needed to answer my entire question.
I would also like to point you to this answer which has provided the first and most-imp hint to me.

Laravel 4 plug-in system

I looking for some plugin structure for Laravel based applications.
For example a forum software, a cms or a e-commerce application can benefit from a plugin structure.
My question is what is the best way to implement this plugin system so that third party plugins can extend the application. The main issue is that it should be dynamically extendible and users should be able to install these plugins easily without messing with the app code.
This question also extends to themes but thats another question. Any ideas?
Laravel is a framework, not a CMS like Wordpress or Joomla, so plugin system that fits everybody may be quite hard to create as Laravel can be used in many ways, but I can really see the benefit of easy packages in some contexts.
The Packagist has been already mentioned and it doesn't solve directly your problem but how about:
Find good usable packages from Packagist for the purposes you need
Define common plugin architecture (common API for binding things together, installer, package format, migration, updates etc) on top of Packagist packages
Create installer that fetches packages via Packagist/Composer and adds sets sane default settings and configuration for the packages and integrates them into the defined plugin architecture
Document and plan this really well and the others will soon follow
I'm a little confused about the question, but I believe what you are looking for is already implemented in Laravel 4. They are just called Packages, and can be found at http://www.packagist.org and easily installed and autoloaded into your application using Composer.

Categories