Index: build-tools/Minifier.php
===================================================================
--- build-tools/Minifier.php	(revision 3963)
+++ 	(revision )
@@ -1,599 +1,0 @@
-<?php
-/*
- * This file is part of the JShrink package.
- *
- * (c) Robert Hafner <tedivm@tedivm.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * JShrink
- *
- *
- * @package    JShrink
- * @author     Robert Hafner <tedivm@tedivm.com>
- */
-
-namespace JShrink;
-
-/**
- * Minifier
- *
- * Usage - Minifier::minify($js);
- * Usage - Minifier::minify($js, $options);
- * Usage - Minifier::minify($js, array('flaggedComments' => false));
- *
- * @package JShrink
- * @author Robert Hafner <tedivm@tedivm.com>
- * @license http://www.opensource.org/licenses/bsd-license.php  BSD License
- */
-class Minifier
-{
-    /**
-     * The input javascript to be minified.
-     *
-     * @var string
-     */
-    protected $input;
-
-    /**
-     * The location of the character (in the input string) that is next to be
-     * processed.
-     *
-     * @var int
-     */
-    protected $index = 0;
-
-    /**
-     * The first of the characters currently being looked at.
-     *
-     * @var string
-     */
-    protected $a = '';
-
-    /**
-     * The next character being looked at (after a);
-     *
-     * @var string
-     */
-    protected $b = '';
-
-    /**
-     * This character is only active when certain look ahead actions take place.
-     *
-     *  @var string
-     */
-    protected $c;
-
-    /**
-     * Contains the options for the current minification process.
-     *
-     * @var array
-     */
-    protected $options;
-
-    /**
-     * Contains the default options for minification. This array is merged with
-     * the one passed in by the user to create the request specific set of
-     * options (stored in the $options attribute).
-     *
-     * @var array
-     */
-    protected static $defaultOptions = array('flaggedComments' => true);
-
-    /**
-     * Contains lock ids which are used to replace certain code patterns and
-     * prevent them from being minified
-     *
-     * @var array
-     */
-    protected $locks = array();
-
-    /**
-     * Takes a string containing javascript and removes unneeded characters in
-     * order to shrink the code without altering it's functionality.
-     *
-     * @param  string      $js      The raw javascript to be minified
-     * @param  array       $options Various runtime options in an associative array
-     * @throws \Exception
-     * @return bool|string
-     */
-    public static function minify($js, $options = array())
-    {
-        try {
-            ob_start();
-
-            $jshrink = new Minifier();
-            $js      = $jshrink->lock($js);
-            $jshrink->minifyDirectToOutput($js, $options);
-
-            // Sometimes there's a leading new line, so we trim that out here.
-            $js = ltrim(ob_get_clean());
-            $js = $jshrink->unlock($js);
-            unset($jshrink);
-
-            return $js;
-
-        } catch (\Exception $e) {
-
-            if (isset($jshrink)) {
-                // Since the breakdownScript function probably wasn't finished
-                // we clean it out before discarding it.
-                $jshrink->clean();
-                unset($jshrink);
-            }
-
-            // without this call things get weird, with partially outputted js.
-            ob_end_clean();
-            throw $e;
-        }
-    }
-
-    /**
-     * Processes a javascript string and outputs only the required characters,
-     * stripping out all unneeded characters.
-     *
-     * @param string $js      The raw javascript to be minified
-     * @param array  $options Various runtime options in an associative array
-     */
-    protected function minifyDirectToOutput($js, $options)
-    {
-        $this->initialize($js, $options);
-        $this->loop();
-        $this->clean();
-    }
-
-    /**
-     *  Initializes internal variables, normalizes new lines,
-     *
-     * @param string $js      The raw javascript to be minified
-     * @param array  $options Various runtime options in an associative array
-     */
-    protected function initialize($js, $options)
-    {
-        $this->options = array_merge(static::$defaultOptions, $options);
-        $js            = str_replace("\r\n", "\n", $js);
-        $js            = str_replace('/**/', '', $js);
-        $this->input   = str_replace("\r", "\n", $js);
-
-        // We add a newline to the end of the script to make it easier to deal
-        // with comments at the bottom of the script- this prevents the unclosed
-        // comment error that can otherwise occur.
-        $this->input .= PHP_EOL;
-
-        // Populate "a" with a new line, "b" with the first character, before
-        // entering the loop
-        $this->a = "\n";
-        $this->b = $this->getReal();
-    }
-
-    /**
-     * The primary action occurs here. This function loops through the input string,
-     * outputting anything that's relevant and discarding anything that is not.
-     */
-    protected function loop()
-    {
-        while ($this->a !== false && !is_null($this->a) && $this->a !== '') {
-
-            switch ($this->a) {
-                // new lines
-                case "\n":
-                    // if the next line is something that can't stand alone preserve the newline
-                    if (strpos('(-+{[@', $this->b) !== false) {
-                        echo $this->a;
-                        $this->saveString();
-                        break;
-                    }
-
-                    // if B is a space we skip the rest of the switch block and go down to the
-                    // string/regex check below, resetting $this->b with getReal
-                    if ($this->b === ' ') {
-                        break;
-                    }
-
-                // otherwise we treat the newline like a space
-
-                case ' ':
-                    if (static::isAlphaNumeric($this->b)) {
-                        echo $this->a;
-                    }
-
-                    $this->saveString();
-                    break;
-
-                default:
-                    switch ($this->b) {
-                        case "\n":
-                            if (strpos('}])+-"\'`', $this->a) !== false) {
-                                echo $this->a;
-                                $this->saveString();
-                                break;
-                            } else {
-                                if (static::isAlphaNumeric($this->a)) {
-                                    echo $this->a;
-                                    $this->saveString();
-                                }
-                            }
-                            break;
-
-                        case ' ':
-                            if (!static::isAlphaNumeric($this->a)) {
-                                break;
-                            }
-
-                        default:
-                            // check for some regex that breaks stuff
-                            if ($this->a === '/' && ($this->b === '\'' || $this->b === '"' || $this->b === '`')) {
-                                $this->saveRegex();
-                                break;
-                            }
-
-                            echo $this->a;
-                            $this->saveString();
-                            break;
-                    }
-            }
-
-            // do reg check of doom
-            $this->b = $this->getReal();
-
-            if (($this->b == '/' && strpos('(,=:[!&|?', $this->a) !== false)) {
-                $this->saveRegex();
-            }
-
-        }
-    }
-
-    /**
-     * Resets attributes that do not need to be stored between requests so that
-     * the next request is ready to go. Another reason for this is to make sure
-     * the variables are cleared and are not taking up memory.
-     */
-    protected function clean()
-    {
-        unset($this->input);
-        $this->index = 0;
-        $this->a     = $this->b     = '';
-        unset($this->c);
-        unset($this->options);
-    }
-
-    /**
-     * Returns the next string for processing based off of the current index.
-     *
-     * @return string
-     */
-    protected function getChar()
-    {
-        // Check to see if we had anything in the look ahead buffer and use that.
-        if (isset($this->c)) {
-            $char = $this->c;
-            unset($this->c);
-
-            // Otherwise we start pulling from the input.
-        } else {
-            $char = substr($this->input, $this->index, 1);
-
-            // If the next character doesn't exist return false.
-            if (isset($char) && $char === false) {
-                return false;
-            }
-
-            // Otherwise increment the pointer and use this char.
-            $this->index++;
-        }
-
-        // Normalize all whitespace except for the newline character into a
-        // standard space.
-        if ($char !== "\n" && ord($char) < 32) {
-            return ' ';
-        }
-
-        return $char;
-    }
-
-    /**
-     * This function gets the next "real" character. It is essentially a wrapper
-     * around the getChar function that skips comments. This has significant
-     * performance benefits as the skipping is done using native functions (ie,
-     * c code) rather than in script php.
-     *
-     *
-     * @return string            Next 'real' character to be processed.
-     * @throws \RuntimeException
-     */
-    protected function getReal()
-    {
-        $startIndex = $this->index;
-        $char       = $this->getChar();
-
-        // Check to see if we're potentially in a comment
-        if ($char !== '/') {
-            return $char;
-        }
-
-        $this->c = $this->getChar();
-
-        if ($this->c === '/') {
-            return $this->processOneLineComments($startIndex);
-
-        } elseif ($this->c === '*') {
-            return $this->processMultiLineComments($startIndex);
-        }
-
-        return $char;
-    }
-
-    /**
-     * Removed one line comments, with the exception of some very specific types of
-     * conditional comments.
-     *
-     * @param  int    $startIndex The index point where "getReal" function started
-     * @return string
-     */
-    protected function processOneLineComments($startIndex)
-    {
-        $thirdCommentString = substr($this->input, $this->index, 1);
-
-        // kill rest of line
-        $this->getNext("\n");
-
-        if ($thirdCommentString == '@') {
-            $endPoint = $this->index - $startIndex;
-            unset($this->c);
-            $char = "\n" . substr($this->input, $startIndex, $endPoint);
-        } else {
-            // first one is contents of $this->c
-            $this->getChar();
-            $char = $this->getChar();
-        }
-
-        return $char;
-    }
-
-    /**
-     * Skips multiline comments where appropriate, and includes them where needed.
-     * Conditional comments and "license" style blocks are preserved.
-     *
-     * @param  int               $startIndex The index point where "getReal" function started
-     * @return bool|string       False if there's no character
-     * @throws \RuntimeException Unclosed comments will throw an error
-     */
-    protected function processMultiLineComments($startIndex)
-    {
-        $this->getChar(); // current C
-        $thirdCommentString = $this->getChar();
-
-        // kill everything up to the next */ if it's there
-        if ($this->getNext('*/')) {
-
-            $this->getChar();         // get *
-            $this->getChar();         // get /
-            $char = $this->getChar(); // get next real character
-
-            // Now we reinsert conditional comments and YUI-style licensing comments
-            if (($this->options['flaggedComments'] && $thirdCommentString === '!')
-                || ($thirdCommentString === '@')) {
-
-                // If conditional comments or flagged comments are not the first thing in the script
-                // we need to echo a and fill it with a space before moving on.
-                if ($startIndex > 0) {
-                    echo $this->a;
-                    $this->a = " ";
-
-                    // If the comment started on a new line we let it stay on the new line
-                    if ($this->input[($startIndex - 1)] === "\n") {
-                        echo "\n";
-                    }
-                }
-
-                $endPoint = ($this->index - 1) - $startIndex;
-                echo substr($this->input, $startIndex, $endPoint);
-
-                return $char;
-            }
-
-        } else {
-            $char = false;
-        }
-
-        if ($char === false) {
-            throw new \RuntimeException('Unclosed multiline comment at position: ' . ($this->index - 2));
-        }
-
-        // if we're here c is part of the comment and therefore tossed
-        if (isset($this->c)) {
-            unset($this->c);
-        }
-
-        return $char;
-    }
-
-    /**
-     * Pushes the index ahead to the next instance of the supplied string. If it
-     * is found the first character of the string is returned and the index is set
-     * to it's position.
-     *
-     * @param  string       $string
-     * @return string|false Returns the first character of the string or false.
-     */
-    protected function getNext($string)
-    {
-        // Find the next occurrence of "string" after the current position.
-        $pos = strpos($this->input, $string, $this->index);
-
-        // If it's not there return false.
-        if ($pos === false) {
-            return false;
-        }
-
-        // Adjust position of index to jump ahead to the asked for string
-        $this->index = $pos;
-
-        // Return the first character of that string.
-        return substr($this->input, $this->index, 1);
-    }
-
-    /**
-     * When a javascript string is detected this function crawls for the end of
-     * it and saves the whole string.
-     *
-     * @throws \RuntimeException Unclosed strings will throw an error
-     */
-    protected function saveString()
-    {
-        $startpos = $this->index;
-
-        // saveString is always called after a gets cleared, so we push b into
-        // that spot.
-        $this->a = $this->b;
-
-        // If this isn't a string we don't need to do anything.
-        if ($this->a !== "'" && $this->a !== '"' && $this->a !== '`') {
-            return;
-        }
-
-        // String type is the quote used, " or ' or `
-        $stringType = $this->a;
-
-        // Echo out that starting quote
-        echo $this->a;
-
-        // Loop until the string is done
-        while (true) {
-
-            // Grab the very next character and load it into a
-            $this->a = $this->getChar();
-
-            switch ($this->a) {
-
-                // If the string opener (single or double quote) is used
-                // output it and break out of the while loop-
-                // The string is finished!
-                case $stringType:
-                    break 2;
-
-                // New lines in strings without line delimiters are bad- actual
-                // new lines will be represented by the string \n and not the actual
-                // character, so those will be treated just fine using the switch
-                // block below.
-                case "\n":
-                    if ($stringType !== '`') {
-                        throw new \RuntimeException('Unclosed string at position: ' . $startpos);
-                    } else {
-                        echo $this->a;
-                    }
-                    break;
-
-                // Escaped characters get picked up here. If it's an escaped new line it's not really needed
-                case '\\':
-
-                    // a is a slash. We want to keep it, and the next character,
-                    // unless it's a new line. New lines as actual strings will be
-                    // preserved, but escaped new lines should be reduced.
-                    $this->b = $this->getChar();
-
-                    // If b is a new line we discard a and b and restart the loop.
-                    if ($this->b === "\n") {
-                        break;
-                    }
-
-                    // echo out the escaped character and restart the loop.
-                    echo $this->a . $this->b;
-                    break;
-
-                // Since we're not dealing with any special cases we simply
-                // output the character and continue our loop.
-                default:
-                    echo $this->a;
-            }
-        }
-    }
-
-    /**
-     * When a regular expression is detected this function crawls for the end of
-     * it and saves the whole regex.
-     *
-     * @throws \RuntimeException Unclosed regex will throw an error
-     */
-    protected function saveRegex()
-    {
-        echo $this->a . $this->b;
-
-        while (($this->a = $this->getChar()) !== false) {
-            if ($this->a === '/') {
-                break;
-            }
-
-            if ($this->a === '\\') {
-                echo $this->a;
-                $this->a = $this->getChar();
-            }
-
-            if ($this->a === "\n") {
-                throw new \RuntimeException('Unclosed regex pattern at position: ' . $this->index);
-            }
-
-            echo $this->a;
-        }
-        $this->b = $this->getReal();
-    }
-
-    /**
-     * Checks to see if a character is alphanumeric.
-     *
-     * @param  string $char Just one character
-     * @return bool
-     */
-    protected static function isAlphaNumeric($char)
-    {
-        return preg_match('/^[\w\$\pL]$/', $char) === 1 || $char == '/';
-    }
-
-    /**
-     * Replace patterns in the given string and store the replacement
-     *
-     * @param  string $js The string to lock
-     * @return bool
-     */
-    protected function lock($js)
-    {
-        /* lock things like <code>"asd" + ++x;</code> */
-        $lock = '"LOCK---' . crc32(time()) . '"';
-
-        $matches = array();
-        preg_match('/([+-])(\s+)([+-])/S', $js, $matches);
-        if (empty($matches)) {
-            return $js;
-        }
-
-        $this->locks[$lock] = $matches[2];
-
-        $js = preg_replace('/([+-])\s+([+-])/S', "$1{$lock}$2", $js);
-        /* -- */
-
-        return $js;
-    }
-
-    /**
-     * Replace "locks" with the original characters
-     *
-     * @param  string $js The string to unlock
-     * @return bool
-     */
-    protected function unlock($js)
-    {
-        if (empty($this->locks)) {
-            return $js;
-        }
-
-        foreach ($this->locks as $lock => $replacement) {
-            $js = str_replace($lock, $replacement, $js);
-        }
-
-        return $js;
-    }
-
-}
Index: build-tools/build-module-rsync-exclude.txt
===================================================================
--- build-tools/build-module-rsync-exclude.txt	(revision 4039)
+++ 	(revision )
@@ -1,21 +1,0 @@
-# Developpement specific dirs/files
-*.map
-*.rb
-sass
-scss
-.sass*
-scripts
-# CVS dirs/files
-.git*
-.hg*
-*.old
-*.bak
-*.BAK
-*.orig
-*.rej
-# Archives
-*.zip
-# Documentation
-mkdocs
-# Mac OS Specific
-.DS_Store
Index: build-tools/build-module.sh
===================================================================
--- build-tools/build-module.sh	(revision 4039)
+++ 	(revision )
@@ -1,68 +1,0 @@
-#!/bin/sh
-
-# Usage: build-module.sh [theme]
-# The local directory of module must be a git repo and version will be extracted from its tags
-# The module installable archive will be created inside the current directory (module root)
-#
-# Examples:
-# (Assuming that the current path is the dotclear local repo root)
-#
-# Plugin module, inside plugins folder:
-# $ cd plugins/my-plugin
-# $ ../build-tools/build-module.sh
-#
-# Theme module, inside themes folder:
-# $ cd themes/my-theme
-# $ ../build-tools/build-module.sh theme
-
-# Module type
-MOD_TYPE="plugin"
-
-# Default module version
-DEF_VERSION="0.1"
-
-# Path for JS minifier (1st argument is the js file to minify)
-DIRECTORY=$(dirname "$0")
-MIN_JS="$DIRECTORY/min-js.php"
-
-# Check optionnal 1st parameter (module type)
-if [ "$1" = "theme" ]; then
-  MOD_TYPE="theme"
-fi
-
-# Find module name
-MOD_NAME=$(basename "$PWD")
-if [ "$MOD_NAME" = "themes" ] || [ "$MOD_NAME" = "plugins" ] || [ -d ./plugins ] ; then
-  echo "Launch this command inside the module folder!"
-  exit 1
-fi
-
-# Copy all files to tmp dir
-if [ -d "$MOD_NAME" ]; then
-  rm -rf ./"$MOD_NAME"
-fi
-mkdir ./"$MOD_NAME"
-rsync --exclude-from="$DIRECTORY/build-module-rsync-exclude.txt" --exclude="$MOD_NAME" -a . ./"$MOD_NAME"
-
-# Pack Javascript files
-if [ -f "$MIN_JS" ]; then
-  find ./"$MOD_NAME" -name '*.js' -exec "$MIN_JS" \{\} \;
-fi
-
-# Find last version (if any)
-CUR_VERSION=$(git tag -l | sort -r -V | grep -E "[0-9]" | head -n 1)
-if [ -z "$CUR_VERSION" ]; then
-  CUR_VERSION=$DEF_VERSION
-fi
-
-# Make installable archive
-if [ -f $MOD_TYPE-"$MOD_NAME"-$CUR_VERSION.zip ]; then
-  rm $MOD_TYPE-"$MOD_NAME"-$CUR_VERSION.zip
-fi
-zip -q -r $MOD_TYPE-"$MOD_NAME"-$CUR_VERSION.zip ./"$MOD_NAME"/
-
-# Cleanup
-rm -rf ./"$MOD_NAME"
-
-# Final output
-echo "$MOD_TYPE-$MOD_NAME-$CUR_VERSION.zip ready!"
Index: build-tools/ckeditor/build-config.js
===================================================================
--- build-tools/ckeditor/build-config.js	(revision 3413)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/**
- * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or http://ckeditor.com/license
- */
-
-/* exported CKBUILDER_CONFIG */
-
-var CKBUILDER_CONFIG = {
-	skin: 'moono',
-	ignore: [
-		'bender.js',
-		'.bender',
-		'bender-err.log',
-		'bender-out.log',
-		'dev',
-		'.DS_Store',
-		'.editorconfig',
-		'.gitignore',
-		'.gitattributes',
-		'gruntfile.js',
-		'.idea',
-		'.jscsrc',
-		'.jshintignore',
-		'.jshintrc',
-		'.mailmap',
-		'node_modules',
-		'package.json',
-		'README.md',
-		'tests',
-		'samples'
-	],
-	plugins: {
-		a11yhelp: 1,
-		about: 1,
-		basicstyles: 1,
-		blockquote: 1,
-		clipboard: 1,
-		colorbutton: 1,
-		dialogadvtab: 1,
-		div: 1,
-		elementspath: 1,
-		enterkey: 1,
-		floatingspace: 1,
-		format: 1,
-		horizontalrule: 1,
-		htmlwriter: 1,
-		image: 1,
-		indentlist: 1,
-		indentblock: 1,
-		justify: 1,
-		link: 1,
-		list: 1,
-		liststyle: 1,
-		magicline: 1,
-		maximize: 1,
-		pastefromword: 1,
-		pastetext: 1,
-		print: 1,
-		removeformat: 1,
-		resize: 1,
-		sourcearea: 1,
-		specialchar: 1,
-		stylescombo: 1,
-		tab: 1,
-		table: 1,
-		tabletools: 1,
-		templates: 1,
-		toolbar: 1,
-		undo: 1,
-		wysiwygarea: 1
-	}
-};
Index: build-tools/ckeditor/build.sh
===================================================================
--- build-tools/ckeditor/build.sh	(revision 3175)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#!/bin/bash
-
-# comment to build without warning
-set -e
-
-# Download ckbuilder.jar from http://download.cksource.com/CKBuilder/
-# Current release is 2.3.0
-
-# 1) clone ckbuilder from git@github.com:ckeditor/ckbuilder.git
-# 2) patch src/lib/builder.js at line 120
-#
-#    diff --git i/src/lib/builder.js w/src/lib/builder.js
-# index df1b059..e4d023c 100644
-# --- i/src/lib/builder.js
-# +++ w/src/lib/builder.js
-# @@ -117,7 +117,7 @@ CKBuilder.builder = function( srcDir, dstDir ) {
-#         *
-#         * @type {java.io.File}
-#         */
-# -       var targetLocation = new File( dstDir, 'ckeditor' );
-# +       var targetLocation = new File( dstDir, '' );^M
-#
-# 3) build ckbuilder
-# $ cd dev/build && ./build_jar.sh
-# 4) copy ckbuilder.jar (generated in bin directory) to build-tools/ckeditor/
-# 5) clone ckeditor-dev git@github.com:ckeditor/ckeditor-dev.git
-# 6) build ckeditor from dotclear root directory
-# $ ./build-tools/ckeditor/build.sh 4.5.8 ../ckeditor-dev
-
-PROGNAME=$(basename $0)
-
-if [ ! $1 ] || [ ! $2 ];then
-    echo "${PROGNAME} VERSION CKEDITOR_SOURCE"
-else
-    VERSION=$1
-    SOURCE=$2
-fi
-
-java -jar ./build-tools/ckeditor/ckbuilder.jar \
-     --build $SOURCE ./plugins/dcCKEditor/js/ckeditor \
-     --build-config ./build-tools/ckeditor/build-config.js \
-     --overwrite \
-     --version="$VERSION" \
-     --skip-omitted-in-build-config \
-     --leave-js-unminified \
-     --leave-css-unminified \
-     --no-zip \
-     --no-tar
Index: build-tools/dh-make-dotclear
===================================================================
--- build-tools/dh-make-dotclear	(revision 2566)
+++ build-tools/dh-make-dotclear	(revision 0)
@@ -6,5 +6,5 @@
 	private $type;
 	private $today;
