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

📄 cpanplus::backend.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
.ie n .Sh "$backend_rv\fP = \f(CW$cb\->readme( modules => \e@mods )".el .Sh "\f(CW$backend_rv\fP = \f(CW$cb\fP\->readme( modules => \e@mods )".IX Subsection "$backend_rv = $cb->readme( modules => @mods )"Fetches the readme for a list of modules. \f(CW@mods\fR can be a list ofdistribution names, module names or module objects\*(--basicallyanything that parse_module can understand..PPSee the equivalent method in \f(CW\*(C`CPANPLUS::Module\*(C'\fR for details onother options you can pass..PPSince this is a multi-module method call, the return value isimplemented as a \f(CW\*(C`CPANPLUS::Backend::RV\*(C'\fR object. Please consultthat module's documentation on how to interpret the return value..ie n .Sh "$backend_rv\fP = \f(CW$cb\->files( modules => \e@mods )".el .Sh "\f(CW$backend_rv\fP = \f(CW$cb\fP\->files( modules => \e@mods )".IX Subsection "$backend_rv = $cb->files( modules => @mods )"Returns a list of files used by these modules if they are installed.\&\f(CW@mods\fR can be a list of distribution names, module names or moduleobjects\*(--basically anything that parse_module can understand..PPSee the equivalent method in \f(CW\*(C`CPANPLUS::Module\*(C'\fR for details onother options you can pass..PPSince this is a multi-module method call, the return value isimplemented as a \f(CW\*(C`CPANPLUS::Backend::RV\*(C'\fR object. Please consultthat module's documentation on how to interpret the return value..ie n .Sh "$backend_rv\fP = \f(CW$cb\->distributions( modules => \e@mods )".el .Sh "\f(CW$backend_rv\fP = \f(CW$cb\fP\->distributions( modules => \e@mods )".IX Subsection "$backend_rv = $cb->distributions( modules => @mods )"Returns a list of module objects representing all releases for thismodule on success.\&\f(CW@mods\fR can be a list of distribution names, module names or moduleobjects, basically anything that parse_module can understand..PPSee the equivalent method in \f(CW\*(C`CPANPLUS::Module\*(C'\fR for details onother options you can pass..PPSince this is a multi-module method call, the return value isimplemented as a \f(CW\*(C`CPANPLUS::Backend::RV\*(C'\fR object. Please consultthat module's documentation on how to interpret the return value..ie n .Sh "$mod_obj\fP = \f(CW$cb\fP\->parse_module( module => \f(CW$modname|$distname|$modobj|URI )".el .Sh "\f(CW$mod_obj\fP = \f(CW$cb\fP\->parse_module( module => \f(CW$modname\fP|$distname|$modobj|URI )".IX Subsection "$mod_obj = $cb->parse_module( module => $modname|$distname|$modobj|URI )"\&\f(CW\*(C`parse_module\*(C'\fR tries to find a \f(CW\*(C`CPANPLUS::Module\*(C'\fR object thatmatches your query. Here's a list of examples you could give to\&\f(CW\*(C`parse_module\*(C'\fR;.IP "Text::Bastardize" 4.IX Item "Text::Bastardize".PD 0.IP "Text-Bastardize" 4.IX Item "Text-Bastardize".IP "Text\-Bastardize\-1.06" 4.IX Item "Text-Bastardize-1.06".IP "AYRNIEU/Text\-Bastardize" 4.IX Item "AYRNIEU/Text-Bastardize".IP "AYRNIEU/Text\-Bastardize\-1.06" 4.IX Item "AYRNIEU/Text-Bastardize-1.06".IP "AYRNIEU/Text\-Bastardize\-1.06.tar.gz" 4.IX Item "AYRNIEU/Text-Bastardize-1.06.tar.gz".IP "http://example.com/Text\-Bastardize\-1.06.tar.gz" 4.IX Item "http://example.com/Text-Bastardize-1.06.tar.gz".IP "file:///tmp/Text\-Bastardize\-1.06.tar.gz" 4.IX Item "file:///tmp/Text-Bastardize-1.06.tar.gz".PD.PPThese items would all come up with a \f(CW\*(C`CPANPLUS::Module\*(C'\fR object for\&\f(CW\*(C`Text::Bastardize\*(C'\fR. The ones marked explicitly as being version 1.06would give back a \f(CW\*(C`CPANPLUS::Module\*(C'\fR object of that version.Even if the version on \s-1CPAN\s0 is currently higher..PPIf \f(CW\*(C`parse_module\*(C'\fR is unable to actually find the module you are lookingfor in its module tree, but you supplied it with an author, moduleand version part in a distribution name or \s-1URI\s0, it will create a fake\&\f(CW\*(C`CPANPLUS::Module\*(C'\fR object for you, that you can use just like thereal thing..PPSee CPANPLUS::Module for the operations you can perform on amodule object..PPIf even this fancy guessing doesn't enable \f(CW\*(C`parse_module\*(C'\fR to createa fake module object for you to use, it will warn about an error andreturn false..ie n .Sh "$bool\fP = \f(CW$cb\->reload_indices( [update_source => \s-1BOOL\s0, verbose => \s-1BOOL\s0] );".el .Sh "\f(CW$bool\fP = \f(CW$cb\fP\->reload_indices( [update_source => \s-1BOOL\s0, verbose => \s-1BOOL\s0] );".IX Subsection "$bool = $cb->reload_indices( [update_source => BOOL, verbose => BOOL] );"This method reloads the source files..PPIf \f(CW\*(C`update_source\*(C'\fR is set to true, this will fetch new source filesfrom your \s-1CPAN\s0 mirror. Otherwise, \f(CW\*(C`reload_indices\*(C'\fR will do itsusual cache checking and only update them if they are out of date..PPBy default, \f(CW\*(C`update_source\*(C'\fR will be false..PPThe verbose setting defaults to what you have specified in yourconfig file..PPReturns true on success and false on failure..ie n .Sh "$bool\fP = \f(CW$cb\->flush(\s-1CACHE_NAME\s0)".el .Sh "\f(CW$bool\fP = \f(CW$cb\fP\->flush(\s-1CACHE_NAME\s0)".IX Subsection "$bool = $cb->flush(CACHE_NAME)"This method allows flushing of caches.There are several things which can be flushed:.IP "\(bu" 4\&\f(CW\*(C`methods\*(C'\fR.SpThe return status of methods which have been attempted, such asdifferent ways of fetching files.  It is recommended that automaticflushing be used instead..IP "\(bu" 4\&\f(CW\*(C`hosts\*(C'\fR.SpThe return status of URIs which have been attempted, such asdifferent hosts of fetching files.  It is recommended that automaticflushing be used instead..IP "\(bu" 4\&\f(CW\*(C`modules\*(C'\fR.SpInformation about modules such as prerequisites and whetherinstallation succeeded, failed, or was not attempted..IP "\(bu" 4\&\f(CW\*(C`lib\*(C'\fR.SpThis resets \s-1PERL5LIB\s0, which is changed to ensure that while installingmodules they are in our \f(CW@INC\fR..IP "\(bu" 4\&\f(CW\*(C`load\*(C'\fR.SpThis resets the cache of modules we've attempted to load, but failed.This enables you to load them again after a failed load, if they somehow have become available..IP "\(bu" 4\&\f(CW\*(C`all\*(C'\fR.SpFlush all of the aforementioned caches..PPReturns true on success and false on failure..ie n .Sh "@mods\fP = \f(CW$cb\fP\->\fIinstalled()".el .Sh "\f(CW@mods\fP = \f(CW$cb\fP\->\fIinstalled()\fP".IX Subsection "@mods = $cb->installed()"Returns a list of module objects of all your installed modules.If an error occurs, it will return false..PPSee CPANPLUS::Module for the operations you can perform on amodule object..ie n .Sh "$bool\fP = \f(CW$cb\->local_mirror([path => '/dir/to/save/to', index_files => \s-1BOOL\s0, force => \s-1BOOL\s0, verbose => \s-1BOOL\s0] )".el .Sh "\f(CW$bool\fP = \f(CW$cb\fP\->local_mirror([path => '/dir/to/save/to', index_files => \s-1BOOL\s0, force => \s-1BOOL\s0, verbose => \s-1BOOL\s0] )".IX Subsection "$bool = $cb->local_mirror([path => '/dir/to/save/to', index_files => BOOL, force => BOOL, verbose => BOOL] )"Creates a local mirror of \s-1CPAN\s0, of only the most recent sources in alocation you specify. If you set this location equal to a custom hostin your \f(CW\*(C`CPANPLUS::Config\*(C'\fR you can use your local mirror to installfrom..PPIt takes the following arguments:.IP "path" 4.IX Item "path"The location where to create the local mirror..IP "index_files" 4.IX Item "index_files"Enable/disable fetching of index files. You can disable fetching of theindex files if you don't plan to use the local mirror as your primary site, or if you'd like up-to-date index files be fetched from elsewhere..SpDefaults to true..IP "force" 4.IX Item "force"Forces refetching of packages, even if they are there already..SpDefaults to whatever setting you have in your \f(CW\*(C`CPANPLUS::Config\*(C'\fR..IP "verbose" 4.IX Item "verbose"Prints more messages about what its doing..SpDefaults to whatever setting you have in your \f(CW\*(C`CPANPLUS::Config\*(C'\fR..PPReturns true on success and false on error..ie n .Sh "$file\fP = \f(CW$cb\->autobundle([path => \s-1OUTPUT_PATH\s0, force => \s-1BOOL\s0, verbose => \s-1BOOL\s0])".el .Sh "\f(CW$file\fP = \f(CW$cb\fP\->autobundle([path => \s-1OUTPUT_PATH\s0, force => \s-1BOOL\s0, verbose => \s-1BOOL\s0])".IX Subsection "$file = $cb->autobundle([path => OUTPUT_PATH, force => BOOL, verbose => BOOL])"Writes out a snapshot of your current installation in \f(CW\*(C`CPAN\*(C'\fR bundlestyle. This can then be used to install the same modules for adifferent or on a different machine..PPIt will, by default, write to an 'autobundle' directory under yourcpanplus homedirectory, but you can override that by supplying a\&\f(CW\*(C`path\*(C'\fR argument..PPIt will return the location of the output file on success and false onfailure..SH "CUSTOM MODULE SOURCES".IX Header "CUSTOM MODULE SOURCES"Besides the sources as provided by the general \f(CW\*(C`CPAN\*(C'\fR mirrors, it's possible to add your own sources list to your \f(CW\*(C`CPANPLUS\*(C'\fR index..PPThe methodology behind this works much like \f(CW\*(C`Debian\*(Aqs apt\-sources\*(C'\fR..PPThe methods below show you how to make use of this functionality. Alsonote that most of these methods are available through the default shellplugin command \f(CW\*(C`/cs\*(C'\fR, making them available as shortcuts through theshell and via the commandline..ie n .Sh "%files\fP = \f(CW$cb\->list_custom_sources".el .Sh "\f(CW%files\fP = \f(CW$cb\fP\->list_custom_sources".IX Subsection "%files = $cb->list_custom_sources"Returns a mapping of registered custom sources and their local indicesas follows:.PP.Vb 1\&    /full/path/to/local/index => http://remote/source.Ve.PPNote that any file starting with an \f(CW\*(C`#\*(C'\fR is being ignored..ie n .Sh "$local_index\fP = \f(CW$cb\->add_custom_source( uri => \s-1URI\s0, [verbose => \s-1BOOL\s0] );".el .Sh "\f(CW$local_index\fP = \f(CW$cb\fP\->add_custom_source( uri => \s-1URI\s0, [verbose => \s-1BOOL\s0] );".IX Subsection "$local_index = $cb->add_custom_source( uri => URI, [verbose => BOOL] );"Adds an \f(CW\*(C`URI\*(C'\fR to your own sources list and mirrors its index. See the documentation on \f(CW\*(C`$cb\->update_custom_source\*(C'\fR on how this is done..PPReturns the full path to the local index on success, or false on failure..PPNote that when adding a new \f(CW\*(C`URI\*(C'\fR, the change to the in-memory tree isnot saved until you rebuild or save the tree to disk again. You can do this using the \f(CW\*(C`$cb\->reload_indices\*(C'\fR method..ie n .Sh "$local_index\fP = \f(CW$cb\->remove_custom_source( uri => \s-1URI\s0, [verbose => \s-1BOOL\s0] );".el .Sh "\f(CW$local_index\fP = \f(CW$cb\fP\->remove_custom_source( uri => \s-1URI\s0, [verbose => \s-1BOOL\s0] );".IX Subsection "$local_index = $cb->remove_custom_source( uri => URI, [verbose => BOOL] );"Removes an \f(CW\*(C`URI\*(C'\fR from your own sources list and removes its index..PPTo find out what \f(CW\*(C`URI\*(C'\fRs you have as part of your own sources list, usethe \f(CW\*(C`$cb\->list_custom_sources\*(C'\fR method..PPReturns the full path to the deleted local index file on success, or falseon failure..ie n .Sh "$bool\fP = \f(CW$cb\->update_custom_source( [remote => \s-1URI\s0] );".el .Sh "\f(CW$bool\fP = \f(CW$cb\fP\->update_custom_source( [remote => \s-1URI\s0] );".IX Subsection "$bool = $cb->update_custom_source( [remote => URI] );"Updates the indexes for all your custom sources. It does this by fetchinga file called \f(CW\*(C`packages.txt\*(C'\fR in the root of the custom sources's \f(CW\*(C`URI\*(C'\fR.If you provide the \f(CW\*(C`remote\*(C'\fR argument, it will only update the index forthat specific \f(CW\*(C`URI\*(C'\fR..PPHere's an example of how custom sources would resolve into index files:.PP.Vb 3\&  file:///path/to/sources       =>  file:///path/to/sources/packages.txt\&  http://example.com/sources    =>  http://example.com/sources/packages.txt\&  ftp://example.com/sources     =>  ftp://example.com/sources/packages.txt.Ve.PPThe file \f(CW\*(C`packages.txt\*(C'\fR simply holds a list of packages that can be foundunder the root of the \f(CW\*(C`URI\*(C'\fR. This file can be automatically generated foryou when the remote source is a \f(CW\*(C`file:// URI\*(C'\fR. For \f(CW\*(C`http://\*(C'\fR, \f(CW\*(C`ftp://\*(C'\fR,and similar, the administrator of that repository should run the method\&\f(CW\*(C`$cb\->write_custom_source_index\*(C'\fR on the repository to allow remoteusers to index it..PPFor details, see the \f(CW\*(C`$cb\->write_custom_source_index\*(C'\fR method below..PPAll packages that are added via this mechanism will be attributed to theauthor with \f(CW\*(C`CPANID\*(C'\fR \f(CW\*(C`LOCAL\*(C'\fR. You can use this id to search for all added packages..ie n .Sh "$file\fP = \f(CW$cb\->write_custom_source_index( path => /path/to/package/root, [to => /path/to/index/file, verbose => \s-1BOOL\s0] );".el .Sh "\f(CW$file\fP = \f(CW$cb\fP\->write_custom_source_index( path => /path/to/package/root, [to => /path/to/index/file, verbose => \s-1BOOL\s0] );".IX Subsection "$file = $cb->write_custom_source_index( path => /path/to/package/root, [to => /path/to/index/file, verbose => BOOL] );"Writes the index for a custom repository root. Most users will not have to worry about this, but administrators of a repository will need to make suretheir indexes are up to date..PPThe index will be written to a file called \f(CW\*(C`packages.txt\*(C'\fR in your repositoryroot, which you can specify with the \f(CW\*(C`path\*(C'\fR argument. You can override thislocation by specifying the \f(CW\*(C`to\*(C'\fR argument, but in normal operation, that shouldnot be required..PPOnce the index file is written, users can then add the \f(CW\*(C`URI\*(C'\fR pointing to the repository to their custom list of sources and start using it right away. See the \f(CW\*(C`$cb\->add_custom_source\*(C'\fR method for user details..SH "BUG REPORTS".IX Header "BUG REPORTS"Please report bugs or other issues to <bug\-cpanplus@rt.cpan.org<gt>..SH "AUTHOR".IX Header "AUTHOR"This module by Jos Boumans <kane@cpan.org>..SH "COPYRIGHT".IX Header "COPYRIGHT"The \s-1CPAN++\s0 interface (of which this module is a part of) is copyright (c) 2001 \- 2007, Jos Boumans <kane@cpan.org>. All rights reserved..PPThis library is free software; you may redistribute and/or modify it under the same terms as Perl itself..SH "SEE ALSO".IX Header "SEE ALSO"CPANPLUS::Configure, CPANPLUS::Module, CPANPLUS::Module::Author, CPANPLUS::Selfupdate

⌨️ 快捷键说明

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