Subversion Repositories Applications.gtt

Compare Revisions

Ignore whitespace Rev 186 → Rev 187

/trunk/bibliotheque/pear/PEAR/PackageFile/v2/Validator.php
1,27 → 1,28
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Greg Beaver <cellog@php.net> |
// | |
// +----------------------------------------------------------------------+
//
// $Id: Validator.php,v 1.97 2007/02/10 05:56:18 cellog Exp $
/**
* PEAR_PackageFile_v2, package.xml version 2.0, read/write version
*
* PHP versions 4 and 5
*
* @category pear
* @package PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a8
*/
/**
* Private validation class used by PEAR_PackageFile_v2 - do not use directly, its
* sole purpose is to split up the PEAR/PackageFile/v2.php file to make it smaller
* @author Greg Beaver <cellog@php.net>
* @category pear
* @package PEAR
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 1.10.1
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a8
* @access private
*/
class PEAR_PackageFile_v2_Validator
71,7 → 72,8
}
if (!isset($this->_packageInfo['attribs']['version']) ||
($this->_packageInfo['attribs']['version'] != '2.0' &&
$this->_packageInfo['attribs']['version'] != '2.1')) {
$this->_packageInfo['attribs']['version'] != '2.1')
) {
$this->_noPackageVersion();
}
$structure =
109,8 → 111,10
isset($test['dependencies']['required']) &&
isset($test['dependencies']['required']['pearinstaller']) &&
isset($test['dependencies']['required']['pearinstaller']['min']) &&
version_compare('1.5.1',
$test['dependencies']['required']['pearinstaller']['min'], '<')) {
'1.10.1' != '@package' . '_version@' &&
version_compare('1.10.1',
$test['dependencies']['required']['pearinstaller']['min'], '<')
) {
$this->_pearVersionTooLow($test['dependencies']['required']['pearinstaller']['min']);
return false;
}
130,18 → 134,13
if (array_key_exists('_lastversion', $test)) {
unset($test['_lastversion']);
}
if (!$this->_stupidSchemaValidate($structure,
$test, '<package>')) {
if (!$this->_stupidSchemaValidate($structure, $test, '<package>')) {
return false;
}
if (empty($this->_packageInfo['name'])) {
$this->_tagCannotBeEmpty('name');
}
if (isset($this->_packageInfo['uri'])) {
$test = 'uri';
} else {
$test = 'channel';
}
$test = isset($this->_packageInfo['uri']) ? 'uri' :'channel';
if (empty($this->_packageInfo[$test])) {
$this->_tagCannotBeEmpty($test);
}
233,14 → 232,17
}
}
}
 
if ($fail) {
return false;
}
 
$list = $this->_packageInfo['contents'];
if (isset($list['dir']) && is_array($list['dir']) && isset($list['dir'][0])) {
$this->_multipleToplevelDirNotAllowed();
return $this->_isValid = 0;
}
 
$this->_validateFilelist();
$this->_validateRelease();
if (!$this->_stack->hasErrors()) {
254,11 → 256,10
$validator = $chan->getValidationObject($this->_pf->getPackage());
if (!$validator) {
$this->_stack->push(__FUNCTION__, 'error',
array_merge(
array('channel' => $chan->getName(),
'package' => $this->_pf->getPackage()),
$valpack
),
array('channel' => $chan->getName(),
'package' => $this->_pf->getPackage(),
'name' => $valpack['_content'],
'version' => $valpack['attribs']['version']),
'package "%channel%/%package%" cannot be properly validated without ' .
'validation package "%channel%/%name%-%version%"');
return $this->_isValid = 0;
276,6 → 277,7
}
}
}
 
$this->_pf->_isValid = $this->_isValid = !$this->_stack->hasErrors('error');
if ($this->_isValid && $state == PEAR_VALIDATE_PACKAGING && !$this->_filesValid) {
if ($this->_pf->getPackageType() == 'bundle') {
292,9 → 294,11
}
}
}
 
if ($this->_isValid) {
return $this->_pf->_isValid = $this->_isValid = $state;
}
 
return $this->_pf->_isValid = $this->_isValid = 0;
}
 