-
+	
 	private $id;
 	private $package_name;
@@ -13,5 +13,5 @@
 	private $author;
 	private $version;
-
+	
 	public function __construct($module,$type)
 	{
@@ -20,27 +20,27 @@
 		}
 		$this->type = $type;
-
+		
 		if (!$module || !is_dir($module)) {
 			throw new Exception(sprintf('Module %s does not exist',$module));
 		}
-
+		
 		$mod_define = $module.'/_define.php';
-
+		
 		if (!is_file($mod_define)) {
 			throw new Exception(sprintf('Module %s does not have _define.php file',$module));
 		}
-
+		
 		if (is_dir($module.'/debian')) {
 			throw new Exception(sprintf('Module %s already have a debian directory',$module));
 		}
-
+		
 		include $mod_define;
 		$this->id = strtolower(basename(realpath($module)));
 		$this->package_name = 'libdotclear-'.$this->type.'-'.$this->id;
-
+		
 		# Creating debian directory
 		$this->deb = $module.'/debian';
 		mkdir($this->deb);
-
+		
 		$this->createFile('changelog',$this->changelogTPL());
 		$this->createFile('compat',"4\n");
@@ -51,5 +51,5 @@
 		chmod($this->deb.'/rules',0755);
 	}
-
+	
 	private function registerModule($name,$desc,$author,$version)
 	{
@@ -59,5 +59,5 @@
 		$this->version = $version;
 	}
