Registers a driver, based on its factory
@param Factory $factory
177259
final public static function register(Factory $factory) {
        if(!isset(self::$factories[$factory->driver]))
            self::$factories[$factory->driver] = $factory;
    }
1340359
public function setMigrationFactory(FactoryInterface $factory)
    {
        foreach ($this->getRepositories() as $repo) {
            $repo->setMigrationFactory($factory);
        }
    }
856005
protected function registerAdapterFactory(string $name, Closure $factory): string
	{
		$this->adapterFactories[$name] = $factory;

		return $name;
	}
453768
public function registerWorker($worker): void
    {
        $this->client->sadd('workers', $worker);
        $this->client->set(
            sprintf('worker:%s:started', $worker),
            strftime('%a %b %d %H:%M:%S %Z %Y')
        );
    }
345024
protected function registerFlysystemFactory()
    {
        $this->app->singleton('flysystem.factory', function (Container $app) {
            $adapter = $app['flysystem.adapterfactory'];
            $cache = $app['flysystem.cachefactory'];

            return new FlysystemFactory($adapter, $cache);
        });

        $this->app->alias('flysystem.factory', FlysystemFactory::class);
    }
442179
public static function registerSerializerFactory($factory, string ...$contentTypes) {
    foreach ($contentTypes as $contentType) {
      self::getSerializerFactories()[$contentType] = $factory;
    }
  }
122482
public function factory(string $className, callable $factory):void
    {
        $this->config->registerClassFactory($className, $factory);
    }
1348553
@Override
    public void registerFactory(String name, Class<? extends ChannelFactory> factory) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "registerFactory: " + name + "; " + factory);
        }
        synchronized (this.factories) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Class<? extends ChannelFactory> prevFactory = this.factories.get(name);
                if (null != prevFactory && factory != prevFactory) {
                    Tr.event(tc, "WARNING: overlaying existing factory: " + prevFactory);
                }
            }
            this.factories.put(name, factory);
        } // end-sync

        // now that we have a new factory type, tell ChannelUtils to process
        // any delayed config that might be waiting for it
        ChannelUtils.loadConfig(null);
    }
544446
public function registerFactory()
    {
        $this->app->singleton('view', function ($app) {
            // Next we need to grab the engine resolver instance that will be used by the
            // environment. The resolver will be used by an environment to get each of
            // the various engine implementations such as plain PHP or Blade engine.
            $resolver = $app['view.engine.resolver'];

            $finder = $app['view.finder'];

            $factory = $this->createFactory($resolver, $finder, $app['events']);

            // We will also set the container instance on this view environment since the
            // view composers may be classes registered in the container, which allows
            // for great testable, flexible composers for the application developer.
            $factory->setContainer($app);

            $factory->share('app', $app);

            return $factory;
        });
    }
1156094
public function build($factory, $parameters) {
		$type = $this->getType($factory);

		list($reflector, $dependencies) = $this->generateReflector($type, $factory);

		$requires = $this->dispatchRequirements($dependencies, $parameters);

		if (is_callable($reflector)) {
			return call_user_func_array($reflector, $requires);
		}

		return $reflector->newInstanceArgs($requires);
	}
664640
public function validator(Factory $factory)
    {
        if (!$this->shouldBeValidated()) {
            return $factory->make([], []);
        }
        
        $rules = app()->call([$this, 'rules']);

        return $factory->make(
            $this->all(), $rules, $this->messages(), $this->attributes()
        );
    }
1316016
protected function buildFactory($factoryClass)
    {
        $factory = $factoryClass::newInstance();
        $factory->setConfig($this->config);
        $factory->validateConfig();

        return $factory;
    }
411503
public function withFactory($factory)
    {
        if (!is_callable($factory)) {
            throw new \InvalidArgumentException("Factory isn't callable");
        }
        
        $runner = clone $this;
        $runner->factory = $factory;
        
        return $runner;
    }
1235961
protected function factory(Factory $factory)
	{
		$factory->setLogger($this->getLogger());

		return $factory->setFactoryManager($this);
	}
1362067
protected function registerModelFactory()
    {
        $this->app->singleton(ModelFactory::class, function ($app) {
            return new ModelFactory(
                $app->make('db'),
                $app->make(Filesystem::class),
                new Classify(),
                new Config($app->make('config')->get('models'))
            );
        });
    }
973378
public function setEntityFactory(EntityFactory $factory = null)
    {
        if ($factory === null) {
            $factory = new Entity();
        }
        $this->factory = $factory;
        return $this;
    }
393000
protected function registerPathMappings($factory)
    {
        $assetPath = $this->app->__invoke(PathFinder::class)->to('assets');

        $factory->map('css', $assetPath->absolute('css'), $assetPath->url('css'));
        $factory->map('js', $assetPath->absolute('js'), $assetPath->url('js'));
    }