it:tools:db:spbimporter
Differences
This shows you the differences between two versions of the page.
| it:tools:db:spbimporter [2019/01/12 17:53] – external edit 127.0.0.1 | it:tools:db:spbimporter [2020/01/01 00:03] (current) – removed arvid | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== SPB Importer ====== | ||
| - | Traduzione italiana (a tratti libera) del documento [[tools: | ||
| - | |||
| - | // | ||
| - | |||
| - | Fare un **BACKUP** della cartella '' | ||
| - | |||
| - | '' | ||
| - | |||
| - | ===== Installazione ed uso ===== | ||
| - | |||
| - | - Copiare il codice riportato poco sotto in un file, salvare con nome '' | ||
| - | - Una volta messo nella cartella root di installazione, | ||
| - | - **IMPORTANTE**: | ||
| - | |||
| - | |||
| - | |||
| - | ===== Altre Informazioni Importanti ===== | ||
| - | |||
| - | '' | ||
| - | |||
| - | L' importazione di file .gz è disabilitata di default, così per permettere la conversione si deve aggiungere un campo, quindi far puntare il browser al file in questo modo: | ||
| - | http:// | ||
| - | |||
| - | **ATTENZIONE** in caso vengano SALTATI (SKIPPED) alcuni file GZ, NON è possibile far eseguire lo script una seconda volta con il parametro '' | ||
| - | |||
| - | E' possibile anche eseguire lo script [[tools: | ||
| - | |||
| - | ===== isoconvert.php ===== | ||
| - | |||
| - | |||
| - | <code php> | ||
| - | <?php | ||
| - | |||
| - | header(' | ||
| - | |||
| - | require_once(' | ||
| - | require_once(INCLUDES_DIR.' | ||
| - | | ||
| - | error_reporting(E_ALL); | ||
| - | |||
| - | |||
| - | class utfencoder extends fs_filelister { | ||
| - | | ||
| - | var $_directory = CONTENT_DIR; | ||
| - | var $foundgz = false; | ||
| - | | ||
| - | function _checkFile($d, | ||
| - | |||
| - | $p=" | ||
| - | if (is_dir($p)) { | ||
| - | return 1; | ||
| - | } else { | ||
| - | |||
| - | $DO_GZ = (isset($_GET[' | ||
| - | |||
| - | echo " | ||
| - | $s = io_load_file($p); | ||
| - | |||
| - | if ((strpos( $p, ' | ||
| - | |||
| - | |||
| - | if (!$DO_GZ) { | ||
| - | $this-> | ||
| - | |||
| - | echo "GZ: SKIPPED\n"; | ||
| - | return 2; | ||
| - | } | ||
| - | |||
| - | echo " | ||
| - | $s = gzinflate(substr($s, | ||
| - | |||
| - | if (strpos($f, ' | ||
| - | io_write_file($d . '/ | ||
| - | echo " | ||
| - | } | ||
| - | |||
| - | $f = substr($f, 0,-3); | ||
| - | unlink($p); | ||
| - | $p = " | ||
| - | |||
| - | |||
| - | } | ||
| - | |||
| - | $s = mb_convert_encoding($s, | ||
| - | if (($f != ' | ||
| - | echo " IMPORTING $f from old versions "; | ||
| - | |||
| - | // compatibility with old versions -__-' | ||
| - | $cont = explode(' | ||
| - | | ||
| - | if (strpos($f, ' | ||
| - | $s = " | ||
| - | } elseif (strpos($f, ' | ||
| - | $s = " | ||
| - | } else { | ||
| - | echo " | ||
| - | return; | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | |||
| - | // remove or replace offending keys | ||
| - | $s = str_replace(' | ||
| - | $s = str_replace(' | ||
| - | |||
| - | $s = io_write_file($p, | ||
| - | |||
| - | |||
| - | echo " | ||
| - | | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | |||
| - | echo " | ||
| - | echo " | ||
| - | |||
| - | |||
| - | $o =& new utfencoder; | ||
| - | echo " | ||
| - | |||
| - | if ($o-> | ||
| - | |||
| - | echo " | ||
| - | echo "so you should call again this script as in / | ||
| - | echo " | ||
| - | |||
| - | } | ||
| - | |||
| - | ?> | ||
| - | </ | ||
it/tools/db/spbimporter.1547312016.txt.gz · Last modified: by 127.0.0.1
