Changeset 8119 in spip-zone


Ignore:
Timestamp:
Dec 18, 2006, 10:40:56 PM (12 years ago)
Author:
bertrand@…
Message:

Un commit vide , marre de pas faire ça en objet , on passe plein de trucs la , je prefererais $this->blah ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _dev_/bin_svn/zonedist.php

    r8110 r8119  
    3030var_dump($changed);
    3131
    32 function addfol(&$folder, $name, $key, $val)
     32function code_change(&$foldelt, $key, $val, &$changed)
     33{
     34}
     35
     36function archive_change(&$foldelt, $key, $val, &$folders)
     37{
     38}
     39
     40function addfol(&$folders, $name, $key, $val, $fun, &$arg)
    3341{
    3442        if (!isset($folders[$name])) {
     
    3644        }
    3745        $folders[$name][$key] = $val;
    38        
     46        $fun($folders[$name], $key, $val, $arg);
    3947}
    40 function folders(&$folder, $in)
     48function folders(&$folders, $in, $fun, &$arg)
    4149{
    4250        while (($line = fgets($in)) !== false) {
     
    4553                                $zip[0] = substr($zip[0], 0, -1);
    4654                        }
    47                         addfol($folder, array_shift($zip), 'z', $zip);
     55                        addfol($folders, array_shift($zip), 'z', $zip, $fun, $arg);
    4856                        continue;
    4957                }
     
    5159                        continue;
    5260                }
    53                 addfol($folder, $matches[1], empty($matches[2]) ? 't' : 'p', true);
     61                addfol($folders, $matches[1], empty($matches[2]) ? 't' : 'p', true, $fun, $arg);
    5462        }
    5563}
     
    5765// les plugin.xml, theme.xml et references archivelist.txt triees
    5866$folders = array();
    59 $status = folders($folders, STDIN);
     67$status = folders($folders, STDIN, 'code_change', $changed);
    6068
    6169$oldfol = array();
    6270if (isset($changed['archivelist.txt'])) {
    6371        $old = fopen('archivelist.txt.old');
    64         $statold = folders($oldfol, $old);
     72        $statold = folders($oldfol, $old, 'archive_change', $folders);
    6573}
    6674var_dump($folders);
Note: See TracChangeset for help on using the changeset viewer.