drupal developer london

Deploying Drupal projects: git + capistrano

 

removing some folders from git, file .gitignore with these contents:

 

# Ignore paths that contain generated content.

cache/

files/

sites/*/files

sites/*/private

 

 

 

Using symbolic links for /files directory:

 

 

namespace:custom do

    task:symlink do

      run "ln -s /var/www/crucerista/sites/crucerista.net/files/ /var/www/crsta/current/sites/crucerista.net/"

      run "echo 'finished'"

    end

end

after "deploy","custom:symlink"

 

 

Related links:

Similar technique, but aplied to Rails apps: http://www.practicalecommerce.com/blogs/post/468-Creating-Symlinks-When-Deploying-a-Rails-Application

Another idea, File Transfer actions in Capistrano: http://www.simonecarletti.com/blog/2009/02/capistrano-uploads-folder/

 

Optimizing a Drupal database: improving the performance

That is what you have when you don't optimize and maintenance properly your Drupal projects. A 4GB database which hits hugely the server performance. Just a couple of "magic tricks" and .... 194MB.

Magic? Not at all. If you have a problem with your server, with hangs up and things going very sloooow, check the cache. sessions and watchdog tables, and clear them.

It works like a charm :-)

Howto patch a Drupal module

Some contributtion to add to this Drupal module with which you have been working on?

Very easy, take note:

 

  1. Go to the folder of your module, previously cloned with git. For example, my contribution this morning: 
  2. git clone --recursive --branch 7.x-1.x http://git.drupal.org/project/cpn.git
  3. cd cpn
  4. Create a new branch, for example: git branch 1912834-weight
  5. Change to this branch to make the changes: git checkout 1912834-weight
  6. Make your changes
  7. Add them with: git add your-file-modified
  8. Commit them, git commit -m "comment your changes as much as possible"
  9. Create your new patch: git diff 7.x-1.x > cpn-weightsettings-1912834.patch
  10. That's it :-)

 

More info:

 

 

Drupal maintenance tasks

 

How important is having a database optimized. Doing some "basic" optimizations like clearing the cache, runing the Drupal cron and a couple of things more, your database can change from having 4 GB to just around 200MB... incredible? Not at all, the importance of maintenance tasks :-)

Which tasks? Mainly:

 

  • Clean / truncate the sessions table. This table can grow up to several millions of registers. 
  • Carefull with the spammers. Your comment table can grow up to similar amounts if too many spammers take a look at you. If the problem is big, simply delete with phpmyadmin:
  • delete from comments where status = '1';  // unpublished comments
  • delete from comments where status = '0';  // all published comments

 

 

Related @links:

 

Drupal developer links of the week (01-02-2013)

Some interesting links that I have found this week.

Problems in which i've been involved this week:

Drupal Sprint London January 2013

After a nice day knowing new people and mainly learning, this is my contribution to the community in this first Drupal Sprint in London:

Doesn't seems too much, mainly because i've learned more than what i've really being able to give.

Documentation and tools which I've found useful:

 

Others:

 

Howto contributing a module to Drupal

 

,

 

  1. Think in some interesting project, and build your module,
  2. If you didn't, create a Drupal user, and a new sandbox for your module(s). Follow this instructions and commit your first lines of code http://drupal.org/node/1068950
  3. Work in your project, and when you are happy to publish your first stable release, go to the next step.
  4. Help the community, doing some reviews of other modules (3 at least): http://drupal.org/project/issues/search/projectapplications?status[]=2&status[]=7 (more info here: http://drupal.org/node/1410826)
  5. Create a new project aplication: http://drupal.org/project/issues/projectapplications

 

 

 

 

Drupal developer in London

My name is Alejandro Moreno Lopez. I'm an spanish developer living in London, degree in Computer Science, who has specialized in PHP and Drupal development.