466,21 → 470,21
$a = $this->_stupidSchemaValidate($structure, $this->_packageInfo['version'], '<version>');
$a &= $this->_stupidSchemaValidate($structure, $this->_packageInfo['stability'], '<stability>');
if ($a) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$this->_packageInfo['version']['release'])) {
$this->_invalidVersion('release', $this->_packageInfo['version']['release']);
}
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$this->_packageInfo['version']['api'])) {
$this->_invalidVersion('api', $this->_packageInfo['version']['api']);
}
if (!in_array($this->_packageInfo['stability']['release'],
array('snapshot', 'devel', 'alpha', 'beta', 'stable'))) {
$this->_invalidState('release', $this->_packageinfo['stability']['release']);
$this->_invalidState('release', $this->_packageInfo['stability']['release']);
}
if (!in_array($this->_packageInfo['stability']['api'],
array('devel', 'alpha', 'beta', 'stable'))) {
$this->_invalidState('api', $this->_packageinfo['stability']['api']);
$this->_invalidState('api', $this->_packageInfo['stability']['api']);
}
}
}
519,13 → 523,13
$type = $installcondition ? '<installcondition><php>' : '<dependencies><required><php>';
$this->_stupidSchemaValidate($structure, $dep, $type);
if (isset($dep['min'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?\\z/',
$dep['min'])) {
$this->_invalidVersion($type . '<min>', $dep['min']);
}
}
if (isset($dep['max'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?\\z/',
$dep['max'])) {
$this->_invalidVersion($type . '<max>', $dep['max']);
}
536,7 → 540,7
}
foreach ($dep['exclude'] as $exclude) {
if (!preg_match(
'/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?$/',
'/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?(?:-[a-zA-Z0-9]+)?\\z/',
$exclude)) {
$this->_invalidVersion($type . '<exclude>', $exclude);
}
554,7 → 558,7
);
$this->_stupidSchemaValidate($structure, $dep, '<dependencies><required><pearinstaller>');
if (isset($dep['min'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['min'])) {
$this->_invalidVersion('<dependencies><required><pearinstaller><min>',
$dep['min']);
561,7 → 565,7
}
}
if (isset($dep['max'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['max'])) {
$this->_invalidVersion('<dependencies><required><pearinstaller><max>',
$dep['max']);
568,7 → 572,7
}
}
if (isset($dep['recommended'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['recommended'])) {
$this->_invalidVersion('<dependencies><required><pearinstaller><recommended>',
$dep['recommended']);
579,7 → 583,7
$dep['exclude'] = array($dep['exclude']);
}
foreach ($dep['exclude'] as $exclude) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$exclude)) {
$this->_invalidVersion('<dependencies><required><pearinstaller><exclude>',
$exclude);
641,19 → 645,19
$this->_DepchannelCannotBeUri('<dependencies>' . $group . $type);
}
if (isset($dep['min'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['min'])) {
$this->_invalidVersion('<dependencies>' . $group . $type . '<min>', $dep['min']);
}
}
if (isset($dep['max'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['max'])) {
$this->_invalidVersion('<dependencies>' . $group . $type . '<max>', $dep['max']);
}
}
if (isset($dep['recommended'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['recommended'])) {
$this->_invalidVersion('<dependencies>' . $group . $type . '<recommended>',
$dep['recommended']);
664,7 → 668,7
$dep['exclude'] = array($dep['exclude']);
}
foreach ($dep['exclude'] as $exclude) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$exclude)) {
$this->_invalidVersion('<dependencies>' . $group . $type . '<exclude>',
$exclude);
713,19 → 717,19
}
$this->_stupidSchemaValidate($structure, $dep, $type);
if (isset($dep['min'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['min'])) {
$this->_invalidVersion(substr($type, 1) . '<min', $dep['min']);
}
}
if (isset($dep['max'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['max'])) {
$this->_invalidVersion(substr($type, 1) . '<max', $dep['max']);
}
}
if (isset($dep['recommended'])) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$dep['recommended'])) {
$this->_invalidVersion(substr($type, 1) . '<recommended', $dep['recommended']);
}
735,7 → 739,7
$dep['exclude'] = array($dep['exclude']);
}
foreach ($dep['exclude'] as $exclude) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$exclude)) {
$this->_invalidVersion(substr($type, 1) . '<exclude', $exclude);
}
932,13 → 936,13
}
$this->_stupidSchemaValidate($required, $package, $type);
if (is_array($package) && array_key_exists('min', $package)) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$package['min'])) {
$this->_invalidVersion(substr($type, 1) . '<min', $package['min']);
}
}
if (is_array($package) && array_key_exists('max', $package)) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$package['max'])) {
$this->_invalidVersion(substr($type, 1) . '<max', $package['max']);
}
948,7 → 952,7
$package['exclude'] = array($package['exclude']);
}
foreach ($package['exclude'] as $exclude) {
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?$/',
if (!preg_match('/^\d+(?:\.\d+)*(?:[a-zA-Z]+\d*)?\\z/',
$exclude)) {
$this->_invalidVersion(substr($type, 1) . '<exclude', $exclude);
}
1007,6 → 1011,11
$dirname = $iscontents ? '<contents>' : $unknown;
} else {
$dirname = '<dir name="' . $list['attribs']['name'] . '">';
if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~',
str_replace('\\', '/', $list['attribs']['name']))) {
// file contains .. parent directory or . cur directory
$this->_invalidDirName($list['attribs']['name']);
}
}
$res = $this->_stupidSchemaValidate($struc, $list, $dirname);
if ($allowignore && $res) {
1036,6 → 1045,12
$ignored_or_installed[$file['attribs']['name']] = array();
}
$ignored_or_installed[$file['attribs']['name']][] = 1;
if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~',
str_replace('\\', '/', $file['attribs']['as']))) {
// file contains .. parent directory or . cur directory references
$this->_invalidFileInstallAs($file['attribs']['name'],
$file['attribs']['as']);
}
}
}
if (isset($list['ignore'])) {
1054,6 → 1069,10
}
}
if (!$allowignore && isset($list['file'])) {
if (is_string($list['file'])) {
$this->_oldStyleFileNotAllowed();
return false;
}
if (!isset($list['file'][0])) {
// single file
$list['file'] = array($list['file']);
1060,11 → 1079,17
}
foreach ($list['file'] as $i => $file)
{
if (isset($file['attribs']) && isset($file['attribs']['name']) &&
$file['attribs']['name']{0} == '.' &&
$file['attribs']['name']{1} == '/') {
// name is something like "./doc/whatever.txt"
$this->_invalidFileName($file['attribs']['name']);
if (isset($file['attribs']) && isset($file['attribs']['name'])) {
if ($file['attribs']['name']{0} == '.' &&
$file['attribs']['name']{1} == '/') {
// name is something like "./doc/whatever.txt"
$this->_invalidFileName($file['attribs']['name'], $dirname);
}
if (preg_match('~/\.\.?(/|\\z)|^\.\.?/~',
str_replace('\\', '/', $file['attribs']['name']))) {
// file contains .. parent directory or . cur directory
$this->_invalidFileName($file['attribs']['name'], $dirname);
}
}
if (isset($file['attribs']) && isset($file['attribs']['role'])) {
if (!$this->_validateRole($file['attribs']['role'])) {
1304,7 → 1329,7
}
if (is_array($rel) && array_key_exists('filelist', $rel)) {
if ($rel['filelist']) {
 
$this->_validateFilelist($rel['filelist'], true);
}
}
1325,7 → 1350,7
$this->_stack->push(__FUNCTION__, 'error',
array('version' => $version),
'This package.xml requires PEAR version %version% to parse properly, we are ' .
'version 1.5.1');
'version 1.10.1');
}
 
function _invalidTagOrder($oktags, $actual, $root)
1349,6 → 1374,13
'<contents>, use <ignore> and <install> only');
}
 
