TypeRocket / typerocket

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

Galaxy undefined constant WPMU_PLUGIN_URL #218

Closed djwave28 closed 5 years ago

djwave28 commented 5 years ago

WP5.2 | mu-plugin | TypeRocket 4

I followed the YouTube instructional videos. I wanted to create the first controller with galaxy, but got greeted with and error.

command: php galaxy make:controller thin Custom

PHP Warning: Use of undefined constant WPMU_PLUGIN_URL - assumed 'WPMU_PLUGIN_URL' (this will throw an Error in a future version of PHP) in .../wp-content/mu-plugins/typerocket/config/paths.php

The controller does get created. What can I do to resolve this?

djwave28 commented 5 years ago

I have experienced this issue on both Mac OS and Linux installs. The problem is basically described as is, a missing constant WPMU_PLUGIN_URL.

After giving this another thought I came up with the fact that the galaxy command runs in the terminal calling the galaxy script on the typerocket root. I was able to solve this issue by adding the following lines.

if (!defined('WPMU_PLUGIN_URL')) {
    define('WPMU_PLUGIN_URL', '/mu-plugins');
}

Place these lines in one of the following locations

  1. ./config/galaxy.php - top of the script
  2. ./galaxy - (bash script) top of script

I seems to me this should be addressed in the source code as a standard.

kevindees commented 5 years ago

@djwave28

I'll look at adding a fix for this into core.