Meanings

The paintings I create arise in my mind and I do not always exactly how it turns out on the canvas.
It just happens. Of course, I have an idea, a thought, a memory, but how I then express it with colours is a more or less unconscious process. The picture becomes it’s meaning during the process of painting.
It is my meaning, because it is how I see the world from my subjective point of view.

I give my pictures titles that express something of what I have thought and felt while painting. I’m not sure if that’s a good idea, since I thus possibly predetermine also a certain interpretation.
Sometimes, people ask me what the image means and before I tell what it means to me, I try to figure out what the viewer sees, what emotions it evokes. And that’s mostly something quite different from the meaning I gave to the image.
For instance, in my image “Sad Memories” I have given sad memories of my life a colour. The person who bought the picture was smitten immediately with it, as for her, the painting radiates optimism and she went home with happy feelings.

Experiences have, depending on the frame of reference, a completely different meaning and are always the result of a personal, interpretive process.
Cognition is something subjective, something “Private” because we select from a set of infinitely  possible meanings one, just sufficient for ourselves. Our private view of the world is one perspective besides of an infinite number of perspectives that are not perceived.
Of course, we permanently change the meanings in our world, because the world itself changes permanently.
So it may be, that when I look in a few weeks, months or years at my pictures, I give them a completely different meaning.

Das demütige Leben eines Klammermanns am Rande des grauen Bands, das niemals endet

Ich erinnere mich nicht mehr so recht, wie das war mit den Klammermännern oder wie Frau SoSo sie nannte, es war hochphilosophisch, wir standen verabschiedend am Bahnhof in Laufenburg, mein Gefühl sagt mir, dass der Moment eine große Sache der Erkenntnis war – für mich, und wahrscheinlich auch für Frau SoSo. Abschiede sind nicht schön. … Das demütige Leben eines Klammermanns am Rande des grauen Bands, das niemals endet weiterlesen

1. What is Joomla?

As promised last week (Iron Blogger & Joomla) I’ll start to write more about Joomla! The next articles are the chapters of the book I wrote in January 2016 for the upcoming Version 3.5.

Why should I get in contact with Joomla! and what is it all about.

Joomla! is a free system for creating websites. It is an open source project, which, like most open source projects, is constantly in motion. It has been extremely successful for ten years now and is popular with millions of users worldwide. It is easy to install, easy to manage, easy to enhance and very reliable. More and more people around the globe are able to make a living by using  Joomla.

History

The word Joomla! is a derivative of the word Jumla from the African language Swahili and means “all together”. The project Joomla! is the result of a heated discussion between the Mambo Foundation, which was founded in August 2005, and its then-development team. Joomla! is a development of the successful system Mambo. Today Joomla! is used all over the world to power websites of all shapes and sizes. The Joomla! team has organised and reorganised itself throughout the last 10 years to better meet the user demands.

Joomla! Version Strategy

The version strategy of Joomla! changed over the years. Today Joomla! versions numbers are spared by dots: [major].[minor].[patch]. For example, Joomla! 3.5.0 has a major number of 3, a minor number of 5 and a patch number of 0.

  • Major release (3):
    A release which increments the major number has a predictable end of life date of two years. After each minor version the two year phase starts again. A major release indicates a break in backward compatibility.
  • Minor release (5).
    A release which increments minor number resets the two years lifetime of the major release and indicates the addition of new features or a significant change to existing features.
  • Patch release (0):
    A release which increments the patch number has no influence on the end of life date and indicates that bugs have been fixed.

The complete changes in the Joomla! 3.x series can be seen at the projects website

The smart way of Joomla

The Joomla! Project is different from other projects like Drupal or WordPress. The Joomla! project is not backed a company. The only entity that serves the financial and legal interests of the Joomla! project is Open Source Matters, a not-for-profit organisation.

It is possible to build nearly every website you can imagine using Joomla! on your own with your own knowledge spending nothing but your time, but it’s possible too to download extensions like shopping carts to build your desired website in a much shorter time. The existence of this sustainable, flexible and very diverse network of service providers based on a free and open source foundation is unique and an opportunity to every person in the world to use Joomla! as a consumer and/or a producer.

