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
 * PEAR_PackageFile_v2, package.xml version 2.0, read/write version
3
 * PEAR_PackageFile_v2, package.xml version 2.0, read/write version
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: rw.php,v 1.19 2006/10/30 04:12:02 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.0a8
13
 * @since      File available since Release 1.4.0a8
21
 */
14
 */
22
/**
15
/**
23
 * For base class
16
 * For base class
Line 25... Line 18...
25
require_once 'PEAR/PackageFile/v2.php';
18
require_once 'PEAR/PackageFile/v2.php';
26
/**
19
/**
27
 * @category   pear
20
 * @category   pear
28
 * @package    PEAR
21
 * @package    PEAR
29
 * @author     Greg Beaver <cellog@php.net>
22
 * @author     Greg Beaver <cellog@php.net>
30
 * @copyright  1997-2006 The PHP Group
23
 * @copyright  1997-2009 The Authors
31
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
24
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
32
 * @version    Release: 1.5.1
25
 * @version    Release: 1.10.1
33
 * @link       http://pear.php.net/package/PEAR
26
 * @link       http://pear.php.net/package/PEAR
34
 * @since      Class available since Release 1.4.0a8
27
 * @since      Class available since Release 1.4.0a8
35
 */
28
 */
36
class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
29
class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2
37
{
30
{
Line 106... Line 99...
106
    {
99
    {
107
        unset($this->_packageInfo['channel']);
100
        unset($this->_packageInfo['channel']);
108
        $this->_isValid = 0;
101
        $this->_isValid = 0;
109
        if (!isset($this->_packageInfo['uri'])) {
102
        if (!isset($this->_packageInfo['uri'])) {
110
            // ensure that the uri tag is set up in the right location
103
            // ensure that the uri tag is set up in the right location
111
            $this->_packageInfo = $this->_insertBefore($this->_packageInfo, 
104
            $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
112
                array('extends', 'summary', 'description', 'lead',
105
                array('extends', 'summary', 'description', 'lead',
113
                'developer', 'contributor', 'helper', 'date', 'time', 'version',
106
                'developer', 'contributor', 'helper', 'date', 'time', 'version',
114
                'stability', 'license', 'notes', 'contents', 'compatible',
107
                'stability', 'license', 'notes', 'contents', 'compatible',
115
                'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
108
                'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
116
                'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
109
                'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
Line 246... Line 239...
246
                    $found = true;
239
                    $found = true;
247
                    break;
240
                    break;
248
                }
241
                }
249
            }
242
            }
250
            foreach ($info as $i => $maintainer) {
243
            foreach ($info as $i => $maintainer) {
251
                if ($maintainer['user'] == $handle) {
244
                if (is_array($maintainer) && $maintainer['user'] == $handle) {
252
                    $found = $i;
245
                    $found = $i;
253
                    break 2;
246
                    break 2;
254
                }
247
                }
255
            }
248
            }
256
        }
249
        }
Line 456... Line 449...
456
                    'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease',
449
                    'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease',
457
                    'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
450
                    'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
458
                    'bundle', 'changelog'), array(), 'contents');
451
                    'bundle', 'changelog'), array(), 'contents');
459
        }
452
        }
460
        if ($this->getPackageType() != 'bundle') {
453
        if ($this->getPackageType() != 'bundle') {
461
            $this->_packageInfo['contents'] = 
454
            $this->_packageInfo['contents'] =
462
                array('dir' => array('attribs' => array('name' => '/')));
455
                array('dir' => array('attribs' => array('name' => '/')));
463
            if ($baseinstall) {
456
            if ($baseinstall) {
464
                $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'] = $baseinstall;
457
                $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'] = $baseinstall;
465
            }
458
            }
-
 
459
        } else {
-
 
460
            $this->_packageInfo['contents'] = array('bundledpackage' => array());
466
        }
461
        }
467
    }
462
    }
Line 468... Line 463...
468
 
463
 
