what is the correct workflow to upgrade an existing project/site from version 7.3.18 to 8.0 ???
i did:
modify composer.json (from ~7.3.0 to ~8.0.0 for neos/flow, welcome, behat, kickstarter and buildessentials)
composer update
./flow flow:cache:flush --force
./flow flow:core:migrate My.Package
this works fine, but then a
./flow database:setcharset
results in
Exception #1355480641 in line 392 of /var/www/…/Quickstart/Packages/Framework/Neos.Flow/Classes/Core/Booting/Scripts.php: Required class “My\Package\Command\Test2CommandController” could not be loaded properly for reflection from “My\Package\Command\Test2CommandController”.
<?php
namespace My\Package\Command;
/*
* This file is part of the My.Package package.
*/
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
/**
* @Flow\Scope("singleton")
*/
class Test2CommandController extends CommandController
{
/**
* An example command
*
* The comment of this command method is also used for Flow's help screens. The first line should give a very short
* summary about what the command does. Then, after an empty line, you should explain in more detail what the command
* does. You might also give some usage example.
*
* It is important to document the parameters with param tags, because that information will also appear in the help
* screen.
*
* @param string $requiredArgument This argument is required
* @param string $optionalArgument This argument is optional
* @return void
*/
public function exampleCommand($requiredArgument, $optionalArgument = null)
{
$this->outputLine('You called the example command and passed "%s" as the first argument.', array($requiredArgument));
}
}
does not help. the system.log tells:
“Reflected class names did not match class names to reflect”
and
"Exception in line 31 of /var/www/…/Quickstart/Packages/Framework/Neos.Flow/Classes/Reflection/ClassReflection.php: Required class “My\Package\Command\Test2CommandController” could not be loaded properly for reflection from “My\Package\Command\Test2CommandController”.
and if i remove the file Test2CommandController.php, then the next class generates this error (and so on), so maybe there is some basic setting wrong within my project?!?
UPDATE: NO, this is not the problem, i check by moving files around …
if i check the docu at Controller — Flow Framework 8.3.x documentation the file schould be Classes/Acme/Blog/Command/BlogCommandController.php, but my file is at Packages/Application/My.Project/Classes/Controller/Command/XYZCommandController.php
If youre new to php i would strongly suggest to play around with a plain composer project (composer init) and understand how autoloading via psr4 standard works.
Neos / Flow doesnt provide any own helping resources about this as this knowledge is implied.
well, the project is running with framework 7.3 during the last year, and i just tried to update the framework, and did not change the source. autoload might be the problem, but the logfiles do not help that much :(((
The paths in the documentation are outdated but ultimately not important to the example there. You should follow PSR guidelines for class loading depending on how you configured it in your packages composer.json.
I would check if your autoloading configuration is correct and uses PSR-4 autoloading standard, which would put your class in
Additionally I find this path suspicious /var/www/…/Quickstart/Packages/Framework/Neos.Flow/Classes/Core/Booting/Scripts.php
So your installation resides in /var/Quickstart/ ? That seems off.
Finally this error can happen if development happened on case insensitive filesystems and the Filename case does not exactly match the classname case, this can go unnoticed on the case insensitive filesystem would fails on a case sensitive filesystem likely on the linux I assume from the path above.
finally i decided to reinstall the environment,
composer create-project --keep-vcs neos/flow-base-distribution MyDirectory 8.0.0
and copied over the source code of my project, and with minor adjustments the project is running again :))))
so the good news are: project running
and the bad news are: no idea what caused the problem, and hopefully an update to the next versions will run smoothly now.
That sounds as if your package is not installed via composer, it should, we do not support just copying source code into an installation anymore. If this works right now that might be more luck than anything. Make sure you setup a project with DistributionPackages folder with your source in, and requiring those packages in the root composer.json if that is not the case yet.