Thousands of companies around the world are developing extensions for Joomla! which you can download in a kind of app store, the Joomla! Extensions Directory. There are free and paid extensions.

Additionally the use of the Joomla! extension directory is free of charge, so the Joomla! project is the base of a vibrant community of consumers and producers of smart software.

This mindset leads to an interesting community of people, involved in the project and who are working somehow together on the project. It is always possible to contribute to the project in the way you are able and willing to.

Websites made with Joomla

All kinds of dynamic websites can be created with Joomla. These websites consists of web pages containing content such as text, images, video and audio. The pages changes or customises themselves frequently and automatically, based on certain criteria. Take the front page as an example. Usually it displays the newest articles automatically on top.
As all the sites in the world wide web are based on the same principles websites can be roughly divided in

Weblogs

A blog is a discussion or informational site consisting of articles (posts, blog entries). The most recent articles appears first.

This is an example from Brasil (Figure 1)

Figure 1: blogdopaz.com.br
Figure 1: blogdopaz.com.br

The Eiffel Tower

The Eiffel Tower is a wrought iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower. Today they are using Joomla! (Figure 2).

Figure 2: www.toureiffel.paris
Figure 2: www.toureiffel.paris

Brochure websites

A brochure website include information about a company and its products and services through text, photos, animations, audio/video and interactive menus and navigation (Figure 3)

Figure 3: solesolutions.no
Figure 3: solesolutions.no

Electronic commerce sites

A site offering goods and services for online sale and enabling online transactions for such sales (Figure 4).

Figure 5: lola-barcelona.com
Figure4: lola-barcelona.com

Gallery websites

A website designed specifically for use as a Gallery, these may be an art gallery or photo gallery and of commercial or noncommercial nature (Figure 5).

Figure 6: www.mb-photography.com
Figure 5: www.mb-photography.com

Government sites

More than 3,000 government websites around the world are built with Joomla! (Figure 6).

Figure 7: joomlagov.info
Figure 6: joomlagov.info

News sites

Similar to an information site, but dedicated to dispensing news, politics, and commentary (Figure 7).

Figure 7: magazine.joomla.org
Figure 7: magazine.joomla.org

Personal websites

Websites about an individual or a small group that contains information or any content that the individual wishes to include (Figure 8).

Figure 8: seanoshea.com.au
Figure 8: seanoshea.com.au

Cars

Peugeot is a French cars brand, part of PSA Peugeot Citroën … and they are using Joomla! (Figure 9).

Figure 9: peugeot.com
Figure 9: peugeot.com

1,000,000,000 websites

Did you ever ask yourself for the total number of Websites? There are a lot, but nobody knows the exact answer to that question.

As you may have noticed, most of the example sites are not the big fishes in the world wide web but they fulfil the needs of their creators and their clients. This does not mean, that Joomla is only useful for smaller websites, it just means that most of the websites are made with limited resources on time and budget and for that reason people often build them with open source systems like Joomla, WordPress and Drupal.
 Bigger websites like Facebook, Flickr, YouTube, Google, Apple, or Microsoft are usually not using one open source content management system for their websites. These companies usually have thousands of developers that create often hundred of websites by selecting and combining all the ideas and solutions available on the market. It is usually not about the technique, it’s more about business models and ideas.

Amateurs vs. Professionals

The above listed websites are created by people that I want to divide in amateurs and professionals.

  • Amateurs are trying to get around. They usually do not want to know one’s stuff, they are happy if succeeded.
  • Professionals try to get to the ground of what they are doing to be able to provide solutions which can be optimised over time. They try to transfer knowledge to strengthen others and build their business around the topic.

For Joomla it doesn’t matter whether you are an amateur or a professional. Both can deal with Joomla and often amateurs become professionals over time and professionals start to get more involved to make Joomla CMS and Framework better and better.
 Time for the first and the last advice in this book!

“Ignore people talking about what you have to do. Focus on moving toward what you like to do instead.”

What are the common parts in all these websites?

