Upgrade CakePHP 1.2 to 2.4 - php

What I have :
I have cakephp application,which is in CakePHP 1.2.12.
What I tried :
I use Upgrade Plugin : https://github.com/dereuromark/cakephp-upgrade
I have followed all the step
I have download new Cakephp 2.4
I have create Plugin in folder inside app of cakephp1.3 application
rename /app/config folder to /app/Config
write CakePlugin::loadAll(); in my app/Config bootstrap
What the error :
when I try to
..\lib\Cake\Console\cake Upgrade.Upgrade all
Its give me error like
Error: Plugin Upgrade could not be found.
#0 C:\xampp\htdocs\cakephp24\lib\Cake\Core\App.php(365): CakePlugin::path('Upgrade')
#1 C:\xampp\htdocs\cakephp24\lib\Cake\Core\App.php(226): App::pluginPath('Upgrade')
#2 C:\xampp\htdocs\cakephp24\lib\Cake\Core\App.php(547): App::path('Console/Command', 'Upgrade')
#3 [internal function]: App::load('UpgradeShell')
#4 [internal function]: spl_autoload_call('UpgradeShell')
#5 C:\xampp\htdocs\cakephp24\lib\Cake\Console\ShellDispatcher.php(247): class_exists('UpgradeShell')
#6 C:\xampp\htdocs\cakephp24\lib\Cake\Console\ShellDispatcher.php(198): ShellDispatcher->_getShell('Upgrade.Upgrade')
#7 C:\xampp\htdocs\cakephp24\lib\Cake\Console\ShellDispatcher.php(66): ShellDispatcher->dispatch()
#8 C:\xampp\htdocs\cakephp24\lib\Cake\Console\cake.php(49): ShellDispatcher::run(Array)
#9 {main}

Related

Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable

I'm upgrading Laravel from 5.2 to 5.3
I followed the steps mentioned here:
https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0
When I tried to to do composer update I kept getting:
[2021-04-12 06:15:52] build.ERROR: exception 'Illuminate\Contracts\Container\BindingResolutionException' with message 'Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable.' in XXXXXXXXXXXX/admin/vendor/laravel/framework/src/Illuminate/Container/Container.php:763
#0 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Container/Container.php(644): Illuminate\Container\Container->build('Illuminate\\Cont...', Array)
#1 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\Container\Container->make('Illuminate\\Cont...', Array)
#2 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Container/Container.php(1203): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#3 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(175): Illuminate\Container\Container->offsetGet('Illuminate\\Cont...')
#4 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(144): Illuminate\Support\Facades\Facade::resolveFacadeInstance('Illuminate\\Cont...')
#5 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(231): Illuminate\Support\Facades\Facade::getFacadeRoot()
#6 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/AuthServiceProvider.php(25): Illuminate\Support\Facades\Facade::__callStatic('policy', Array)
#7 /Users/ahmad/Projects/admin/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/AuthServiceProvider.php(25): Illuminate\Support\Facades\Gate::policy('XXXXXX\\Model', 'XXXXXXX\\Polic...')
#8 /Users/ahmad/Projects/admin/app/Providers/AuthServiceProvider.php(26): Illuminate\Foundation\Support\Providers\AuthServiceProvider->registerPolicies()
#9 [internal function]: XXXXXX\Providers\AuthServiceProvider->boot()
I added the Gate to my providers array, and tried clearing the bootstrap cache folder and delete the vendor, and reinstall everything in the composer.json
Any advises?
When you upgrade from an older version of Laravel, it may contain some old files or code which are not needed. In my case, I needed to update config/app.php file as per the latest code and it fixed the error.

array_merge(): Argument #2 is not an array after adding class into providers

I am using pbmedia/laravel-ffmpeg as soon as I installed and added the providers and alias, it shows me the following error. This code was simply working on another machine
array_merge(): Argument #2 is not an array
I have tried the following things
Composer update/ and Fresh install
Cleaning the bootstrap/cache/
Checked the config file for laravel-ffmpeg it's there and fine
Publish the config file using the artisan CLI tool: php artisan vendor:publish --provider="Pbmedia\LaravelFFMpeg\FFMpegServiceProvider"
Here is the portion from laravel.log when I tried to run.
[2019-06-19 00:34:40] local.ERROR: ErrorException: array_merge(): Argument #2 is not an array in /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:59
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'array_merge(): ...', '/Users/damanmok...', 59, Array)
#1 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(59): array_merge(Array, 1)
#2 /Users/damanmokha/edetyv2/vendor/pbmedia/laravel-ffmpeg/src/FFMpegServiceProvider.php(25): Illuminate\Support\ServiceProvider->mergeConfigFrom('/Users/damanmok...', 'laravel-ffmpeg')
#3 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(565): Pbmedia\LaravelFFMpeg\FFMpegServiceProvider->register()
#4 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(74): Illuminate\Foundation\Application->register(Object(Pbmedia\LaravelFFMpeg\FFMpegServiceProvider))
#5 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(540): Illuminate\Foundation\ProviderRepository->load(Array)
#6 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders()
#7 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap(Object(Illuminate\Foundation\Application))
#8 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(267): Illuminate\Foundation\Application->bootstrapWith(Array)
#9 /Users/damanmokha/edetyv2/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(113): Illuminate\Foundation\Console\Kernel->bootstrap()
#10 /Users/damanmokha/edetyv2/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 {main}
if I don't add these providers it works fine, but then I am not able to use ffmpeg without that.
Laravel Version 5.3
pbmedia/laravel-ffmpeg 1.3
php version: 7.1

Unsupported operand types CakePHP

