PEAR_Validate::_validPackageName() – Override this method to handle validation of normal package names


require_once '/Validate.php';

bool PEAR_Validate::_validPackageName ( string $name )


This protected method can be used to change the normal package validation scheme. By default, all packages must begin with a letter and contain only letters, numbers and underscores. Using this method, it is possible to change this entirely to enforce another scheme.

For instance, enforcing java-style com.blah.package package names can be done simply by this code:

require_once 'PEAR/Validate.php';
MyChannel_Validate extends PEAR_Validate

Then, by using a customized channel validation package, the installer will enforce java-style package names for your channel.


string $name

package name string to test for validity.


throws no exceptions thrown


This function can not be called statically.

Determine whether a version is a properly formatted version number that can be used by version_compare (Previous) Constants defined in and used by PEAR (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.