Justice avec des saucisses

Puisque Firefox 3 a son habillage voilà je fait mon habillage Opera 9.5 na ! En plus FF3 puxor d'abord !

# Posté le vendredi 13 juin 2008 12:43

Une application simple avec l'API Skyrock

Ce petit exemple très rapide d'application utilisant l'API de Skyrock demande que vous ayez le paquet PEAR XML_RPC. Pour ceci, si vous avez Debian ou Ubuntu vous pouvez taper ceci dans une console :

sudo apt-get install php-pear
sudo pear install XML_RPC

Cette application permet simplement de poster un article sur votre blog avec un lien en plus en bas de l'article. Vous trouverez son code ici : api_example.php

# Posté le jeudi 06 mars 2008 10:04

Modifié le jeudi 06 mars 2008 10:47

IE 8 beta 1

IE 8 beta 1
Résultats du test SunSpider :

  4954.0ms +/- 1.7% | Firefox 3b5 Nightly
8268.2ms +/- 3.9% | Opera 9.5 weekly
13191.2ms +/- 1.3% | IE8 beta 1
13323.0ms +/- 5.8% | Firefox 3 beta 3
14693.0ms +/- 1.1% | Safari 3.0.4 beta
23334.4ms +/- 2.6% | Firefox 2
42384.8ms +/- 2.9% | IE7

Test du raytracer FULL :

 FAIL | IE7 (plantage)
FAIL | Firefox 3 beta 3 (plantage)
FAIL | IE8 (plantage)
600+ | Firefox 3b5 nightly (pas terminé)
75s | Safari 3.0.4 beta
37s | Opera 9.5 weekly

A noter :
- ononline et onoffline ne fonctionnent pas sous XP (débile...)
- la règle CSS *:first-child+html souvent utilisée dans IE7 pour cibler les bugs du navigateur fonctionnent dans IE8, et induisent donc des bugs...

# Posté le mercredi 05 mars 2008 16:26

Modifié le jeudi 06 mars 2008 10:48

How to add static method support to Smarty ?

Smarty is a great template engine but it lacks support for static objects, you can't do for example {if myObject::isTrue()} do something... {/if}. But we can easily extend smarty to do this, without editing smarty code at all, yeah.

First you have to tell smarty that you will use your own Compiler object (in fact it just extends the original smarty compiler) :

$smarty = new Smarty;
$smarty->compiler_class = 'mySmarty_Compiler';
$smarty->compiler_file = 'class.mySmartyCompiler.php';

Now we'll build our "mySmarty_Compiler" class with a little add :

require_once SMARTY_DIR . 'Smarty_Compiler.class.php';

class mySmarty_Compiler extends Smarty_Compiler
{
function __construct()
{
parent::__construct();
$this->_func_regexp = '(?:[a-zA-Z0-9_]+\:\:)?[a-zA-Z_]\w*';
}
}

The "func_regexp" adds the syntax to allow the use of static objects in {if} statements. This was the easy part, now the hard one ;)

The next step is to parse assign, foreach, capture and other tags arguments for static syntax. For this we have to extend the _parse_attrs method. You'll find the extended function to put in your mySmarty_Compiler class here.

The last step is to parse "function" tags for static methods (like {myObject::getDate()}). For this we just have to extend the _compile_if_tag method by doing a copy and changing just one line, like in this diff :

  ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call
+ ' . $this->_func_regexp . ' | # valid function name
' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)? | # var or quoted string

And that's all :)

If you're lazy you can find the code of the extended class mySmarty_Compiler here. After getting this file you'll just have to change the compiler_name and compiler_file of your smarty object.
[ Ajouter un commentaire ] [ Aucun commentaire ]

# Posté le mardi 12 février 2008 12:11

Modifié le jeudi 06 mars 2008 10:48

SVN UP automatisé

Pour faire un svn up automatisé il est recommandé :
- d'avoir un user spécifique sur le repository qui n'ait qu'un accès en lecture, et qui ne serve que pour les up
- d'utiliser la ligne de commande suivante : svn up MON_REPERTOIRE --username MON_LOGIN --password MON_PASS --no-auth-cache --non-interactive --config-dir MA_CONFIG_SUBVERSION
- d'utiliser une config de subversion générique (un répertoire .subversion), avec un fichiers servers contenant ceci :


[global]
ssl-trust-default-ca = true
ssl-ignore-unknown-ca = true
ssl-ignore-invalid-date = true
ssl-ignore-host-mismatch = true


Voilà ça va déjà bien aider, surtout que ces options ne sont documentées nulle part à priori...
[ Ajouter un commentaire ] [ Aucun commentaire ]

# Posté le mercredi 06 février 2008 21:17