Skip to content

Instantly share code, notes, and snippets.

@maranemil
maranemil / gist:fd6cd302dcd8485aba04
Last active August 29, 2015 14:09
SugarCRM 6.5 performance optimization tuning
<?php
/***CONFIGURATOR***/
$sugar_config['js_custom_version'] = '';
$sugar_config['list_max_entries_per_page'] = '15';
$sugar_config['default_module_favicon'] = false;
$sugar_config['dashlet_auto_refresh_min'] = '30';
$sugar_config['show_download_tab'] = true;
$sugar_config['enable_action_menu'] = true;
$sugar_config['stack_trace_errors'] = false;
@maranemil
maranemil / gist:2671a143d951c410528a
Last active August 29, 2015 14:09
SugarCRM 6.5 allow access to specific pages
<?php
// avoids the Cross-site forgery attack blocker
$sugar_config['http_referer']['list'][] = 'localhost';
$sugar_config['http_referer']['actions'] = array( 'index', 'ListView', 'DetailView', 'EditView', 'Authenticate', 'Login' );
// or
$sugar_config['http_referer']['list']['0'] = 'localhost';
$sugar_config['http_referer']['actions']['0'] = 'index';
$sugar_config['http_referer']['actions']['1'] = 'ListView';
@maranemil
maranemil / gist:2ca296457c9d9fd993a1
Last active August 29, 2015 14:09
SugarCRM 6.5 config_override add new settings on install
<?php
if(!defined('sugarEntry')) define('sugarEntry', true);
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/entryPoint.php');
global $db;
global $moduleList;
/////////////////////////////////////////////////////////////////////////////////
@maranemil
maranemil / gist:8a9a2f8b7bd944898604
Last active August 29, 2015 14:09
SugarCRM 6.5 config_override remove settings on uninstall
<?php
if(!defined('sugarEntry')) define('sugarEntry', true);
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/entryPoint.php');
//global $db;
//global $moduleList;
@maranemil
maranemil / gist:31fdad589da707f302f5
Last active August 29, 2015 14:10
SugarCRM get version of installed packages
<?php
/**
* Created by PhpStorm.
* User: emil
* Date: 21.11.14
* Time: 12:05
*/
if(!defined('sugarEntry'))define('sugarEntry', true);
require_once('include/entryPoint.php');
@maranemil
maranemil / gist:83a0a55ddba7bd8da213
Last active August 29, 2015 14:10
SugarCRM On Demand Settings
<?php
/*
Module Loader Restriction Alternatives
http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_7.2/70_API/Application/Module_Loader/20_Module_Loader_Restriction_Alternatives/
Module Loader Restrictions
http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/02_Application_Framework/Module_Loader/00_Module_Loader_Restrictions/
@maranemil
maranemil / gist:b2d9f8359264e1316e24
Last active August 29, 2015 14:10
SugarCRM Boosting Config
<?php
/***CONFIGURATOR***/
$sugar_config['admin_access_control'] = false;
$sugar_config['admin_export_only'] = true;
$sugar_config['cache_dir'] = 'cache/';
$sugar_config['calculate_response_time'] = false;
$sugar_config['dbconfigoption']['persistent'] = false;
$sugar_config['dbconfigoption']['autofree'] = false;
@maranemil
maranemil / gist:f44564b52d3aa9c3fc66
Last active August 29, 2015 14:10
Debug in SugarCRM
<?php
// most entry points have this, except soap.php
// require_once ('log4php/LoggerManager.php'); # deprecated
require_once('include/SugarLogger/LoggerManager.php');
$GLOBALS['log'] = LoggerManager::getLogger('SugarCRM');
// depending on what your log level is set at in log4php.properties
$GLOBALS['log']->fatal(msg);
$GLOBALS['log']->debug(msg);
@maranemil
maranemil / gist:2ddc545ca94c3d75b8ff
Created December 9, 2014 09:17
Clean Lamp Log File on Ubuntu 14.10
sudo find / -name '*' -size +1G
sudo truncate -s0 error_log
@maranemil
maranemil / gist:9852c2b307438893bc21
Created December 10, 2014 09:41
SugarCRM htaccess with new expires rules - boost speed
RewriteEngine on
# BEGIN SUGARCRM RESTRICTIONS
RedirectMatch 403 (?i).*\.log$
RedirectMatch 403 (?i)/+not_imported_.*\.txt
RedirectMatch 403 (?i)/+(soap|cache|xtemplate|data|examples|include|log4php|metadata|modules)/+.*\.(php|tpl)
RedirectMatch 403 (?i)/+emailmandelivery\.php
RedirectMatch 403 (?i)/+upload/
RedirectMatch 403 (?i)/+custom/+blowfish
RedirectMatch 403 (?i)/+cache/+diagnostic