CVS edit link for bob_hirnlego
I work as a developer for Radio Radicale, an Italian radio website.
They asked for a solution for maintaining a network of sites under D6 with shared resources (users, nodes and taxonomies) and my team developed a module called Hydra.
Hydra is similar to Domain Access in the main purpose, but approaches the matter in a different way: while Domain Access derives a new site from a master and then tries to give it some independence, on the contrary Hydra creates an independent site and then adds it to the network.
Technically Domain Access uses a single Drupal site, Hydra creates a site for each domain.
This way, every Hydra site is totally independent when it comes to files, modules and themes.
This also means more order and tidiness when working on a lot of sites with different administrators.
Each new site is cloned from a "template" site which must be properly arranged, and the creation is done in one click.
There's a lot more to it, but I'd like to make clear that we developed Hydra when Domain Access for D6 was young and lacking the features we needed. Besides, we noted that Domain Access was too complex to setup and use for our needs, so we decided to write our solution. When we compared them lately, though, we came to the conclusion that while Domain Access is more suitable for a group of affiliated sites that share more than the contents, Hydra is best suggested to those who want to focus on sites identity and autonomy.
Comments
Comment #1
bob_hirnlego commentedComment #2
avpadernoThe CVS ID tag should be
$Id$.Rather than concatenating a string, use a placeholder; concatenated string cannot be extracted for translation, and the string would not appear in the translation template.
hook_init()is called only on not cached pages; depending on the case, this could cause problems.Hook implementations should never call
die().Drupal has the function
truncate_utf8().Global variables used by the module should be named something like
$_hydra_master_name.Isn't
SHOW TABLESspecific for a database engine?For that, there is the function
db_query_range().Use placeholders.
There is the function
db_placeholders().There is the function
drupal_match_path().base_path()is normally used in such cases.There is the function
db_drop_table(), even if it is normally used on update functions; as alternative, it is possible to execute the query only afterdb_table_exists()returnedTRUE.Comment #3
bob_hirnlego commentedUnfortunately I need to drop tables specifing a certain prefix, and both db_drop_table() and db_table_exists() add it by their own means.
Solutions?
Comment #4
avpadernoYou can use
@db_query('DROP TABLE {'. $table .'}'); that query is surely compatible with all the database engines that Drupal supports.Comment #5
bob_hirnlego commentedHere is the corrected version.
Comment #6
avpadernoThe current directory set when Drupal runs is the Drupal root directory; the paths used would not allow PHP to find the files.
When a module needs to include code files, it should use
module_load_include().The coding standars also reports which functions should be called from a module.
Such lines reports the dependency from other Drupal modules, not from external code. That line is commented out, but it should be removed as it could confuse the user.
Comment #7
bob_hirnlego commentedActually, the operations defined by Hydra override those defined by core. Users will not see duplicated labels.
This is necessary because of how contents are shared between sites.
New version attached.
Comment #8
avpadernoComment #9
avpadernoThat line should be removed. The packaging script already adds a version line.
substr(), andstrlen()(see http://drupal.org/node/473460).Comment #10
bob_hirnlego commentedI'm sorry if it's not the right place, but I've already sent a query using the contact form a few days ago and still received no answer.
I'll wait longer but I need to release this project fast.
The problem is the following:
I need to release this project (Hydra) using another Drupal account. I've already created it ("radioradicale").
The CVS account (that is "radioradicale" too) is correct, but would it be possible to assign it to the Drupal user "radioradicale"?
Forgive me for the trouble, but I'm bound to release Hydra with the other Drupal account.
Comment #11
avpadernoI am not sure if what you are asking is acceptable; I would open a report in the Drupal.org webmasters queue, so that somebody could say if this is acceptable or not.
This issue queue is used from a minority of Drupal webmasters, and your request would not be much visible.
Also, you already used radioradicale as CVS username; it is not possible to change CVS username, but it is possible to swap it between two different users.
Comment #12
avpadernoComment #14
avpaderno