Ejemplo n.º 1
0
 public static function getEntryPointInstance()
 {
     if (!EntryPoint::isCreated()) {
         $logger = new NullLogger();
         EntryPoint::createInstance(new SugarApp($logger, getenv('SUGARCLI_SUGAR_PATH')), '1');
     }
     return EntryPoint::getInstance();
 }
Ejemplo n.º 2
0
 public function getEntryPointInstance()
 {
     if (!EntryPoint::isCreated()) {
         $logger = new NullLogger();
         EntryPoint::createInstance(new SugarApp($logger, getenv('SUGARCLI_SUGAR_PATH')), '1');
         $this->assertInstanceOf('Inet\\SugarCRM\\EntryPoint', EntryPoint::getInstance());
     }
     return EntryPoint::getInstance();
 }
Ejemplo n.º 3
0
 public function getEntryPointInstance()
 {
     if (!EntryPoint::isCreated()) {
         $logger = new NullLogger();
         EntryPoint::createInstance(new Application($logger, getenv('SUGARCRM_PATH')), getenv('SUGARCRM_CURRENT_USER_ID'));
         $this->assertInstanceOf('Inet\\SugarCRM\\EntryPoint', EntryPoint::getInstance());
     }
     return EntryPoint::getInstance();
 }
Ejemplo n.º 4
0
 public function testCreateTwice()
 {
     $first = $this->getEntryPointInstance();
     $second = EntryPoint::createInstance(new Application(new NullLogger(), $first->getPath()), '1');
     $this->assertEquals($first, $second);
 }
Ejemplo n.º 5
0
 /**
  * Set the LogPrefix to be unique and ask for an Entry Point to SugarCRM
  *
  * @param EntryPoint $entryPoint Enters the SugarCRM Folder
  * @param DB         $db         Get the SugarCRM DB and make queries
  */
 public function __construct(EntryPoint $entryPoint)
 {
     $this->logPrefix = __CLASS__ . ': ';
     $this->log = $entryPoint->getLogger();
     $this->currentUser = $entryPoint->getCurrentUser();
     $this->beanList = $entryPoint->getBeansList();
     $this->db = new DB($entryPoint);
 }