Инструменты пользователя

Инструменты сайта


limb2:en:releases:2_4_alpha1

Limb 2.4-alpha1 release

Status - released. CHANGELOG, download

Short summary

The following release is a demo project built with Limb 2.4-alpha1. Alpha status implies that it's not stable yet, API is not stabilized and is subject to change in the future, it's not recommended to use this release in production. This release also breaks BC with 2.3.x.

Here's the list of the most noticeable changes:

  • Way more flexible and simpler Limb project web server installation
  • Improved admin GUI
  • Better I18N support(UTF8)
  • General code cleanup, refactoring and speed improvements

Way more flexible and simpler Limb project web server installation

Limb doesn't require any more that projects built with it be installed in the root web directory. There's also no annoying starting /root part for every url.

PathInfo

All requests are handled with index.php script(root.php is gone). All requests are PathInfo based(which is a part of CGI standard) and generally look like: index.php/path/to/some/object?foo=1&bar=2.

In theory PathInfo support allows to use Limb with other web servers, not only Apache. Unfortunately we didn't manage to enable PathInfo support in IIS(and it's known to support it), thus we can't be 100% sure.

Pretty urls

One of the most popular ways to make urls look more readable is to use Apache mod_rewrite. The demo project contains the .htaccess file with mod_rewrite rules enabled. Limb must be informed about mod_rewrite usage explicitly via ENABLE_MOD_REWRITE constant in setup.php(setup.override.php):

...
define('ENABLE_MOD_REWRITE', true);
...

Technical details

New constants

Limb defines automatically the following set of constants:

HTTP_BASE_PATH - http location of the Limb based project, e.g. http://dot.com/limb

HTTP_GATEWAY_PATH - http location of Limb requests gateway, e.g. http://dot.com/limb/index.php. In case of mod_rewrite HTTP_GATEWAY_PATH == HTTP_BASE_PATH

HTTP_SHARED_PATH - http location of the Limb shared directory

:!: Please keep in mind that all these constants have trailing slash «/»

These constants are globally available in templates: {#HTTP_BASE_PATH}, {#HTTP_GATEWAY_PATH}, {#HTTP_SHARED_PATH}.

<Limb:HTTP_BASE>

New <Limb:HTTP_BASE> tag was added which is responsible for:

  • defines global JavaScript variables HTTP_BASE_PATH, HTTP_GATEWAY_PATH è HTTP_SHARED_PATH
  • renders html <base href=«HTTP_BASE_PATH»> tag. This way all user content urls don't have to contain the host information, e.g. internal content link /news/foo must be written as news/foo, <base> tag appends host information to all relative links.

fetcher

fetcher sets new http_path attribute for each fetched object, you can use this attribute templates

Improved admin GUI

:!: Current admin GUI was tested in Mozilla FireFox only, better support for other major browser is planned for next releases.

New design

Previous frame based design raised some usability issues. The new design is not frame based anymore. The new design also introduces renewed styles, icons, color schemes, etc.

Initial unification of admin templates

Some new tags were added in order to unify admin templates.

Admin forms:

<admin:form>
<admin:form:header>
  <admin:form:title>...</admin:form:title>
  <admin:form:icon>...</admin:form:icon>
</admin:form:header>
 
<admin:form:hint>...</admin:form:hint>
 
<admin:form:tabs>
 <admin:form:tab_item id='tab1'>
   <admin:form:tab_label>...</admin:form:tab_label>
   <admin:form:tab_content></admin:form:tab_content>
 </admin:form:tab_item>
...
</admin:form:tabs>
 
<admin:form:buttons>
  <admin:form:buttons:cancel>
  ...
</admin:form:buttons>
</admin:form>

Admin tables:

<admin:list>
 
<admin:list:title>...</admin:list:title>
 
<admin:list:item>
  <admin:list:cell>...</admin:list:cell>
  <admin:list:cell>...</admin:list:cell>
</admin:list:item> 
 
<admin:list:buttons>...</admin:list:buttons>
 
</admin:list>

Better html markup

We're gradually porting existing <table> based markup to <div> based one and moving all formatting rules to CSS stylesheets in order to make html more W3C standards compliant. It's planned to move to XHTML in the nearest future.

JavaScript refactoring

JavaScript layer was substantially refactored and now follows JSAN library namespace conventions. All Limb related code is under Limb namespace which allows to avoid name clashes when used with external JavaScript products.

Initial AJAX usage

Node select GUI is AJAX based now. We're planning to improve other parts of GUI using AJAX which in theory should decrease the server load.

Better I18N support(UTF8)

Some new tools were added for multibyte(UTF8) strings processing. All non ASCII content was converted to UTF8.

The following multibyte aware global functions were added(analogous to PHP built ones):

_substr($str, $start, $length=null)
_explode($sep, $str)
_str_replace($s, $r, $str)
_ltrim($str, $charlist='')
_rtrim($str, $charlist='')
_trim($str, $charlist='')
_strtolower($string)
_strtoupper($string)
_strpos($haystack, $needle, $offset=null)

These functions delegate all strings processing to the currently selected strings driver. There're several drivers, the most appropriate one is used according to PHP installed extensions, e.g. if mbstring extension is available then the most optimized driver will be used, if not - a slower pure PHP emulation will be used then.

By default, however, singlebyte driver is loaded. UTF8 is ASCII compatible(i.e. English only content) and it makes sense to use the multibyte driver only if really neccessary. You can enable the multibyte driver by declaring the ENABLE_UTF8 constant in setup.php(setup.override.php):

...
define('ENABLE_UTF8', true);
...

You should clearly understand when it makes sense to use multibyte aware functions instead of PHP built ones. There's a very good tutorial on UTF8 peculiarites by Harry Fuecks.

General code cleanup, refactoring and speed improvements

We're gradually increasing the quality of code for 2.x series.

This version of Limb inroduces some transparent for the client levels of caching which speed up notably the overall execution time.

Tree cache

The new caching_tree decorator wraps materialized_path_tree and caches all requests to the file system cache. This cache persists between requests and is flushed completely if tree gets changed somehow. It allow to keep the cached tree in sync with the actual tree stored in database.

:!: This functionality has beta quality and is switched off be default(on in demo project though), it can be enabled by placing the following code in project setup.php(setup.override.php):

define('ENABLE_TREE_CACHE', true);

DB cache

The new db_caching_driver decorator was added which caches all identical DB request results during the request session.

:!: This functionality has beta quality and is switched off be default(on in demo project though), it can be enabled by placing the following code in project setup.php(setup.override.php):

define('ENABLE_DB_CACHE', true);

Обсуждение

Ваш комментарий. Вики-синтаксис разрешён:
   ____   _  __   ___   _      __   __  ___
  / __/  / |/ /  / _ ) | | /| / /  /  |/  /
 / _/   /    /  / _  | | |/ |/ /  / /|_/ / 
/_/    /_/|_/  /____/  |__/|__/  /_/  /_/
 
limb2/en/releases/2_4_alpha1.txt · Последнее изменение: 2010/11/10 10:02 — 127.0.0.1