Even if the listed example websites are all very different, they have a few things in common:

  • they are displaying content (text, images, video, audio)
  • they have individual designs, layouts and colours. Individual doesn’t mean perfect or tasteful or artistic. It just means “individual” 🙂
  • visitors can interact in some ways with the site. Sometimes they have to create a user account in advance
  • the common static words are available in different languages, sometimes the content too.

Joomla is the glue

All these websites are based on the ideas of their creators and the almost endless possibilities of the Joomla Content Management System. In this book, I want to cover the common parts of all these websites and some examples of paid and free services to enhance the Joomla core distribution. You’ll be able to create a quite nice looking website on your own after you have read the next chapters.

And it’s up to you, whether you do it in the amateur or in the professional way 🙂


Next: 2. A fresh Joomla Installation

Get The Jab

Ladies and Gentlemen. Welcome to JandBeyong. If I could offer you only one tip to a better life, JAB would be it, the long term benefits of JAB has been proved by Joomla scientists, whereas the rest of my advice, has no basis more reliable than my own meandering experience.

Robert Deutz the organizer for Jand Beyong, in his forward says “JAB is fun-and Iam not talking about the JOSCARS, JFACTOR or the time at the bar”. He should know better, am sure he does. The theme this year was; A FAMILY GATHERING. For sure you all know what happens in family gatherings. So you all see what am talking about. I will despense this advice now.

Enjoy the power and beauty of Joomlers, well never mind……….you will not understand the power and beauty of Joomlers until it has faded, that is if it will fade. But trust me….in twenty years you’ll look back at photos of yourself and recall in a way you can’t grasp now how much possibility lay before you and how fabulous you really looked. You are not as lonely as you thought.

Fly, Not like a bird but in an aeroplane. Most JAB event are a flight away, and when I say a flight away I mean, you might be on the train or a bus or something…. but to be honest, I havent met anyone who arrived at JAB in a bicycle, but in a minute or two, the hotel will be full of people. So if you are scared of flying, atleast do one thing that scares you.

Floss, dont waste your time on Jealousy, sometimes you are at JAB, sometimes you are not, so have a good camera, a good phone and if possible a selfie stick and have a good time. Take adverntage of crowds, thats where the action is always at. Take pictures at the lobby with other Joomlers and post them on your social media and forget that you have problems-if you succed doing this, tell me how. And when you fill you have something to tell the world, blog.

Run, Join the Jrunners at the hotel lobby at 7am, you will meet some cool people who love to do what you love to do. You will run to the streets, then decide to run to the hill, to Tibidabo, it will be difficult getting to the top and some will drop out of the race and some will push on and when you finally get there, you will see a beautiful view of the city de Barcelona. You will take salfies and you will have earned your breakfast, but not until you run back to the hotel before 9am.

Learn, Attend all the keynotes, Be(e) Community by Radek Suski, A day in the life of a UX designer by Chiara Aliotta, Would it be easier if we all spoke English by Brian Teeman-am sorry, I have to write this article in English. Be at the breakout rooms, there is always a reason why they are there, just as I said, so that you can learn something. Ask question and angage the audiance and much as you can, if possible, make your contributions.

Network, Look forward to the meals, the healthy break at the lobby, with snanks and drinks and Joomlers to interact with. Sit on a table with people you dont know, or havent talked to, or people you dont like, you never know, you might start liking them. Exchange contact at the table, talk about stuff, Joomla stuff you are doing in your country, and your families too. Laugh, laugh and laugh because you never know when you will meet them again. And when you meet them again somewhere, remember their names and continue talking.

Be Crazy, Dont miss the JOSCARS and JFACTOR, I mean, dont miss those two kids. They have a way of making you realise the talents you have, it maybe shouting, making faces, singing, magic, hitting drums like Cliff or bending metals and nails. If you are crazy enough, show your bad underwear, accomblanied with your bad dancing styles but remember, you will still have tomorrow to face the same crowd. Whatever it is, you will be glad that you tried it and if you win, you will brag for a whole year.

The Bar, Know that its always open at 5pm and everybody will be waiting for that moment. The people you want to meet will be there. You will not need your wallet am sure because Jab always has it sorted. There are soft drinka too, for Joomlars who dont drink, or you can try different cocktails by yourself. You can carry your beer from home too, and brag about how good it tastes. Dont be stationary, get to different table and feel different moods of Joomlers. Some beer makes them relaxed and some, it improves their energy, but for the noise, there is nothing we can do about the noise.

