2017 © Pedro Peláez
 

library sugarcrm-database

image

addoptify/sugarcrm-database

  • Tuesday, November 14, 2017
  • by kilhage
  • Repository
  • 2 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 2 % Grown

The README.md

Info

Enhanced database management for SugarCRM >=7.5, (*1)

Author: Emil Kilhage emilkilhage@gmail.com, (*2)

* Adds support for transactions for MySQL InnoDB
* Throws errors instead of triggering a die(); upon database errors

Installation

Install dependency

Add dependency

"require": {
    // ...
    "dri-nordic/sugarcrm-database": "~0.1.0"
    // ...
},

Update dependencies

composer update

Make sure that composer autoloading is enabled

<?php // docroot/custom/Extension/application/Ext/Utils/composer.autoloader.php

require dirname(dirname(dirname(dirname(dirname(__DIR__))))) . "/vendor/autoload.php";

Configure the manager

<?php // docroot/config_override.php

$sugar_config['dbconfig']['db_manager_class'] = 'DRI\\SugarCRM\\Component\\Database\\MySQL\\Manager';

Usage

<?php

use DRI\SugarCRM\Component\Database\TransactionalManager;

try {
    if ($db instanceof TransactionalManager) {
        $db->beginTransaction();
     }

     // Do your stuff

    if ($db instanceof TransactionalManager) {
        $db->commit();
    }
} catch (\Exception $e) {
    if ($db instanceof TransactionalManager) {
        $db->rollback();
    }

    throw $e;
}

Experimental

Don't use in production until this is more tested, (*3)

This logic hook enables support in the the api (v10) for full transaction support in all api calls by hooking in to the, (*4)

src/LogicHook/TransactionManager.php

Install this logic hook in the same path it is placed as in ./copy, (*5)

copy/custom/Extension/application/Ext/LogicHooks/dri-transaction-management.php

The Versions

14/11 2017

dev-master

9999999-dev

  Sources   Download

14/11 2017

0.2.2

0.2.2.0

  Sources   Download

29/04 2015

0.2.1

0.2.1.0

  Sources   Download

29/01 2015

0.2.0

0.2.0.0

  Sources   Download

29/01 2015

0.1.4

0.1.4.0

  Sources   Download

29/01 2015

0.1.3

0.1.3.0

  Sources   Download

15/12 2014

0.1.2

0.1.2.0

  Sources   Download

05/12 2014

0.1.1

0.1.1.0

  Sources   Download

27/10 2014

0.1.0

0.1.0.0

  Sources   Download