TinyAuth\Utility\Utility::deconstructIniKey PHP Метод

deconstructIniKey() публичный статический Метод

Deconstructs an authentication ini section key into a named array with authentication parts.
public static deconstructIniKey ( string $key ) : array
$key string INI section key as found in authentication.ini
Результат array Array with named keys for controller, plugin and prefix
    public static function deconstructIniKey($key)
    {
        $res = ['plugin' => null, 'prefix' => null];
        if (strpos($key, '.') !== false) {
            list($res['plugin'], $key) = explode('.', $key);
        }
        if (strpos($key, '/') !== false) {
            list($res['prefix'], $key) = explode('/', $key);
        }
        $res['controller'] = $key;
        return $res;
    }

Usage Example

Пример #1
0
 /**
  * Deconstructs an ACL INI section key into a named array with ACL parts.
  *
  * @param string $key INI section key as found in acl.ini
  * @return array Array with named keys for controller, plugin and prefix
  */
 protected function _deconstructIniKey($key)
 {
     return Utility::deconstructIniKey($key);
 }