This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2018-09-19 on Sugar 8.0.0 | |
// | |
// CLI script to output the current record count per SQL table, in json and csv format | |
ini_set('memory_limit', '64M'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2019-01-04 on Sugar 8.0.2 | |
// | |
// CLI script to optimize Sugar mysql tables, by dropping all non-primary indices, optimizing and finally re-creating indices | |
function usage($error = '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2019-09-24 Sugar 9.0.0 | |
// create missing tables | |
function usage($error = '') { | |
if (!empty($error)) print(PHP_EOL . 'Error: ' . $error . PHP_EOL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2019-09-26 on Sugar 9.0.0 | |
// | |
// Metadata extractor, to compare 2 metadatas with a diff command | |
// eg: diff -auNw file1.array file2.array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2019-09-02 on Sugar 8.0.0 | |
// | |
// CLI script to find records with acl_team_set_id | |
function usage($error = '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2018-12-28 Sugar 8.3.0 | |
// Show last 10 commentlog entries on Cases, with the newest one at the top | |
// | |
// file: custom/Extension/modules/Cases/Ext/Vardefs/commentlog.php | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
... | |
# file path will depend on the installation path or where the file should be | |
# if this needs to be executed everywhere (even from cron), consider setting it on php.ini instead of the .htaccess | |
php_value auto_prepend_file /var/www/html/sugar/prepend.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2019-05-13 | |
// Sample of programmatic AES256GCM and blowfish encryption and decryption of secret value in Sugar | |
// secret value to encrypt for storage purposes, and to decrypt real-time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// Original work: https://gist.github.com/lblockken/78a59273f2460b36eb127a7c2ee510a1 | |
// | |
// 2017-07-31 on Sugar 7.9.1.0 with PHP 7.1 | |
// filename: custom/include/SugarXHprof/TidewaysProf.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enrico Simonetti | |
// enricosimonetti.com | |
// | |
// 2017-12-15 on Sugar 7.9.2.0 | |
// Sugar CLI command to run index processing without waiting for the scheduler | |
// | |
// Trigger reindex with: ./bin/sugarcrm search:reindex | |
// Process records by running either as a background process or with a cron: ./bin/sugarcrm elastic:process_records |