Bearsampp 2026.9.23
Loading...
Searching...
No Matches
PEAR_PackageFile_v2_rw Class Reference
Inheritance diagram for PEAR_PackageFile_v2_rw:
Collaboration diagram for PEAR_PackageFile_v2_rw:

Public Member Functions

 _addGroupDependency ($type, $dep, $groupname)
 _constructDep ($name, $channel, $uri, $min, $max, $recommended, $exclude, $providesextension=false, $nodefault=false, $conflicts=false)
& _getCurrentRelease ($strict=true)
 _setPackageVersion2_1 ()
 addArchDep ($pattern, $conflicts=false)
 addBinarypackage ($package)
 addBundledPackage ($path)
 addCompatiblePackage ($name, $channel, $min, $max, $exclude=false)
 addConfigureOption ($name, $prompt, $default=null)
 addConflictingPackageDepWithChannel ($name, $channel, $providesextension=false, $min=false, $max=false, $exclude=false)
 addConflictingPackageDepWithUri ($name, $uri, $providesextension=false)
 addDependencyGroup ($name, $hint)
 addExtensionDep ($type, $name, $min=false, $max=false, $recommended=false, $exclude=false)
 addExtensionInstallCondition ($name, $min=false, $max=false, $recommended=false, $exclude=false)
 addFile ($dir, $file, $attrs)
 addGroupExtensionDep ($groupname, $name, $min=false, $max=false, $recommended=false, $exclude=false)
 addGroupPackageDepWithChannel ($type, $groupname, $name, $channel, $min=false, $max=false, $recommended=false, $exclude=false, $providesextension=false, $nodefault=false)
 addGroupPackageDepWithURI ($type, $groupname, $name, $uri, $providesextension=false, $nodefault=false)
 addIgnore ($path)
 addInstallAs ($path, $as)
 addMaintainer ($role, $handle, $name, $email, $active='yes')
 addOsDep ($name, $conflicts=false)
 addPackageDepWithChannel ($type, $name, $channel, $min=false, $max=false, $recommended=false, $exclude=false, $providesextension=false, $nodefault=false)
 addPackageDepWithUri ($type, $name, $uri, $providesextension=false, $nodefault=false)
 addRelease ()
 addSubpackageDepWithChannel ($type, $name, $channel, $min=false, $max=false, $recommended=false, $exclude=false, $nodefault=false)
 addSubpackageDepWithUri ($type, $name, $uri, $nodefault=false)
 addTaskToFile ($filename, $task)
 addUsesrole ($role, $packageOrUri, $channel=false)
 addUsestask ($task, $packageOrUri, $channel=false)
 clearChangeLog ()
 clearCompatible ()
 clearContents ($baseinstall=false)
 clearDeps ()
 deleteMaintainer ($handle)
 generateChangeLogEntry ($notes=false)
 installedFile ($file, $atts)
 resetUsesrole ()
 resetUsestask ()
 setAPIStability ($state)
 setAPIVersion ($version)
 setArchInstallCondition ($pattern, $conflicts=false)
 setChangelogEntry ($releaseversion, $contents)
 setChannel ($channel)
 setDescription ($desc)
 setExtends ($extends)
 setInstalledAs ($file, $path)
 setLicense ($license, $uri=false, $filesource=false)
 setNotes ($notes)
 setOsInstallCondition ($name, $conflicts=false)
 setPackage ($package)
 setPackageType ($type)
 setPearinstallerDep ($min, $max=false, $recommended=false, $exclude=false)
 setPhpDep ($min, $max=false, $exclude=false)
 setPhpInstallCondition ($min, $max, $exclude=false)
 setProvidesExtension ($extension)
 setReleaseStability ($state)
 setReleaseVersion ($version)
 setSourcePackage ($packageOrUri)
 setSummary ($summary)
 setUri ($uri)
 updateMaintainer ($newrole, $handle, $name, $email, $active='yes')
Public Member Functions inherited from PEAR_PackageFile_v2
 __construct ()
 _differentDescription ($description)
 _differentEmail ($handle, $email, $selfemail)
 _differentName ($handle, $name, $selfname)
 _differentNotes ($notes)
 _differentPackage ($package)
 _differentRole ($handle, $role, $selfrole)
 _differentState ($state)
 _differentSummary ($summary)
 _differentVersion ($version)
 _getFlattenedFilelist (&$files, $dir, $baseinstall=false, $path='')
 _insertBefore ($array, $keys, $contents, $newkey)
 _ksplice ($array, $key, $value, $newkey)
 _mergeTag ($manip, $contents, $order)
 _missingFile ($file)
 _unmatchedMaintainers ($my, $yours)
 analyzeSourceCode ($file, $string=false)
 dependsOn ($package, $channel)
 flattenFilelist ()
 fromArray ($pinfo)
 getArchiveFile ()
 getArray ($forReg=false)
 getBundledPackages ()
 getChangelog ()
 getChannel ()
 getCompatible ()
 getConfigureOptions ()
 getContents ()
 getContributors ()
 getDate ()
& getDefaultGenerator ()
 getDependencies ()
 getDependencyGroup ($name)
 getDeps ($raw=false, $nopearinstaller=false)
 getDescription ()
 getDevelopers ()
 getDirtree ()
 getExtends ()
 getFileContents ($file)
 getFilelist ($preserve=false)
 getHelpers ()
 getInstallationFilelist ($forfilecheck=false)
 getInstalledBinary ()
 getInstalledLocation ($file)
 getLastInstalledVersion ()
 getLastModified ()
 getLeads ()
 getLicense ($raw=false)
 getLicenseLocation ()
 getMaintainers ($raw=false)
 getName ()
 getNotes ()
 getPackage ()
 getPackageFile ()
 getPackageType ()
 getPackagexmlVersion ()
& getPEARDependency2 (&$c, $o, $p, $s=PEAR_VALIDATE_INSTALLING)
& getPEARDownloader (&$i, $o, &$c)
 getProvidesExtension ()
 getReleases ()
 getRequestedGroup ()
& getRW ()
 getSourcePackage ()
 getStability ()
 getState ($key='release')
 getSummary ()
 getTask ($task)
 getTasksNs ()
 getTime ()
 getUri ()
 getUsesrole ()
 getUsestask ()
 getValidationWarnings ($purge=true)
 getVersion ($key='release')
 hasDeps ()
 initPostinstallScripts ()
 installBinary (&$installer)
 isCompatible ($pf)
 isEquivalent ($pf1)
 isExtension ($extension)
 isIncomplete ()
 isSubpackage ($p)
 isSubpackageOf ($p)
 listPostinstallScripts ()
 packageInfo ($field)
 PEAR_PackageFile_v2 ()
 resetDirtree ()
 resetFilelist ()
 runPostinstallScripts ()
 setCompatible ($compat)
 setConfig (&$config)
 setDate ($date)
 setDeps ($deps)
 setDirtree ($path)
 setFileAttribute ($filename, $attr, $value, $index=false)
 setLastInstalledVersion ($version)
 setLogger (&$logger)
 setPackagefile ($file, $archive=false)
 setRawChannel ($channel)
 setRawCompatible ($compatible)
 setRawPackage ($package)
 setRawState ($state)
 setRequestedGroup ($group)
 setTime ($time)
 toArray ($forreg=false)
 validate ($state=PEAR_VALIDATE_NORMAL)

Additional Inherited Members

Data Fields inherited from PEAR_PackageFile_v2
 $_archiveFile
 $_config
 $_filesValid = false
 $_incomplete = true
 $_isValid = 0
 $_logger
 $_packageFile
 $_packageInfo = array()
 $_registry
 $_requestedGroup = false
 $_stack
 $_tasksNs
 $_v2Validator

Detailed Description

Definition at line 29 of file rw.php.

Member Function Documentation

◆ _addGroupDependency()

_addGroupDependency ( $type,
$dep,
$groupname )
Parameters
package|subpackage|extension
arraydependency contents
stringname of the dependency group to add this to
Returns
boolean @access private

