Subversion Repositories Applications.gtt

Rev

Rev 94 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 94 Rev 187
Line 2... Line 2...
2
/**
2
/**
3
 * package.xml generation class, package.xml version 1.0
3
 * package.xml generation class, package.xml version 1.0
4
 *
4
 *
5
 * PHP versions 4 and 5
5
 * PHP versions 4 and 5
6
 *
6
 *
7
 * LICENSE: This source file is subject to version 3.0 of the PHP license
-
 
8
 * that is available through the world-wide-web at the following URI:
-
 
9
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
-
 
10
 * the PHP License and are unable to obtain it through the web, please
-
 
11
 * send a note to license@php.net so we can mail you a copy immediately.
-
 
12
 *
-
 
13
 * @category   pear
7
 * @category   pear
14
 * @package    PEAR
8
 * @package    PEAR
15
 * @author     Greg Beaver <cellog@php.net>
9
 * @author     Greg Beaver <cellog@php.net>
16
 * @copyright  1997-2006 The PHP Group
10
 * @copyright  1997-2009 The Authors
17
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
11
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
18
 * @version    CVS: $Id: v1.php,v 1.72 2006/05/10 02:56:19 cellog Exp $
-
 
19
 * @link       http://pear.php.net/package/PEAR
12
 * @link       http://pear.php.net/package/PEAR
20
 * @since      File available since Release 1.4.0a1
13
 * @since      File available since Release 1.4.0a1
21
 */
14
 */
22
/**
15
/**
23
 * needed for PEAR_VALIDATE_* constants
16
 * needed for PEAR_VALIDATE_* constants
Line 31... Line 24...
31
 * Supported output formats include array, XML string, and a PEAR_PackageFile_v2
24
 * Supported output formats include array, XML string, and a PEAR_PackageFile_v2
32
 * object, for converting package.xml 1.0 into package.xml 2.0 with no sweat.
25
 * object, for converting package.xml 1.0 into package.xml 2.0 with no sweat.
33
 * @category   pear
26
 * @category   pear
34
 * @package    PEAR
27
 * @package    PEAR
35
 * @author     Greg Beaver <cellog@php.net>
28
 * @author     Greg Beaver <cellog@php.net>
36
 * @copyright  1997-2006 The PHP Group
29
 * @copyright  1997-2009 The Authors
37
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
30
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
38
 * @version    Release: 1.5.1
31
 * @version    Release: 1.10.1
39
 * @link       http://pear.php.net/package/PEAR
32
 * @link       http://pear.php.net/package/PEAR
40
 * @since      Class available since Release 1.4.0a1
33
 * @since      Class available since Release 1.4.0a1
41
 */
34
 */