function _oldStyleFileNotAllowed()
{
$this->_stack->push(__FUNCTION__, 'error', array(),
'Old-style <file>name</file> is not allowed. Use' .
'<file name="name" role="role"/>');
}
 
function _tagMissingAttribute($tag, $attr, $context)
{
$this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag,
1381,9 → 1413,23
{
$this->_stack->push(__FUNCTION__, 'error', array(
'file' => $file),
'File "%file%" cannot begin with "."');
'File "%file%" in directory "%dir%" cannot begin with "./" or contain ".."');
}
 
function _invalidFileInstallAs($file, $as)
{
$this->_stack->push(__FUNCTION__, 'error', array(
'file' => $file, 'as' => $as),
'File "%file%" <install as="%as%"/> cannot contain "./" or contain ".."');
}
 
function _invalidDirName($dir)
{
$this->_stack->push(__FUNCTION__, 'error', array(
'dir' => $file),
'Directory "%dir%" cannot begin with "./" or contain ".."');
}
 
function _filelistCannotContainFile($filelist)
{
$this->_stack->push(__FUNCTION__, 'error', array('tag' => $filelist),
1625,13 → 1671,13
function _usesroletaskMustHaveChannelOrUri($role, $tag)
{
$this->_stack->push(__FUNCTION__, 'error', array('role' => $role, 'tag' => $tag),
'<%tag%> must contain either <uri>, or <channel> and <package>');
'<%tag%> for role "%role%" must contain either <uri>, or <channel> and <package>');
}
 
function _usesroletaskMustHavePackage($role, $tag)
{
$this->_stack->push(__FUNCTION__, 'error', array('role' => $role, 'tag' => $tag),
'<%tag%> must contain <package>');
'<%tag%> for role "%role%" must contain <package>');
}
 