Definition at line 973 of file rw.php.

974 {
975 $arr = array('subpackage', 'extension');
976 if ($type != 'package') {
977 array_shift($arr);
978 }
979 if ($type == 'extension') {
980 array_shift($arr);
981 }
982 if (!isset($this->_packageInfo['dependencies']['group'])) {
983 return false;
984 } else {
985 if (!isset($this->_packageInfo['dependencies']['group'][0])) {
986 if ($this->_packageInfo['dependencies']['group']['attribs']['name'] == $groupname) {
987 $this->_packageInfo['dependencies']['group'] = $this->_mergeTag(
988 $this->_packageInfo['dependencies']['group'], $dep,
989 array(
990 $type => $arr
991 ));
992 $this->_isValid = 0;
993 return true;
994 } else {
995 return false;
996 }
997 } else {
998 foreach ($this->_packageInfo['dependencies']['group'] as $i => $group) {
999 if ($group['attribs']['name'] == $groupname) {
1000 $this->_packageInfo['dependencies']['group'][$i] = $this->_mergeTag(
1001 $this->_packageInfo['dependencies']['group'][$i], $dep,
1002 array(
1003 $type => $arr
1004 ));
1005 $this->_isValid = 0;
1006 return true;
1007 }
1008 }
1009 return false;
1010 }
1011 }
1012 }
_mergeTag($manip, $contents, $order)
Definition v2.php:2030

References PEAR_PackageFile_v2\_mergeTag().

Referenced by addGroupExtensionDep(), addGroupPackageDepWithChannel(), and addGroupPackageDepWithURI().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _constructDep()

_constructDep ( $name,
$channel,
$uri,
$min,
$max,
$recommended,
$exclude,
$providesextension = false,
$nodefault = false,
$conflicts = false )
Parameters
stringpackage name
string|falsechannel name, false if this is a uri
string|falseuri name, false if this is a channel
string|falseminimum version required
string|falsemaximum version allowed
string|falserecommended installation version
array|falseversions to exclude from installation
stringextension this package provides, if any
boolif true, tells the installer to ignore the default optional dependency group when installing this package
boolif true, tells the installer to negate this dependency (conflicts)
Returns
array @access private

Definition at line 860 of file rw.php.

863 {
864 $dep =
865 array(
866 'name' => $name,
867 );
868 if ($channel) {
869 $dep['channel'] = $channel;
870 } elseif ($uri) {
871 $dep['uri'] = $uri;
872 }
873 if ($min) {
874 $dep['min'] = $min;
875 }
876 if ($max) {
877 $dep['max'] = $max;
878 }
879 if ($recommended) {
880 $dep['recommended'] = $recommended;
881 }
882 if ($exclude) {
883 if (is_array($exclude) && count($exclude) == 1) {
884 $exclude = $exclude[0];
885 }
886 $dep['exclude'] = $exclude;
887 }
888 if ($conflicts) {
889 $dep['conflicts'] = '';
890 }
891 if ($nodefault) {
892 $dep['nodefault'] = '';
893 }
894 if ($providesextension) {
895 $dep['providesextension'] = $providesextension;
896 }
897 return $dep;
898 }

Referenced by addConflictingPackageDepWithChannel(), addExtensionDep(), addExtensionInstallCondition(), addGroupExtensionDep(), addGroupPackageDepWithChannel(), addGroupPackageDepWithURI(), addPackageDepWithChannel(), addPackageDepWithUri(), addSubpackageDepWithChannel(), and addSubpackageDepWithUri().

Here is the caller graph for this function:

◆ _getCurrentRelease()

& _getCurrentRelease ( $strict = true)

Get the current release tag in order to add to it

Parameters
boolreturns only releases that have installcondition if true
Returns
array|null

Definition at line 1268 of file rw.php.

1269 {
1270 if ($p = $this->getPackageType()) {
1271 if ($strict) {
1272 if ($p == 'extsrc' || $p == 'zendextsrc') {
1273 $a = null;
1274 return $a;
1275 }
1276 }
1277 if ($p != 'bundle') {
1278 $p .= 'release';
1279 }
1280 if (isset($this->_packageInfo[$p][0])) {
1281 return $this->_packageInfo[$p][count($this->_packageInfo[$p]) - 1];
1282 } else {
1283 return $this->_packageInfo[$p];
1284 }
1285 } else {
1286 $a = null;
1287 return $a;
1288 }
1289 }

References PEAR_PackageFile_v2\getPackageType().

Referenced by addBinarypackage(), addConfigureOption(), addExtensionInstallCondition(), addIgnore(), addInstallAs(), setArchInstallCondition(), setOsInstallCondition(), and setPhpInstallCondition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setPackageVersion2_1()

_setPackageVersion2_1 ( )

set this as a package.xml version 2.1 @access private

Definition at line 79 of file rw.php.

80 {
81 $info = array(
82 'version' => '2.1',
83 'xmlns' => 'http://pear.php.net/dtd/package-2.1',
84 'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0',
85 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
86 'xsi:schemaLocation' => 'http://pear.php.net/dtd/tasks-1.0
87 http://pear.php.net/dtd/tasks-1.0.xsd
88 http://pear.php.net/dtd/package-2.1
89 http://pear.php.net/dtd/package-2.1.xsd',
90 );
91 if (!isset($this->_packageInfo['attribs'])) {
92 $this->_packageInfo = array_merge(array('attribs' => $info), $this->_packageInfo);
93 } else {
94 $this->_packageInfo['attribs'] = $info;
95 }
96 }

Referenced by setPackageType().

Here is the caller graph for this function:

◆ addArchDep()

addArchDep ( $pattern,
$conflicts = false )
Parameters
stringArchitecture matching pattern
booleantrue if this package cannot be installed on this architecture

Definition at line 1187 of file rw.php.

1188 {
1189 $this->_isValid = 0;
1190 $dep = array('pattern' => $pattern);
1191 if ($conflicts) {
1192 $dep['conflicts'] = '';
1193 }
1194 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1195 array(
1196 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1197 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1198 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1199 'required' => array('optional', 'group'),
1200 'arch' => array()
1201 ));
1202 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addBinarypackage()

addBinarypackage ( $package)

Add an extension binary package for this extension source code release

Note that the package must be from the same channel as the extension source package

Parameters
string

Definition at line 1335 of file rw.php.

1336 {
1337 if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
1338 return false;
1339 }
1340 $r = &$this->_getCurrentRelease(false);
1341 if ($r === null) {
1342 return false;
1343 }
1344 $this->_isValid = 0;
1345 $r = $this->_mergeTag($r, $package,
1346 array(
1347 'binarypackage' => array('filelist'),
1348 ));
1349 }
& _getCurrentRelease($strict=true)
Definition rw.php:1268

References _getCurrentRelease(), PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ addBundledPackage()

addBundledPackage ( $path)
Parameters
stringrelative path of the bundled package.

Definition at line 467 of file rw.php.

468 {
469 if ($this->getPackageType() != 'bundle') {
470 return false;
471 }
472 $this->_filesValid = false;
473 $this->_isValid = 0;
474 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $path, array(
475 'contents' => array('compatible', 'dependencies', 'providesextension',
476 'usesrole', 'usestask', 'srcpackage', 'srcuri', 'phprelease',
477 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
478 'bundle', 'changelog'),
479 'bundledpackage' => array()));
480 }

References PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ addCompatiblePackage()

addCompatiblePackage ( $name,
$channel,
$min,
$max,
$exclude = false )
Parameters
stringDependent package name
stringDependent package's channel name
stringminimum version of specified package that this release is guaranteed to be compatible with
stringmaximum version of specified package that this release is guaranteed to be compatible with
stringversions of specified package that this release is not compatible with

Definition at line 594 of file rw.php.