Tour, Get yourself a T10 metro ticket, you will have ten rides on the metro. Tour the Arena De Barcelona, Sadrida Familia, Rambla Street or Cathedral De Barcelona. Pick the maps, read direction even if you do not follow them, ask for a toilet-in Spanish and pray that you said the right words. If you like something, take photos, they will remind you when you are back home. Value every minute, be selfish with time, yea really, its those things you cant recover when they are gone. If its summer, you will enjoy long days and off course very short nights. Remember your way back home and the time the metro will go to sleep, if you miss both, you will destroy a whole days work.

Check-out, But don’t be in a harry to leave the hotel, there is always somebody who feels they should be around for a few more hours, or even days. Trust me, you will not be alone. You will find yourself in a group of Joomlers and you will creat some awosome memories. But if your cab shows-up, just leave, you might miss your flight back home, or whatever your next destination. When you are home, you will have alot to smile about.

Remember one fact, that Joomlers will always attend JAB, it will always be fun, the keynote will be always be great, you will be allowed to be crazy at the JFACTOR and JOSCARS, you will learn, network and interact alot, there will be great meals and the beer, the beer tap will keep running. Maybe some broken bottles, or glasses, but it will be worth the lose. And you will love your family gathering.

Gracias Barcelona


Art of Resource Mobilization – Discussion

On 1st June, 2016 some headed to Hotel Africana in Kampala for the much awaited monthly gathering – Author’s Forum.

Many who haven’t attended a single of this forum don’t do because they think it’s for book writers because of it’s name. However, the lead organizer/facilitator Bake Robert Tumuhaise made clear by reflecting to God, as the Author of life. Therefore the gathering is about everyone, every single individual who does something to make sure this world is a better place.

I’m a web designer, entrepreneur and trainer and I was there as well as many other people from different walks of life; some graphics designers, some media management brands like Akiira Digital, commercial cleaning brands like NBK Cleaning International and web design brands like Gagawala Graphics, financial brands like Jubilee Insurance and Mazima Retiremement Plan (Tukereke) and a many others.

The theme was Resource Mobilization. Because many people whether youth or adults in Uganda, find it difficult to raise funds (capital) to start on their goals.

In the beginning

In fact, we kicked off, by helping advise someone called Musa, who is 55 years old, has a family of a wife and kids, he rents a house to stay, has no savings and works for the government. Musa is only 5 years to retirement. Our task was to advise him so that by the time he retires he has something to live on and sustain his family, so we got into groups and did it.

Among the advise we came up with were, help him appreciate that he is aged and about to retire, for him to think of what to do and immediately cut current expenses to save, and finally attend social and entrepreneurship forums to be inspired on how to do what he has to do.

The discussion

Authors forum
From left Jude Kalema of Jubilee Insurance, Danstun Kisuule of Y-Save and Bake Robert of World of Inspiration.

Usually at the Author’s forum there is an hour or so for guest speakers, this time it was Danstun Kisuule and Jude Kalema. Both men have a successful background. Danstun being a former engineer of National Housing but now a CEO of over UGX 10billion, Multi-purpose Savings Cooperative called Y-Save. Y-save is an acronym for Young savers association for ventures and entrepreneurs, it was started in 2000, Kampala Pentecostal Church by then, now Watoto church. And the cooperative membership is exclusive to members of Watoto church only.

Jude is the retail manager for Jubilee insurance company, which he has helped redefine insurance service in Uganda.

Lessons to go with

Danstun Kisuule shared a list of things to consider before joining a savings cooperative or group, which are Trust, Vision, Good leadership, Commitment, Governing structure, Group think and Respect distinction.

Jude Kalema, in his answer to the question, what are the top 3 mistakes done by insurance customers? he said.

  1. They don’t read policies so they end up not understanding what they sign up to.
  2. They don’t report in time; sighting a car accident as an example, many people when they knock or are knocked by someone they rash to discuss or negotiate. Instead of calling the insurer, immediately.
  3. They don’t follow up cases.

