typerocket icon indicating copy to clipboard operation
typerocket copied to clipboard

support for PHP 8.1

Open str opened this issue 3 years ago • 6 comments
trafficstars

I wanted to make:plugin. Before making the plugin there was no $overrides folder, so I pointed both vars to the same typerocket folder. This ran fine, but after creating the plugin, the system crashed if I ran the galaxy command again.

$  ./galaxy 
Whoops\Exception\ErrorException: strtolower(): 
Passing null to parameter #1 ($string) of type string is deprecated in file 
web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/core/src/Elements/BaseForm.php on line 59

Stack trace:
  1. Whoops\Exception\ErrorException->() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/core/src/Elements/BaseForm.php:59
  2. strtolower() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/core/src/Elements/BaseForm.php:59
  3. TypeRocket\Elements\BaseForm->__construct() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/core/src/Utility/Helper.php:175
  4. TypeRocket\Utility\Helper->form() web/app/plugins/maphpia-om/app/MaphpiaOmTypeRocketPlugin.php:21
  5. MaphpiaOm\MaphpiaOmTypeRocketPlugin->init() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/professional/src/Register/BasePlugin.php:57
  6. TypeRocketPro\Register\BasePlugin->__construct() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/professional/src/Register/BasePlugin.php:31
  7. TypeRocketPro\Register\BasePlugin->new() web/app/plugins/maphpia-om/maphpia-om.php:39
  8. typerocket_plugin_maphpia_om() web/wp/wp-includes/class-wp-hook.php:307
  9. WP_Hook->apply_filters() web/wp/wp-includes/class-wp-hook.php:331
 10. WP_Hook->do_action() web/wp/wp-includes/plugin.php:476
 11. do_action() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/core/src/Core/System.php:78
 12. TypeRocket\Core\System->TypeRocket\Core\{closure}() web/wp/wp-includes/class-wp-hook.php:307
 13. WP_Hook->apply_filters() web/wp/wp-includes/class-wp-hook.php:331
 14. WP_Hook->do_action() web/wp/wp-includes/plugin.php:476
 15. do_action() web/wp/wp-settings.php:576
 16. require_once() web/wp-config.php:9
 17. require_once() web/wp/wp-load.php:55
 18. require() web/app/mu-plugins/typerocket/typerocket/vendor/typerocket/core/src/Console/GalaxyConsoleLauncher.php:64
 19. TypeRocket\Console\GalaxyConsoleLauncher->__construct() galaxy:20

This is solved if I point $overrides to the plugin we created BUT it does not make sense if I want to have multiple typerocket-based plugins.

str avatar Aug 17 '22 16:08 str

Hey @str

When creating custom plugins you do not need to use override folders if you are using the make:plugin command. The command will generate a PHP class that will handle your needs for routes, views, models, controllers, and such. Keep in mind the overrides folder is for site-wide settings and there can only be one config, app, and other folder pre-project.

kevindees avatar Aug 17 '22 20:08 kevindees

I now better understand how things work...at least a bit. This error happens when you run galaxy with PHP 8.1. This does not happen if you use PHP 8.0

str avatar Aug 17 '22 23:08 str

Hey @str

TypeRocket does not yet have full support for PHP 8.1. However, we are working to be ready with PHP 8.1. There are several changes that need to be made for 8.1 to be fully supported and we also need some of the packages like Whoops PHP to gain support as well.

kevindees avatar Aug 18 '22 01:08 kevindees

@kevindees Whoops was replaced by Laravel for ignition which is full PHP 8.1 compatible.

str avatar Aug 18 '22 01:08 str

@str is there a none Laravel version? I have seen this but I'm not aware of a framework agnostic version.

kevindees avatar Aug 18 '22 01:08 kevindees

@kevindees checking the github discussions, they asked how to integrate it in other frameworks: https://github.com/facade/ignition/discussions/459

str avatar Aug 18 '22 01:08 str

@str

We have added much better support for PHP 8.0 and some for 8.1 in v6 of TypeRocket.

kevindees avatar Nov 29 '22 19:11 kevindees