-
+	
 	private function createFile($name,$content='')
 	{
@@ -66,5 +66,5 @@
 		fclose($fp);
 	}
-
+	
 	private function changelogTPL()
 	{
@@ -76,5 +76,5 @@
 		" -- ".$this->author." <email@example.com>  ".date('r')."\n\n";
 	}
-
+	
 	private function controlTPL()
 	{
@@ -96,5 +96,5 @@
 		"\n";
 	}
-
+	
 	private function copyrightTPL()
 	{
@@ -126,5 +126,5 @@
 		"\n";
 	}
-
+	
 	private function dirsTPL()
 	{
@@ -132,5 +132,5 @@
 		'/usr/share/dotclear/'.$this->type.'s/'.$this->id."\n";
 	}
-
+	
 	private function rulesTPL()
 	{
Index: build-tools/jsmin-1.1.1.php
===================================================================
--- build-tools/jsmin-1.1.1.php	(revision 0)
+++ build-tools/jsmin-1.1.1.php	(revision 0)
@@ -0,0 +1,291 @@
+<?php
+/**
+ * jsmin.php - PHP implementation of Douglas Crockford's JSMin.
+ *
+ * This is pretty much a direct port of jsmin.c to PHP with just a few
+ * PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and
+ * outputs to stdout, this library accepts a string as input and returns another
+ * string as output.
+ *
+ * PHP 5 or higher is required.
+ *
+ * Permission is hereby granted to use this version of the library under the
+ * same terms as jsmin.c, which has the following license:
+ *
+ * --
+ * Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * The Software shall be used for Good, not Evil.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * --
+ *
+ * @package JSMin
+ * @author Ryan Grove <ryan@wonko.com>
+ * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
+ * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
+ * @license http://opensource.org/licenses/mit-license.php MIT License
+ * @version 1.1.1 (2008-03-02)
+ * @link http://code.google.com/p/jsmin-php/
+ */
+
+class JSMin {
+  const ORD_LF    = 10;
+  const ORD_SPACE = 32;
+
+  protected $a           = '';
+  protected $b           = '';
+  protected $input       = '';
+  protected $inputIndex  = 0;
+  protected $inputLength = 0;
+  protected $lookAhead   = null;
+  protected $output      = '';
+
+  // -- Public Static Methods --------------------------------------------------
+
+  public static function minify($js) {
+    $jsmin = new JSMin($js);
+    return $jsmin->min();
+  }
+
+  // -- Public Instance Methods ------------------------------------------------
+
+  public function __construct($input) {
+    $this->input       = str_replace("\r\n", "\n", $input);
+    $this->inputLength = strlen($this->input);
+  }
+
+  // -- Protected Instance Methods ---------------------------------------------
+
+  protected function action($d) {
+    switch($d) {
+      case 1:
+        $this->output .= $this->a;
+
+      case 2:
+        $this->a = $this->b;
+
+        if ($this->a === "'" || $this->a === '"') {
+          for (;;) {
+            $this->output .= $this->a;
+            $this->a       = $this->get();
+
+            if ($this->a === $this->b) {
+              break;
+            }
+
+            if (ord($this->a) <= self::ORD_LF) {
+              throw new JSMinException('Unterminated string literal.');
+            }
+
+            if ($this->a === '\\') {
+              $this->output .= $this->a;
+              $this->a       = $this->get();
+            }
+          }
+        }
+
+      case 3:
+        $this->b = $this->next();
+
+        if ($this->b === '/' && (
+            $this->a === '(' || $this->a === ',' || $this->a === '=' ||
+            $this->a === ':' || $this->a === '[' || $this->a === '!' ||
+            $this->a === '&' || $this->a === '|' || $this->a === '?')) {
+
+          $this->output .= $this->a . $this->b;
+
+          for (;;) {
+            $this->a = $this->get();
+
+            if ($this->a === '/') {
+              break;
+            } elseif ($this->a === '\\') {
+              $this->output .= $this->a;
+              $this->a       = $this->get();
+            } elseif (ord($this->a) <= self::ORD_LF) {
+              throw new JSMinException('Unterminated regular expression '.
+                  'literal.');
+            }
+
+            $this->output .= $this->a;
+          }
+
+          $this->b = $this->next();
+        }
+    }
+  }
+
+  protected function get() {
+    $c = $this->lookAhead;
+    $this->lookAhead = null;
+
+    if ($c === null) {
+      if ($this->inputIndex < $this->inputLength) {
+        $c = $this->input[$this->inputIndex];
+        $this->inputIndex += 1;
+      } else {
+        $c = null;
+      }
+    }
+
+    if ($c === "\r") {
+      return "\n";
+    }
+
+    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
+      return $c;
+    }
+
+    return ' ';
+  }
+
+  protected function isAlphaNum($c) {
+    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
+  }
+
+  protected function min() {
+    $this->a = "\n";
+    $this->action(3);
+
+    while ($this->a !== null) {
+      switch ($this->a) {
+        case ' ':
+          if ($this->isAlphaNum($this->b)) {
+            $this->action(1);
+          } else {
+            $this->action(2);
+          }
+          break;
+
+        case "\n":
+          switch ($this->b) {
+            case '{':
+            case '[':
+            case '(':
+            case '+':
+            case '-':
+              $this->action(1);
+              break;
+
+            case ' ':
+              $this->action(3);
+              break;
+
+            default:
+              if ($this->isAlphaNum($this->b)) {
+                $this->action(1);
+              }
+              else {
+                $this->action(2);
+              }
+          }
+          break;
+
+        default:
+          switch ($this->b) {
+            case ' ':
+              if ($this->isAlphaNum($this->a)) {
+                $this->action(1);
+                break;
+              }
+
+              $this->action(3);
+              break;
+
+            case "\n":
+              switch ($this->a) {
+                case '}':
+                case ']':
+                case ')':
+                case '+':
+                case '-':
+                case '"':
+                case "'":
+                  $this->action(1);
+                  break;
+
+                default:
+                  if ($this->isAlphaNum($this->a)) {
+                    $this->action(1);
+                  }
+                  else {
+                    $this->action(3);
+                  }
+              }
+              break;
+
+            default:
+              $this->action(1);
+              break;
+          }
+      }
+    }
+
+    return $this->output;
+  }
+
+  protected function next() {
+    $c = $this->get();
+
+    if ($c === '/') {
+      switch($this->peek()) {
+        case '/':
+          for (;;) {
+            $c = $this->get();
+
+            if (ord($c) <= self::ORD_LF) {
+              return $c;
+            }
+          }
+
+        case '*':
+          $this->get();
+
+          for (;;) {
+            switch($this->get()) {
+              case '*':
+                if ($this->peek() === '/') {
+                  $this->get();
+                  return ' ';
+                }
+                break;
+
+              case null:
+                throw new JSMinException('Unterminated comment.');
+            }
+          }
+
+        default:
+          return $c;
+      }
+    }
+
+    return $c;
+  }
+
+  protected function peek() {
+    $this->lookAhead = $this->get();
+    return $this->lookAhead;
+  }
+}
+
+// -- Exceptions ---------------------------------------------------------------
+class JSMinException extends Exception {}
+?>
Index: build-tools/make-l10n.php
===================================================================
--- build-tools/make-l10n.php	(revision 3877)
+++ build-tools/make-l10n.php	(revision 0)
@@ -2,32 +2,56 @@
 <?php
 $license_block = <<<EOF
