How to cut dependency between nette/bootstrap and robotLoader

Notice: This thread is very old.
Jan Endel
Member | 1026
+
0
-

Hi there, i have these composer.json:

"require": {
  "php": ">= 5.5.0",
  "nette/utils": "@dev",
  "tracy/tracy": "@dev",
  "nette/neon": "@dev",
  "nette/finder": "@dev",
  "nette/di": "@dev",
  "kdyby/console": "~2.3@dev",
  "nette/bootstrap": "@dev"
},

and i want to use classical bootstrap, but when I try launch console command i get Fatal error: Class 'Nette\Loaders\RobotLoader' not found in .. but i don`t want it in my project. Whole autoloading is composer thing. I made a little research and i found – bootstrap has this row in default configuration:

public $defaultExtensions = array(
		'application' => array('Nette\Bridges\ApplicationDI\ApplicationExtension', array('%debugMode%', array('%appDir%'))),

second param is scanDir for robot loader, so my question is – Is there any way to disable it, not by replacing application extension in config.neon like this?

extensions:
	application: MyApp\DI\MyAppExtension
enumag
Member | 2128
+
0
-
$configurator = new \Nette\Configurator();
$configurator->defaultExtensions = []; // or maybe add ExtensionsExtension
// ...

Comments

Jan Endel:

Aah its public property, never mind :-). Thanks.

5 years ago
Jan Tvrdík
Nette guru | 2563
+
0
-

Does the following work in config.neon?

application:
	scanDir: []

Comments

David Grudl:

It should be scanDir!: []

5 years ago