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

Laravel 9 Update #1413

Merged
merged 65 commits into from
Mar 14, 2022
Merged

Laravel 9 Update #1413

merged 65 commits into from
Mar 14, 2022

Conversation

nabeelio
Copy link
Owner

@nabeelio nabeelio commented Feb 22, 2022

Upgrade Guide

  • WITH THIS UPDATE, PHPVMS NOW REQUIRES PHP 8.0+
  • Please read through the Laravel Upgrade Guide - there are some settings that are moved/deprecated, and they may apply to you, if you have customized those settings
  • The SMTP stream options like verify_peer have moved to the root of the SMTP settings. See the Laravel upgrade guide, under "SMTP Stream Options"
  • Any modules/themes will need to be updated for casting fuel and other types properly (see notes below)
  • The captcha has been changed to use hCaptcha

Notes

  • laravel-gamp (google analytics) removed a) library version incompatible b) wanting to remove google analytics from being included because of gdpr, etc
  • Fuel/distance are being properly casted now the Fuel and Distance styles, so usages of those need to be updated, so something like $pirep->fuel_used->internal([rounding]) to get the value. There are several methods: internal() gets the unit in its internal storage format, local() to the unit that the user has selected to view them as, in the admin panel. Both methods take an optional rounding value

Template Changes

Task List

@FatihKoz
Copy link
Contributor

FatihKoz commented Mar 9, 2022

Fresh install with php8.1.3 is not possible, below exception occurs.

image

[2022-03-09 17:35:35] dev.INFO: Redirecting to database setup  
[2022-03-09 17:35:35] production.ERROR: Attribute value must be of type bool for selected attribute, string given {"exception":"[object] (TypeError(code: 0): Attribute value must be of type bool for selected attribute, string given at D:\\Projects\\v7\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connectors\\Connector.php:70)
[stacktrace]
#0 D:\\Projects\\v7\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connectors\\Connector.php(70): PDO->__construct('mysql:host=127....', 'root', '', Array)
#1 D:\\Projects\\v7\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connectors\\Connector.php(46): Illuminate\\Database\\Connectors\\Connector->createPdoConnection('mysql:host=127....', 'root', '', Array)
#2 D:\\Projects\\v7\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connectors\\MySqlConnector.php(24): Illuminate\\Database\\Connectors\\Connector->createConnection('mysql:host=127....', Array, Array)

@FatihKoz
Copy link
Contributor

FatihKoz commented Mar 9, 2022

Fresh install with php8.0.16 works fine.

@FatihKoz
Copy link
Contributor

FatihKoz commented Mar 10, 2022

Exporting expenses still do not work

image

image

Re-Create;

  • Fresh install
  • Add a new test expense
  • Try to export

@nabeelio nabeelio changed the title Laravel 9 Update (WIP) Laravel 9 Update Mar 11, 2022
@FatihKoz
Copy link
Contributor

Testing the branch on my live site, with flights and daily ops.

This error shows up every 5 mins on my laravel log.

[2022-03-13 17:20:02] prod.ERROR: Class "PDO" not found {"exception":"[object] (Error(code: 0): Class \"PDO\" not found at /vendor/laravel/framework/src/Illuminate/Database/Connection.php:1470)

PDO Error.txt

Trying to figure out what it can be, cron or a module or something else ? Not much clues in the error and stack trace below.

@FatihKoz
Copy link
Contributor

And this is the last entry from my cron log, this makes me think that above PDO error is somehow related with cron.

[2022-03-13 13:20:02] prod.ERROR: Command "version" is not defined.

Did you mean one of these?
    phpvms:version
    session:table {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"version\" is not defined.

Did you mean one of these?
    phpvms:version
    session:table at /vendor/symfony/console/Application.php:683)
[stacktrace]
#0 /vendor/symfony/console/Application.php(259): Symfony\\Component\\Console\\Application->find()
#1 /vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun()
#2 /vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
#3 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
#4 /bin/cron(25): Illuminate\\Foundation\\Console\\Kernel->handle()
#5 {main}

@FatihKoz
Copy link
Contributor

FatihKoz commented Mar 13, 2022

I think the cron error is related to this 'cause it is the only piece of code, running a version command every time cron runs

https://github.com/nabeelio/phpvms/blob/Laravel9/bin/cron#L21-L26

$status = $kernel->handle(
    $input = new Symfony\Component\Console\Input\ArrayInput([
        'command' => 'version',
    ]),
    new Symfony\Component\Console\Output\NullOutput()
);

@nabeelio
Copy link
Owner Author

PDO is a PHP class from the PDO driver, maybe something not configured right with the command line PHP? That command throwing an error is strange though, I'll look

@FatihKoz
Copy link
Contributor

This is what I got at cpanel for php8.1

image

Looks like I have every extension we need there and enabled.

@FatihKoz
Copy link
Contributor

[2022-03-13 18:00:06] prod.INFO: Hourly: Removing expired Simbrief entries

Cron started working again, that suggestion provided with the error worked :) And no repeating errors in laravel log on every cron run.

@FatihKoz
Copy link
Contributor

Also saw this with Discord Notifications

image

Notice the difference in distance, either it is not sending 0 km or we have an unnecessary / there. Before (with latest dev build) notification was like below

image

@nabeelio nabeelio merged commit 1284809 into dev Mar 14, 2022
@nabeelio nabeelio deleted the Laravel9 branch March 14, 2022 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants