Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible [Bug] Workbench Package #6

Closed
raftalks opened this issue Jan 11, 2013 · 7 comments
Closed

Possible [Bug] Workbench Package #6

raftalks opened this issue Jan 11, 2013 · 7 comments

Comments

@raftalks
Copy link
Contributor

I have fresh installation of L4 beta.
Created a workbench package.
Applied composer update to the package.
Registered the Package Service Provider in App/Config file.
Refreshed home page and got this error.

ReflectionException: Class translator does not exist
in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Container/Container.php line 274
at ReflectionClass->__construct('translator') in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Container/Container.php line 274
at Container->build('translator', array()) in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Container/Container.php line 218
at Container->make('translator', array()) in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php line 261
at Application->make('translator') in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Container/Container.php line 401
at Container->offsetGet('translator') in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php line 77
at ServiceProvider->package('raftalks/assets') in /Users/raf/Sites/hbt2013/L4/app/workbench/raftalks/assets/src/Raftalks/Assets/AssetsServiceProvider.php line 21
at AssetsServiceProvider->register() in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php line 230
at Application->register(object(AssetsServiceProvider)) in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php line 67
at ProviderRepository->load(object(Application), array('Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\CommandCreatorServiceProvider', 'Illuminate\Foundation\Providers\ComposerServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Log\LogServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Database\MigrationServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Foundation\Providers\PublisherServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Database\SeedServiceProvider', 'Illuminate\Foundation\Providers\ServerServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Foundation\Providers\TinkerServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Illuminate\Workbench\WorkbenchServiceProvider', 'Raftalks\Assets\AssetsServiceProvider')) in /Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Foundation/start.php line 184
at require('/Users/raf/Sites/hbt2013/L4/app/vendor/laravel/framework/src/Illuminate/Foundation/start.php') in /Users/raf/Sites/hbt2013/L4/app/start.php line 59
at require_once('/Users/raf/Sites/hbt2013/L4/app/start.php') in /Users/raf/Sites/hbt2013/L4/app/public/index.php line 53

I think this is happening because the translator is trying to load the language files from the lang directory of the package when it is empty.

When I removed the package lang directory which gives a temporary solution. I am not sure but I think this is the problem.

@flaviozantut
Copy link
Contributor

I'm having the same problem.

@raftalks
Copy link
Contributor Author

I am assuming the Translation package of illuminate needs some adjustment to solve this problem.

@taylorotwell
Copy link
Member

OK, the problem is I need to make the package call from the boot method and not the register method. The issue you're running into is the TranslationServiceProvider hasn't been registered yet.

@taylorotwell
Copy link
Member

Fixed.

@jasonlewis
Copy link
Contributor

Digging this up again @taylorotwell... What would you suggest people do if they need configuration available during the register process? Because you can't bootstrap a package (just the lang side of it anyway) from the register() method should people be registering the service within the boot() if they need configuration. Or should they just use $this->app['config']->package() to do the config side manually in the register() method if they need to.

Cheers.

@franzliedke
Copy link
Contributor

I'm confused, Jason. Shouldn't the config provider be registered before all those service providers?

@raftalks
Copy link
Contributor Author

@jasonlewis I see you have a point and I like to to say that I am using boot method as suggested by Taylor for now but using $this->app['config']->package() sounds good to me.

KluVerKamp added a commit to KluVerKamp/framework that referenced this issue Aug 29, 2015
Lately, I have upgraded my website from L 4.2.11 to the latest one. The Encryption cipher used before was MCRYPT_RIJNDAEL_128 which uses an IV with a length of 32. Since the payload in the cookies in users was encrypted using the old cipher, the EncryptCookies middleware threw an exception with this trace:

```
production.ERROR: exception 'ErrorException' with message 'openssl_decrypt(): IV passed is 32 bytes long which is longer than the 16 expected by selected cipher, truncating' in /home/www/MY/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:95
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'openssl_decrypt...', '/home/www/...', 95, Array)
laravel#1 /home/www/MY/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php(95): openssl_decrypt('Dbyr0401XlXcY6N...', 'AES-256-CBC', 'VyZn2WxfW9UgMrI...', 0, 'h\x82\x9Co\t\x9Fqx\\\x84\x8B\x16\x8B\x82P...')
laravel#2 /home/www/MY/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(95): Illuminate\Encryption\Encrypter->decrypt('eyJpdiI6ImFJS2N...')
laravel#3 /home/www/MY/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(76): Illuminate\Cookie\Middleware\EncryptCookies->decryptCookie('eyJpdiI6ImFJS2N...')
laravel#4 /home/www/MY/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Cookie\Middleware\EncryptCookies->decrypt(Object(Illuminate\Http\Request))
laravel#5 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
laravel#6 /home/www/MY/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
laravel#7 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
laravel#8 /home/www/MY/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
laravel#9 /home/www/MY/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
laravel#10 /home/www/MY/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
laravel#11 /home/www/MY/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
laravel#12 {main} 
```
This commit will allow the the decrypt method to handle non `Illuminate\Contracts\Encryption\DecryptException` exceptions. Since sometimes that class can't cover all the decryption issues since cookies can be set from other third parties in the browser.
@qindj qindj mentioned this issue Jan 12, 2021
TomHAnderson pushed a commit to TomHAnderson/laravel-framework that referenced this issue Dec 13, 2021
…egistration-test-names

Changed test names to camelCase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants