$access_name = 'admin.plugins.module.config_module';
$path = 'admin._items.plugins._items.module._items.config';
$default_title = 'Config Module';
@param type $access_name
494046
function auto_create_parent($access_name) {
        $path = str_replace('.', '._items.', $access_name);
        $arr = explode('.', $access_name);
        $tmp = array_pop($arr);
        $default_title = ucwords(str_replace('_', ' ', $tmp));
        if (!Arr::path($this->items, $path . '.item')) {
            Arr::set_path($this->items, $path . '.item.text', $default_title);
            Arr::set_path($this->items, $path . '.item.url', '#');
        }
        if (!Arr::path($this->items, $path . '.access_name')) {
            Arr::set_path($this->items, $path . '.access_name', $access_name);
        }
    }
836875
public static function upload($file_name, $saved_file_path, $uploaded_file_type_limit = null, $uploaded_file_size_limit = null, $uploaded_file_ext_limit = null)
    {
        $storage = new \Upload\Storage\FileSystem($saved_file_path);
        $file = new \Upload\File($file_name, $storage);

        // Optionally you can rename the file on upload
        /**
 * @var IdGenerator $idGenerator 
*/
        $idGenerator = IdGenerator::component();
        $new_filename = $idGenerator->generate();
        $file->setName($new_filename);

        // Validate file upload
        // MimeType List => http://www.iana.org/assignments/media-types/media-types.xhtml
        $validations = [];
        if ($uploaded_file_type_limit) {
            //You can also add multi mimetype validation
            $validations[] = new \Upload\Validation\Mimetype($uploaded_file_type_limit);
        }
        if ($uploaded_file_size_limit) {
            // Ensure file is no larger than 5M (use "B", "K", M", or "G")
            $validations[] = new \Upload\Validation\Size($uploaded_file_size_limit);
        }
        if ($uploaded_file_ext_limit) {
            $validations[] = new \Upload\Validation\Extension($uploaded_file_ext_limit);
        }
        if ($validations) {
            $file->addValidations($validations);
        }

        // Access data about the file that has been uploaded
        $data = array(
            'name'       => $file->getNameWithExtension(),
            'extension'  => $file->getExtension(),
            'mime'       => $file->getMimetype(),
            'size'       => $file->getSize(),
            'md5'        => $file->getMd5(),
            'dimensions' => $file->getDimensions()
        );

        // Try to upload file
        try {
            // Success!
            $file->upload();
            return ['result' => 'success', 'new_name' => $new_filename, 'data' => $data];
        } catch (\Throwable $e) {
            // Fail!
            $errors = $file->getErrors();
            return ['result' => 'failed', 'errors' => $errors];
        }
    }
502148
function getAccessType()
    {
        if (!$this->_c__accMode instanceof AccessMode)
            $this->_c__accMode = new AccessMode;

        $this->assertMetaData();
        $mode = $this->getMetaKey('mode');
        if ($mode !== null)
            $this->_c__accMode->fromString($mode);

        return $this->_c__accMode;
    }
144956
public function setDefaultAccessToken($accessToken)
    {
        if (is_string($accessToken)) {
            $this->defaultAccessToken = new AccessToken($accessToken);
        }
        if ($accessToken instanceof AccessToken) {
            $this->defaultAccessToken = $accessToken;
        }

       // throw new \InvalidArgumentException('Токен ключ по умолчанию должен быть типа string или \Steein\SDK\Authentication\AccessToken');
    }
279226
function _get_plugin_filepath($type, $name)
	{
		$_params = array('type' => $type, 'name' => $name);
		require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
		return smarty_core_assemble_plugin_filepath($_params, $this);
	}
360993
private function assertField(string $name)
    {
        if (!$this->hasField($name)) {
            throw new AccessException(sprintf(
                "No such property '%s' in '%s', check schema being relevant",
                $name,
                get_called_class()
            ));
        }
    }