function _usesroletaskMustHaveRoleTask($tag, $type)
1648,7 → 1694,7
 
function _invalidDepGroupName($name)
{
$this->_stack->push(__FUNCTION__, 'error', array('group' => $name),
$this->_stack->push(__FUNCTION__, 'error', array('name' => $name),
'Invalid dependency group name "%name%"');
}
 
1683,14 → 1729,15
return false;
}
$dir_prefix = dirname($this->_pf->_packageFile);
$common = new PEAR_Common;
$log = isset($this->_pf->_logger) ? array(&$this->_pf->_logger, 'log') :
array('PEAR_Common', 'log');
array($common, 'log');
$info = $this->_pf->getContents();
$info = $info['bundledpackage'];
if (!is_array($info)) {
$info = array($info);
}
$pkg = &new PEAR_PackageFile($this->_pf->_config);
$pkg = new PEAR_PackageFile($this->_pf->_config);
foreach ($info as $package) {
if (!file_exists($dir_prefix . DIRECTORY_SEPARATOR . $package)) {
$this->_fileNotFound($dir_prefix . DIRECTORY_SEPARATOR . $package);
1798,15 → 1845,19
'Parser error: token_get_all() function must exist to analyze source code, PHP may have been compiled with --disable-tokenizer');
return false;
}
 
if (!defined('T_DOC_COMMENT')) {
define('T_DOC_COMMENT', T_COMMENT);
}
 
if (!defined('T_INTERFACE')) {
define('T_INTERFACE', -1);
}
 
if (!defined('T_IMPLEMENTS')) {
define('T_IMPLEMENTS', -1);
}
 
if ($string) {
$contents = $file;
} else {
1816,7 → 1867,18
fclose($fp);
$contents = file_get_contents($file);
}
$tokens = token_get_all($contents);
 