Shout out!

I’m conducting a comprehensive practical Web design training class this June, starting on 9th June up to 2nd July. The beauty about it, is that anyone who can spare time at 5pm to 7pm, only 3 times in a week, for 4 weeks you will be and can attend. David Wampamba 0704255401 WhatsApp and call.

#AuthorsForumDoItNow #WDT16


My First Exhibition

A few days ago, I had the chance to show my paintings to a wider audience.
I am a transactional analyst, counselling people to improve their personal and professional development. To further develop my professional skills in that field, I need to attend yearly workshops and seminars, given at national and international conferences by my analyst colleagues.

This year, the German transactional analysis conference took place in Hamburg and the organizers asked for artists to show their works. I applied, got accepted and thus had the opportunity to exhibit during that conference.
When I saw the list of the other exhibitors, the shock of sheer respect went through my body: my co-exhibitors were professional artists, art therapists and art educators, all somehow experts in art. Even though I saw it as a great chance to show my paintings to the more than 600 participants of that conference, I was suddenly no longer sure I should exhibit. But I dared, with success 🙂

I sold my Sad Memories to somebody who immediately got attached to the image (and did know nothing about my thought when painting it). My sad memories turned into something more delightful. It brings light and good feelings, and it has interesting structures to discover.
Few days later, I sold Deep Blue and Latvia. Both buyers said they love to dive into the colours and dream about the ocean and the forest.

I am very happy having got so much positive feedback and such recognition.

 

 

Iron Blogger & Joomla!

Last week, David Opati Aswani visited us here in Fitou, France. He is doing a lot for the Joomla project in East Africa and I met him for the first time in Bangalore, India at JWC15 (Joomla – A Social Movement In Tech Industry?). He invited me to CMSSummit 2016 in Kampala, Uganda and I enjoyed every minute. Then it happened that Jandbeyond 2016 took place in Barcelona, Spain (200km from the place where I live). Unfortunately, it was not possible for me to attend, so I was happy that David decided to visit us in our small village. We spend a few days together and it was funny, interesting, inspiring, motivating, encouraging and sometimes a bit sad, especially during a traffic stop of the Spanish police. They carried machine guns and stopped our car at the border between France and Spain. Four policemen first searched the luggage of David, then both of us and then the car. Other policemen surrounded our car. Welcome to the “new Europe” with fresh border controls!
Luckily, the rest of the stay was without these kind of incidents.

Joomla

Even if I’m not so present at Joomladays all around the world anymore, I still use the software, write some blog posts about it (in German) and try to follow the development of the Joomla project. I noticed that the community of the Joomla project became more and more a market for extension developers and template clubs and there was and still is a lot of #jpolitics. I also noticed, that the Joomla software is still very useful, easy to install and to maintain and that it’s totally possible to make a living from using Joomla for clients and/or yourself. At #jwc15 Hung Dinh from Joomlart asked me, whether I would write again a book about Joomla if he sponsors me. I agreed and started to write but then the release of Joomla 3.5 was delayed and the project stunted.

With David I talked not much about Joomla but during his stay I noticed that

African Joomla Conference
African Joomla Conference
  • CMS Summit 2017, organized by David, Shedy and Oduor will be held in Abuja, Nigeria and they are looking for sponsors – anyone?
  • David tries to organize a JoomlaDay in Somaliland and is also looking for sponsors – anyone?
  • the “official” budget of Open Source Matters for travel costs and sponsoring of Joomla days was cut (I don’t know details).
    Update: I still don’t know details but I was told I should write “appears to be under threat” instead of cut!
  • if more people could learn to develop, contribute to core, sell extensions and services it would be a good business for the individual and a good deal too for the project. For most people, Joomla is a source of income!
  • Joomla needs “fresh ideas”, people in Joomla are often very old (me included 😉 )
  • there are other CMS’s in this world (e.g. WordPress, Drupal, PageKit, Grav, List of CMS)

Important Disclaimer: These are my thoughts and interpretations. David don’t know that I write something in my blog about these topics and at the moment he is in a plane ;).

During his stay, he took a photo of some of the books I wrote between 2002-2010 and published it on his Facebook profile.

