Subversion Repositories oidplus

Rev

Rev 730 | Rev 1086 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 730 Rev 1050
Line 15... Line 15...
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
17
 * limitations under the License.
18
 */
18
 */
19
 
19
 
20
if (!defined('INSIDE_OIDPLUS')) die();
20
namespace ViaThinkSoft\OIDplus;
21
 
21
 
22
// OIDplusConfig contains settings that are stored in the database.
22
// OIDplusConfig contains settings that are stored in the database.
23
// Not to be confused with OIDplusBaseConfig which is the basic ("static")
23
// Not to be confused with OIDplusBaseConfig which is the basic ("static")
24
// configuration stored in userdata/baseconfig/config.inc.php,
24
// configuration stored in userdata/baseconfig/config.inc.php,
25
// e.g. database access credentials.
25
// e.g. database access credentials.
Line 70... Line 70...
70
                // Figure out if we need to create/update something at database level
70
                // Figure out if we need to create/update something at database level
71
                if (!isset($this->values[$name])) {
71
                if (!isset($this->values[$name])) {
72
                        // Case A: The config setting does not exist in the database. So we create it now.
72
                        // Case A: The config setting does not exist in the database. So we create it now.
73
                        try {
73
                        try {
74
                                OIDplus::db()->query("insert into ###config (name, description, value, protected, visible) values (?, ?, ?, ?, ?)", array($name, $description, $init_value, $protected, $visible));
74
                                OIDplus::db()->query("insert into ###config (name, description, value, protected, visible) values (?, ?, ?, ?, ?)", array($name, $description, $init_value, $protected, $visible));
75
                        } catch (Exception $e) {
75
                        } catch (\Exception $e) {
76
                                // After a software update that introduced a new config setting,
76
                                // After a software update that introduced a new config setting,
77
                                // there will be a race-condition at this place, because
77
                                // there will be a race-condition at this place, because
78
                                // jsTree and content are loading simultaneously!
78
                                // jsTree and content are loading simultaneously!
79
                                // So we ignore the error here.
79
                                // So we ignore the error here.
80
                        }
80
                        }