This repository was archived by the owner on Jan 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSugarInterface.php
More file actions
134 lines (123 loc) · 3.49 KB
/
SugarInterface.php
File metadata and controls
134 lines (123 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
/*
* This file is part of the Insulin CLI
*
* Copyright (c) 2008-2013 Filipe Guerra, João Morais
* http://cli.sugarmeetsinsulin.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Insulin\Sugar;
/**
* Interface for Sugar API being used by Insulin.
*
* This will allow the Sugar API and Insulin to work independently and support
* several versions as long as these methods are available on their
* implementations.
* Later we might release this interface and their implementations to be used
* by other project's that might want to integrate with SugarCRM using PHP.
*/
interface SugarInterface
{
/**
* Creates a new Sugar instance proxy to wrap all Sugar element elegantly.
*
* @param string $path
* The real path to this Sugar instance.
*
* @api
*/
public function __construct($path);
/**
* Retrieves current SugarCRM instance root directory.
*
* @return string
* Path to the current SugarCRM instance root directory.
*
* @api
*/
public function getPath();
/**
* Gets SugarCRM full version information.
*
* @param string $property
* (optional) The property to retrieve can be 'build', 'flavor' or
* 'version', defaults to the latter.
* @param bool $refresh
* (optional) `true` if we want to re-read the file, defaults to `false`.
*
* @return mixed
* SugarCRM version value according to the supplied property.
*
* @throws \InvalidArgumentException
* If unknown property supplied.
* @throws Exception\RuntimeException
* If the supplied property isn't found on this SugarCRM instance.
*
* @api
*/
public function getInfo();
/**
* Boots this Sugar instance root folder.
*/
public function bootRoot();
/**
* Boots configuration files.
*
* @param bool $refresh
* (optional) `true` if we want to re-read the configuration files,
* defaults to `false`.
*
* @return array
* An array of configuration values.
*
* @throws \RuntimeException
* If config file isn't found.
*/
public function bootConfig();
/**
* Boots database.
*
* @return PDO
* Database handler.
*
* @throws \RuntimeException
* If database config is invalid or an unsupported driver is supplied.
*/
public function bootDatabase();
/**
* Boots application.
*
* @api
*/
public function bootApplication();
/**
* Performs a local login based on supplied username.
*
* @param string $username
* (optional) Username against which the login is performed, if none
* supplied system user is used instead.
*
* @return User
* Logged in user.
*
* @throws \RuntimeException
* If login fails.
*/
public function localLogin($username);
/**
* Gets the system settings from the Administration module.
*
* @param string $category
* The category to get a slimmer payload.
* @param bool $reload
* Reload data by skipping cache.
* @return array
* All the settings cached due to bug on SugarCRM.
*
* TODO we should only get the category(ies) that we asked for.
* Currently we send information just like SugarCRM has it.
*/
public function getSystemSettings($category, $reload = false);
}