š¾ Sugar 12 (Q2 2022) directory structure
What is in all of these directories and should I care?
As I teach new Sugar developers, it is important to have a frame of reference where to find Sugarās core code and where we as developers are allowed to add or update functionality. Immediately after installing Sugar, our file system has a plethora of directories and files. Ā The following is a brief explanation of what types of files can be found in each directory.
api
This is an old deprecated directory. There is not much to look at in here. This directory points to files that no longer exist
bin
In here you will find access to the command-line executable sugarcrm. The command-line program provides a lot of features to access and rebuild full-text search. This is extendable and we wil be leveraging this in future post.
cache
This directory is where much of the runtime of the application is downloaded to the browser or the mobile app. This directory stores metadata, languages, javascript, controllers, and views that have been converted from various files into a single runtime file.
clients
Definitions of Sidecar layouts, views, controllers, and fields. This is a very important directory and has great examples of how to build our future customizations.
custom
This is our directory. We will spend 95+ percent of our time as a developer in this folder. This folder will contain all of our customizations, logic, etc.
data
This directory contains files related to Sugars Model. Ā You will find information about SugarBean as well as how relationships are connected to the SugarBean
dist
Code used internally by SugarCRM to support the use of Sugar Identity Manager
etc
A directory that contains some files for Unit Tests. These arenāt the droids you are looking forā¦. Obi-Wan Kenobi
examples
This is an old deprecated directory. There is not much to look at here. The files in this directory have not changed in about 10 years.
This directory contains old SOAP examples on how to connect external sources to Sugar.
Ext
Leveraging the extension framework, you will find some out of the box LogicHooks and ScheduledTasks
features
Internal directory for SugarCRM that describes some of the features of the CRM application.
gulp
An additional directory that is for internal use by SugarCRM and does not provide anything for us as developers.
include
A portion of the backend framework can be found in this directory. A large portion of this directory is dedicated to supporting Backward Compatibility
install
Used to install Sugar, once installed the files in this directory are unused
jssource
A legacy folder that contains helper files for use with JavaScript. The use of the files in this folder will be transparent to use a developer
metadata
This directly contains ājoin tableā definitions. Ā For example the definition of the accounts_contacts table
mobile
Provides the ability to view Sugar as āmobileā in the browser. This directory has been depreciated and SugarCRM has indicated that they will be removing the ability to view Mobile within the browser in a future release. Instead, use the Sugar Mobile App from either the App Store or the Google Play Store
modules
This directory defines each Module (i.e., Object) used within Sugar. Within each sub-folder, you will find details about each Model, View, and Controller specific to that Module. Examples include Accounts and Contacts
ModuleInstall
Utilized by Upgrade Wizard, Module Loader, and silentUpgrader to update the Sugar environment
portal2
If you are using Sugar Enterprise or Sugar Serve a Customer Portal is available for use within Sugar. The files in this directory enable the portal
service
A legacy folder that contains deprecated WebServices. This folder contains the definitions of both the deprecated REST and SOAP functionality.
This directory should be ignored you should be us using the modern RESTFul API!
sidecar
Contains the entire source code for the Sidecar framework. This directory is useful to understand how Sidecar functions.
soap
This is an old deprecated directory. There is not much to look at in here. The files in this directory have not changed in about 10 years.
A deprecated version of the SOAP WebServices.
src
Sugar legacy code is mostly kept in the include directory. This directory contains all of the newer updated code that makes up the backend of Sugarsā Framework.
styleguide
Used in several different ways
You can access Sugarsā design guide by accessing http://<SUGARCRM>/#Styleguide
There are assets such as CSS, LESS, and Images that are used within the application.
themes
This directory contains both current and deprecated files. Files here include application bootstrap files such as CSS, images, and fonts.
Many of the files in this folder are legacy and are maintained for Backward Compatability such as Studio, Module Builder, Drop Down Editor, etc.
upgrade
Files leveraged by the UpgradeWizard when performing upgrades to the application
upgrades
Information about files pertaining to Module Loadable Packages (e.g., MLPs) is stored in this directory.
upload
Within Sugar, there are a number of ways where a file, attachment, or image can attach to a record. This folder stores all of these files.
vendor
Sugar leverages a number of open-source projects. The vendor directory contains the source code for each of these projects. Some of the projects found here are:
"beberlei/assert": "^2.9.9",
"doctrine/dbal": "^2.13.2",
"ezyang/htmlpurifier": "^4.12",
"ext-openssl": "*",
"ext-zip": "*",
"google/apiclient": "2.10.1",
"league/oauth2-client": "2.2.1",
"monolog/monolog": "1.22.0",
"moontoast/math": "1.1.0",
"nikic/php-parser": "^4.10",
"wikimedia/less.php": "v3.1.0",
"parsecsv/php-parsecsv": "^1.2",
"phpmailer/phpmailer" : "v6.5.0",
"psr/log": "1.1.3",
"psr/simple-cache": "^1.0",
"ramsey/uuid": "3.8.0",
"ruflin/elastica" : "^7.0.0",
"aws/aws-sdk-php": "3.183.13",
"sugarcrm/identity-provider": "2.2.2",
"guzzlehttp/guzzle": "6.3.3",
"smarty/smarty": "^3.1.39",
"symfony/cache": "v3.4.47",
"symfony/console": "v3.4.47",
"symfony/security-core": "v3.4.47",
"symfony/security-csrf": "v3.4.47",
"symfony/translation": "v3.4.47",
"symfony/validator": "^v3.4.47",
"symfony/process": "v3.4.47",
"symfony/http-kernel": "v3.4.47",
"tedivm/jshrink": "v1.4.0",
"vanderlee/php-stable-sort-functions": "2.0.5",
"ultra-lite/container": "6.2.0",
"laminas/laminas-mail": "^2.14.0",
"microsoft/microsoft-graph": "^1.33.0"