A few of my books
A few of my books

Since the release of Joomla 2.5 I published the books by myself with the help of sponsors and offered them as a free download. People like that and still until today I receive feedback. The last book was about Joomla 3 and I wrote it in 2012 (Free PDF download).

Idea

Today I brought David to the airport in Barcelona for his flight to Kenya. On the way back I thought it might be a good idea to write again about Joomla (and beyond). The “and beyond” part is important. Joomla is a good Content Management System and with a little bit of know how it is possible to build amazing websites. The more “and beyond” you know the easier it will become to earn money with Joomla!

Iron Blogger

Since last year I’m a so called Iron blogger. Iron bloggers are publishing a blog post every week and because the language I know best is German, I joined a German Iron Blogger group (Ich werde Iron Blogger :)). The basic idea is very simple. Everyone who participates needs a blog (CMS doesn’t matter). He or she has to write one blog entry per week. All the blog posts will be aggregated.
From now on, I’ll try to write about Joomla (of course in English).

If you like the idea, join me, become a Joomla Iron Blogger too and tell me about your decision in a comment 🙂

A good topic for the first entry could be

  • where do I get information about Joomla?
  • what means “and beyond”?
  • some websites made with Joomla!
  • how to publish content in Joomla, especially images?
  • how to create a template?
  • how to develop a simple component?
  • how to develop the iron blogger component 🙂

 

PHP/Drupal Code Quality Quick Wins, Part 3: Automated Validation with Git pre-commit Hooks

Even within small, closely-knit teams introducing new ways of doing things can take its time being adopted across the board. This is where having a Git-based workflow pays off: by adding a pre-commit hook in your local repository you can automatically have Git run php -l and phpcs on the files affected by your commit. If the linting or code validation check fails, the commit will be aborted.

At first this may seem an aggressive move towards the development team but once everyone sees the benefits of working with uniformly formatted, properly documented, syntax-checked and standards-validating code, they’ll wonder how they ever got things done without this in place.

Setup and usage

To implement a hook simply add a shell script with the name of the hook in your project’s .git/hooks directory. Bash, php, ruby, python… any language is ok, as long as the shell script is executable and the language is supported on your system.

# 1. Add hook in your project’s ./git/hooks directory.
$ touch precommit
 
# 2. Make sure hook is executable.
$ chmod a+x pre-commit
 
# 3. Paste in our example, fetch it from [url] or add in your own hook.

Now try to commit some non-validating code to your repository. If all goes well you’ll see the same output as if you’d run the checks manually. If you now run git status, you’ll see that your files are still staged, so the commit itself has been rolled back and you’re free to edit your code and retry the commit.

Where to go from here

There are a number of other analysis and testing tools you could integrate in your process, IDE and Git hooks. Not all of them make sense to auto-run on pre-commit though. Some scripts you’ll want to run on a test server, others on a build server… ultimately it’s up to you to see which tools fit into your process.

If you’ve got static analysis tools you integrate in your daily Drupal development process, do share!

PHP/Drupal Code Quality Quick Wins, Part 3: Automated Validation with Git pre-commit Hooks

Even within small, closely-knit teams introducing new ways of doing things can take its time being adopted across the board. This is where having a Git-based workflow pays off: by adding a pre-commit hook in your local repository you can automatically have Git run php -l and phpcs on the files affected by your commit. If the linting or code validation check fails, the commit will be aborted.

At first this may seem an aggressive move towards the development team but once everyone sees the benefits of working with uniformly formatted, properly documented, syntax-checked and standards-validating code, they’ll wonder how they ever got things done without this in place.

Setup and usage

To implement a hook simply add a shell script with the name of the hook in your project’s .git/hooks directory. Bash, php, ruby, python… any language is ok, as long as the shell script is executable and the language is supported on your system.

# 1. Add hook in your project’s ./git/hooks directory.
$ touch precommit
 
# 2. Make sure hook is executable.
$ chmod a+x pre-commit
 
# 3. Paste in our example, fetch it from [url] or add in your own hook.

Now try to commit some non-validating code to your repository. If all goes well you’ll see the same output as if you’d run the checks manually. If you now run git status, you’ll see that your files are still staged, so the commit itself has been rolled back and you’re free to edit your code and retry the commit.

