TypeRocket / typerocket

TypeRocket is a highly integrated MVC WordPress framework with beautiful UI components for the modern developer.
https://typerocket.com
452 stars 62 forks source link

support for PHP 8.1 #254

Closed str closed 1 year ago

str commented 2 years ago

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.

kevindees commented 2 years ago

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.

str commented 2 years ago

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

kevindees commented 2 years ago

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.

str commented 2 years ago

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

kevindees commented 2 years ago

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

str commented 2 years ago

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

kevindees commented 1 year ago

@str

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