⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 validator.php

📁 php-4.4.7学习linux时下载的源代码
💻 PHP
📖 第 1 页 / 共 5 页
字号:
    }    function _tagMissingAttribute($tag, $attr, $context)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag,            'attribute' => $attr, 'context' => $context),            'tag <%tag%> in context "%context%" has no attribute "%attribute%"');    }    function _tagHasNoAttribs($tag, $context)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag,            'context' => $context),            'tag <%tag%> has no attributes in context "%context%"');    }    function _invalidInternalStructure()    {        $this->_stack->push(__FUNCTION__, 'exception', array(),            'internal array was not generated by compatible parser, or extreme parser error, cannot continue');    }    function _invalidFileRole($file, $dir, $role)    {        $this->_stack->push(__FUNCTION__, 'error', array(            'file' => $file, 'dir' => $dir, 'role' => $role,            'roles' => PEAR_Installer_Role::getValidRoles($this->_pf->getPackageType())),            'File "%file%" in directory "%dir%" has invalid role "%role%", should be one of %roles%');    }    function _invalidFileName($file, $dir)    {        $this->_stack->push(__FUNCTION__, 'error', array(            'file' => $file),            'File "%file%" cannot begin with "."');    }    function _filelistCannotContainFile($filelist)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $filelist),            '<%tag%> can only contain <dir>, contains <file>.  Use ' .            '<dir name="/"> as the first dir element');    }    function _filelistMustContainDir($filelist)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $filelist),            '<%tag%> must contain <dir>.  Use <dir name="/"> as the ' .            'first dir element');    }    function _tagCannotBeEmpty($tag)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag),            '<%tag%> cannot be empty (<%tag%/>)');    }    function _UrlOrChannel($type, $name)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type,            'name' => $name),            'Required dependency <%type%> "%name%" can have either url OR ' .            'channel attributes, and not both');    }    function _NoChannel($type, $name)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type,            'name' => $name),            'Required dependency <%type%> "%name%" must have either url OR ' .            'channel attributes');    }    function _UrlOrChannelGroup($type, $name, $group)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type,            'name' => $name, 'group' => $group),            'Group "%group%" dependency <%type%> "%name%" can have either url OR ' .            'channel attributes, and not both');    }    function _NoChannelGroup($type, $name, $group)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type,            'name' => $name, 'group' => $group),            'Group "%group%" dependency <%type%> "%name%" must have either url OR ' .            'channel attributes');    }    function _unknownChannel($channel)    {        $this->_stack->push(__FUNCTION__, 'error', array('channel' => $channel),            'Unknown channel "%channel%"');    }    function _noPackageVersion()    {        $this->_stack->push(__FUNCTION__, 'error', array(),            'package.xml <package> tag has no version attribute, or version is not 2.0');    }    function _NoBundledPackages()    {        $this->_stack->push(__FUNCTION__, 'error', array(),            'No <bundledpackage> tag was found in <contents>, required for bundle packages');    }    function _AtLeast2BundledPackages()    {        $this->_stack->push(__FUNCTION__, 'error', array(),            'At least 2 packages must be bundled in a bundle package');    }    function _ChannelOrUri($name)    {        $this->_stack->push(__FUNCTION__, 'error', array('name' => $name),            'Bundled package "%name%" can have either a uri or a channel, not both');    }    function _noChildTag($child, $tag)    {        $this->_stack->push(__FUNCTION__, 'error', array('child' => $child, 'tag' => $tag),            'Tag <%tag%> is missing child tag <%child%>');    }    function _invalidVersion($type, $value)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, 'value' => $value),            'Version type <%type%> is not a valid version (%value%)');    }    function _invalidState($type, $value)    {        $states = array('stable', 'beta', 'alpha', 'devel');        if ($type != 'api') {            $states[] = 'snapshot';        }        if (strtolower($value) == 'rc') {            $this->_stack->push(__FUNCTION__, 'error',                array('version' => $this->_packageInfo['version']['release']),                'RC is not a state, it is a version postfix, try %version%RC1, stability beta');        }        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type, 'value' => $value,            'types' => $states),            'Stability type <%type%> is not a valid stability (%value%), must be one of ' .            '%types%');    }    function _invalidTask($task, $ret, $file)    {        switch ($ret[0]) {            case PEAR_TASK_ERROR_MISSING_ATTRIB :                $info = array('attrib' => $ret[1], 'task' => $task, 'file' => $file);                $msg = 'task <%task%> is missing attribute "%attrib%" in file %file%';            break;            case PEAR_TASK_ERROR_NOATTRIBS :                $info = array('task' => $task, 'file' => $file);                $msg = 'task <%task%> has no attributes in file %file%';            break;            case PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE :                $info = array('attrib' => $ret[1], 'values' => $ret[3],                    'was' => $ret[2], 'task' => $task, 'file' => $file);                $msg = 'task <%task%> attribute "%attrib%" has the wrong value "%was%" '.                    'in file %file%, expecting one of "%values%"';            break;            case PEAR_TASK_ERROR_INVALID :                $info = array('reason' => $ret[1], 'task' => $task, 'file' => $file);                $msg = 'task <%task%> in file %file% is invalid because of "%reason%"';            break;        }        $this->_stack->push(__FUNCTION__, 'error', $info, $msg);    }    function _unknownTask($task, $file)    {        $this->_stack->push(__FUNCTION__, 'error', array('task' => $task, 'file' => $file),            'Unknown task "%task%" passed in file <file name="%file%">');    }    function _subpackageCannotProvideExtension($name)    {        $this->_stack->push(__FUNCTION__, 'error', array('name' => $name),            'Subpackage dependency "%name%" cannot use <providesextension>, ' .            'only package dependencies can use this tag');    }    function _subpackagesCannotConflict($name)    {        $this->_stack->push(__FUNCTION__, 'error', array('name' => $name),            'Subpackage dependency "%name%" cannot use <conflicts/>, ' .            'only package dependencies can use this tag');    }    function _cannotProvideExtension($release)    {        $this->_stack->push(__FUNCTION__, 'error', array('release' => $release),            '<%release%> packages cannot use <providesextension>, only extbinrelease and extsrcrelease can provide a PHP extension');    }    function _mustProvideExtension($release)    {        $this->_stack->push(__FUNCTION__, 'error', array('release' => $release),            '<%release%> packages must use <providesextension> to indicate which PHP extension is provided');    }    function _cannotHaveSrcpackage($release)    {        $this->_stack->push(__FUNCTION__, 'error', array('release' => $release),            '<%release%> packages cannot specify a source code package, only extension binaries may use the <srcpackage> tag');    }    function _mustSrcPackage($release)    {        $this->_stack->push(__FUNCTION__, 'error', array('release' => $release),            '<extbinrelease> packages must specify a source code package with <srcpackage>');    }    function _mustSrcuri($release)    {        $this->_stack->push(__FUNCTION__, 'error', array('release' => $release),            '<extbinrelease> packages must specify a source code package with <srcuri>');    }    function _uriDepsCannotHaveVersioning($type)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type),            '%type%: dependencies with a <uri> tag cannot have any versioning information');    }    function _conflictingDepsCannotHaveVersioning($type)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type),            '%type%: conflicting dependencies cannot have versioning info, use <exclude> to ' .            'exclude specific versions of a dependency');    }    function _DepchannelCannotBeUri($type)    {        $this->_stack->push(__FUNCTION__, 'error', array('type' => $type),            '%type%: channel cannot be __uri, this is a pseudo-channel reserved for uri ' .            'dependencies only');    }    function _bundledPackagesMustBeFilename()    {        $this->_stack->push(__FUNCTION__, 'error', array(),            '<bundledpackage> tags must contain only the filename of a package release ' .            'in the bundle');    }    function _binaryPackageMustBePackagename()    {        $this->_stack->push(__FUNCTION__, 'error', array(),            '<binarypackage> tags must contain the name of a package that is ' .            'a compiled version of this extsrc package');    }    function _fileNotFound($file)    {        $this->_stack->push(__FUNCTION__, 'error', array('file' => $file),            'File "%file%" in package.xml does not exist');    }    function _notInContents($file, $tag)    {        $this->_stack->push(__FUNCTION__, 'error', array('file' => $file, 'tag' => $tag),            '<%tag% name="%file%"> is invalid, file is not in <contents>');    }    function _cannotValidateNoPathSet()    {        $this->_stack->push(__FUNCTION__, 'error', array(),            'Cannot validate files, no path to package file is set (use setPackageFile())');    }    function _usesroletaskMustHaveChannelOrUri($role, $tag)    {        $this->_stack->push(__FUNCTION__, 'error', array('role' => $role, 'tag' => $tag),            '<%tag%> 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>');    }    function _usesroletaskMustHaveRoleTask($tag, $type)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag, 'type' => $type),            '<%tag%> must contain <%type%> defining the %type% to be used');    }    function _cannotConflictWithAllOs($type)    {        $this->_stack->push(__FUNCTION__, 'error', array('tag' => $tag),            '%tag% cannot conflict with all OSes');    }    function _invalidDepGroupName($name)    {        $this->_stack->push(__FUNCTION__, 'error', array('group' => $name),            'Invalid dependency group name "%name%"');    }    function _analyzeBundledPackages()    {        if (!$this->_isValid) {            return false;        }        if (!$this->_pf->getPackageType() == 'bundle') {            return false;        }        if (!isset($this->_pf->_packageFile)) {            return false;        }        $dir_prefix = dirname($this->_pf->_packageFile);        $log = isset($this->_pf->_logger) ? array(&$this->_pf->_logger, 'log') :            array('PEAR_Common', 'log');        $info = $this->_pf->getContents();        $info = $info['bundledpackage'];        if (!is_array($info)) {            $info = array($info);        }        $pkg = &new PEAR_PackageFile($this->_pf->_config);        foreach (

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -