Zurmo – How the Source Code is Organized – Part 3

In previous posts on this topic we learned how to locate and distinguish between the official Zurmo remote source code repository on Bitbucket, and the source code that is running on your hosted installation, or instance of Zurmo CRM. We also reviewed two different ways that you can browse the Zurmo file structure. In this post, you get a reference, “cheat-sheet” which describes the purpose of each of the directories in the Zurmo file system.

Starting from the root of your zurmo installation: (~/www/zurmo/ on Arvixe)

.
|-- app                    # The application root
|                             a.k.a. INSTANCE_ROOT
|                        
| |-- assets               #  Contains minified javascript
| |                           no need to touch this directory.
| |
| |             
| |-- protected            # The bulk of the Zurmo core
| | |                        Zurmo application code, and also
| | |                        your custom modules. See note below.
| | |
| | |-- commands           # Contains console utility commands.
| | |
| | |-- config             # Contains the configuration files
| | |                        and templates.
| | |
| | |-- core               # Contains Zurmo core code. 
| | |                        See below for more information.
| | |
| | |-- data               # Used for staging data for migrations
| | |                        Rarely used.
| | |
| | |-- extensions         #  3rd party libraries, like amcharts
| | |                         each extension in it's own folder.
| | |
| | |-- messages           # Contains language translation files.
| | |
| | |-- modules            # Contains Zurmo and Custom modules
| | |
| | |-- runtime            # Contains the runtime logs
| | |
| | |-- tests              # Contains directories for 
| |                          /common /functional /unit testing.
| |                          these tests are for Zurmo core and 
| |                          Zurmo configuration. You should never
| |                          need to change these. However you may
| |                          want to run these tests on their own.
| | 
| |-- themes               # Contains css files for theme-ing
| | |                         each theme in it's own folder.
|   |
|   |-- default            # you can add your "custom.css" here.
|                            Zurmo will automatically minify your
|                            file and include your changes.
|
|
|-- redbean                # Contains RedBean PHP library
|                            for database abstraction. 
|                            no need to touch this directory.
|
|-- yii                    # Contains Yii framework. 
                             no need to touch this directory

First, we need to explain the difference between the Zurmo “core” and the rest of the Zurmo code that lives outside the core. This is often confusing to new Zurmo administrators and developers. Because a lot of what you and I might consider “core” functionality is actually in /app/protected/modules and elsewhere – not only in /protected/core.

It’s my opinion, this design was either a brilliant stroke of genius or a bit of an oversight when the Zurmo architects first came up with the file system directory layout. protected/core certainly does contain common code, used in all Zurmo modules, but so does /protected/modules/zurmo. Furthermore all of the security related code as well as the application view code is also located outside protected/core. One theory has it that “protected/core” actually was the seed code from prior projects, on top of which the Zurmo CRM application is built. That would lead one to suppose that possibly other types of applications besides CRM could leverage the same code in “protected/core“. Sounds intriguing, but probably not likely. The bottom line is that any Zurmo developer or administrator should be aware that code used by more than one module may be spread out in different areas of the file structure, so don’t rely on instinct alone when you are looking for a bug or when you need to review or leverage some of the common functionality Zurmo provides.

Next we’ll take a deeper dive into the /app/protected/modules directory and review the anatomy of a module.

(c) 2014 Windsor Wallaby. All rights reserved.

Tags: , , , , , , , , , , , , , , , , | Posted under Zurmo | RSS 2.0

Author Spotlight

Windsor Wallaby

Windsor Wallaby

Windsor Wallaby is an independent and enthusiastic Zurmo CRM supporter and Open Source contributor. Active on the Zurmo user forums and a regular personality on the weekly Zurmo developer's conference call, Windsor is committed to building helping relationships by Listening, Learning, Doing, and Sharing. Windsor works with Zurmo CRM daily to track business opportunities and contacts. Windsor also integrates Zurmo as a core platform component for in-house and bespoke IT development projects.

Leave a Reply

Your email address will not be published. Required fields are marked *


− 4 = 4

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>