Nette Framework 2.4 (2017–08–29)

Notice: This thread is very old.
David Grudl
Nette Core | 8229
+
+27
-

Nette Framework 2.4 (2017–08–29) has just been released.

This release is compatible with PHP 7.2

Note that dependencies in composer.json has been relaxed to ^2.4, so ZIP packages are now distinguished by build date instead of patch version. Hence this release is “2.4 2017–08–29”

This summarizes the differences from release 2017–01–19

Latte

  • Engine: better error message when is unable to create file
  • Engine: throws exception when is unable to create directory
  • Parser: expands <script /> to <script></script> nette/latte#164
  • added |webalize (requires nette/utils)
  • added |reverse
  • n:class supports BEM (nette/latte#156)
  • Filters: trim() is content type aware
  • macro n:attr expands array (nette/latte#158)
  • Filters: independent on utf8_decode()

For the details you can have a look at the diff.

Application

  • Route: converts all scalar params to strings nette/application#185
  • Route: fixed handling of required parameters with default value
  • ComponentReflection: ‘sinces’ are stored only for presenters, refactoring
  • Control: enhanced code completion for $template (nette/application#184)
  • Component::saveState() fixed compatibility with PHP 7.2
  • Presenter: added requestToUrl(), taken out from createRequest()
  • RoutingExtension: added support for custom single-route classes. (nette/application#162)
  • UI\Presenter::canonicalize() allows to redirect to specified destination
  • Presenter: fixed uninitialized $since nette/application#166
  • uses IResponse constants
  • TemplateFactory: “nonce” is Presenter agnostic (nette/application#172)
  • BadRequestException: added getHttpCode()
  • TemplateFactory: dependency on nette/caching is optional
  • Revert “ComponentReflection::combineArgs() throws InvalidArgumentException instead BadRequestException when incompatible type is object”

For the details you can have a look at the diff.

Bootstrap

  • detectDebugMode() check for Forwarded header existence (nette/bootstrap#55)
  • Configurator:getCacheDirectory() throws exception when is unable to create directory
  • added Configurator::addDynamicParameters()
  • compatible with RobotLoader 3.0

For the details you can have a look at the diff.

Caching

  • added Cache::NAMESPACES and support for cleaning namespace in FileStorage nette/caching#52
  • CacheExtension: throws exception when is unable to create directory
  • Cache: do not save data with negative/zero expiration (nette/caching#50)
  • Cache: create dependencies when closing macro (nette/caching#49)

For the details you can have a look at the diff.

Database

  • SqlPreprocessor: workaround for PDO bug 74996 when looking for ? in prepared query nette/database#177
  • fetchPairs() supports floats in keys
  • SqliteDriver::getColumns() fix regexp for autoincrement recognition (nette/database#168)
  • DatabaseExtension: added support for constants in options values
  • OciDriver: do not use meta, driver is not meta-aware
  • Insert to table with multi primary or without autoincrement primary (nette/database#105)(nette/database#41)(nette/database#80)(nette/database#102)
  • Connection::getInsertId() is normalized to string
  • DatabaseExtension: fixed compatibility with nette/di
  • SqlBuilder: lose parameters for aliasses (nette/database#150)
  • MySqlDriver: formatLike() uses quote()

For the details you can have a look at the diff.

DI

  • added support for class aliases created via class_alias() nette/di#156
  • DependencyChecker: class is expired when parent/interfaces/traits was changed
  • DecoratorExtension: accepts setup syntax ‘$prop = val’
  • ContainerBuilder: allows ::Namespace\func as factory name
  • generated factories: fix return type, PHP does not support return type covariance (nette/di#152)
  • Compiler::loadDefinitions: allow to get to existing service by class nette/di#145
  • ContainerBuilder::getByType() added argument $throw
  • DependencyChecker::isExpired() can alter $phpFiles modification times nette/di#144
  • Helpers::getReturnType() ignores ‘object’ and ‘mixed’
  • PhpGenerator: removed unnecessary type checking in PHP 7
  • ContainerBuilder: create_function() replaced with eval()
  • added dynamic parameters nette/di#61
  • Compiler::addExtension() allows empty name
  • ContainerBuilder: ltrims \ from service class
  • Helpers::expand supports concatenation of PhpLiteral
  • ContainerBuilder: disable autowiring for aliases only when autowired is TRUE

For the details you can have a look at the diff.

Forms

  • addError() by default translates messages (BC break)
  • FormMacros: fix edcompatibility between n:class macro and n:name form macro. (nette/forms#159)
  • added Form::reset()
  • $onClick handlers are called with argument $values (as $onSuccess)
  • tests: improved $onSuccess & $onClick etc. tests
  • DefaultFormRenderer: translates object ‘label’ & ‘description’ nette/forms#142
  • DefaultRenderer: fix for calling renderErrors() from renderPair() which was caused by nette/forms#145 (->form = NULL) (nette/forms#150)
  • ControlGroup: added remove() and removeOrphans() nette/forms#155
  • SelectBox: only one item can be rendered as selected at the same time
  • added support for static addCondition(TRUE | FALSE)
  • netteForms.js: fixed ‘Too much recursions’ nette/forms#143
  • BaseControl::setDisabled(FALSE) reloads HTTP value nette/forms#139
  • Revert “TextBase: emptyValue is removed from value in validate()” – getValue() can be called before validation

For the details you can have a look at the diff.

Http

  • RequestFactory: when proxy is used and HTTP_X_FORWARDED_PORT is not available, uses default port nette/http#124
  • RequestFactory: test that HTTP_X_FORWARDED_PROTO doesn't change the port
  • RequestFactory: correctly ignores not-ip values in HTTP_X_FORWARDED_FOR & REMOTE_ADDR (nette/http#122)
  • Session: configuration options are normalized in setOptions() instead of configure() nette/http#121
  • SessionExtension: special value ‘domain’ in cookieDomain means whole domain
  • Url: added getDomain()

For the details you can have a look at the diff.

Php Generator

  • ClassType: checks whether names are valid
  • Helpers::isNamespaceIdentifier() added $allowLeadingSlash
  • Helpers::isNamespace()isNamespaceIdentifier()
  • Closure::setUses() checks argument type
  • Helpers::formatArgs() escaped \? means ?
  • Helpers::formatArgs() ...? is substitution for ?*
  • Helpers::formatArgs() refactoring

For the details you can have a look at the diff.

Utils

  • Html: accepts IHtmlString nette/forms#160
  • Html::addText() accepts Html as setText() does
  • Reflection: added support for PHP 7.2 type ‘object’
  • ArrayList: triggers notice when indexes are not integers
  • Image: attempt to serialize throws exception
  • Validators::isInRange() works with DateTime
  • Validators::isInRange() return FALSE when both limits are NULL
  • Validators::isInRange() compares strings as strings and numbers as numbers (BC break) nette/forms#146
  • Validators::isInRange() ignores NULL
  • Reflection::getReturnType() & getParameterType() supports ‘parent’
  • Callback: workaround for Suhosin extension bug (nette/utils#134)

For the details you can have a look at the diff.

Tracy

  • added Debugger::renderLoader() for faster client-side initialization
  • element <div id=tracy-debug> is created by JS
  • bar: added support for touch events
  • bar: is draggable only using logo
  • bar: all H1 tags should make panel draggable (nette/tracy#207)
  • dumper: added CSS for anchors
  • TracyExtension: throws exception when log directory is not writable
  • dumps true/false/null in lowercase
  • Show date/time error occured on error 500 (nette/tracy#258)
  • AJAX: debug Fetch requests (nette/tracy#249)
  • Logger::getExceptionFile() hash contains exception class name
  • Helpers::improveException() fixed suggestion when calling undefined method of anonymous class nette/tracy#248
  • create-phar: leaves annotation @tracySkipLocation nette/tracy#254
  • TracyExtension: added ‘editorMapping’ default parameter (nette/tracy#244)
  • error 500 redesign
  • bar.css: fixed reseting :before and :after
  • templates: improved list of hardclosed elements
  • bar.js: tracy-debug is always in <body>
  • bar.css: fixed whitepace for code nette/application#169
  • bar.css: resets SVG display

For the details you can have a look at the diff.

CZechBoY
Member | 3608
+
0
-

nette/database
pdo bug: https://bugs.php.net/bug.php?…

David Grudl
Nette Core | 8229
+
+2
-

fixed