Nov. 29, 2007
Dopo un lungo periodo di gestazione, finalmente e’ venuto alla luce questo post, che personalmente reputo molto interessante (ma va??).
Come introdotto dal titolo, espongo uno scenario di uso che mostra come poter integrare Subversion con lo sviluppo e il mantenimento della nostra web application. Nel dettaglio, con web application intendo un applicativo PHP installato in diversi server di produzione: quindi, un punto di sviluppo, tanti punti di utilizzo.
Bene, ipotizziamo ora il workflow per l’installazione per un nuovo cliente: connessione remota verso il server, quindi decompressione (se abbiamo una tarball o un archivio compresso) oppure copia (nel caso di singoli files), niente di trascendentale, quindi; il discorso si complica nel caso in cui ci accorgiamo che il nostro prodotto contiene un bug, oppure se abbiamo apportato modifiche interessanti allo stesso, e in questo caso dobbiamo operare a mano nelle n installazioni, con il rischio di sbagliare/dimenticarsi qualcosa.
E’ qui che Subversion viene in nostro aiuto per realizzare una specie di sistema di installazione/aggiornamento automatizzata di tipo “push” (spero che il termine sia giusto).
Posted by mcalamelli in Linux, Opensource, PHP, Python | 2 Comments
Jan. 29, 2007
E anche questo upgrade e’ andato a buon fine, giusto il tempo di fare il backup dei files e dei dati di mySQL!
Per la cronaca, ho seguito l’ottimo screencast di Andrea Beggi.
Buon upgrade a tutti!
Alla prox
Posted by mcalamelli in JavaScript, Opensource, PHP | 1 Comment
Mar. 15, 2006
Hi all, here’s a small tutorial to setup Polyglot in Wordpress.
It’s very easy to do this: you have to get Polyglot from here, unpack the archive and put the files into Wordpress’s plugins directory. Now you can activate this plugin from the plugin administration page, and start up to write a multilanguage post.
How? Simply using the lang_xx and /lang_xx tags to enclose the text, in the title and in the body of the post.
A very simple example:
Title: <lang_it> Vino </lang_it><lang_en> Wine </lang_en>
Body: <ang_it> Vino rosso</lang_it><lang_en> Red wine </lang_en>
now it’s enough to bring some modification is to the template ones of the sidebar that to the template ones of the single one post so that in before the languages available appear (than, if selected will apply the language to the blog), and in the second appears the small flag of the languages available for the single post.
Here’s my settings
sidebar.php
-
<li>
-
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
-
</li>
-
<li><h2> Lingue </h2><ul>
-
polyglot_list_langs(false);
-
}?></ul>
single.php
-
<h2><a href=“<?php echo get_permalink() ?>” rel=“bookmark” title=“Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></a><?php if(function_exists(‘lp_other_langs’)) {lp_other_langs(‘ ‘,‘ ‘, ‘ ‘, ‘ ‘, ‘ ‘);}?></h2>
The last thing that I have made is to modify the file polyglot.php in order to personalize the plugin; here one snippet of mine:
polyglot.php
-
// Default language version - used when proper language version of the text is not present
-
$polyglot_settings[‘default_lang’] = ‘it’;
-
-
//You can define your own translations of language shortcuts
-
-
//$polyglot_settings['trans']['cs'] = ‘česky’;
-
//$polyglot_settings['trans']['de'] = ‘deutsch’;
-
$polyglot_settings[‘trans’][‘en’] = ‘english’;
-
-
$polyglot_settings[‘trans’][‘it’] = ‘italiano’;
-
//$polyglot_settings['trans']['nl'] = ‘nederlands’;
-
//$polyglot_settings['trans']['sv'] = ’svenska’;
-
-
-
//Which language versions you offer for the whole web - use the proper ISO codes!
-
//$polyglot_settings['knownlangs'] = array(’cs’,'en’,’sv’);
-
-
//if there should be shown flags instead of names of languages
-
$polyglot_settings[‘use_flags’] = true;
And this is all, simple and clear.
Alla prox
Posted by mcalamelli in Opensource, PHP | 1 Comment
Jan. 20, 2006
Hi all, this post regards a small script PHP that allows to visualize randomly a Flash movie between those present ones in one directory. The operation mechanism is this: page PHP does not make other that to load an Array the files .swf present in the directory, do a shuffle of the Array and sendes, using the opportune ones header, to browser the content of element 0 of the Array. From the part of page HTML, he is sufficient to modify the references to single swf file relatively to tag OBJECT and EMBED so that pointing to page PHP.
<?phpdefine("LOCALDIR",getcwd());$files = array();if ($dir = opendir(LOCALDIR)) {while (($file = readdir($dir)) !== false) {$fileinfo = pathinfo(LOCALDIR."\\".$file);if ($file != "." && $file != ".." && $fileinfo["extension"] == "swf") {$finfo = stat(LOCALDIR."\\".$file);$files[] = $file;}}closedir($dir);}shuffle($files);$swf = $files[0];header("Pragma: public");header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");header("Cache-Control: must-revalidate");header("Content-type: application/x-shockwave-flash");header("Content-Length: ".filesize($swf));header("Content-disposition: inline; filename=$swf");header("Accept-Ranges: ".filesize($swf));readfile($swf);exit();?>- Download this code: swfproducer.txt




