通过一个完整的类命名来生成一个对象，然后放入内存池
PS：如果给生成对象的构造函数传参数，必须以数组的形式
@param $alias 别名/类完整名
@param null $namespace 类完整名/当$alias为类完整名时，也可以为构造参数
@param array $args 生成对象的构造参数
@return mixed
@throws \ReflectionException
779288
public static function object($alias,$namespace=null,$args=[]) {
        if (isset(self::$pool[$alias])) {
            return self::$pool[$alias];
        }

        //object('dao','\app\Name',[]);3
        //object('dao','\app\Name');2

        //object('\app\Name',[]); 2
        //object('\app\Name');  1

        if($namespace == null) {
            $namespace = $alias;
        }
        elseif(is_array($namespace)) {
            $args = $namespace;
            $namespace = $alias;
        }

        $constructor = static::make($namespace,$args);
        /*
        $reflect = new \ReflectionClass($namespace);
        $constructor = $reflect->getConstructor();
        if (!$constructor || $constructor->getNumberOfParameters() == 0) {
            $constructor = $reflect->newInstance();
        }
        else {
            $constructor = $reflect->newInstanceArgs($args);
        }
        */
        //固化
        if(in_array($alias,Config::$o->pool)) {
            self::$solidify[$alias] = $constructor;
        }
        return self::$pool[$alias] = $constructor;
    }
1244140
public function load(string $alias): ?bool
    {
        if (\strpos($alias, self::FACADE_NAMESPACE) === 0) {
            return $this->loadFacade($alias);
        }

        if (isset($this->aliases[$alias])) {
            return \class_alias($this->aliases[$alias], $alias);
        }

        return null;
    }
210992
public static function table($alias = null)
    {
        $className = get_called_class();
        $tableKey = $className . ($alias ? ':' . $alias : '');
        $table = &self::$tables[$tableKey];
        if (null !== $table) {
            return $table;
        }
        /*
        if (isset(self::$settingColumns[$tableKey])) {
            throw new Exception('Already setting columns');
        }
        $columns = new \stdClass();
        self::$settingColumns[$tableKey] = $columns;
        unset(self::$settingColumns[$tableKey]);
        */
        $schemaName = Utils::fromCamelCase(str_replace('\\', '', $className));
        $table = new Table(null, self::getDatabase($className), $schemaName);
        $table->entityClassName = $className;
        $table->alias = $alias;
        static::setUpColumns($table->columns);
        static::setUpTable($table, $table->columns);

        return $table;
    }
1102281
public function setAlias($alias) {
    if (is_string($alias)) {
      $alias = new TokenNode(T_STRING, $alias);
    }

    if ($alias instanceof TokenNode) {
      if ($this->hasAlias()) {
        $this->alias->replaceWith($alias);
      }
      else {
        $this->alias = $alias;
        $this->addChild(WhitespaceNode::create(' '));
        $this->addChild(Token::_as());
        $this->addChild(WhitespaceNode::create(' '));
        $this->addChild($alias, 'alias');
      }
    }
    elseif ($alias === NULL && $this->hasAlias()) {
      $this->alias->previousUntil(Filter::isInstanceOf('\Pharborist\Namespaces\NameNode'))->remove();
      $this->alias->remove();
      $this->alias = NULL;
    }
    else {
      throw new \InvalidArgumentException();
    }

    return $this;
  }
916486
public function loadAliasesFrom($path, $namespace, $key = 'aliases')
    {
        // Get the alias loader
        $loader = Loader::getInstance();

        // Prepare key for config line
        $key = ! is_null($key) ? '.' . $key : null;

        // Wrapped in a try catch because Finder squawks when there is no directory
        try{

            // Load the namespaced config files
            $files = Finder::create()->files()->name('*.php')->in($path);
            foreach($files as $file)
            {
                // Construct the config line where aliases are defined
                $filename = basename($file->getRealPath(), '.php');
                $line = $namespace . '::' . $filename . $key;

                // Load each of the aliases
                $aliases = config($line, []);
                foreach( $aliases as $alias => $class)
                {
                    $loader->alias($alias, $class);
                }
            }

        // Silently ignore Finder exceptions
        } catch( InvalidArgumentException $e){}
    }
425885
public static function getAlias(string $alias): string
    {
        // empty OR not an alias
        if (!$alias || $alias[0] !== '@') {
            return $alias;
        }

        if (isset(self::$aliases[$alias])) {
            return self::$aliases[$alias];
        }

        list($root) = \explode('/', $alias, 2);
        if (!isset(self::$aliases[$root])) {
            throw new \InvalidArgumentException('The set root alias does not exist，alias=' . $root);
        }

        $rootPath  = self::$aliases[$root];
        $aliasPath = \str_replace($root, '', $alias);

        return $rootPath . $aliasPath;
    }
286914
public function makeInstance(string $namespace, $arguments = [])
    {
        if (!class_exists($namespace)) {
            throw new ContainerException(sprintf('Class "%s" not exists.', $namespace));
        }
        $class = $this->getClassNameFromNamespace($namespace);

        if ($this->has($class)) {
            return $this->get($class);
        }

        return $this[$class] = new $namespace($arguments);
    }
