Login +

Release Notes / 1.0.9

Introduction

SillySmart 1.0.9 introduces 42 new features & bug fixes.

To browse the full list, check the roadmap :

http://redmine.sillysmart.org/versions/52

Controller

Robots informations:

Directives follow, nofollow, index, noindex are now set in headers.

Change routing:

You are not forced anymore to use uppercase on first letters of controllers and actions translations.

Model

Foreign key on update/delete:

Foreach foreign key, you can now set the action to do on update and on delete (MySQL like).

Foreign key default value:

If you set a default mysql value on a foreign key column, it'll be presetted on the customer bo.

toXML() and pdoToXML() improvements:

You can now add key formed from others model's columns.

$xml = $news->toXML($xml,array("news_excerpt"     => array("php:strip_tags", "SLS_String:trimStringToLength:100"),
                               "news_date"        => array("SLS_Date:getDate:FULL_LITTERAL_TIME", "php:ucwords"),
                               "news_photo"       => "SLS_String:getUrlFileImg:_0",
                               "news_pdf"         => "SLS_String:getUrlFile",
                               "news_title"       => "php:trim",
                               "news_link"        => array("/Item/",
                                                           "news_title" => "SLS_String:stringToUrl:_",
                                                           "-",
                                                           "news_id" => array("php:intval","php:pow:2"),
                                                           "/User/",
                                                           "user_id")
                                ));

Specific type "Complexity":

The specific type "Complexity" was added. It allow to set complexity settings on a field (lower|upper|digit|special char|min chars).

Specific type "Numeric":

The specific type "Numeric" was added. It allow to set integer constraints like positive, positive or zero, negative and negative or zero modes.

Specific type "File" and "FileImg":

You can now set a mysql default value on all file and fileimg fields. It allow to set a default image or file for exemple.

searchModels() improvements:

You can now use the new mode "notin" in where clause with an array as value.

You can now pass the $order param like:

array("param_name" => "param_value") ;

// Instead of:

array("key" => "param_name", "value" => "param_value");

You can now pass the $limit param like:

array(0 => 10) ;

// Instead of:

array("start" => "0", "length" => "10");

You can now override the natural join mode by left / right like:

array(array("table" => "user", "column" => "user_id", "mode" => "left"));

// Instead of:

array("user");

// or

array(array("table" => "user", "column" => "user_id"));

clear() method:

Add a new method clear() to reset all keys/values of the current model.

Magic methods:

  • __toString() > if you try to echo a model, it'll format for you all keys/values of the current model.
  • __call() > if you try to call an unknown method, sls will catch error for you.
  • __callStatic() > if you try to call an unknown static method, sls will catch error for you.

getParamsUpdated() method():

New method which returns only columns updated of the current model

Cache

Controller/view cache:

Allow to cache full or part of a static, a component and an action with expiration time and scope visibility (public or private).

Flush cache:

Allow to flush cache in SLS_Bo from static, component, controller, action, user, table or total app cache.

Allow to flush cache in app with:

  $this->_cache->flushStatic($staticName);
  $this->_cache->flushComponent($componentName);
  $this->_cache->flushController($controllerId);
  $this->_cache->flushAction($actionId);
  $this->_cache->flushUser($sessionId);
  $this->_cache->flushFromTable($tableName);

For more informations, view dedicated chapter.

SLS_Sql3

Explain queries:

SLS analyze for you all select queries and throw an exception in dev mode if you process a full table scan.

SLS_Lang4

Domain/Lang binding:

You can now bind a domain with a specific lang. If you do it, sls forward automaticaly on the correct domain according to the current language.

SLS_Date2

getAge() added:

This method give you the exact age of the current sls_date value.

getDate() improvement:

This method now support custom pattern (native php date() method) instead of predefined pattern if you set the 2nd parameter to true.

$date = new SLS_Date(date("Y-m-d H:i:s"));
var_dump($date->getDate("G:m A - j M Y",false));

SLS_HttpRequest5

Detecting GET array parameters:

You can now pass array parameters in get like this "protocol://vhost.domain.tld/Controller/Action/param[]/1/param[]/2".

SLS_Session6

session_id():

New method to get current user session_id.

$this->_session->session_id();

SLS_Email7

setPlainText() improvements:

If you don't call setPlainText(), SLS_Email7 applies a regex to format proper plain text version based on current HTML version (add link in a content, add alt of img in plain, etc.)

SLS_Dtd8

Custom XSL variables:

You can now create custom XSL variables directly on the controller side. These variables will be accessibles on xsl with {$var_name} call.

Back-End:

$this->_generic->addViewCustomVar("sls_url_home",$this->_generic->getFullPath("Home","Index"));        
$this->_generic->getViewCustomVar("sls_url_home");
$this->_generic->getViewCustomVars();
$this->_generic->existViewCustomVar("sls_url_home");
$this->_generic->delViewCustomVar("sls_url_home");

Front-End:

<xsl:value-of select="$sls_url_home" />

SLS_Generic9

switchLang() improvements:

Add parameters more and domain to allow force $more parameter (key|value) and domain alias.

function switchLang($lang,$controller="",$scontroller="",$params="",$domainAlias="")

getFullPath() and forward() improvements:

You can now pass the $more param like array("param_name" => "param_value") instead of array("key" => "param_name", "value" => "param_value").

SLS_Bo

Project release:

Add a new setting which allow to describe your current project version.

This release version is added as a token at the end of all files loaded by SLS_String1::callCachingFile().

Controllers/Actions:

Display templates used by any action on Controllers/Actions list.

Deployment and environements:

You can now create as many environements you want as preprod, prod, [...], etc. and generate configs for all this environements (site_{environment}.xml, etc.)

Manage CDN servers:

You can now set a domain name as CDN server. If you do it, all statics ressources (js, css, img, files, etc.) will be loaded from this server instead of the current one.

Default doctype on template creation:

When you want to add a new XSL main template in the Bo, the predefined doctype is the one you set during app installation.

Back-office rights:

You can now set password complexity (lower|upper|digit|special char|min chars), expiration (now, fixed, never) and last passwords loging to avoid reusing of same old passwords.

Back-office listing:

You can now directly click on each bo name to access entry.

Monitoring log:

You can now enable/disable monitoring logs ; they are now disabled by default.

Login redirect:

If you try to access to sls_bo page without be logged, after login successfull you'll be redirected on the previous wanted page.

Related :

References

  1. SLS_String - Tool SLS_String - String Treatment
  2. SLS_Date - Tool SLS_Date - Dates Handling
  3. SLS_Sql - SQL_Sql class - SQL Mother
  4. SLS_Lang - Multilanguage Management
  5. SLS_HttpRequest - Tool SLS_HttpRequest - Http Request Treatment
  6. SLS_Session - SLS_Session class - Manage session
  7. SLS_Email - Send mail from a distant SMTP
  8. SLS_Dtd - Tool SLS_Dtd - Perform a XSL -> Php transformation
  9. SLS_Generic - Generic Class - Used eveywhere in the application