diff --git a/php/EE/Loggers/Regular.php b/php/EE/Loggers/Regular.php index 168e8fbc8..5c06a91ca 100644 --- a/php/EE/Loggers/Regular.php +++ b/php/EE/Loggers/Regular.php @@ -42,7 +42,7 @@ public function warning( $message ) { } /** - * Write an message to STDERR, prefixed with "Error: ". + * Write a message to STDERR, prefixed with "Error: ". * * @param string $message Message to write. */ @@ -50,6 +50,15 @@ public function error( $message ) { $this->_line( $message, 'Error', '%R', STDERR ); } + /** + * Write a message, prefixed with "Notice: ". + * + * @param string $message Message to write. + */ + public function notice( $message ) { + $this->_line( $message, 'Notice', '%y' ); + } + /** * Similar to error( $message ), but outputs $message in a red box * diff --git a/php/EE/Runner.php b/php/EE/Runner.php index 8e608b315..f0c647b95 100644 --- a/php/EE/Runner.php +++ b/php/EE/Runner.php @@ -777,6 +777,17 @@ public function start() { $this->arguments[] = 'help'; } + // Print a deprecation warning if 'create' or 'delete' is being used (ee auth). + if ( 'auth' === $this->arguments[0] && ( 'create' === $this->arguments[1] || 'delete' === $this->arguments[1] ) ) { + $deprecation_warn = sprintf( + '`%1$s` is deprecated and will be replaced with `%2$s`. See: `ee auth %2$s`', + $this->arguments[1], + ( 'create' === $this->arguments[1] ? 'add' : 'remove' ) + ); + + EE::notice( $deprecation_warn ); + } + // Protect 'cli info' from most of the runtime, // except when the command will be run over SSH if ( ! empty( $this->arguments[0] ) && 'cli' === $this->arguments[0] && ! empty( $this->arguments[1] ) && 'info' === $this->arguments[1] ) { diff --git a/php/class-ee.php b/php/class-ee.php index e9dc1b0d3..a4b9cfc4d 100644 --- a/php/class-ee.php +++ b/php/class-ee.php @@ -572,6 +572,17 @@ public static function warning( $message ) { self::$file_logger->warning( $message ); } + /** + * Display notice message prefixed with "Notice: ". + * + * @param string $message Message to write. + * + * @return null + */ + public static function notice( $message ) { + self::$logger->notice( self::error_to_string( $message ) ); + } + /** * Display error message prefixed with "Error: " and exit script. *