+ throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your %s.php file?', $name, get_class($this)));

+ }

+

+ if (true === $first) {

+ return $this->bundleMap[$name][0];

+ }

+

+ return $this->bundleMap[$name];

+ }

+

+

+ public function locateResource($name, $dir = null, $first = true)

+ {

+ if ('@' !== $name[0]) {

+ throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));

+check(is_writable(__DIR__.'/../app/cache'), sprintf('Checking that app/cache/ directory is writable'), 'Change the permissions of the app/cache/ directory so that the web server can write in it', true);

+check(is_writable(__DIR__.'/../app/logs'), sprintf('Checking that the app/logs/ directory is writable'), 'Change the permissions of the app/logs/ directory so that the web server can write in it', true);

+check(function_exists('json_encode'), 'Checking that the json_encode() is available', 'Install and enable the json extension', true);

+check(class_exists('SQLite3') || in_array('sqlite', PDO::getAvailableDrivers()), 'Checking that the SQLite3 or PDO_SQLite extension is available', 'Install and enable the SQLite3 or PDO_SQLite extension.', true);

+check(function_exists('session_start'), 'Checking that the session_start() is available', 'Install and enable the session extension', true);

+check(function_exists('ctype_alpha'), 'Checking that the ctype_alpha() is available', 'Install and enable the ctype extension', true);

+check(function_exists('token_get_all'), 'Checking that the token_get_all() is available', 'Install and enable the tokenizer extension', true);