// Silence this function so we can catch PHP Warnings and show our own custom message
$tokens = @token_get_all($contents);
if (isset($php_errormsg)) {
if (isset($this->_stack)) {
$pn = $this->_pf->getPackage();
$this->_stack->push(__FUNCTION__, 'warning',
array('file' => $file, 'package' => $pn),
'in %file%: Could not process file for unknown reasons,' .
' possibly a PHP parse error in %file% from %package%');
}
}
/*
for ($i = 0; $i < sizeof($tokens); $i++) {
@list($token, $data) = $tokens[$i];
1856,6 → 1918,7
$token = $tokens[$i];
$data = '';
}
 
if ($inquote) {
if ($token != '"' && $token != T_END_HEREDOC) {
continue;
1864,6 → 1927,7
continue;
}
}
 
switch ($token) {
case T_WHITESPACE :
continue;
1899,8 → 1963,14
$interface = true;
case T_CLASS:
if (($current_class_level != -1) || ($current_function_level != -1)) {
$this->_stack->push(__FUNCTION__, 'error', array('file' => $file),
'Parser error: invalid PHP found in file "%file%"');
if (isset($this->_stack)) {
$this->_stack->push(__FUNCTION__, 'error', array('file' => $file),
'Parser error: invalid PHP found in file "%file%"');
} else {
PEAR::raiseError("Parser error: invalid PHP found in file \"$file\"",
PEAR_COMMON_ERROR_INVALIDPHP);
}
 
return false;
}
case T_FUNCTION:
1910,17 → 1980,6
$look_for = $token;
continue 2;
case T_STRING:
if (version_compare(zend_version(), '2.0', '<')) {
if (in_array(strtolower($data),
array('public', 'private', 'protected', 'abstract',
'interface', 'implements', 'throw')
)) {
$this->_stack->push(__FUNCTION__, 'warning', array(
'file' => $file),
'Error, PHP5 token encountered in %file%,' .
' analysis should be in PHP5');
}
}
if ($look_for == T_CLASS) {
$current_class = $data;
$current_class_level = $brace_level;
1944,11 → 2003,13
$current_function = $data;
$declared_functions[] = $current_function;
}
 
$current_function_level = $brace_level;
$m = array();
} elseif ($look_for == T_NEW) {
$used_classes[$data] = true;
}
 
$look_for = 0;
continue 2;
case T_VARIABLE:
1964,18 → 2025,28
}
continue 2;
case T_DOUBLE_COLON:
if (!($tokens[$i - 1][0] == T_WHITESPACE || $tokens[$i - 1][0] == T_STRING)) {
$this->_stack->push(__FUNCTION__, 'warning', array('file' => $file),
'Parser error: invalid PHP found in file "%file%"');
$token = $tokens[$i - 1][0];
if (!($token == T_WHITESPACE || $token == T_STRING || $token == T_STATIC || $token == T_VARIABLE)) {
if (isset($this->_stack)) {
$this->_stack->push(__FUNCTION__, 'warning', array('file' => $file),
'Parser error: invalid PHP found in file "%file%"');
} else {
PEAR::raiseError("Parser error: invalid PHP found in file \"$file\"",
PEAR_COMMON_ERROR_INVALIDPHP);
}
 
return false;
}
 
$class = $tokens[$i - 1][1];
if (strtolower($class) != 'parent') {
$used_classes[$class] = true;
}
 
continue 2;
}
}
 
return array(
"source_file" => $file,
"declared_classes" => $declared_classes,
1985,7 → 2056,7
"used_classes" => array_diff(array_keys($used_classes), $nodeps),
"inheritance" => $extends,
"implements" => $implements,
);
);
}
 
/**
2012,15 → 2083,17
if (!$this->_isValid) {
return array();
}
 
$providesret = array();
$file = basename($srcinfo['source_file']);
$pn = $this->_pf->getPackage();
$pnl = strlen($pn);
$file = basename($srcinfo['source_file']);
$pn = isset($this->_pf) ? $this->_pf->getPackage() : '';
$pnl = strlen($pn);
foreach ($srcinfo['declared_classes'] as $class) {
$key = "class;$class";
if (isset($providesret[$key])) {
continue;
}
 
$providesret[$key] =
array('file'=> $file, 'type' => 'class', 'name' => $class);
if (isset($srcinfo['inheritance'][$class])) {
2028,6 → 2101,7
$srcinfo['inheritance'][$class];
}
}
 
foreach ($srcinfo['declared_methods'] as $class => $methods) {
foreach ($methods as $method) {
$function = "$class::$method";
2036,6 → 2110,7
isset($providesret[$key])) {
continue;
}
 
$providesret[$key] =
array('file'=> $file, 'type' => 'function', 'name' => $function);
}
2046,13 → 2121,15
if ($function{0} == '_' || isset($providesret[$key])) {
continue;
}
 
if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) {
$warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\"";
}
 
$providesret[$key] =
array('file'=> $file, 'type' => 'function', 'name' => $function);
}
 
return $providesret;
}
}
?>