42
class PEAR_PackageFile_Generator_v1
35
class PEAR_PackageFile_Generator_v1
43
{
36
{
44
    /**
37
    /**
45
     * @var PEAR_PackageFile_v1
38
     * @var PEAR_PackageFile_v1
46
     */
39
     */
47
    var $_packagefile;
40
    var $_packagefile;
48
    function PEAR_PackageFile_Generator_v1(&$packagefile)
41
    function __construct(&$packagefile)
49
    {
42
    {
50
        $this->_packagefile = &$packagefile;
43
        $this->_packagefile = &$packagefile;
51
    }
44
    }
Line 52... Line 45...
52
 
45
 
53
    function getPackagerVersion()
46
    function getPackagerVersion()
54
    {
47
    {
55
        return '1.5.1';
48
        return '1.10.1';
Line 56... Line 49...
56
    }
49
    }
57
 
50
 
58
    /**
51
    /**
Line 113... Line 106...
113
            }
106
            }
114
        }
107
        }
115
        // }}}
108
        // }}}
116
        $packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, 'package.xml', true);
109
        $packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, 'package.xml', true);
117
        if ($packagexml) {
110
        if ($packagexml) {
118
            $tar =& new Archive_Tar($dest_package, $compress);
111
            $tar = new Archive_Tar($dest_package, $compress);
119
            $tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors
112
            $tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors
120
            // ----- Creates with the package.xml file
113
            // ----- Creates with the package.xml file
121
            $ok = $tar->createModify(array($packagexml), '', $where);
114
            $ok = $tar->createModify(array($packagexml), '', $where);
122
            if (PEAR::isError($ok)) {
115
            if (PEAR::isError($ok)) {
123
                return $ok;
116
                return $ok;
Line 172... Line 165...
172
     * @return string
165
     * @return string
173
     * @access private
166
     * @access private
174
     */
167
     */
175
    function _fixXmlEncoding($string)
168
    function _fixXmlEncoding($string)
176
    {
169
    {
177
        if (version_compare(phpversion(), '5.0.0', 'lt')) {
-
 
178
            $string = utf8_encode($string);
-
 
179
        }
-
 
180
        return strtr($string, array(
170
        return strtr($string, array(
181
                                          '&'  => '&amp;',
171
                                          '&'  => '&amp;',
182
                                          '>'  => '&gt;',
172
                                          '>'  => '&gt;',
183
                                          '<'  => '&lt;',
173
                                          '<'  => '&lt;',
184
                                          '"'  => '&quot;',
174
                                          '"'  => '&quot;',
Line 204... Line 194...
204
            "email" => "email",
194
            "email" => "email",
205
            "role" => "role",
195
            "role" => "role",
206
            );
196
            );
207
        $ret = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
197
        $ret = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
208
        $ret .= "<!DOCTYPE package SYSTEM \"http://pear.php.net/dtd/package-1.0\">\n";
198
        $ret .= "<!DOCTYPE package SYSTEM \"http://pear.php.net/dtd/package-1.0\">\n";
209
        $ret .= "<package version=\"1.0\" packagerversion=\"1.5.1\">\n" .
199
        $ret .= "<package version=\"1.0\" packagerversion=\"1.10.1\">\n" .
210
" <name>$pkginfo[package]</name>";
200
" <name>$pkginfo[package]</name>";
211
        if (isset($pkginfo['extends'])) {
201
        if (isset($pkginfo['extends'])) {
212
            $ret .= "\n<extends>$pkginfo[extends]</extends>";
202
            $ret .= "\n<extends>$pkginfo[extends]</extends>";
213
        }
203
        }
214
        $ret .=
204
        $ret .=
Line 519... Line 509...
519
                    ' to version 2.0', null, null, null,
509
                    ' to version 2.0', null, null, null,
520
                    $this->_packagefile->getValidationWarnings(true));
510
                    $this->_packagefile->getValidationWarnings(true));
521
                return $a;
511
                return $a;
522
            }
512
            }
523
        }
513
        }
-
 
514
 
524
        $arr = array(
515
        $arr = array(
525
            'attribs' => array(
516
            'attribs' => array(
526
                             'version' => '2.0',
517
                             'version' => '2.0',
527
                             'xmlns' => 'http://pear.php.net/dtd/package-2.0',
518
                             'xmlns' => 'http://pear.php.net/dtd/package-2.0',
528
                             'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0',
519
                             'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0',
Line 548... Line 539...
548
                'email' => $maintainer['email'],
539
                'email' => $maintainer['email'],
549
                'active' => 'yes',
540
                'active' => 'yes',
550
            );
541
            );
551
            $arr['lead'][] = $new;
542
            $arr['lead'][] = $new;
552
        }
543
        }
-
 
544
 
553
        if (!isset($arr['lead'])) { // some people... you know?
545
        if (!isset($arr['lead'])) { // some people... you know?
554
            $arr['lead'] = array(
546
            $arr['lead'] = array(
555
                'name' => 'unknown',
547
                'name' => 'unknown',
556
                'user' => 'unknown',
548
                'user' => 'unknown',
557
                'email' => 'noleadmaintainer@example.com',
549
                'email' => 'noleadmaintainer@example.com',
558
                'active' => 'no',
550
                'active' => 'no',
559
            );
551
            );
560
        }
552
        }
-
 
553
 
561
        if (count($arr['lead']) == 1) {
554
        if (count($arr['lead']) == 1) {
562
            $arr['lead'] = $arr['lead'][0];
555
            $arr['lead'] = $arr['lead'][0];
563
        }
556
        }
-
 
557
 
564
        foreach ($maintainers as $maintainer) {
558
        foreach ($maintainers as $maintainer) {
565
            if ($maintainer['role'] == 'lead') {
559
            if ($maintainer['role'] == 'lead') {
566
                continue;
560
                continue;
567
            }
561
            }
568
            $new = array(
562
            $new = array(
Line 571... Line 565...
571
                'email' => $maintainer['email'],
565
                'email' => $maintainer['email'],
572
                'active' => 'yes',
566
                'active' => 'yes',
573
            );
567
            );
574
            $arr[$maintainer['role']][] = $new;
568
            $arr[$maintainer['role']][] = $new;
575
        }
569
        }