545956
private function get_config( $config_name ) {
		// Check that we have our config_name defined in our config
		if ( isset( $this->config[ $config_name ] ) !== true ) {
			throw new \Exception(
				'No "' . $config_name . '" config set. I don\'t know what to load!'
			);
		}
		else {
			// If its set, just hand it over
			return $this->config[ $config_name ];
		}
	}
117361
public static AccessType getAccessType(final String _name)
        throws CacheReloadException
    {
        final Cache<String, AccessType> cache = InfinispanCache.get()
                        .<String, AccessType>getCache(AccessType.NAMECACHE);
        if (!cache.containsKey(_name)) {
            AccessType.getAccessTypeFromDB(AccessType.SQL_NAME, _name);
        }
        return cache.get(_name);
    }
160776
public function delete($dir, $path, $name, $type = 'file'){
    if ( ($cfg = $this->dir($dir)) &&
      ($root = $this->get_root_path($dir))
    ){
      $is_file = $type === 'file';
      $wtype = $is_file ? 'file' : 'directory';
      $delete = [];
      if ( !empty($cfg['tabs']) ){
        foreach ( $cfg['tabs'] as $t ){
          if ( empty($t['fixed']) ){
            $real = $root . $t['path'];
            if ( dirname($path) !== '.' ){
              $real .= dirname($path) . '/';
            }
            if ( $is_file ){
              foreach ( $t['extensions'] as $e ){
                $tmp = $real . $name . '.' . $e['ext'];
                if ( file_exists($tmp) && !\in_array($tmp, $delete) ){
                  array_push($delete, $tmp);
                  if ( $t['url'] === 'php' ){
                    $del_perm = $tmp;
                  }
                }
              }
            }
            else {
              $real .= $name;
              if ( file_exists($real) && !\in_array($real, $delete) ){
                array_push($delete, $real);
                if ( $t['url'] === 'php' ){
                  $del_perm = $real;
                }
              }
            }
          }
        }
      }
      else {
        $real = $root . $path;
        if ( file_exists($real) ){
          array_push($delete, $real);
        }
      }
      $files = [];
      // Remove permissions
      if ( !empty($del_perm) ){
        $this->delete_perm($del_perm, $type);
      }
      foreach ( $delete as $d ){
        if ( $is_file ){
          // Add it to files to be closed
          array_push($files, $this->real_to_url($d));
          // Delete file
          if ( !unlink($d) ){
            $this->error("Impossible to delete the file $d");
            return false;
          }
          // Remove file's options
          $this->options->remove($this->options->from_code($this->real_to_id($d), $this->_files_pref()));
        }
        else {
          $f = $this->rem_dir_opt($d);
          $files = array_merge($files, $f);
          // Delete directory
          if ( !bbn\file\dir::delete($d) ){
            $this->error("Impossible to delete the directory $d");
            return false;
          }
        }
      }
      return ['files' => $files];
    }
    return false;
  }
438887
public function urlFor($path, $type_name = 'asset', array $params = array())
    {
        switch ($type_name) {
            case 'asset':
                return $this->container->getRequest()->getRootUri() . $path;
                break;
            case 'route':
                $routeUrl = $this->container->getRequest()->getRootUri($this->getSetting('debug')) . $this->container->getRoute($path)->getPatternUri();
                return (!empty($params)) ? $routeUrl . '?' . http_build_query($params) : $routeUrl;
                break;
        }
    }
734271
protected static function _find_module($name = null)
	{
		$files = array();

		if ($name)
		{
			// find a module
			foreach (\Config::get('module_paths') as $m)
			{
				$found = new \GlobIterator($m.$name.DS.\Config::get('migrations.folder').'*_*.php');
				if (count($found))
				{
					foreach($found as $file)
					{
						$files[] = $file->getPathname();
					}
					break;
				}
			}
		}
		else
		{
			// find all modules
			foreach (\Config::get('module_paths') as $m)
			{
				$found = new \GlobIterator($m.'*'.DS.\Config::get('migrations.folder').'*_*.php');
				foreach($found as $file)
				{
					$files[] = $file->getPathname();
				}
			}
		}

		return $files;
	}
