I have these namespaces defined in my bootstrap file:
use Doctrine\Common\ClassLoader,
Doctrine\Common\Annotations\AnnotationReader,
Doctrine\ODM\MongoDB\DocumentManager,
Doctrine\ODM\MongoDB\Mongo,
Doctrine\ODM\MongoDB\Configuration,
Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
But there is an error on the first line above:
syntax error, unexpected 'Doctrine', expecting '('
7.X is supposed to have namespace support, but it's showing errors ALL throughout my project. Any idea why?
Just a thought, but do you definitely have your project configured for PHP 5.3 support? Our installation here defaults to PHP 5.2 for new projects.
Related
I am trying to use Laravel Scout Searchable into my model but it gives me an error
Undefined type 'Laravel\Scout\Searchable'.
I have already included
use Laravel\Scout\Searchable;
in the code. Could someone please tell me what am I doing wrong here?
I have followed the documentation as is until this point.
After a little bit of tinkering around I found the answer myself.
The error was produced by PHP intelliphense plugin of VS Code. It seems there is a problem with a version of the plugin I used. I downgraded my version one step and now it detects everything correctly.
I have a Laravel 5.1 install that I am upgrading. I meticulously followed the instructions available at https://laravel.com/docs/5.3/upgrade#upgrade-5.2.0 for the upgrade, including removing Illuminate\Foundation\Providers\ArtisanServiceProvider and Illuminate\Routing\ControllerServiceProvider from the config/app.php file (I am stressing this point, as googling for this issue has suggested this in every response).
Despite this, I am still getting this error when I run composer cache:clear
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Illuminate\Routing\ControllerServiceProvider' not found error
and see this error in my browser:
FatalThrowableError in ProviderRepository.php line 146:
Class 'Illuminate\Routing\ControllerServiceProvider' not found
Thinking that perhaps references to these classes were being cached, I checked bootstrap/cache/services.json and removed the references from there as well and then ran composer dump-autoload but I am still getting this error.
I also made sure to copy over example config/app.php from Laravel 5.2 clean install example here: https://raw.githubusercontent.com/ziyed/Laravel-5.2/master/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php
I have read through the similar threads on StackOverflow and Laracast and tried tried to use the advice contained inside, but nothing seems to work.
Any help would be greatly appreciated. For reference, my dev setup is running on a local XAMPP stack under a Windows 10 OS. The other environments are remote, using a traditional LAMP stack with Amazon Linux 2. I was trying to do the upgrade locally.
Illuminate\Routing\ControllerServiceProvider is not present anymore.
When I recently had to upgrade the same versions as you, I had to run composer update before and after removing Illuminate\Routing\ControllerServiceProvider::class and Illuminate\Foundation\Providers\ArtisanServiceProvider::class to make it work. Also worth to mention you need to clear bootstrap/cache. It worked for me.
Edit: i noticed now you tried the last step partially as well. You can remove all php files from cache.
I am closing this question, not because I found an answer, but because continuing down this path just didn't pass a cost/benefit analysis. After upgrading to 5.2, the next upgrade would be 5.3, and the breaking changes between 5.2 to 5.3 is a lot higher than between 5.1 to 5.2. After some thought, it was obvious that the better approach would be a fresh install on my target version, and then start porting over each module in my project by copying over the views, updating the routing, and making changes to the controllers and middleware as needed.
Or just using Laravel Shift.
Thank you to everyone who chimed in with suggestions!
I am trying to scaffold and getting following error:
There was an error running the selected code generator Method not found: 'Void EntityFrameworkCore.Design.Internal.DbContextOperations
https://learn.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db?view=aspnetcore-2.0#install-entity-framework
I suspect you are missing the assemblies that are necessary for scaffolding? I also assume you are trying to reverse engineer an existing db?
example
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
if it fails like i can't find it might be a pmc issue, try closing down VS try again. After that its probably a configuration with missing assemblies.
It may be the Microsoft.EntityFrameworkCore.Design version issue. Update it to version 2.0.3. It worked for me.
I got this error too when trying to add a new controller. The day before I had upgraded both Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Tools Nuget Packages from version 2.0.2 to 2.1.3.
Downgrading both packages to 2.0.2 allowed me to scaffold a new controller again.
Saeef's error is from trying to create CRUD razor pages, not creating the domain classes from an existing database
I had the same problem. I had two instances of VS2017 (enterprise & developer edition) for some reason I updated only one of them. The shourtcut on my desk was the 'out of date version' so I didnt figure it out until now.
I uninstalled the older, updated the other to 15.8+ and it works fine now.
Fatal error: Declaration of Zend_Pdf_FileParserDataSource_File::__construct() must be compatible with Zend_Pdf_FileParserDataSource::__construct()
My php version is 5.4
I need to know if I upgrade my php version to 5.5.this error will get solved or not?
I am not sure about this error, but perhaps you are passing some parameter in __construct() function in your magento module function and parent abstract class doesn't accept any parameters.
Upgrading PHP won't fix it. This is a bug in Zend Framework that was fixed in version 1.12. I don't use Magento but as far as I can tell it ships with version 1.11.1 (which is around three years old).
Until Magento updates, your best option is probably to apply the fix to the copy of ZF in your Magento installation. All you need to do is comment out the constructor in lib/Zend/Pdf/FileParserDataSource.php, which is this line: https://github.com/magento/magento2/blob/master/lib/Zend/Pdf/FileParserDataSource.php#L78. You will have to re-apply this fix everytime you update Magento.
I've been trying to setup SublimeLinter (Mac) but something must be going wrong as the php lint simply doesn't work. I've installed and removed the package many times, tried to add/remove support for php following different tutorials I've found but none worked. I thought Sublime packages were straight forward as installing and using. Am I missing something?
I believe Sublime sets the syntax of PHP to HTML by default. Change the syntax to PHP if you want it to lint as PHP.