-
 
570
 
576
        if (isset($arr['developer']) && count($arr['developer']) == 1) {
571
        if (isset($arr['developer']) && count($arr['developer']) == 1) {
577
            $arr['developer'] = $arr['developer'][0];
572
            $arr['developer'] = $arr['developer'][0];
578
        }
573
        }
-
 
574
 
579
        if (isset($arr['contributor']) && count($arr['contributor']) == 1) {
575
        if (isset($arr['contributor']) && count($arr['contributor']) == 1) {
580
            $arr['contributor'] = $arr['contributor'][0];
576
            $arr['contributor'] = $arr['contributor'][0];
581
        }
577
        }
-
 
578
 
582
        if (isset($arr['helper']) && count($arr['helper']) == 1) {
579
        if (isset($arr['helper']) && count($arr['helper']) == 1) {
583
            $arr['helper'] = $arr['helper'][0];
580
            $arr['helper'] = $arr['helper'][0];
584
        }
581
        }
-
 
582
 
585
        $arr['date'] = $this->_packagefile->getDate();
583
        $arr['date'] = $this->_packagefile->getDate();
586
        $arr['version'] =
584
        $arr['version'] =
587
            array(
585
            array(
588
                'release' => $this->_packagefile->getVersion(),
586
                'release' => $this->_packagefile->getVersion(),
589
                'api' => $this->_packagefile->getVersion(),
587
                'api' => $this->_packagefile->getVersion(),
Line 603... Line 601...
603
                'bsd-style' => 'http://www.opensource.org/licenses/bsd-license.php',
601
                'bsd-style' => 'http://www.opensource.org/licenses/bsd-license.php',
604
                'mit' => 'http://www.opensource.org/licenses/mit-license.php',
602
                'mit' => 'http://www.opensource.org/licenses/mit-license.php',
605
                'gpl' => 'http://www.gnu.org/copyleft/gpl.html',
603
                'gpl' => 'http://www.gnu.org/copyleft/gpl.html',
606
                'apache' => 'http://www.opensource.org/licenses/apache2.0.php'
604
                'apache' => 'http://www.opensource.org/licenses/apache2.0.php'
607
            );
605
            );
-
 
606
 
608
        if (isset($licensemap[strtolower($this->_packagefile->getLicense())])) {
607
        if (isset($licensemap[strtolower($this->_packagefile->getLicense())])) {
609
            $arr['license'] = array(
608
            $arr['license'] = array(
610
                'attribs' => array('uri' =>
609
                'attribs' => array('uri' =>
611
                    $licensemap[strtolower($this->_packagefile->getLicense())]),
610
                    $licensemap[strtolower($this->_packagefile->getLicense())]),
612
                '_content' => $this->_packagefile->getLicense()
611
                '_content' => $this->_packagefile->getLicense()
613
                );
612
                );
614
        } else {
613
        } else {
615
            // don't use bogus uri
614
            // don't use bogus uri
616
            $arr['license'] = $this->_packagefile->getLicense();
615
            $arr['license'] = $this->_packagefile->getLicense();
617
        }
616
        }
-
 
617
 
618
        $arr['notes'] = $this->_packagefile->getNotes();
618
        $arr['notes'] = $this->_packagefile->getNotes();
619
        $temp = array();
619
        $temp = array();
620
        $arr['contents'] = $this->_convertFilelist2_0($temp);
620
        $arr['contents'] = $this->_convertFilelist2_0($temp);
621
        $this->_convertDependencies2_0($arr);
621
        $this->_convertDependencies2_0($arr);
622
        $release = ($this->_packagefile->getConfigureOptions() || $this->_isExtension) ?
622
        $release = ($this->_packagefile->getConfigureOptions() || $this->_isExtension) ?
623
            'extsrcrelease' : 'phprelease';
623
            'extsrcrelease' : 'phprelease';
624
        if ($release == 'extsrcrelease') {
624
        if ($release == 'extsrcrelease') {
625
            $arr['channel'] = 'pecl.php.net';
625
            $arr['channel'] = 'pecl.php.net';
626
            $arr['providesextension'] = $arr['name']; // assumption
626
            $arr['providesextension'] = $arr['name']; // assumption
627
        }
627
        }
-
 
628
 
628
        $arr[$release] = array();
629
        $arr[$release] = array();
