Skip to content
Dan Book edited this page Apr 7, 2015 · 26 revisions

Upgrading to Mojolicious 6.0

Parameter name listing

Name listing support was removed from the Mojolicious::Controller and Mojo::Parameters param methods, in favor of the more appropriate Mojolicious::Parameters names method. For example, my @names = $c->param should now be written as my @names = @{$c->req->params->names}, if you wish to retrieve all GET/POST parameter names. The previous behavior of including names of placeholders and uploads has been removed. Similarly, the names of validated parameters in Mojolicious::Validator::Validation have been moved from param to passed and failed, which also now return arrayrefs instead of lists.

Multi-name parameter retrieval

Multi-name support was removed from various methods that retrieved parameters by name; these methods can only be used to retrieve one parameter at a time now. The affected methods include: Mojolicious::Controller cookie, param, and signed_cookie; Mojolicious::Validator::Validation param; Mojo::Parameters param; Mojo::Message cookie and upload.

Removed Mojo::Log methods

The log method was removed from Mojo::Log; use the individual logging methods instead (e.g. debug, info). The is_level method was also removed, use is_debug and similar methods to test the log level. The is_fatal method was removed because fatal logging is always enabled.

Removed Mojo::UserAgent custom socket support

Don't know what this was? Neither do we!

Removed Mojo::Loader object-oriented API

The Mojo::Loader OO API has been removed, use the exported-on-demand functions data_section, find_modules, and load_class directly instead.

Exception and Not-Found rendering

The deprecated Mojolicious::Controller methods render_exception and render_not_found have been removed, use the helpers $c->reply->exception and $c->reply->not_found instead.

Removed accept mutex

The accept mutex behavior was removed from Mojo::IOLoop and Mojo::Server::Prefork for better performance, along with the related attributes:

  • Mojo::IOLoop accept_interval, lock, and unlock
  • Mojo::Server::Prefork accept_interval, lock_file, and lock_timeout.

Route bridge

The deprecated Mojolicious::Routes::Route bridge method has been removed, use under instead.

Mojo::UserAgent::CookieJar return values

The all and find methods now return arrayrefs instead of lists.

Other removed deprecations

Mojo::Reactor is_readable method has been removed.

Mojo::DOM renaming

Mojo::DOM methods have been reorganized to better match the DOM spec.

  • all_contents => descendant_nodes
  • contents => child_nodes
  • match => matches (also renamed in Mojo::DOM::CSS)
  • following_siblings => following_nodes
  • preceding_siblings => preceding_nodes
  • next_sibling => next_node
  • previous_sibling => previous_node
  • siblings => Replaced by following and preceding methods
  • node => type
  • type => tag

Other renaming

  • Mojo::UserAgent::CookieJar:
  • extracting => collecting
  • extract => collect
  • inject => prepare
  • Mojo::Template: template => unparsed
  • Mojolicious::Types: types => mapping
  • Mojolicious::Routes::Match:
  • current => position
  • match => find
  • Mojolicious::Routes::Pattern: pattern => unparsed
  • Mojo::UserAgent::Proxy: inject => prepare
  • Mojo::Parameters: params => pairs
  • prefork command: -A => -a
  • Hypnotoad option: keep_alive_requests => requests

Clone this wiki locally