Where to go from here

There are a number of other analysis and testing tools you could integrate in your process, IDE and Git hooks. Not all of them make sense to auto-run on pre-commit though. Some scripts you’ll want to run on a test server, others on a build server… ultimately it’s up to you to see which tools fit into your process.

If you’ve got static analysis tools you integrate in your daily Drupal development process, do share!

PHP/Drupal Code Quality Quick Wins, Part 2: Validating Code Standards

The Drupal project has coding standards, available at https://drupal.org/coding-standards, based on the PEAR coding standards (http://pear.php.net/manual/en/standards.php).

These code standards are a set of guidelines that cover file organisation, internal documentation, naming conventions, whitespace/indentation settings, line length, line wrapping, concatenation styles, etc. The general aim is to have a more uniform code base throughout the project, to make working with someone else’s code easier, to reduce bugs and to allow for certain automated processes such as documentation generation and patch testing.

The easiest way to start producing code that lives up to the standards is by simply having PHP_CodeSniffer (http://pear.php.net/package/PHP_CodeSniffer/docs), also often referred to as phpcs, report on the state of your code and learn from the remarks.

Phpcs simply parses any given code and basically validates it against a given set of rules. By default phpcs validates against the PEAR standard, but additional standards can be added. In our case, we will download Drupal’s coder.module (http://drupal.org/project/coder) to a central location (/opt/coder for example). Amongst other things, this module contains Drupal Code Standards integration support for phpcs, so we just need to make phpcs aware of the existence of this integration code and we’re ready to go.

Installation

# Install phpcs with PEAR.
$ pear config-set auto_discover 1
$ pear install PHP_CodeSniffer
 
# Install Drupal’s coder module.
$ cd /opt/; drush dl coder
 
# Make phpcs aware of our ‘Drupal’ code standard.
$ phpcs --config-set installed_paths /path/to/coder/coder_sniffer
 
# Optional: make the ‘Drupal’ code standard default.
# phpcs --config-set default_standard Drupal

Usage

$ phpcs —standard=drupal example.php
$ phpcs —standard=drupal —extensions=“php, module, install, inc, test” /path/to/my/code/example.php

Example output:

--------------------------------------------------------------------------------
FOUND 11 ERROR(S) AND 1 WARNING(S) AFFECTING 8 LINE(S)
--------------------------------------------------------------------------------
  2 | ERROR   | Missing file doc comment
  8 | ERROR   | Spaces must be used to indent lines; tabs are not allowed
  8 | ERROR   | Line indented incorrectly; expected 2 spaces, found 1
 10 | ERROR   | Missing function doc comment
 19 | WARNING | Line exceeds 80 characters; contains 102 characters
 19 | ERROR   | Inline comments must start with a capital letter
 19 | ERROR   | Inline comments must end in full-stops, exclamation marks, or
     |         	      | question marks
 20 | ERROR   | Missing function doc comment
 24 | ERROR   | Inline comments must start with a capital letter
 26 | ERROR   | Missing function doc comment
 26 | ERROR   | Visibility must be declared on method "tearDown"
 29 | ERROR   | Missing function doc comment
--------------------------------------------------------------------------------

Retro-actively checking a big-ish module can generate dozens if not hundreds of warnings. Don’t be discouraged: cleaning up your code is totally worth it. Trust me on this one.

IDE integration

Being able to run linters and tools like phpcs from the command line is pretty nice, but sometimes having to switch between your editor and the command line is too much of an interruption for some. Luckily, because these tools are open sourced, and open source people are awesome human beings, support and integration for these tools exists for most browsers.

Here’s a quick overview of how different IDEs integrate phpcs:

Sublime Text 2 and 3:
http://www.soulbroken.co.uk/code/sublimephpcs/

PhpStorm:
http://www.jetbrains.com/phpstorm/webhelp/using-php-code-sniffer-tool.html

Eclipse:
http://www.phpsrc.org/projects/pti-php-codesniffer/wiki/

Netbeans:
http://popthestash.com/2013/04/11/install-code-sniffer-extension-in-netb...

Have fun.