629
        if ($this->_packagefile->getConfigureOptions()) {
630
        if ($this->_packagefile->getConfigureOptions()) {
630
            $arr[$release]['configureoption'] = $this->_packagefile->getConfigureOptions();
631
            $arr[$release]['configureoption'] = $this->_packagefile->getConfigureOptions();
631
            foreach ($arr[$release]['configureoption'] as $i => $opt) {
632
            foreach ($arr[$release]['configureoption'] as $i => $opt) {
632
                $arr[$release]['configureoption'][$i] = array('attribs' => $opt);
633
                $arr[$release]['configureoption'][$i] = array('attribs' => $opt);
633
            }
634
            }
634
            if (count($arr[$release]['configureoption']) == 1) {
635
            if (count($arr[$release]['configureoption']) == 1) {
635
                $arr[$release]['configureoption'] = $arr[$release]['configureoption'][0];
636
                $arr[$release]['configureoption'] = $arr[$release]['configureoption'][0];
636
            }
637
            }
637
        }
638
        }
-
 
639
 
638
        $this->_convertRelease2_0($arr[$release], $temp);
640
        $this->_convertRelease2_0($arr[$release], $temp);
639
        if ($release == 'extsrcrelease' && count($arr[$release]) > 1) {
641
        if ($release == 'extsrcrelease' && count($arr[$release]) > 1) {
640
            // multiple extsrcrelease tags added in PEAR 1.4.1
642
            // multiple extsrcrelease tags added in PEAR 1.4.1
641
            $arr['dependencies']['required']['pearinstaller']['min'] = '1.4.1';
643
            $arr['dependencies']['required']['pearinstaller']['min'] = '1.4.1';
642
        }
644
        }
-
 
645
 
643
        if ($cl = $this->_packagefile->getChangelog()) {
646
        if ($cl = $this->_packagefile->getChangelog()) {
644
            foreach ($cl as $release) {
647
            foreach ($cl as $release) {
645
                $rel = array();
648
                $rel = array();
646
                $rel['version'] =
649
                $rel['version'] =
647
                    array(
650
                    array(
Line 649... Line 652...
649
                        'api' => $release['version'],
652
                        'api' => $release['version'],
650
                    );
653
                    );
651
                if (!isset($release['release_state'])) {
654
                if (!isset($release['release_state'])) {
652
                    $release['release_state'] = 'stable';
655
                    $release['release_state'] = 'stable';
653
                }
656
                }
-
 
657
 
654
                $rel['stability'] =
658
                $rel['stability'] =
655
                    array(
659
                    array(
656
                        'release' => $release['release_state'],
660
                        'release' => $release['release_state'],
657
                        'api' => $release['release_state'],
661
                        'api' => $release['release_state'],
658
                    );
662
                    );
659
                if (isset($release['release_date'])) {
663
                if (isset($release['release_date'])) {
660
                    $rel['date'] = $release['release_date'];
664
                    $rel['date'] = $release['release_date'];
661
                } else {
665
                } else {
662
                    $rel['date'] = date('Y-m-d');
666
                    $rel['date'] = date('Y-m-d');
663
                }
667
                }
-
 
668
 
664
                if (isset($release['release_license'])) {
669
                if (isset($release['release_license'])) {
665
                    if (isset($licensemap[strtolower($release['release_license'])])) {
670
                    if (isset($licensemap[strtolower($release['release_license'])])) {
666
                        $uri = $licensemap[strtolower($release['release_license'])];
671
                        $uri = $licensemap[strtolower($release['release_license'])];
667
                    } else {
672
                    } else {
668
                        $uri = 'http://www.example.com';
673
                        $uri = 'http://www.example.com';
Line 672... Line 677...
672
                            '_content' => $release['release_license']
677
                            '_content' => $release['release_license']
673
                        );
678
                        );
674
                } else {
679
                } else {
675
                    $rel['license'] = $arr['license'];
680
                    $rel['license'] = $arr['license'];
676
                }
681
                }
-
 
682
 
677
                if (!isset($release['release_notes'])) {
683
                if (!isset($release['release_notes'])) {
678
                    $release['release_notes'] = 'no release notes';
684
                    $release['release_notes'] = 'no release notes';
679
                }
685
                }
-
 
686
 
680
                $rel['notes'] = $release['release_notes'];
687
                $rel['notes'] = $release['release_notes'];
681
                $arr['changelog']['release'][] = $rel;
688
                $arr['changelog']['release'][] = $rel;
682
            }
689
            }
683
        }
690
        }
-
 
691
 
684
        $ret = new $class;
692
        $ret = new $class;
685
        $ret->setConfig($this->_packagefile->_config);