469
    /**
464
    /**
Line 1223... Line 1218...
1223
        $this->_isValid = 0;
1218
        $this->_isValid = 0;
1224
        if (!in_array($type, array('php', 'extbin', 'extsrc', 'zendextsrc',
1219
        if (!in_array($type, array('php', 'extbin', 'extsrc', 'zendextsrc',
1225
                                   'zendextbin', 'bundle'))) {
1220
                                   'zendextbin', 'bundle'))) {
1226
            return false;
1221
            return false;
1227
        }
1222
        }
-
 
1223
 
1228
        if (in_array($type, array('zendextsrc', 'zendextbin'))) {
1224
        if (in_array($type, array('zendextsrc', 'zendextbin'))) {
1229
            $this->_setPackageVersion2_1();
1225
            $this->_setPackageVersion2_1();
1230
        }
1226
        }
-
 
1227
 
1231
        if ($type != 'bundle') {
1228
        if ($type != 'bundle') {
1232
            $type .= 'release';
1229
            $type .= 'release';
1233
        }
1230
        }
-
 
1231
 
1234
        foreach (array('phprelease', 'extbinrelease', 'extsrcrelease',
1232
        foreach (array('phprelease', 'extbinrelease', 'extsrcrelease',
1235
                       'zendextsrcrelease', 'zendextbinrelease', 'bundle') as $test) {
1233
                       'zendextsrcrelease', 'zendextbinrelease', 'bundle') as $test) {
1236
            unset($this->_packageInfo[$test]);
1234
            unset($this->_packageInfo[$test]);
1237
        }
1235
        }
-
 
1236
 
1238
        if (!isset($this->_packageInfo[$type])) {
1237
        if (!isset($this->_packageInfo[$type])) {
1239
            // ensure that the release tag is set up
1238
            // ensure that the release tag is set up
1240
            $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('changelog'),
1239
            $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('changelog'),
1241
                array(), $type);
1240
                array(), $type);
1242
        }
1241
        }
-
 
1242
 
1243
        $this->_packageInfo[$type] = array();
1243
        $this->_packageInfo[$type] = array();
1244
        return true;
1244
        return true;
1245
    }
1245
    }
Line 1246... Line 1246...
1246
 
1246
 
Line 1357... Line 1357...
1357
    function addConfigureOption($name, $prompt, $default = null)
1357
    function addConfigureOption($name, $prompt, $default = null)
1358
    {
1358
    {
1359
        if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
1359
        if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
1360
            return false;
1360
            return false;
1361
        }
1361
        }
-
 
1362
 
1362
        $r = &$this->_getCurrentRelease(false);
1363
        $r = &$this->_getCurrentRelease(false);
1363
        if ($r === null) {
1364
        if ($r === null) {
1364
            return false;
1365
            return false;
1365
        }
1366
        }
-
 
1367
 
1366
        $opt = array('attribs' => array('name' => $name, 'prompt' => $prompt));
1368
        $opt = array('attribs' => array('name' => $name, 'prompt' => $prompt));
1367
        if ($default !== null) {
1369
        if ($default !== null) {
1368
            $opt['default'] = $default;
1370
            $opt['attribs']['default'] = $default;
1369
        }
1371
        }
-
 
1372
 
1370
        $this->_isValid = 0;
1373
        $this->_isValid = 0;
1371
        $r = $this->_mergeTag($r, $opt,
1374
        $r = $this->_mergeTag($r, $opt,
1372
            array(
1375
            array(
1373
                'configureoption' => array('binarypackage', 'filelist'),
1376
                'configureoption' => array('binarypackage', 'filelist'),
1374
            ));
1377
            ));
Line 1542... Line 1545...
1542
     * @param string|false
1545
     * @param string|false
1543
     */
1546
     */
1544
    function generateChangeLogEntry($notes = false)
1547
    function generateChangeLogEntry($notes = false)
1545
    {
1548
    {
1546
        return array(
1549
        return array(
1547
            'version' => 
1550
            'version' =>
1548
                array(
1551
                array(
1549
                    'release' => $this->getVersion('release'),
1552
                    'release' => $this->getVersion('release'),
1550
                    'api' => $this->getVersion('api'),
1553
                    'api' => $this->getVersion('api'),
1551
                    ),
1554
                    ),
1552
            'stability' =>
1555
            'stability' =>
Line 1595... Line 1598...
1595
     */
1598
     */
1596
    function clearChangeLog()
1599
    function clearChangeLog()
1597
    {
1600
    {
1598
        unset($this->_packageInfo['changelog']);
1601
        unset($this->_packageInfo['changelog']);
1599
    }
1602
    }
1600
}
-
 
1601
?>
-
 
1602
1603
}
-
 
1604
1603
1605