Changeset 7720 in spip-zone


Ignore:
Timestamp:
Dec 2, 2006, 11:24:51 AM (12 years ago)
Author:
bertrand@…
Message:

Ca cree inc et inc/sms maintenant , mettre inc non ecrivable pour tester avec echo

Location:
_dev_/genere_lib_sms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _dev_/genere_lib_sms/makeSMSinc.sh

    r7719 r7720  
    88# remplacer "update" par "checkout" la premier fois ...
    99#cvs -d :pserver:cvsread@anoncvs.horde.org:/repository update framework/Net_SMS
    10 
     10mkdir -p inc/sms
    1111find framework/Net_SMS -name '*.php' -print0 | xargs -0 php patch_SMS.php inc
  • _dev_/genere_lib_sms/patch_SMS.php

    r7719 r7720  
    11<?php
    2 var_dump($_SERVER['argv']);
     2// pour generer inc/sms à partir du Net_SMS de Horde/PEAR
     3// normalement lance par makeSMSinc.sh
     4// necessite un checkout de Net_SMS , cf makeSMSinc.sh
     5// si le 1er argument ("inc" défaut) est un repertoire ecrivable,
     6// genere les fichiers, echo sinon
    37
    48$sea = array(
     
    2327    );
    2428
     29$pasgene = false;
    2530if (!isset($_SERVER['argv'][1]) or !is_dir($tar = $_SERVER['argv'][1])) {
    26         die("Enter a directory to put processed files first argument\n Followed by the files to process\n");
     31        $pasgene = "*** NOTE ***\nEnter a directory to put processed files as first argument\n Followed by the files to process\n";
    2732}
    2833$max = count($_SERVER['argv']);
     
    3035for ($i = 2; $i < $max; $i++) {
    3136    $script = $_SERVER['argv'][$i];
    32         echo "\n******** $script ********\n";
    3337        // on vire framework/Net_SMS/ et en minuscules
    34 //      $fw = fopen("$tar/".basename($script), 'w');
    35 echo ("$tar/" . strtolower(substr($script, 18)));
    36 //      fwrite($fw,
    37 echo(preg_replace($sea, $rep, file_get_contents($script)));
    38 //      fclose($fw);
     38        $target = "$tar/" . strtolower(substr($script, 18));
     39        echo "\n******** $script dans $target ********\n";
     40        $source = preg_replace($sea, $rep, file_get_contents($script));
     41        if ($pasgene) {
     42                echo $source;
     43        } else {
     44                $fw = fopen($target, 'w');
     45                fwrite($fw, $source);
     46                fclose($fw);
     47        }
    3948}
     49echo $pasgene;
    4050?>
Note: See TracChangeset for help on using the changeset viewer.