Subversion Repositories oidplus

Rev

Rev 1219 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1219 Rev 1354
Line 203... Line 203...
203
         * @param mixed|null $default
203
         * @param mixed|null $default
204
         * @return mixed|null
204
         * @return mixed|null
205
         * @throws OIDplusException
205
         * @throws OIDplusException
206
         */
206
         */
207
        public function getValue(string $name, $default=null) {
207
        public function getValue(string $name, $default=null) {
-
 
208
                if ($name == 'oidplus_private_key') {
-
 
209
                        $caller_class = debug_backtrace()[1]['class'];
-
 
210
                        if (!str_starts_with($caller_class, 'ViaThinkSoft\\OIDplus\\')) {
-
 
211
                                throw new OIDplusException(_L('Outdated plugin: Calling %1 from a plugin is deprecated. Please use %2 instead', $name, 'OIDplus::getSystemPrivateKey()'));
-
 
212
                        }
-
 
213
                }
-
 
214
                if ($name == 'oidplus_public_key') {
-
 
215
                        $caller_class = debug_backtrace()[1]['class'];
-
 
216
                        if (!str_starts_with($caller_class, 'ViaThinkSoft\\OIDplus\\')) {
-
 
217
                                throw new OIDplusException(_L('Outdated plugin: Calling %1 from a plugin is deprecated. Please use %2 instead', $name, 'OIDplus::getSystemPublicKey()'));
-
 
218
                        }
-
 
219
                }
-
 
220
 
208
                // Read all config settings once and write them in array $this->values
221
                // Read all config settings once and write them in array $this->values
209
                $this->buildConfigArray();
222
                $this->buildConfigArray();
210
 
223
 
211
                // Now we can see if our desired attribute is available
224
                // Now we can see if our desired attribute is available
212
                return $this->values[$name] ?? $default;
225
                return $this->values[$name] ?? $default;