693
        $ret->setConfig($this->_packagefile->_config);
686
        if (isset($this->_packagefile->_logger) && is_object($this->_packagefile->_logger)) {
694
        if (isset($this->_packagefile->_logger) && is_object($this->_packagefile->_logger)) {
687
            $ret->setLogger($this->_packagefile->_logger);
695
            $ret->setLogger($this->_packagefile->_logger);
688
        }
696
        }
-
 
697
 
689
        $ret->fromArray($arr);
698
        $ret->fromArray($arr);
690
        return $ret;
699
        return $ret;
691
    }
700
    }
Line 692... Line 701...
692
 
701
 
Line 698... Line 707...
698
    function _convertDependencies2_0(&$release, $internal = false)
707
    function _convertDependencies2_0(&$release, $internal = false)
699
    {
708
    {
700
        $peardep = array('pearinstaller' =>
709
        $peardep = array('pearinstaller' =>
701
            array('min' => '1.4.0b1')); // this is a lot safer
710
            array('min' => '1.4.0b1')); // this is a lot safer
702
        $required = $optional = array();
711
        $required = $optional = array();
703
        $release['dependencies'] = array();
712
        $release['dependencies'] = array('required' => array());
704
        if ($this->_packagefile->hasDeps()) {
713
        if ($this->_packagefile->hasDeps()) {
705
            foreach ($this->_packagefile->getDeps() as $dep) {
714
            foreach ($this->_packagefile->getDeps() as $dep) {
706
                if (!isset($dep['optional']) || $dep['optional'] == 'no') {
715
                if (!isset($dep['optional']) || $dep['optional'] == 'no') {
707
                    $required[] = $dep;
716
                    $required[] = $dep;
708
                } else {
717
                } else {
Line 829... Line 838...
829
    }
838
    }
Line 830... Line 839...
830
 
839
 
831
    /**
840
    /**
832
     * Post-process special files with install-as/platform attributes and
841
     * Post-process special files with install-as/platform attributes and
833
     * make the release tag.
842
     * make the release tag.
834
     * 
843
     *
835
     * This complex method follows this work-flow to create the release tags:
844
     * This complex method follows this work-flow to create the release tags:
836
     * 
845
     *
837
     * <pre>
846
     * <pre>
838
     * - if any install-as/platform exist, create a generic release and fill it with
847
     * - if any install-as/platform exist, create a generic release and fill it with
839
     *   o <install as=..> tags for <file name=... install-as=...>
848
     *   o <install as=..> tags for <file name=... install-as=...>
840
     *   o <install as=..> tags for <file name=... platform=!... install-as=..>
849
     *   o <install as=..> tags for <file name=... platform=!... install-as=..>
Line 847... Line 856...
847
     *   o <ignore> tags for <file name=... platform=!this platform>
856
     *   o <ignore> tags for <file name=... platform=!this platform>
848
     *   o <ignore> tags for <file name=... platform=other platform>
857
     *   o <ignore> tags for <file name=... platform=other platform>
849
     *   o <ignore> tags for <file name=... platform=other platform install-as=..>
858
     *   o <ignore> tags for <file name=... platform=other platform install-as=..>
850
     *   o <ignore> tags for <file name=... platform=!this platform install-as=..>
859
     *   o <ignore> tags for <file name=... platform=!this platform install-as=..>
851
     * </pre>
860
     * </pre>
852
     * 
861
     *
853
     * It does this by accessing the $package parameter, which contains an array with
862
     * It does this by accessing the $package parameter, which contains an array with
854
     * indices:
863
     * indices:
855
     * 
864
     *
856
     *  - platform: mapping of file => OS the file should be installed on
865
     *  - platform: mapping of file => OS the file should be installed on
857
     *  - install-as: mapping of file => installed name
866
     *  - install-as: mapping of file => installed name
858
     *  - osmap: mapping of OS => list of files that should be installed
867
     *  - osmap: mapping of OS => list of files that should be installed
859
     *    on that OS
868
     *    on that OS
860
     *  - notosmap: mapping of OS => list of files that should not be
869
     *  - notosmap: mapping of OS => list of files that should not be
Line 864... Line 873...
864
     * @param array
873
     * @param array
865
     * @access private
874
     * @access private
866
     */
875
     */
867
    function _convertRelease2_0(&$release, $package)
876
    function _convertRelease2_0(&$release, $package)
868
    {
877
    {
869
        //- if any install-as/platform exist, create a generic release and fill it with 
878
        //- if any install-as/platform exist, create a generic release and fill it with
870
        if (count($package['platform']) || count($package['install-as'])) {
879
        if (count($package['platform']) || count($package['install-as'])) {
871
            $generic = array();
880
            $generic = array();
872
            $genericIgnore = array();
881
            $genericIgnore = array();
873
            foreach ($package['install-as'] as $file => $as) {
882
            foreach ($package['install-as'] as $file => $as) {
874
                //o <install as=..> tags for <file name=... install-as=...>
883
                //o <install as=..> tags for <file name=... install-as=...>
Line 1163... Line 1172...
1163
        if (count($max) > 0) {
1172
        if (count($max) > 0) {
1164
            uksort($max, 'version_compare');
1173
            uksort($max, 'version_compare');
1165
        }
1174
        }
1166
        if (count($min)) {
1175
        if (count($min)) {
1167
            // get the highest minimum
1176
            // get the highest minimum
1168
            $min = array_pop($a = array_flip($min));
1177
            $a = array_flip($min);
-
 
1178
            $min = array_pop($a);
1169
        } else {
1179
        } else {
1170
            $min = false;
1180
            $min = false;
1171
        }
1181
        }
1172
        if (count($max)) {
1182
        if (count($max)) {
1173
            // get the lowest maximum
1183
            // get the lowest maximum
-
 
1184
            $a = array_flip($max);
1174
            $max = array_shift($a = array_flip($max));
1185
            $max = array_shift($a);
1175
        } else {
1186
        } else {
1176
            $max = false;
1187
            $max = false;
1177
        }
1188
        }
1178
        if ($min) {
1189
        if ($min) {
1179
            $php['min'] = $min;
1190
            $php['min'] = $min;
Line 1200... Line 1211...
1200
     * @return array
1211
     * @return array
1201
     * @access private
1212
     * @access private
1202
     */
1213
     */
1203
    function _processMultipleDepsName($deps)
1214
    function _processMultipleDepsName($deps)
1204
    {
1215
    {
1205
        $tests = array();
1216
        $ret = $tests = array();
1206
        foreach ($deps as $name => $dep) {
1217
        foreach ($deps as $name => $dep) {
1207
            foreach ($dep as $d) {
1218
            foreach ($dep as $d) {
1208
                $tests[$name][] = $this->_processDep($d);
1219
                $tests[$name][] = $this->_processDep($d);
1209
            }
1220
            }
1210
        }
1221
        }
-
 
1222
 
1211
        foreach ($tests as $name => $test) {
1223
        foreach ($tests as $name => $test) {
1212
            $php = array();
-
 
1213
            $min = array();
-
 
1214
            $max = array();
1224
            $max = $min = $php = array();
1215
            $php['name'] = $name;
1225
            $php['name'] = $name;
1216
            foreach ($test as $dep) {
1226
            foreach ($test as $dep) {
1217
                if (!$dep) {
1227
                if (!$dep) {
1218
                    continue;
1228
                    continue;
1219
                }
1229
                }
Line 1236... Line 1246...
1236
            if (count($max) > 0) {
1246
            if (count($max) > 0) {
1237
                uksort($max, 'version_compare');
1247
                uksort($max, 'version_compare');
1238
            }
1248
            }
1239
            if (count($min)) {
1249
            if (count($min)) {
1240
                // get the highest minimum
1250
                // get the highest minimum
1241
                $min = array_pop($a = array_flip($min));
1251
                $a = array_flip($min);
-
 
1252
                $min = array_pop($a);
1242
            } else {
1253
            } else {
1243
                $min = false;
1254
                $min = false;
1244
            }
1255
            }
1245
            if (count($max)) {
1256
            if (count($max)) {
1246
                // get the lowest maximum
1257
                // get the lowest maximum
-
 
1258
                $a = array_flip($max);
1247
                $max = array_shift($a = array_flip($max));
1259
                $max = array_shift($a);
1248
            } else {
1260
            } else {
1249
                $max = false;
1261
                $max = false;
1250
            }
1262
            }
1251
            if ($min) {
1263
            if ($min) {
1252
                $php['min'] = $min;
1264
                $php['min'] = $min;
Line 1267... Line 1279...
1267
            $ret[] = $php;
1279
            $ret[] = $php;
1268
        }
1280
        }
1269
        return $ret;
1281
        return $ret;
1270
    }
1282
    }
1271
}
1283
}
1272
?>
-
 
1273
1284
?>
-
 
1285