TODO

@param $name
182739
private function instanceCache($name)
    {
        self::$cache = new $name();
        self::$cache->connect($this->getConfig());
    }
552313
public function remove($name)
    {
        if (!isset($this->indexed[$name])) {
            return;
        }
        unset($this->indexed[$name]);

        foreach ($this->items as $i => $v) {
            if ($v === $name) {
                unset($this->items[$i]);
            }
        }
    }
1297883
protected function markChanged($name)
    {
        $diffVar = &$this->changedData;
        foreach (explode('.', $name) as $namePart) {
            if (!isset($diffVar[$namePart])) {
                $diffVar[$namePart] = [];
            }
            $diffVar = &$diffVar[$namePart];

            // Already diffed
            if ($diffVar === true) {
                return;
            }
        }
        // Mark changed
        $diffVar = true;
    }
334476
public function typeExist($name)
    {
        $type = $this->type->findOneBy(['name' => $name]);

        if (is_object($type)) {
            return true;
        }

        return false;
    }
42317
public function make( $name ) {
		$this->name = ucfirst( camel_case( $name ) );
		$this->createController();
		$this->createContract();
		$this->createRequests();
	}
107299
public function uninstall($name)
    {
        if (!isset($this->items[$name]))
        {
            $this->load($name);
        }
        if (isset($this->items[$name]))
        {
            /** @var Eresus_Plugin $plugin */
            $plugin = $this->items[$name];
            $plugin->uninstall();
        }
        $item = Eresus_CMS::getLegacyKernel()->db->selectItem('plugins', "`name`='".$name."'");
        if (!is_null($item))
        {
            Eresus_CMS::getLegacyKernel()->db->delete('plugins', "`name`='".$name."'");
        }
        //$filename = filesRoot.'ext/'.$name.'.php';
        //if (file_exists($filename)) unlink($filename);
    }
289762
public function listen($name)
    {
        if(!isset($this->providersDeferred[$name]))
            return;

        $this->register(new $this->providersDeferred[$name]);

        unset($this->providersDeferred[$name]);
    }
364449
public function profileEnd($name)
    {
        if (!is_string($name) || empty($name) || empty($this->_profileStacks)) {
            return;
        }

        if (!empty($this->_profileStacks[$name])) {
            $this->profile($name, microtime(true) - $this->_profileStacks[$name]);
        }
    }
289825
public function start($name) {

        if (!isset($this->blocks[$name])){
            $this->blocks[$name] = [];
        }

        \ob_start();
    }
1275449
public function setName( $name )
	{
		if ( $name == $this->getName() ) { return; }

		$this->_values['name'] = (string) $name;
		$this->setModified();
	}
1085272
public function clear($name)
    {
        if (!in_array($name, $this->clearedCookies, true)) {
            $this->clearedCookies[] = $name;
            foreach ($this->cookies as $index => $value) {
                if ($value->getName() === $name) {
                    unset($this->cookies[$index]);
                }
            }
            $this->cookies = array_values($this->cookies);
        }
    }
1192654
public function delete($name) {

        if ( array_key_exists($name, $this->data) ) {
            unset($this->data[$name]);
            return true;
        }

        return false;

    }
907458
public function package(string $name): void
    {
        $files = $this->app->make('files');

        if (\method_exists($this->app, 'vendorPath')) {
            $vendorPath = \rtrim($this->app->vendorPath(), '/');
        } else {
            $basePath = \rtrim($this->app->basePath(), '/');
            $vendorPath = "{$basePath}/vendor";
        }

        $paths = [
            "{$vendorPath}/{$name}/resources/database/migrations/",
            "{$vendorPath}/{$name}/database/migrations/",
            "{$vendorPath}/{$name}/migrations/",
        ];

        foreach ($paths as $path) {
            if ($files->isDirectory($path)) {
                $this->run($path);
            }
        }
    }
636126
public static function destroy($name)
    {
        if (is_array($name)) {
            foreach ($name as $v) {
                self::destroy($v);
            }
        } elseif (is_string($name) && self::hasTask($name)) {
            unset(self::$tasks[$name]);
        }
    }
65656
public function block($name = null)
    {
        if ($name === null) {
            $this->addBlock($this->currentBlock, ob_get_clean());
            $this->currentBlock = '';
            ob_clean();
        } else {
            $this->currentBlock = $name;
            ob_start();
        }
    }
374132
public function modifyName($name)
    {
        if (substr($name, -1) !== '.') {
            $this->attributes['name'] = $name.'[]';
        }

        parent::modifyName($this->attributes['name']);
    }
1151088
public function delete(string $name): self
    {
        if (isset($this->data[$name])) {
            unset($this->data[$name]);
        }
        return $this;
    }