866419
function get_section_names($file_name)
	{
		$file_name = $this->_config_path . $file_name;
		if (!isset($this->_config_data[$file_name])) {
			$this->_trigger_error_msg("Unknown config file '$file_name'");
			return;
		}

		return array_keys($this->_config_data[$file_name]["sections"]);
	}
93487
public function get($module, $name, $default)
    {
        $index = 0;

        if ($this->has($module, $name, $index)) {
            return $this->data[$index][ConstProviderInterface::CONFIG_PARAM_VALUE];
        } else {
            return $default;
        }
    }
1078811
public function setAccess($keyType = null, $accessMask = 0)
    {
        $this->keyType = in_array(
            ucfirst(strtolower($keyType)),
            array('Account', 'Character', 'Corporation')
        ) ? $keyType : null;
        $this->accessMask = (int)$accessMask;
    }
560804
private function setAccess($accessType, $userId, $allowed)
    {
        if ($userId instanceof AVUser)
        {
            $userId = $userId->getObjectId();
        }
        if ($userId instanceof AVRole)
        {
            $userId = "role:" . $userId->getName();
        }
        if (!is_string($userId))
        {
            throw new AVException("Invalid target for access control.");
        }
        if (!isset($this->permissionsById[$userId]))
        {
            if (!$allowed)
            {
                return;
            }
            $this->permissionsById[$userId] = array();
        }
        if ($allowed)
        {
            $this->permissionsById[$userId][$accessType] = true;
        } else
        {
            unset($this->permissionsById[$userId][$accessType]);
            if (empty($this->permissionsById[$userId]))
            {
                unset($this->permissionsById[$userId]);
            }
        }
    }
186868
protected function ___getterSetterCheckAccess ($type, $name)
    {
        // Check for explicit definition
        if (isset($this->_getterSetterAccessMap)) {
            if (array_key_exists($name, $this->_getterSetterAccessMap)) {
                if (array_key_exists($type, $this->_getterSetterAccessMap[$name])) {
                    return $this->_getterSetterAccessMap[$name][$type];
                }
            }
        }

        // Check for default privilege setting
        $typeUcf = ucfirst($type);
        $defaultAccessPropertyName = "_getterSetterDefault{$typeUcf}Allow";
        if (isset($this->{$defaultAccessPropertyName})) {
            return $this->{$defaultAccessPropertyName};
        }

        // Otherwise return default sensible answer (write no, read yes)
        if ('read' == $type) {
            return true;
        } else {
            return false;
        }
    }
536538
public function grant(string $type, string $name,
                          int $mode = WebAclRule::READ) {
        $this->checkParam($type, $mode);
        $fedora = $this->res->getFedora();

        $curMode   = array(WebAclRule::NONE);
        $matches   = array();
        $modeMatch = null;
        foreach ($this->resRules as $i) {
            $iMode = $i->getMode();
            if ($i->hasRole($type, $name)) {
                $matches[] = $i;
                $curMode[] = $iMode;
            }
            if ($iMode === $mode) {
                $modeMatch = $i;
            }
        }
        $curMode = max($curMode);

        if ($mode > $curMode) {
            foreach ($matches as $i) {
                $i->deleteRole($type, $name);
            }
            if ($modeMatch) {
                $modeMatch->addRole($type, $name);
            } else {
                $rule = new WebAclRule($fedora);
                $rule->setMode($mode);
                $rule->addResource($this->res);
                $rule->addRole($type, $name);
                if (self::$autosave) {
                    $rule->save($this->res->getAclUrl());
                }
                $this->resRules[] = $rule;
            }
            if (self::$autosave) {
                foreach ($matches as $i) {
                    $rule->save($this->res->getAclUrl());
                }
            }
        }
    }