868101
private function getCacheConfig(string $alias): ?string
    {
        //读配置文件 ,可以不指定
        $config = configDefault([], 'tablecache');
        foreach ($config as $type => $tables) {
            if ($tables == $alias) {
                return $type;
            }

            if (is_array($tables)) {
                foreach ($tables as $table) {
                    if ($table == $alias) {
                        return $type;
                    }
                }
            }
        }
        return null;
    }
1039377
public function globalise($alias = null)
    {
        if (!is_null($alias)){
            if (substr($alias, 0, 1) != '\\')
                $alias = '\\' . $alias;
            if (class_exists($alias))
                throw new \Exception('Class already exists!');
            class_alias(get_class($this), $alias);
        }
        self::$instance = $this;
    }
322652
public static function instanceExists($alias = null)
	{
		if('' === static::$driverName)
		{
			static::init();
		}
		return isset(self::$instances[static::$driverName][null === $alias ? self::defaultAlias() : $alias]);
	}
424630
public static function create(...$args) {
        $alias = get_called_class();

        $config = end($args)?:[];
        $class = self::parse($alias,$config);

        return Pool::make($class,$args);
    }
1079800
public function resolveNamespaceAlias(string $alias)
    {
        foreach ($this->namespaces as $namespace) {
            list($className, $aliasTo) = $namespace;

            if (false == strpos($alias, $aliasTo)) {
                if (!empty($aliasTo)) {
                    $alias = substr($alias, strlen($aliasTo) + 1);
                }

                return $this->getClassForNamespaceAlias($className.'\\'.$alias);
            }
        }

        return false;
    }
1331001
public static function getInstance($alias = null)
	{
		if('' === static::$driverName)
		{
			static::init();
		}
		if(null === $alias)
		{
			$alias = self::defaultAlias();
		}
		if (isset(self::$instances[static::$driverName][$alias]))
		{
			return self::$instances[static::$driverName][$alias];
		}
		else
		{
			$option = Config::get('@.APP_' . strtoupper(static::$driverName) . '.' . $alias);
			if(false === $option)
			{
				return null;
			}
			else
			{
				return self::create($option,$alias);
			}
		}
	}
150139
public function add(Command $command, string $alias = '', bool $default = false): self
    {
        $name = $command->name();

        if ($this->commands[$name] ?? $this->aliases[$name] ?? $this->commands[$alias] ?? $this->aliases[$alias] ?? null) {
            throw new InvalidArgumentException(\sprintf('Command "%s" already added', $name));
        }

        if ($alias) {
            $command->alias($alias);
            $this->aliases[$alias] = $name;
        }

        if ($default) {
            $this->default = $name;
        }

        $this->commands[$name] = $command->version($this->version)->onExit($this->onExit)->bind($this);

        return $this;
    }
655739
public function getByAlias($alias, array $data = [])
    {
        $pattern = null;
        foreach ($this->_patterns as $_pattern) {
            if ($_pattern[5] == $alias) {
                $pattern = $_pattern;
                break;
            }
        }
        if ($pattern == null) {
            return null;
        }

        /**
         * 没有指定数据则会直接返回原始路由信息
         */
        if (!$data) {
            return $pattern[3];
        }

        foreach ($data as $key => $val) {
            $data[':' . $key] = $val;
            unset($data[$key]);
        }
        $url = str_replace(array_keys($data), array_values($data), $pattern[3]);
        /**
         * 替换掉占位符格式限制字符串
         */
        $formatLimit = array_map(function ($item) {
            return '@' . $item;
        }, array_keys($this->regexps));
        $url = str_replace($formatLimit, '', $url);
        return $url;
    }
279753
public function toPhpString(
        $namespace,
        array $aliased_classes,
        $this_class,
        $php_major_version,
        $php_minor_version
    ) {
        $nullable = false;

        if (!$this->isSingleAndMaybeNullable()
            || $php_major_version < 7
            || (isset($this->types['null']) && $php_minor_version < 1)
        ) {
            return null;
        }

        $types = $this->types;

        if (isset($types['null'])) {
            unset($types['null']);

            $nullable = true;
        }

        if (!$types) {
            return null;
        }

        $atomic_type = array_values($types)[0];

        $atomic_type_string = $atomic_type->toPhpString(
            $namespace,
            $aliased_classes,
            $this_class,
            $php_major_version,
            $php_minor_version
        );

        if ($atomic_type_string) {
            return ($nullable ? '?' : '') . $atomic_type_string;
        }

        return null;
    }
1255985
public function getPath(string $alias = null, array $params = []): string
    {
        if (empty($alias)) {
            $routerConfig = $this->router->getConfiguration();
            $alias = "{$routerConfig->getDefaultController()}:{$routerConfig->getDefaultAction()}";
        }

        return $this->router->getQuery($alias, $params);
    }