Initiate a new ACL Container instance.

@param  string|null  $name
@param  \Orchestra\Contracts\Memory\Provider|null  $memory

@return \Orchestra\Contracts\Authorization\Authorization
194398
public function make(string $name = null, ?Provider $memory = null): AuthorizationContract
    {
        $name = $name ?? 'default';

        if (! isset($this->drivers[$name])) {
            $this->drivers[$name] = (new Authorization($name, $memory))->setAuthenticator($this->auth);
        }

        return $this->drivers[$name];
    }
663711
public static function create($name = null)
    {
        $name = $name ? $name : self::generateName();
        $container = new Container($name);
        $container->register('Container', $container);
        self::$containers[$name] = $container;
        return $container;
    }
311585
protected function initiate()
    {
        $name = $this->name;
        $data = ['acl' => [], 'actions' => [], 'roles' => []];
        $data = array_merge($data, $this->memory->get("acl_{$name}", []));
        if (empty($data['roles'])) {
            $roles         = $this->memory->get('acl_antares.roles');
            $data['roles'] = $roles == null ? [] : $roles;
        }

        $this->roles->attachKeyValuePair($data['roles']);
        $this->actions->attachKeyValuePair($data['actions']);

        foreach ($data['acl'] as $id => $allow) {
            list($role, $action) = explode(':', $id);
            $this->assign($role, $action, $allow);
        }
    }
503557
public static function runApplication($name, ClassLoader $classLoader = null)
    {
        $class = sprintf('Ftven\\Build\\Cli\\Application\\%sApplication', ucfirst($name));

        /** @var CliApplication $application */
        $application = new $class;

        if (null !== $classLoader) {
            if (method_exists($application, 'setClassLoader')) {
                $application->setClassLoader($classLoader);
            }
        }

        return $application->run();
    }
1367892
public function addFrom(string $address, ?string $name = null): Message
    {
        $this->from[] = [
            'address' => $address,
            'name'    => $name
        ];

        return $this;
    }
337070
public static function holder( $name = null ) 
	{	
		if ( !isset( $name ) ) 
		{
			$name = static::$_default;
		}
		
		if ( !isset( static::$instances[$name] ) ) 
		{
			 static::$instances[$name] = new CCAsset_Holder();
		}
		
		return static::$instances[$name];
	}
185654
public function createPolicy(
        ?PolicyCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(PolicyCreateType::class);

        return $this->formFactory->createNamed($name, PolicyCreateType::class, $data);
    }
891628
public function getProvider($name, $request)
    {
        $class = isset($this->providers[$name]) ? $this->providers[$name] : null;

        if (!$class) {
            return null;
        }

        return new $class($request, $request->input('client_id'), $request->input('client_secret'), $request->input('redirect_url'));
    }
397737
public function createProjectAsync($writerId, $name = null, $accessToken = null, $queue = 'primary')
    {
        $params = [
            'writerId' => $writerId,
            'queue' => $queue
        ];
        if ($name) {
            $params['name'] = $name;
        }
        if ($accessToken) {
            $params['accessToken'] = $accessToken;
        }
        return $this->getCommand('CreateProject', $params)->execute();
    }
1240515
public function addBcc($address, $name = null)
    {
        $current = $this->getBcc();
        $current[$address] = $name;

        return $this->setBcc($current);
    }
596366
public function create($name, $description, $privacy = self::BOARD_PRIVACY_PUBLIC)
    {
        $requestOptions = [
            'name' => $name,
            'description' => $description,
            'privacy' => $privacy,
        ];

        return $this->post(UrlBuilder::RESOURCE_CREATE_BOARD, $requestOptions);
    }
1182965
private function createServiceFromDelegator(string $name, array $options = null)
    {
        // @todo: This selection is necessary only because lazy services
        // configuration currently requires an explicit Delegator definition
        if ($this->delegators[$name][0] === Proxy\LazyServiceFactory::class) {
            return $this->createServiceFromLazyServiceDelegator($name, $options);
        }

        $creationCallback = $this->delegatorCallbackCache[$name] ?? null;
        if ($creationCallback) {
            $object = $creationCallback($this->creationContext, $name, $creationCallback, $options);
            return $object;
        }

        $creationCallback = function () use ($name, $options) {
            return $this->createServiceFromFactory($name, $options);
        };

        foreach ($this->delegators[$name] as $index => $delegatorFactory) {
            if (is_string($delegatorFactory) && class_exists($delegatorFactory)) {
                $delegatorFactory = new $delegatorFactory();
                if ($delegatorFactory instanceof DelegatorFactoryInterface) {
                    $this->delegators[$name][$index] = $delegatorFactory;
                    $creationCallback = function () use ($delegatorFactory, $name, $creationCallback, $options) {
                        return $delegatorFactory($this->creationContext, $name, $creationCallback, $options);
                    };
                    continue;
                }
            }
            if (is_callable($delegatorFactory)) {
                $creationCallback = function () use ($delegatorFactory, $name, $creationCallback, $options) {
                    return $delegatorFactory($this->creationContext, $name, $creationCallback, $options);
                };
                continue;
            }
            if (is_string($delegatorFactory)) {
                throw InvalidArgumentException::fromInvalidDelegatorFactoryClass($delegatorFactory);
            }
            throw InvalidArgumentException::fromInvalidDelegatorFactoryInstance($delegatorFactory);
        }

        //cache the callback for later requests
        $this->delegatorCallbackCache[$name] = $creationCallback;
        return $creationCallback($this->creationContext, $name, $creationCallback, $options);
    }
432559
public function viewIfCan($authorization, string $name, array $data = null)
    {
        return $this->addIfCan($authorization, View::create($name, $data));
    }
1325231
public function create(Name $name)
    {
        $factory = $this->factoryMap->hasFactory($name)
            ? $this->factoryMap->getFactory($name)
            : $this->defaultTransactionFactory;

        return new IsolateContext($name, $factory);
    }
1175482
public function get($name, $memory = false)
    {
        return $this->client->send(sprintf('/api/nodes/%s%s', urlencode($name), $memory ? '?memory=true' : ''));
    }
806863
public function bcc($address, $name = null)
    {
        if (is_array($address)) {
            $this->addAddressArray($address, 'bcc');
        } else {
            $this->bcc[$address] = $name;
        }

        return $this;
    }
1285936
public function createFromArray(array $data, $name = null)
    {
        $preloadOids = $itemList = array();
        $menu        = $this->_createFromArray($data, $name, $itemList, $preloadOids);

        if ($preloadOids && $this->aclProvider) {
            //preload all acls for menu items
            try {
                $this->aclProvider->findAcls($preloadOids);
            } catch(AclNotFoundException $e) {
            }
        }

        foreach ($itemList as $item) {
            $this->setContext($item[0], $item[1], $item[2]);
        }

        return $menu;
    }