I have a CakePHP project running on other server PHP 5.6 but here this same app is not running on PHP 5.6 / 7.0.
I am using Croogo with CakePHP.
It's showing me debug error like below:
Error: [Error] Unsupported operand types
Stack Trace:
#0 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(282): include()
#1 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(201): CakePlugin::_includeFile('/var/www/vhosts...', true)
#2 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(121): CakePlugin::bootstrap('Acl')
#3 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(94): CakePlugin::load('Acl', Array)
#4 /Vendor/croogo/croogo/Extensions/Lib/CroogoPlugin.php(656): CakePlugin::load(Array, Array)
#5 /Vendor/croogo/croogo/Croogo/Config/croogo_bootstrap.php(126): CroogoPlugin::load(Array)
#6 /Vendor/croogo/croogo/Croogo/Config/bootstrap.php(8): require_once('/var/www/vhosts...')
#7 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(282): include('/var/www/vhosts...')
#8 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(201): CakePlugin::_includeFile('/var/www/vhosts...', false)
#9 /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(121): CakePlugin::bootstrap('Croogo')
#10 /Config/bootstrap.php(78): CakePlugin::load('Croogo', Array)
#11 /Vendor/cakephp/cakephp/lib/Cake/Core/Configure.php(98): include('/var/www/vhosts...')
#12 /Vendor/cakephp/cakephp/lib/Cake/bootstrap.php(432): Configure::bootstrap(true)
#13 /webroot/index.php(90): include('/var/www/vhosts...')
#14 {main}
It is from my tmp/logs/error.log file
Is there any fix?
Thanks in advance
Try debugging this place: /Vendor/cakephp/cakephp/lib/Cake/Core/CakePlugin.php(282): include() #1. See which file it's trying to include when failing and what's in it.

I'm trying to migrate from Cakephp 2.5 to Cakephp 3.3 but facing some issues

Error: [Cake\View\Exception\MissingTemplateException] Template file "Error\error500.ctp" is missing. #0 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\View\View.php(588): Cake\View\View->_getViewFileName('Error\error500') #1 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\ExceptionRenderer.php(366): Cake\View\View->render('error500', 'error') #2 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\ExceptionRenderer.php(333): Cake\Error\ExceptionRenderer->_outputMessageSafe('error500') #3 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\ExceptionRenderer.php(336): Cake\Error\ExceptionRenderer->_outputMessage('error500') #4 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\ExceptionRenderer.php(194): Cake\Error\ExceptionRenderer->_outputMessage('error') #5 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\ErrorHandler.php(144): Cake\Error\ExceptionRenderer->render() #6 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php(180): Cake\Error\ErrorHandler->_displayException(Object(Cake\Error\PHP7ErrorException)) #7 C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php(164): Cake\Error\BaseErrorHandler->handleException(Object(Cake\Error\PHP7ErrorException)) #8 [internal function]: Cake\Error\BaseErrorHandler->wrapAndHandleException(Object(Cake\Error\PHP7ErrorException)) #9 {main}
File C:\xampp\htdocs\mmdb11\vendor\cakephp\cakephp\src\Error\ErrorHandler.php
Line: 156
Those versions are not compatible. You could update to CakePHP 2.9.1 (or any other version in 2.x branch). CakePHP 3 uses namspaces, and a lot of code has changed.
basicly You would have to rewrite Your application to use CakePHP 3.3

PHP Fatal error Could not include the language file Opencart

I have installed opencart and I have also installed Arabic language and pavillion theme and I followed the documentation, but I get this problem:
PHP Fatal error: 'Could not include the language file /home3/smartgpt/public_html/project/catalog/language/english/default.php'
in /home3/smartgpt/public_html/project/tb_themes/pavilion/library/ResourceLoader.php:143
Stack trace:
#0 tb_themes/pavilion/library/ThemeManager.php(722): TB_ResourceLoader->loadOcTranslation('default')
#1 tb_themes/pavilion/catalog/ThemeCatalogExtension.php(302): TB_ThemeManager->loadOcTranslation()
#2 tb_themes/pavilion/catalog/ThemeCatalogExtension.php(94): Theme_Catalog_Extension->setLanguageDirection()
#3 tb_themes/pavilion/library/vendor/sfEventDispatcher.php(81): Theme_Catalog_Extension->afterRouting(Object(sfEvent))
#4 tb_themes/pavilion/library/CatalogDispatcher.php(130): sfEventDispatcher->notify(Object(sfEvent))
#5 tb_themes/pavilion/library/CatalogDispatcher.php(66): TB_CatalogDispatcher->doRouting(Object(sfEventDispatcher), Object(Request), Object(TB_ViewDataBag))
#6 tb_themes/pavilion/catalog/boot.php(48): TB_CatalogDispatcher->dispatch(Array)
#7 catalog/controller/common/tb_themes.php(32): TB_Boot::bootTheme(Object(Registry), Object(Front), 'pavilion', 0)
#8 [internal function]: ControllerCommonTbThemes->index(Array)
#9 system/modification/system/engine/action.php(65): call_user_func(Array, Array)
#10 system/modification/system/engine/front.php(42): Action->execute(Object(Registry))
#11 system/modification/system/engine/front.php(37): Front->execute(Object(Action))
#12 system/modification/system/engine/front.php(17): Front->dispatch(Object(Action), Object(Action))
#13 index.php(243): Front->addPreAction(Object(Action))
#14 {main}
Go to : /catalog/language/english/ ... Download english.php > rename to default.php > upload back to /catalog/language/english/
Because it is saying, that it could not include language file, because there is no such file in /catalog/language/english/ directory.
Helped for me.

Categories