-/**
- * @package Dotclear
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
 EOF;
 
-require dirname(__FILE__) . '/../inc/libs/clearbricks/common/lib.l10n.php';
+require dirname(__FILE__).'/../inc/libs/clearbricks/common/lib.l10n.php';
 
 $path = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : getcwd();
 $path = realpath($path);
 
-$cmd = 'find ' . $path . ' -type f -name \'*.po\'';
-exec($cmd, $eres, $ret);
+$cmd = 'find '.$path.' -type f -name \'*.po\'';
+exec($cmd,$eres,$ret);
 
 $res = array();
 
-foreach ($eres as $f) {
-    $dest = dirname($f) . '/' . basename($f, '.po') . '.lang.php';
-    echo "l10n file " . $dest . ": ";
-
-    if (l10n::generatePhpFileFromPo(dirname($f) . '/' . basename($f, '.po'), $license_block)) {
-        echo 'OK';
-    } else {
-        echo 'FAILED';
-    }
-    echo "\n";
+foreach ($eres as $f)
+{
+	$dest = dirname($f).'/'.basename($f,'.po').'.lang.php';
+	echo "l10n file ".$dest.": ";
+	
+	$l = l10n::getPoFile($f);
+	
+	$fcontent =
+	"<?php\n".
+	$license_block.
+	"#\n#\n#\n".
+	"#        DOT NOT MODIFY THIS FILE !\n\n\n\n\n";
+	
+	foreach (l10n::getPoFile($f) as $vo => $tr) {
+		$vo = str_replace("'","\\'",$vo);
+		$tr = str_replace("'","\\'",$tr);
+		$fcontent .= '$GLOBALS[\'__l10n\'][\''.$vo.'\'] = \''.$tr.'\';'."\n";
+	}
+	
+	$fcontent .= "?>";
+	
+	echo $dest.' : ';
+	if (($fp = fopen($dest,'w')) !== false) {
+		fwrite($fp,$fcontent,strlen($fcontent));
+		fclose($fp);
+		echo 'OK';
+	} else {
+		echo 'FAILED';
+	}
+	echo "\n";
 }
 ?>
Index: build-tools/min-js.php
===================================================================
--- build-tools/min-js.php	(revision 3883)
+++ build-tools/min-js.php	(revision 0)
@@ -1,33 +1,38 @@
 #!/usr/bin/env php
 <?php
-/**
- * @package Dotclear
- * @subpackage Core
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
+# Licensed under the GPL version 2.0 license.
+# See LICENSE file or
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+#
+# -- END LICENSE BLOCK -----------------------------------------
 
 try
 {
-    $js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null;
-
-    if (!$js || !is_file($js)) {
-        throw new Exception(sprintf("File %s does not exist", $js));
-    }
-
-    require dirname(__FILE__) . '/Minifier.php';
-
-    $content = file_get_contents($js);
-    $res     = \JShrink\Minifier::minify($content, array('flaggedComments' => false));
-
-    if (($fp = fopen($js, 'wb')) === false) {
-        throw new Exception(sprintf('Unable to open file %s', $js));
-    }
-    fwrite($fp, $res);
-    fclose($fp);
-} catch (Exception $e) {
-    fwrite(STDERR, $e->getMessage() . ($js ? "($js)" : '') . "\n");
-    exit(1);
+	$js = (!empty($_SERVER['argv'][1])) ? $_SERVER['argv'][1] : null;
+	
+	if (!$js || !is_file($js)) {
+		throw new Exception(sprintf("File %s does not exist",$js));
+	}
+	
+	require dirname(__FILE__).'/jsmin-1.1.1.php';
+	
+	$content = file_get_contents($js);
+	$res = JSMin::minify($content);
+	
+	if (($fp = fopen($js,'wb')) === false) {
+		throw new Exception(sprintf('Unable to open file %s',$js));
+	}
+	fwrite($fp,$res);
+	fclose($fp);
+}
+catch (Exception $e)
+{
+	fwrite(STDERR,$e->getMessage()."\n");
+	exit(1);
 }
 ?>
Index: build-tools/po_update.sh
===================================================================
--- build-tools/po_update.sh	(revision 3784)
+++ 	(revision )
@@ -1,195 +1,0 @@
-#!/bin/sh
-# @package Dotclear
-#
-# @copyright Olivier Meunier & Association Dotclear
-# @copyright GPL-2.0-only
-#
-# Usage (from l10n-plugins root)
-# po_update.sh <dotclear-root> [<lang>]
-
-export LANG=C
-
-XGETTEXT=xgettext
-MSGMERGE=msgmerge
-
-PLUGINS="
-aboutConfig
-akismet
-antispam
-attachments
-blogroll
-blowupConfig
-breadcrumb
-dclegacy
-fairTrackbacks
-importExport
-maintenance
-pages
-pings
-simpleMenu
-tags
-themeEditor
-userPref
-widgets
-dcLegacyEditor
-dcCKEditor
-_fake_plugin
-"
-
-PO_LANG=$1
-PO_MODULE=$2
-
-if [ ! -d ./inc/core ]; then
-  echo "You are not on Dotclear root directory"
-  exit 1
-fi
-
-if [ ! -d locales/_pot ]; then
-  echo "Template not found."
-  exit 1
-fi
-
-extract_strings()
-{
-  $XGETTEXT \
-  -f- \
-  --sort-by-file \
-  -L PHP -k"__:1,2" -k"__:1" \
-  --no-wrap \
-  --foreign-user \
-  --from-code=UTF-8 \
-  "$@"
-}
-
-extract_html_strings()
-{
-  tee -
-
-  $XGETTEXT \
-  - \
-  --sort-by-file \
-  -L PHP -k__ \
-  --no-wrap \
-  --foreign-user \
-  --from-code=UTF-8 \
-  "$@"
-}
-update_po()
-{
-  po_file=$1
-  pot_file=$2
-  po_dir=`dirname $1`
-  po_tmp=$po_dir/tmp.po~
-
-  if [ ! -d $po_dir ]; then
-    mkdir $po_dir
-  fi
-
-  if [ ! -f $po_file ]; then
-    cp $pot_file $po_file
-    perl -pi -e "s|; charset=CHARSET|; charset=UTF-8|sgi;" $po_file $po_file
-  fi
-
-  $MSGMERGE --no-location --no-wrap -o $po_tmp $po_file $pot_file
-  mv $po_tmp $po_file
-}
-
-if [ -z "$PO_MODULE" ]; then
-  #
-  # Create po template files
-  #
-  echo "Building main PO template..."
-  find ./admin ./inc -name '*.php' -not -regex '.*/inc/public/.*' -not -regex '.*/inc/libs/.*' -print | \
-    extract_strings \
-    --package-name="Dotclear 2" \
-    -o locales/_pot/main.pot \
-    -x locales/_pot/date.pot
-
-  echo "DONE"
-
-  # plugins.pot
-  echo "Building plugins PO template..."
-  for p in $PLUGINS; do
-    if [ -d plugins/$p ]; then
-      find ./plugins/$p -name '*.php' -print
-    fi
-  done | \
-    extract_strings \
-    --package-name="Dotclear 2" \
-    -o locales/_pot/plugins.pot \
-    -x locales/_pot/date.pot \
-    -x locales/_pot/main.pot
-
-  echo "DONE"
-
-  #
-  # Update locales/<lang> if needed
-  #
-  if [ -z "$PO_LANG" ]; then
-    exit 0;
-  fi
-
-  # Init locale if not present
-  if [ ! -d locales/$PO_LANG ]; then
-    mkdir -p locales/$PO_LANG/help
-
-    # Base help files
-    for i in locales/en/help/*.html; do
-      cp $i locales/$PO_LANG/help/core_`basename $i`
-    done
-    for i in $PLUGINS; do
-      if [ -f plugins/$i/help.html ]; then
-        cp plugins/$i/help.html locales/$PO_LANG/help/$i.html
-      fi
-    done
-  fi
-
-  # update main.po
-  echo "Updating <$PO_LANG> po files..."
-  update_po ./locales/$PO_LANG/main.po ./locales/_pot/main.pot
-  update_po ./locales/$PO_LANG/plugins.po ./locales/_pot/plugins.pot
-  update_po ./locales/$PO_LANG/public.po ./locales/_pot/public.pot
-  update_po ./locales/$PO_LANG/date.po ./locales/_pot/date.pot
-else
-  #
-  # Plugin language update
-  #
-
-  if [ ! -d $PO_MODULE ]; then
-    echo "Module $PO_MODULE does not exist"
-    exit 1
-  fi
-  echo "Module $PO_MODULE language update"
-
-
-  #
-  # Building po template file
-  #
-  if [ ! -d $PO_MODULE/locales/_pot ]; then
-    mkdir -p $PO_MODULE/locales/_pot
-  fi
-  echo "Building main PO template..."
-  echo '<?php' >$PO_MODULE/__html_tpl_dummy.php
-  find $PO_MODULE -name '*.html' -exec grep -o '{{tpl:lang [^}]*}}' {} \; | sed 's/{{tpl:lang \(.*\)}}$/__\("\1")/' | sort -u \
-    >> $PO_MODULE/__html_tpl_dummy.php
-  sed -i "" 's/\$/\\\$/g' $PO_MODULE/__html_tpl_dummy.php
-
-  find $PO_MODULE -name '*.php' -print | \
-    extract_strings \
-    --package-name="Dotclear 2 `basename $PO_MODULE` module" \
-    -o $PO_MODULE/locales/_pot/main.pot \
-    -x locales/_pot/date.pot -x locales/_pot/main.pot -x locales/_pot/public.pot -x locales/_pot/plugins.pot
-
-  rm -f $PO_MODULE/__html_tpl_dummy.php
-
-  echo "DONE"
-
-  #
-  # Update locale/<lang>
-  #
-  if [ ! -d $PO_MODULE/locales/$PO_LANG ]; then
-    mkdir -p $PO_MODULE/locales/$PO_LANG
-  fi
-  echo "Updating module <$PO_MODULE> main <$PO_LANG> po file... "
-  update_po $PO_MODULE/locales/$PO_LANG/main.po $PO_MODULE/locales/_pot/main.pot
-fi
Index: build-tools/setup.php
===================================================================
--- build-tools/setup.php	(revision 3877)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-$license_block = <<<EOF
-/**
- * @package Dotclear
- *
- * @copyright Olivier Meunier & Association Dotclear
- * @copyright GPL-2.0-only
- */
-EOF;
-
-$dc_base  = dirname(__FILE__) . '/..';
-$php_exec = $_SERVER['_'];
-
-$opts = array(
-    'http' => array()
-);
-if (getenv('http_proxy') !== false) {
-    $opts['http']['proxy'] = 'tcp://' . getenv('http_proxy');
-}
-$context = stream_context_create($opts);
-
-if (!file_exists($dc_base . '/composer.phar')) {
-    echo "Downloading composer.phar\n";
-    $composer_installer = file_get_contents('https://getcomposer.org/composer.phar', false, $context);
-    file_put_contents($dc_base . '/composer.phar', $composer_installer);
-}
-chdir($dc_base);
-echo 'Running ' . $php_exec . ' composer.phar install' . "\n";
-passthru($php_exec . ' composer.phar install');