595 {
596 $this->_isValid = 0;
597 $set = array(
598 'name' => $name,
599 'channel' => $channel,
600 'min' => $min,
601 'max' => $max,
602 );
603 if ($exclude) {
604 $set['exclude'] = $exclude;
605 }
606 $this->_isValid = 0;
607 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $set, array(
608 'compatible' => array('dependencies', 'providesextension', 'usesrole', 'usestask',
609 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
610 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog')
611 ));
612 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addConfigureOption()

addConfigureOption ( $name,
$prompt,
$default = null )

Add a configureoption to an extension source package

Parameters
string
string
string

Definition at line 1357 of file rw.php.

1358 {
1359 if ($this->getPackageType() != 'extsrc' && $this->getPackageType() != 'zendextsrc') {
1360 return false;
1361 }
1362
1363 $r = &$this->_getCurrentRelease(false);
1364 if ($r === null) {
1365 return false;
1366 }
1367
1368 $opt = array('attribs' => array('name' => $name, 'prompt' => $prompt));
1369 if ($default !== null) {
1370 $opt['attribs']['default'] = $default;
1371 }
1372
1373 $this->_isValid = 0;
1374 $r = $this->_mergeTag($r, $opt,
1375 array(
1376 'configureoption' => array('binarypackage', 'filelist'),
1377 ));
1378 }

References _getCurrentRelease(), PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ addConflictingPackageDepWithChannel()

addConflictingPackageDepWithChannel ( $name,
$channel,
$providesextension = false,
$min = false,
$max = false,
$exclude = false )

Mark a package as conflicting with this package

Parameters
stringpackage name
stringpackage channel
stringextension this package provides, if any
string|falseminimum version required
string|falsemaximum version allowed
array|falseversions to exclude from installation

Definition at line 788 of file rw.php.

790 {
791 $this->_isValid = 0;
792 $dep = $this->_constructDep($name, $channel, false, $min, $max, false,
793 $exclude, $providesextension, false, true);
794 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
795 array(
796 'dependencies' => array('providesextension', 'usesrole', 'usestask',
797 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
798 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
799 'required' => array('optional', 'group'),
800 'package' => array('subpackage', 'extension', 'os', 'arch')
801 ));
802 }
_constructDep($name, $channel, $uri, $min, $max, $recommended, $exclude, $providesextension=false, $nodefault=false, $conflicts=false)
Definition rw.php:860

References _constructDep(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addConflictingPackageDepWithUri()

addConflictingPackageDepWithUri ( $name,
$uri,
$providesextension = false )

Mark a package as conflicting with this package

Parameters
stringpackage name
stringpackage channel
stringextension this package provides, if any

Definition at line 810 of file rw.php.

811 {
812 $this->_isValid = 0;
813 $dep =
814 array(
815 'name' => $name,
816 'uri' => $uri,
817 'conflicts' => '',
818 );
819 if ($providesextension) {
820 $dep['providesextension'] = $providesextension;
821 }
822 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
823 array(
824 'dependencies' => array('providesextension', 'usesrole', 'usestask',
825 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
826 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
827 'required' => array('optional', 'group'),
828 'package' => array('subpackage', 'extension', 'os', 'arch')
829 ));
830 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addDependencyGroup()

addDependencyGroup ( $name,
$hint )

Definition at line 832 of file rw.php.

833 {
834 $this->_isValid = 0;
835 $this->_packageInfo = $this->_mergeTag($this->_packageInfo,
836 array('attribs' => array('name' => $name, 'hint' => $hint)),
837 array(
838 'dependencies' => array('providesextension', 'usesrole', 'usestask',
839 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
840 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
841 'group' => array(),
842 ));
843 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addExtensionDep()

addExtensionDep ( $type,
$name,
$min = false,
$max = false,
$recommended = false,
$exclude = false )
Parameters
optional|requiredoptional, required
stringextension name
stringminimum version
stringmaximum version
stringrecommended version
arrayincompatible versions

Definition at line 1143 of file rw.php.

1145 {
1146 $this->_isValid = 0;
1147 $arr = array('optional', 'group');
1148 if ($type != 'required') {
1149 array_shift($arr);
1150 }
1151 $dep = $this->_constructDep($name, false, false, $min, $max, $recommended, $exclude);
1152 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1153 array(
1154 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1155 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1156 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1157 $type => $arr,
1158 'extension' => array('os', 'arch')
1159 ));
1160 }

References _constructDep(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addExtensionInstallCondition()

addExtensionInstallCondition ( $name,
$min = false,
$max = false,
$recommended = false,
$exclude = false )
Parameters
optional|requiredoptional, required
stringextension name
stringminimum version
stringmaximum version
stringrecommended version
arrayincompatible versions

Definition at line 1427 of file rw.php.

1429 {
1430 $r = &$this->_getCurrentRelease();
1431 if ($r === null) {
1432 return false;
1433 }
1434 $this->_isValid = 0;
1435 $dep = $this->_constructDep($name, false, false, $min, $max, $recommended, $exclude);
1436 if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') {
1437 $r = $this->_mergeTag($r, $dep,
1438 array(
1439 'installconditions' => array('configureoption', 'binarypackage',
1440 'filelist'),
1441 'extension' => array('os', 'arch')
1442 ));
1443 } else {
1444 $r = $this->_mergeTag($r, $dep,
1445 array(
1446 'installconditions' => array('filelist'),
1447 'extension' => array('os', 'arch')
1448 ));
1449 }
1450 }

References _constructDep(), _getCurrentRelease(), PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ addFile()

addFile ( $dir,
$file,
$attrs )
Parameters
stringpath to the file
stringfilename
arrayextra attributes

Definition at line 552 of file rw.php.

553 {
554 if ($this->getPackageType() == 'bundle') {
555 return false;
556 }
557 $this->_filesValid = false;
558 $this->_isValid = 0;
559 $dir = preg_replace(array('!\\\\+!', '!/+!'), array('/', '/'), $dir);
560 if ($dir == '/' || $dir == '') {
561 $dir = '';
562 } else {
563 $dir .= '/';
564 }
565 $attrs['name'] = $dir . $file;
566 if (!isset($this->_packageInfo['contents'])) {
567 // ensure that the contents tag is set up
568 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
569 array('compatible', 'dependencies', 'providesextension', 'usesrole', 'usestask',
570 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease',
571 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
572 'bundle', 'changelog'), array(), 'contents');
573 }
574 if (isset($this->_packageInfo['contents']['dir']['file'])) {
575 if (!isset($this->_packageInfo['contents']['dir']['file'][0])) {
576 $this->_packageInfo['contents']['dir']['file'] =
577 array($this->_packageInfo['contents']['dir']['file']);
578 }
579 $this->_packageInfo['contents']['dir']['file'][]['attribs'] = $attrs;
580 } else {
581 $this->_packageInfo['contents']['dir']['file']['attribs'] = $attrs;
582 }
583 }
_insertBefore($array, $keys, $contents, $newkey)
Definition v2.php:2005

References PEAR_PackageFile_v2\_insertBefore(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ addGroupExtensionDep()

addGroupExtensionDep ( $groupname,
$name,
$min = false,
$max = false,
$recommended = false,
$exclude = false )
Parameters
stringgroup name (must be pre-existing)
stringextension name
stringminimum version allowed
stringmaximum version allowed
stringrecommended version
arrayincompatible versions

Definition at line 958 of file rw.php.

960 {
961 $this->_isValid = 0;
962 $dep = $this->_constructDep($name, false, false, $min, $max, $recommended, $exclude);
963 return $this->_addGroupDependency('extension', $dep, $groupname);
964 }
_addGroupDependency($type, $dep, $groupname)
Definition rw.php:973

References _addGroupDependency(), and _constructDep().

Here is the call graph for this function:

◆ addGroupPackageDepWithChannel()

addGroupPackageDepWithChannel ( $type,
$groupname,
$name,
$channel,
$min = false,
$max = false,
$recommended = false,
$exclude = false,
$providesextension = false,
$nodefault = false )
Parameters
package|subpackage
stringgroup name
stringpackage name
stringpackage channel
stringminimum version
stringmaximum version
stringrecommended version
array|falseoptional excluded versions
stringextension this package provides, if any
boolif true, tells the installer to ignore the default optional dependency group when installing this package
Returns
bool false if the dependency group has not been initialized with addDependencyGroup(), or a subpackage is added with a providesextension

Definition at line 916 of file rw.php.

919 {
920 if ($type == 'subpackage' && $providesextension) {
921 return false; // subpackages must be php packages
922 }
923 $dep = $this->_constructDep($name, $channel, false, $min, $max, $recommended, $exclude,
924 $providesextension, $nodefault);
925 return $this->_addGroupDependency($type, $dep, $groupname);
926 }

References _addGroupDependency(), and _constructDep().

Here is the call graph for this function:

◆ addGroupPackageDepWithURI()

addGroupPackageDepWithURI ( $type,
$groupname,
$name,
$uri,
$providesextension = false,
$nodefault = false )
Parameters
package|subpackage
stringgroup name
stringpackage name
stringpackage uri
stringextension this package provides, if any
boolif true, tells the installer to ignore the default optional dependency group when installing this package
Returns
bool false if the dependency group has not been initialized with addDependencyGroup()

Definition at line 939 of file rw.php.

941 {
942 if ($type == 'subpackage' && $providesextension) {
943 return false; // subpackages must be php packages
944 }
945 $dep = $this->_constructDep($name, false, $uri, false, false, false, false,
946 $providesextension, $nodefault);
947 return $this->_addGroupDependency($type, $dep, $groupname);
948 }

References _addGroupDependency(), and _constructDep().

Here is the call graph for this function:

◆ addIgnore()

addIgnore ( $path)

Add a file to the current release that should be ignored

Parameters
string<contents> path to file
Returns
bool success of operation

Definition at line 1315 of file rw.php.

1316 {
1317 $r = &$this->_getCurrentRelease();
1318 if ($r === null) {
1319 return false;
1320 }
1321 $this->_isValid = 0;
1322 $r = $this->_mergeTag($r, array('attribs' => array('name' => $path)),
1323 array(
1324 'filelist' => array(),
1325 'ignore' => array()
1326 ));
1327 }

References _getCurrentRelease(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addInstallAs()

addInstallAs ( $path,
$as )

Add a file to the current release that should be installed under a different name

Parameters
string<contents> path to file
stringname the file should be installed as

Definition at line 1296 of file rw.php.

1297 {
1298 $r = &$this->_getCurrentRelease();
1299 if ($r === null) {
1300 return false;
1301 }
1302 $this->_isValid = 0;
1303 $r = $this->_mergeTag($r, array('attribs' => array('name' => $path, 'as' => $as)),
1304 array(
1305 'filelist' => array(),
1306 'install' => array('ignore')
1307 ));
1308 }

References _getCurrentRelease(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addMaintainer()

addMaintainer ( $role,
$handle,
$name,
$email,
$active = 'yes' )

Adds a new maintainer - no checking of duplicates is performed, use updatemaintainer for that purpose.

Definition at line 184 of file rw.php.

185 {
186 if (!in_array($role, array('lead', 'developer', 'contributor', 'helper'))) {
187 return false;
188 }
189 if (isset($this->_packageInfo[$role])) {
190 if (!isset($this->_packageInfo[$role][0])) {
191 $this->_packageInfo[$role] = array($this->_packageInfo[$role]);
192 }
193 $this->_packageInfo[$role][] =
194 array(
195 'name' => $name,
196 'user' => $handle,
197 'email' => $email,
198 'active' => $active,
199 );
200 } else {
201 $testarr = array('lead',
202 'developer', 'contributor', 'helper', 'date', 'time', 'version',
203 'stability', 'license', 'notes', 'contents', 'compatible',
204 'dependencies', 'providesextension', 'usesrole', 'usestask',
205 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease',
206 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog');
207 foreach (array('lead', 'developer', 'contributor', 'helper') as $testrole) {
208 array_shift($testarr);
209 if ($role == $testrole) {
210 break;
211 }
212 }
213 if (!isset($this->_packageInfo[$role])) {
214 // ensure that the extends tag is set up in the right location
215 $this->_packageInfo = $this->_insertBefore($this->_packageInfo, $testarr,
216 array(), $role);
217 }
218 $this->_packageInfo[$role] =
219 array(
220 'name' => $name,
221 'user' => $handle,
222 'email' => $email,
223 'active' => $active,
224 );
225 }
226 $this->_isValid = 0;
227 }

References PEAR_PackageFile_v2\_insertBefore().

Referenced by updateMaintainer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addOsDep()

addOsDep ( $name,
$conflicts = false )
Parameters
stringOperating system name
booleantrue if this package cannot be installed on this OS

Definition at line 1166 of file rw.php.

1167 {
1168 $this->_isValid = 0;
1169 $dep = array('name' => $name);
1170 if ($conflicts) {
1171 $dep['conflicts'] = '';
1172 }
1173 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1174 array(
1175 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1176 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1177 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1178 'required' => array('optional', 'group'),
1179 'os' => array('arch')
1180 ));
1181 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addPackageDepWithChannel()

addPackageDepWithChannel ( $type,
$name,
$channel,
$min = false,
$max = false,
$recommended = false,
$exclude = false,
$providesextension = false,
$nodefault = false )
Parameters
optional|required
stringpackage name
stringpackage channel
stringminimum version
stringmaximum version
stringrecommended version
stringextension this package provides, if any
boolif true, tells the installer to ignore the default optional dependency group when installing this package
array|falseoptional excluded versions

Definition at line 1026 of file rw.php.

1029 {
1030 if (!in_array($type, array('optional', 'required'), true)) {
1031 $type = 'required';
1032 }
1033 $this->_isValid = 0;
1034 $arr = array('optional', 'group');
1035 if ($type != 'required') {
1036 array_shift($arr);
1037 }
1038 $dep = $this->_constructDep($name, $channel, false, $min, $max, $recommended, $exclude,
1039 $providesextension, $nodefault);
1040 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1041 array(
1042 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1043 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1044 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1045 $type => $arr,
1046 'package' => array('subpackage', 'extension', 'os', 'arch')
1047 ));
1048 }

References _constructDep(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addPackageDepWithUri()

addPackageDepWithUri ( $type,
$name,
$uri,
$providesextension = false,
$nodefault = false )
Parameters
optional|required
stringname of the package
stringuri of the package
stringextension this package provides, if any
boolif true, tells the installer to ignore the default optional dependency group when installing this package

Definition at line 1058 of file rw.php.

1060 {
1061 $this->_isValid = 0;
1062 $arr = array('optional', 'group');
1063 if ($type != 'required') {
1064 array_shift($arr);
1065 }
1066 $dep = $this->_constructDep($name, false, $uri, false, false, false, false,
1067 $providesextension, $nodefault);
1068 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1069 array(
1070 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1071 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1072 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1073 $type => $arr,
1074 'package' => array('subpackage', 'extension', 'os', 'arch')
1075 ));
1076 }

References _constructDep(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addRelease()

addRelease ( )
Returns
bool true if package type is set up

Definition at line 1250 of file rw.php.

1251 {
1252 if ($type = $this->getPackageType()) {
1253 if ($type != 'bundle') {
1254 $type .= 'release';
1255 }
1256 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, array(),
1257 array($type => array('changelog')));
1258 return true;
1259 }
1260 return false;
1261 }

References PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ addSubpackageDepWithChannel()

addSubpackageDepWithChannel ( $type,
$name,
$channel,
$min = false,
$max = false,
$recommended = false,
$exclude = false,
$nodefault = false )
Parameters
optional|requiredoptional, required
stringpackage name
stringpackage channel
stringminimum version
stringmaximum version
stringrecommended version
arrayincompatible versions
boolif true, tells the installer to ignore the default optional dependency group when installing this package

Definition at line 1089 of file rw.php.

1092 {
1093 $this->_isValid = 0;
1094 $arr = array('optional', 'group');
1095 if ($type != 'required') {
1096 array_shift($arr);
1097 }
1098 $dep = $this->_constructDep($name, $channel, false, $min, $max, $recommended, $exclude,
1099 $nodefault);
1100 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1101 array(
1102 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1103 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1104 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1105 $type => $arr,
1106 'subpackage' => array('extension', 'os', 'arch')
1107 ));
1108 }

References _constructDep(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addSubpackageDepWithUri()

addSubpackageDepWithUri ( $type,
$name,
$uri,
$nodefault = false )
Parameters
optional|requiredoptional, required
stringpackage name
stringpackage uri for download
boolif true, tells the installer to ignore the default optional dependency group when installing this package

Definition at line 1117 of file rw.php.

1118 {
1119 $this->_isValid = 0;
1120 $arr = array('optional', 'group');
1121 if ($type != 'required') {
1122 array_shift($arr);
1123 }
1124 $dep = $this->_constructDep($name, false, $uri, false, false, false, false, $nodefault);
1125 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
1126 array(
1127 'dependencies' => array('providesextension', 'usesrole', 'usestask',
1128 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
1129 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
1130 $type => $arr,
1131 'subpackage' => array('extension', 'os', 'arch')
1132 ));
1133 }

References _constructDep(), and PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addTaskToFile()

addTaskToFile ( $filename,
$task )
Parameters
stringfile name
PEAR_Task_Commona read/write task

Definition at line 486 of file rw.php.

487 {
488 if (!method_exists($task, 'getXml')) {
489 return false;
490 }
491 if (!method_exists($task, 'getName')) {
492 return false;
493 }
494 if (!method_exists($task, 'validate')) {
495 return false;
496 }
497 if (!$task->validate()) {
498 return false;
499 }
500 if (!isset($this->_packageInfo['contents']['dir']['file'])) {
501 return false;
502 }
503 $this->getTasksNs(); // discover the tasks namespace if not done already
504 $files = $this->_packageInfo['contents']['dir']['file'];
505 if (!isset($files[0])) {
506 $files = array($files);
507 $ind = false;
508 } else {
509 $ind = true;
510 }
511 foreach ($files as $i => $file) {
512 if (isset($file['attribs'])) {
513 if ($file['attribs']['name'] == $filename) {
514 if ($ind) {
515 $t = isset($this->_packageInfo['contents']['dir']['file'][$i]
516 ['attribs'][$this->_tasksNs .
517 ':' . $task->getName()]) ?
518 $this->_packageInfo['contents']['dir']['file'][$i]
519 ['attribs'][$this->_tasksNs .
520 ':' . $task->getName()] : false;
521 if ($t && !isset($t[0])) {
522 $this->_packageInfo['contents']['dir']['file'][$i]
523 [$this->_tasksNs . ':' . $task->getName()] = array($t);
524 }
525 $this->_packageInfo['contents']['dir']['file'][$i][$this->_tasksNs .
526 ':' . $task->getName()][] = $task->getXml();
527 } else {
528 $t = isset($this->_packageInfo['contents']['dir']['file']
529 ['attribs'][$this->_tasksNs .
530 ':' . $task->getName()]) ? $this->_packageInfo['contents']['dir']['file']
531 ['attribs'][$this->_tasksNs .
532 ':' . $task->getName()] : false;
533 if ($t && !isset($t[0])) {
534 $this->_packageInfo['contents']['dir']['file']
535 [$this->_tasksNs . ':' . $task->getName()] = array($t);
536 }
537 $this->_packageInfo['contents']['dir']['file'][$this->_tasksNs .
538 ':' . $task->getName()][] = $task->getXml();
539 }
540 return true;
541 }
542 }
543 }
544 return false;
545 }

References PEAR_PackageFile_v2\getTasksNs().

Here is the call graph for this function:

◆ addUsesrole()

addUsesrole ( $role,
$packageOrUri,
$channel = false )
Parameters
string
stringpackage name or uri
stringchannel name if non-uri

Definition at line 629 of file rw.php.

629 {
630 $set = array('role' => $role);
631 if ($channel) {
632 $set['package'] = $packageOrUri;
633 $set['channel'] = $channel;
634 } else {
635 $set['uri'] = $packageOrUri;
636 }
637 $this->_isValid = 0;
638 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $set, array(
639 'usesrole' => array('usestask', 'srcpackage', 'srcuri',
640 'phprelease', 'extsrcrelease', 'extbinrelease',
641 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog')
642 ));
643 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ addUsestask()

addUsestask ( $task,
$packageOrUri,
$channel = false )
Parameters
string
stringpackage name or uri
stringchannel name if non-uri

Definition at line 661 of file rw.php.

661 {
662 $set = array('task' => $task);
663 if ($channel) {
664 $set['package'] = $packageOrUri;
665 $set['channel'] = $channel;
666 } else {
667 $set['uri'] = $packageOrUri;
668 }
669 $this->_isValid = 0;
670 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $set, array(
671 'usestask' => array('srcpackage', 'srcuri',
672 'phprelease', 'extsrcrelease', 'extbinrelease',
673 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog')
674 ));
675 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ clearChangeLog()

clearChangeLog ( )

Remove the changelog entirely

Definition at line 1599 of file rw.php.

1600 {
1601 unset($this->_packageInfo['changelog']);
1602 }

◆ clearCompatible()

clearCompatible ( )

Remove all compatible tags

Definition at line 680 of file rw.php.

681 {
682 unset($this->_packageInfo['compatible']);
683 }

◆ clearContents()

clearContents ( $baseinstall = false)

Reset the listing of package contents

Parameters
stringbase installation dir for the whole package, if any

Definition at line 441 of file rw.php.

442 {
443 $this->_filesValid = false;
444 $this->_isValid = 0;
445 if (!isset($this->_packageInfo['contents'])) {
446 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
447 array('compatible',
448 'dependencies', 'providesextension', 'usesrole', 'usestask',
449 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease',
450 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
451 'bundle', 'changelog'), array(), 'contents');
452 }
453 if ($this->getPackageType() != 'bundle') {
454 $this->_packageInfo['contents'] =
455 array('dir' => array('attribs' => array('name' => '/')));
456 if ($baseinstall) {
457 $this->_packageInfo['contents']['dir']['attribs']['baseinstalldir'] = $baseinstall;
458 }
459 } else {
460 $this->_packageInfo['contents'] = array('bundledpackage' => array());
461 }
462 }

References PEAR_PackageFile_v2\_insertBefore(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ clearDeps()

clearDeps ( )

Reset dependencies prior to adding new ones

Definition at line 688 of file rw.php.

689 {
690 if (!isset($this->_packageInfo['dependencies'])) {
691 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, array(),
692 array(
693 'dependencies' => array('providesextension', 'usesrole', 'usestask',
694 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
695 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog')));
696 }
697 $this->_packageInfo['dependencies'] = array();
698 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ deleteMaintainer()

deleteMaintainer ( $handle)

Definition at line 265 of file rw.php.

266 {
267 $found = false;
268 foreach (array('lead', 'developer', 'contributor', 'helper') as $role) {
269 if (!isset($this->_packageInfo[$role])) {
270 continue;
271 }
272 if (!isset($this->_packageInfo[$role][0])) {
273 $this->_packageInfo[$role] = array($this->_packageInfo[$role]);
274 }
275 foreach ($this->_packageInfo[$role] as $i => $maintainer) {
276 if ($maintainer['user'] == $handle) {
277 $found = $i;
278 break;
279 }
280 }
281 if ($found !== false) {
282 unset($this->_packageInfo[$role][$found]);
283 if (!count($this->_packageInfo[$role]) && $role == 'lead') {
284 $this->_isValid = 0;
285 }
286 if (!count($this->_packageInfo[$role])) {
287 unset($this->_packageInfo[$role]);
288 return true;
289 }
290 $this->_packageInfo[$role] =
291 array_values($this->_packageInfo[$role]);
292 if (count($this->_packageInfo[$role]) == 1) {
293 $this->_packageInfo[$role] = $this->_packageInfo[$role][0];
294 }
295 return true;
296 }
297 if (count($this->_packageInfo[$role]) == 1) {
298 $this->_packageInfo[$role] = $this->_packageInfo[$role][0];
299 }
300 }
301 return false;
302 }

◆ generateChangeLogEntry()

generateChangeLogEntry ( $notes = false)

Generate a valid change log entry from the current package.xml

Parameters
string|false

Definition at line 1547 of file rw.php.

1548 {
1549 return array(
1550 'version' =>
1551 array(
1552 'release' => $this->getVersion('release'),
1553 'api' => $this->getVersion('api'),
1554 ),
1555 'stability' =>
1556 $this->getStability(),
1557 'date' => $this->getDate(),
1558 'license' => $this->getLicense(true),
1559 'notes' => $notes ? $notes : $this->getNotes()
1560 );
1561 }
getLicense($raw=false)
Definition v2.php:1114
getVersion($key='release')
Definition v2.php:1090

References PEAR_PackageFile_v2\getDate(), PEAR_PackageFile_v2\getLicense(), PEAR_PackageFile_v2\getNotes(), PEAR_PackageFile_v2\getStability(), and PEAR_PackageFile_v2\getVersion().

Here is the call graph for this function:

◆ installedFile()

installedFile ( $file,
$atts )

This is only used at install-time, after all serialization is over.

Reimplemented from PEAR_PackageFile_v2.

Definition at line 427 of file rw.php.

428 {
429 if (isset($this->_packageInfo['filelist'][$file])) {
430 $this->_packageInfo['filelist'][$file] =
431 array_merge($this->_packageInfo['filelist'][$file], $atts['attribs']);
432 } else {
433 $this->_packageInfo['filelist'][$file] = $atts['attribs'];
434 }
435 }

◆ resetUsesrole()

resetUsesrole ( )

Removes the <usesrole> tag entirely

Definition at line 617 of file rw.php.

618 {
619 if (isset($this->_packageInfo['usesrole'])) {
620 unset($this->_packageInfo['usesrole']);
621 }
622 }

◆ resetUsestask()

resetUsestask ( )

Removes the <usestask> tag entirely

Definition at line 648 of file rw.php.

649 {
650 if (isset($this->_packageInfo['usestask'])) {
651 unset($this->_packageInfo['usestask']);
652 }
653 }

◆ setAPIStability()

setAPIStability ( $state)
Parameters
devel|alpha|beta|stable

Definition at line 355 of file rw.php.

356 {
357 if (isset($this->_packageInfo['stability']) &&
358 isset($this->_packageInfo['stability']['api'])) {
359 unset($this->_packageInfo['stability']['api']);
360 }
361 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $state, array(
362 'stability' => array('license', 'notes', 'contents', 'compatible',
363 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
364 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
365 'extbinrelease', 'bundle', 'changelog'),
366 'api' => array()));
367 $this->_isValid = 0;
368 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ setAPIVersion()

setAPIVersion ( $version)

Definition at line 319 of file rw.php.

320 {
321 if (isset($this->_packageInfo['version']) &&
322 isset($this->_packageInfo['version']['api'])) {
323 unset($this->_packageInfo['version']['api']);
324 }
325 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $version, array(
326 'version' => array('stability', 'license', 'notes', 'contents', 'compatible',
327 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
328 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
329 'extbinrelease', 'bundle', 'changelog'),
330 'api' => array()));
331 $this->_isValid = 0;
332 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ setArchInstallCondition()

setArchInstallCondition ( $pattern,
$conflicts = false )

Set an installation condition based on architecture for the current release set

Parameters
stringarchitecture pattern
boolwhether this arch is incompatible with the current release

Definition at line 1492 of file rw.php.

1493 {
1494 $r = &$this->_getCurrentRelease();
1495 if ($r === null) {
1496 return false;
1497 }
1498 $this->_isValid = 0;
1499 if (isset($r['installconditions']['arch'])) {
1500 unset($r['installconditions']['arch']);
1501 }
1502 $dep = array('pattern' => $pattern);
1503 if ($conflicts) {
1504 $dep['conflicts'] = '';
1505 }
1506 if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') {
1507 $r = $this->_mergeTag($r, $dep,
1508 array(
1509 'installconditions' => array('configureoption', 'binarypackage',
1510 'filelist'),
1511 'arch' => array()
1512 ));
1513 } else {
1514 $r = $this->_mergeTag($r, $dep,
1515 array(
1516 'installconditions' => array('filelist'),
1517 'arch' => array()
1518 ));
1519 }
1520 }

References _getCurrentRelease(), PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ setChangelogEntry()

setChangelogEntry ( $releaseversion,
$contents )
Parameters
stringrelease version to set change log notes for
arrayoutput of generateChangeLogEntry()

Definition at line 1567 of file rw.php.

1568 {
1569 if (!isset($this->_packageInfo['changelog'])) {
1570 $this->_packageInfo['changelog']['release'] = $contents;
1571 return;
1572 }
1573 if (!isset($this->_packageInfo['changelog']['release'][0])) {
1574 if ($this->_packageInfo['changelog']['release']['version']['release'] == $releaseversion) {
1575 $this->_packageInfo['changelog']['release'] = array(
1576 $this->_packageInfo['changelog']['release']);
1577 } else {
1578 $this->_packageInfo['changelog']['release'] = array(
1579 $this->_packageInfo['changelog']['release']);
1580 return $this->_packageInfo['changelog']['release'][] = $contents;
1581 }
1582 }
1583 foreach($this->_packageInfo['changelog']['release'] as $index => $changelog) {
1584 if (isset($changelog['version']) &&
1585 strnatcasecmp($changelog['version']['release'], $releaseversion) == 0) {
1586 $curlog = $index;
1587 }
1588 }
1589 if (isset($curlog)) {
1590 $this->_packageInfo['changelog']['release'][$curlog] = $contents;
1591 } else {
1592 $this->_packageInfo['changelog']['release'][] = $contents;
1593 }
1594 }

◆ setChannel()

setChannel ( $channel)

Definition at line 115 of file rw.php.

116 {
117 unset($this->_packageInfo['uri']);
118 $this->_isValid = 0;
119 if (!isset($this->_packageInfo['channel'])) {
120 // ensure that the channel tag is set up in the right location
121 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
122 array('extends', 'summary', 'description', 'lead',
123 'developer', 'contributor', 'helper', 'date', 'time', 'version',
124 'stability', 'license', 'notes', 'contents', 'compatible',
125 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
126 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
127 'extbinrelease', 'bundle', 'changelog'), $channel, 'channel');
128 }
129 $this->_packageInfo['channel'] = $channel;
130 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setDescription()

setDescription ( $desc)

Definition at line 164 of file rw.php.

165 {
166 $this->_isValid = 0;
167 if (!isset($this->_packageInfo['description'])) {
168 // ensure that the description tag is set up in the right location
169 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
170 array('lead',
171 'developer', 'contributor', 'helper', 'date', 'time', 'version',
172 'stability', 'license', 'notes', 'contents', 'compatible',
173 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
174 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
175 'extbinrelease', 'bundle', 'changelog'), $desc, 'description');
176 }
177 $this->_packageInfo['description'] = $desc;
178 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setExtends()

setExtends ( $extends)

Definition at line 132 of file rw.php.

133 {
134 $this->_isValid = 0;
135 if (!isset($this->_packageInfo['extends'])) {
136 // ensure that the extends tag is set up in the right location
137 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
138 array('summary', 'description', 'lead',
139 'developer', 'contributor', 'helper', 'date', 'time', 'version',
140 'stability', 'license', 'notes', 'contents', 'compatible',
141 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
142 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
143 'extbinrelease', 'bundle', 'changelog'), $extends, 'extends');
144 }
145 $this->_packageInfo['extends'] = $extends;
146 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setInstalledAs()

setInstalledAs ( $file,
$path )

This is only used at install-time, after all serialization is over.

Parameters
stringfile name
stringinstalled path

Reimplemented from PEAR_PackageFile_v2.

Definition at line 415 of file rw.php.

416 {
417 if ($path) {
418 return $this->_packageInfo['filelist'][$file]['installed_as'] = $path;
419 }
420 unset($this->_packageInfo['filelist'][$file]['installed_as']);
421 }

◆ setLicense()

setLicense ( $license,
$uri = false,
$filesource = false )

Definition at line 370 of file rw.php.

371 {
372 if (!isset($this->_packageInfo['license'])) {
373 // ensure that the license tag is set up in the right location
374 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
375 array('notes', 'contents', 'compatible',
376 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
377 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
378 'extbinrelease', 'bundle', 'changelog'), 0, 'license');
379 }
380 if ($uri || $filesource) {
381 $attribs = array();
382 if ($uri) {
383 $attribs['uri'] = $uri;
384 }
385 $uri = true; // for test below
386 if ($filesource) {
387 $attribs['filesource'] = $filesource;
388 }
389 }
390 $license = $uri ? array('attribs' => $attribs, '_content' => $license) : $license;
391 $this->_packageInfo['license'] = $license;
392 $this->_isValid = 0;
393 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setNotes()

setNotes ( $notes)

Definition at line 395 of file rw.php.

396 {
397 $this->_isValid = 0;
398 if (!isset($this->_packageInfo['notes'])) {
399 // ensure that the notes tag is set up in the right location
400 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
401 array('contents', 'compatible',
402 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
403 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
404 'extbinrelease', 'bundle', 'changelog'), $notes, 'notes');
405 }
406 $this->_packageInfo['notes'] = $notes;
407 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setOsInstallCondition()

setOsInstallCondition ( $name,
$conflicts = false )

Set an installation condition based on operating system for the current release set

Parameters
stringOS name
boolwhether this OS is incompatible with the current release

Definition at line 1457 of file rw.php.

1458 {
1459 $r = &$this->_getCurrentRelease();
1460 if ($r === null) {
1461 return false;
1462 }
1463 $this->_isValid = 0;
1464 if (isset($r['installconditions']['os'])) {
1465 unset($r['installconditions']['os']);
1466 }
1467 $dep = array('name' => $name);
1468 if ($conflicts) {
1469 $dep['conflicts'] = '';
1470 }
1471 if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') {
1472 $r = $this->_mergeTag($r, $dep,
1473 array(
1474 'installconditions' => array('configureoption', 'binarypackage',
1475 'filelist'),
1476 'os' => array('arch')
1477 ));
1478 } else {
1479 $r = $this->_mergeTag($r, $dep,
1480 array(
1481 'installconditions' => array('filelist'),
1482 'os' => array('arch')
1483 ));
1484 }
1485 }

References _getCurrentRelease(), PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ setPackage()

setPackage ( $package)

Definition at line 53 of file rw.php.

54 {
55 $this->_isValid = 0;
56 if (!isset($this->_packageInfo['attribs'])) {
57 $this->_packageInfo = array_merge(array('attribs' => array(
58 'version' => '2.0',
59 'xmlns' => 'http://pear.php.net/dtd/package-2.0',
60 'xmlns:tasks' => 'http://pear.php.net/dtd/tasks-1.0',
61 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
62 'xsi:schemaLocation' => 'http://pear.php.net/dtd/tasks-1.0
63 http://pear.php.net/dtd/tasks-1.0.xsd
64 http://pear.php.net/dtd/package-2.0
65 http://pear.php.net/dtd/package-2.0.xsd',
66 )), $this->_packageInfo);
67 }
68 if (!isset($this->_packageInfo['name'])) {
69 return $this->_packageInfo = array_merge(array('name' => $package),
70 $this->_packageInfo);
71 }
72 $this->_packageInfo['name'] = $package;
73 }

◆ setPackageType()

setPackageType ( $type)

Set the kind of package, and erase all release tags

  • a php package is a PEAR-style package
  • an extbin package is a PECL-style extension binary
  • an extsrc package is a PECL-style source for a binary
  • an zendextbin package is a PECL-style zend extension binary
  • an zendextsrc package is a PECL-style source for a zend extension binary
  • a bundle package is a collection of other pre-packaged packages
    Parameters
    php|extbin|extsrc|zendextsrc|zendextbin|bundle
    Returns
    bool success

Definition at line 1216 of file rw.php.

1217 {
1218 $this->_isValid = 0;
1219 if (!in_array($type, array('php', 'extbin', 'extsrc', 'zendextsrc',
1220 'zendextbin', 'bundle'))) {
1221 return false;
1222 }
1223
1224 if (in_array($type, array('zendextsrc', 'zendextbin'))) {
1225 $this->_setPackageVersion2_1();
1226 }
1227
1228 if ($type != 'bundle') {
1229 $type .= 'release';
1230 }
1231
1232 foreach (array('phprelease', 'extbinrelease', 'extsrcrelease',
1233 'zendextsrcrelease', 'zendextbinrelease', 'bundle') as $test) {
1234 unset($this->_packageInfo[$test]);
1235 }
1236
1237 if (!isset($this->_packageInfo[$type])) {
1238 // ensure that the release tag is set up
1239 $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('changelog'),
1240 array(), $type);
1241 }
1242
1243 $this->_packageInfo[$type] = array();
1244 return true;
1245 }

References PEAR_PackageFile_v2\_insertBefore(), and _setPackageVersion2_1().

Here is the call graph for this function:

◆ setPearinstallerDep()

setPearinstallerDep ( $min,
$max = false,
$recommended = false,
$exclude = false )
Parameters
stringminimum allowed PEAR installer version
stringmaximum allowed PEAR installer version
stringrecommended PEAR installer version
arrayincompatible version of the PEAR installer

Definition at line 744 of file rw.php.

745 {
746 $this->_isValid = 0;
747 $dep =
748 array(
749 'min' => $min,
750 );
751 if ($max) {
752 $dep['max'] = $max;
753 }
754 if ($recommended) {
755 $dep['recommended'] = $recommended;
756 }
757 if ($exclude) {
758 if (count($exclude) == 1) {
759 $exclude = $exclude[0];
760 }
761 $dep['exclude'] = $exclude;
762 }
763 if (isset($this->_packageInfo['dependencies']['required']['pearinstaller'])) {
764 $this->_stack->push(__FUNCTION__, 'warning', array('dep' =>
765 $this->_packageInfo['dependencies']['required']['pearinstaller']),
766 'warning: PEAR Installer dependency already exists, overwriting');
767 unset($this->_packageInfo['dependencies']['required']['pearinstaller']);
768 }
769 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
770 array(
771 'dependencies' => array('providesextension', 'usesrole', 'usestask',
772 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
773 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
774 'required' => array('optional', 'group'),
775 'pearinstaller' => array('package', 'subpackage', 'extension', 'os', 'arch')
776 ));
777 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ setPhpDep()

setPhpDep ( $min,
$max = false,
$exclude = false )
Parameters
stringminimum PHP version allowed
stringmaximum PHP version allowed
array$excludeincompatible PHP versions

Definition at line 705 of file rw.php.

706 {
707 $this->_isValid = 0;
708 $dep =
709 array(
710 'min' => $min,
711 );
712 if ($max) {
713 $dep['max'] = $max;
714 }
715 if ($exclude) {
716 if (count($exclude) == 1) {
717 $exclude = $exclude[0];
718 }
719 $dep['exclude'] = $exclude;
720 }
721 if (isset($this->_packageInfo['dependencies']['required']['php'])) {
722 $this->_stack->push(__FUNCTION__, 'warning', array('dep' =>
723 $this->_packageInfo['dependencies']['required']['php']),
724 'warning: PHP dependency already exists, overwriting');
725 unset($this->_packageInfo['dependencies']['required']['php']);
726 }
727 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $dep,
728 array(
729 'dependencies' => array('providesextension', 'usesrole', 'usestask',
730 'srcpackage', 'srcuri', 'phprelease', 'extsrcrelease', 'extbinrelease',
731 'zendextsrcrelease', 'zendextbinrelease', 'bundle', 'changelog'),
732 'required' => array('optional', 'group'),
733 'php' => array('pearinstaller', 'package', 'subpackage', 'extension', 'os', 'arch')
734 ));
735 return true;
736 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ setPhpInstallCondition()

setPhpInstallCondition ( $min,
$max,
$exclude = false )

Set an installation condition based on php version for the current release set

Parameters
stringminimum version
stringmaximum version
false|arrayincompatible versions of PHP

Definition at line 1386 of file rw.php.

1387 {
1388 $r = &$this->_getCurrentRelease();
1389 if ($r === null) {
1390 return false;
1391 }
1392 $this->_isValid = 0;
1393 if (isset($r['installconditions']['php'])) {
1394 unset($r['installconditions']['php']);
1395 }
1396 $dep = array('min' => $min, 'max' => $max);
1397 if ($exclude) {
1398 if (is_array($exclude) && count($exclude) == 1) {
1399 $exclude = $exclude[0];
1400 }
1401 $dep['exclude'] = $exclude;
1402 }
1403 if ($this->getPackageType() == 'extsrc' || $this->getPackageType() == 'zendextsrc') {
1404 $r = $this->_mergeTag($r, $dep,
1405 array(
1406 'installconditions' => array('configureoption', 'binarypackage',
1407 'filelist'),
1408 'php' => array('extension', 'os', 'arch')
1409 ));
1410 } else {
1411 $r = $this->_mergeTag($r, $dep,
1412 array(
1413 'installconditions' => array('filelist'),
1414 'php' => array('extension', 'os', 'arch')
1415 ));
1416 }
1417 }

References _getCurrentRelease(), PEAR_PackageFile_v2\_mergeTag(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ setProvidesExtension()

setProvidesExtension ( $extension)
Parameters
stringExtension name
Returns
bool success of operation

Definition at line 35 of file rw.php.

36 {
37 if (in_array($this->getPackageType(),
38 array('extsrc', 'extbin', 'zendextsrc', 'zendextbin'))) {
39 if (!isset($this->_packageInfo['providesextension'])) {
40 // ensure that the channel tag is set up in the right location
41 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
42 array('usesrole', 'usestask', 'srcpackage', 'srcuri', 'phprelease',
43 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
44 'bundle', 'changelog'),
45 $extension, 'providesextension');
46 }
47 $this->_packageInfo['providesextension'] = $extension;
48 return true;
49 }
50 return false;
51 }

References PEAR_PackageFile_v2\_insertBefore(), and PEAR_PackageFile_v2\getPackageType().

Here is the call graph for this function:

◆ setReleaseStability()

setReleaseStability ( $state)

snapshot|devel|alpha|beta|stable

Definition at line 337 of file rw.php.

338 {
339 if (isset($this->_packageInfo['stability']) &&
340 isset($this->_packageInfo['stability']['release'])) {
341 unset($this->_packageInfo['stability']['release']);
342 }
343 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $state, array(
344 'stability' => array('license', 'notes', 'contents', 'compatible',
345 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
346 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
347 'extbinrelease', 'bundle', 'changelog'),
348 'release' => array('api')));
349 $this->_isValid = 0;
350 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ setReleaseVersion()

setReleaseVersion ( $version)

Definition at line 304 of file rw.php.

305 {
306 if (isset($this->_packageInfo['version']) &&
307 isset($this->_packageInfo['version']['release'])) {
308 unset($this->_packageInfo['version']['release']);
309 }
310 $this->_packageInfo = $this->_mergeTag($this->_packageInfo, $version, array(
311 'version' => array('stability', 'license', 'notes', 'contents', 'compatible',
312 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
313 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
314 'extbinrelease', 'bundle', 'changelog'),
315 'release' => array('api')));
316 $this->_isValid = 0;
317 }

References PEAR_PackageFile_v2\_mergeTag().

Here is the call graph for this function:

◆ setSourcePackage()

setSourcePackage ( $packageOrUri)

For extension binary releases, this is used to specify either the static URI to a source package, or the package name and channel of the extsrc/zendextsrc package it is based on.

Parameters
stringPackage name, or full URI to source package (extsrc/zendextsrc type)

Definition at line 1528 of file rw.php.

1529 {
1530 $this->_isValid = 0;
1531 if (isset($this->_packageInfo['channel'])) {
1532 $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('phprelease',
1533 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
1534 'bundle', 'changelog'),
1535 $packageOrUri, 'srcpackage');
1536 } else {
1537 $this->_packageInfo = $this->_insertBefore($this->_packageInfo, array('phprelease',
1538 'extsrcrelease', 'extbinrelease', 'zendextsrcrelease', 'zendextbinrelease',
1539 'bundle', 'changelog'), $packageOrUri, 'srcuri');
1540 }
1541 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setSummary()

setSummary ( $summary)

Definition at line 148 of file rw.php.

149 {
150 $this->_isValid = 0;
151 if (!isset($this->_packageInfo['summary'])) {
152 // ensure that the summary tag is set up in the right location
153 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
154 array('description', 'lead',
155 'developer', 'contributor', 'helper', 'date', 'time', 'version',
156 'stability', 'license', 'notes', 'contents', 'compatible',
157 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
158 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
159 'extbinrelease', 'bundle', 'changelog'), $summary, 'summary');
160 }
161 $this->_packageInfo['summary'] = $summary;
162 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ setUri()

setUri ( $uri)

Definition at line 98 of file rw.php.

99 {
100 unset($this->_packageInfo['channel']);
101 $this->_isValid = 0;
102 if (!isset($this->_packageInfo['uri'])) {
103 // ensure that the uri tag is set up in the right location
104 $this->_packageInfo = $this->_insertBefore($this->_packageInfo,
105 array('extends', 'summary', 'description', 'lead',
106 'developer', 'contributor', 'helper', 'date', 'time', 'version',
107 'stability', 'license', 'notes', 'contents', 'compatible',
108 'dependencies', 'providesextension', 'usesrole', 'usestask', 'srcpackage', 'srcuri',
109 'phprelease', 'extsrcrelease', 'zendextsrcrelease', 'zendextbinrelease',
110 'extbinrelease', 'bundle', 'changelog'), $uri, 'uri');
111 }
112 $this->_packageInfo['uri'] = $uri;
113 }

References PEAR_PackageFile_v2\_insertBefore().

Here is the call graph for this function:

◆ updateMaintainer()

updateMaintainer ( $newrole,
$handle,
$name,
$email,
$active = 'yes' )

Definition at line 229 of file rw.php.

230 {
231 $found = false;
232 foreach (array('lead', 'developer', 'contributor', 'helper') as $role) {
233 if (!isset($this->_packageInfo[$role])) {
234 continue;
235 }
236 $info = $this->_packageInfo[$role];
237 if (!isset($info[0])) {
238 if ($info['user'] == $handle) {
239 $found = true;
240 break;
241 }
242 }
243 foreach ($info as $i => $maintainer) {
244 if (is_array($maintainer) && $maintainer['user'] == $handle) {
245 $found = $i;
246 break 2;
247 }
248 }
249 }
250 if ($found === false) {
251 return $this->addMaintainer($newrole, $handle, $name, $email, $active);
252 }
253 if ($found !== false) {
254 if ($found === true) {
255 unset($this->_packageInfo[$role]);
256 } else {
257 unset($this->_packageInfo[$role][$found]);
258 $this->_packageInfo[$role] = array_values($this->_packageInfo[$role]);
259 }
260 }
261 $this->addMaintainer($newrole, $handle, $name, $email, $active);
262 $this->_isValid = 0;
263 }
addMaintainer($role, $handle, $name, $email, $active='yes')
Definition rw.php:184

References addMaintainer().

Here is the call graph for this function:

The documentation for this class was generated from the following file:
  • E:/Bearsampp-development/sandbox/core/libs/php/pear/pear/PEAR/PackageFile/v2/rw.php