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

📄 cpanplus::module.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
This method returns a \f(CW\*(C`CPANPLUS::Module\*(C'\fR object. Normal usersshould never call this method directly, but instead use the\&\f(CW\*(C`CPANPLUS::Backend\*(C'\fR to obtain module objects..PPThis example illustrates a \f(CW\*(C`new()\*(C'\fR call with all required arguments:.PP.Vb 7\&        CPANPLUS::Module\->new(\&            module  => \*(AqFoo\*(Aq,\&            path    => \*(Aqauthors/id/A/AA/AAA\*(Aq,\&            package => \*(AqFoo\-1.0.tgz\*(Aq,\&            author  => $author_object,\&            _id     => INTERNALS_OBJECT_ID,\&        );.Ve.PPEvery accessor is also a valid option to pass to \f(CW\*(C`new\*(C'\fR..PPReturns a module object on success and false on failure..ie n .Sh "$mod\->package_name".el .Sh "\f(CW$mod\fP\->package_name".IX Subsection "$mod->package_name"Returns the name of the package a module is in. For \f(CW\*(C`Acme::Bleach\*(C'\fRthat might be \f(CW\*(C`Acme\-Bleach\*(C'\fR..ie n .Sh "$mod\->package_version".el .Sh "\f(CW$mod\fP\->package_version".IX Subsection "$mod->package_version"Returns the version of the package a module is in. For a modulein the package \f(CW\*(C`Acme\-Bleach\-1.1.tar.gz\*(C'\fR this would be \f(CW1.1\fR..ie n .Sh "$mod\->package_extension".el .Sh "\f(CW$mod\fP\->package_extension".IX Subsection "$mod->package_extension"Returns the suffix added by the compression method of a package acertain module is in. For a module in \f(CW\*(C`Acme\-Bleach\-1.1.tar.gz\*(C'\fR, thiswould be \f(CW\*(C`tar.gz\*(C'\fR..ie n .Sh "$mod\->package_is_perl_core".el .Sh "\f(CW$mod\fP\->package_is_perl_core".IX Subsection "$mod->package_is_perl_core"Returns a boolean indicating of the package a particular module is in,is actually a core perl distribution..ie n .Sh "$mod\->module_is_supplied_with_perl_core( [version => $]] )".el .Sh "\f(CW$mod\fP\->module_is_supplied_with_perl_core( [version => $]] )".IX Subsection "$mod->module_is_supplied_with_perl_core( [version => $]] )"Returns a boolean indicating whether \f(CW\*(C`ANY VERSION\*(C'\fR of this modulewas supplied with the current running perl's core package..ie n .Sh "$mod\->is_bundle".el .Sh "\f(CW$mod\fP\->is_bundle".IX Subsection "$mod->is_bundle"Returns a boolean indicating if the module you are looking at, isactually a bundle. Bundles are identified as modules whose name startswith \f(CW\*(C`Bundle::\*(C'\fR..ie n .Sh "$mod\->is_third_party".el .Sh "\f(CW$mod\fP\->is_third_party".IX Subsection "$mod->is_third_party"Returns a boolean indicating whether the package is a known third-party module (i.e. it's not provided by the standard Perl distribution and is not available on the \s-1CPAN\s0, but on a third party software provider).See Module::ThirdParty for more details..ie n .Sh "$mod\->third_party_information".el .Sh "\f(CW$mod\fP\->third_party_information".IX Subsection "$mod->third_party_information"Returns a reference to a hash with more information about a third-partymodule. See the documentation about \f(CW\*(C`module_information()\*(C'\fR in Module::ThirdParty for more details..ie n .Sh "$clone\fP = \f(CW$self\->clone".el .Sh "\f(CW$clone\fP = \f(CW$self\fP\->clone".IX Subsection "$clone = $self->clone"Clones the current module object for tinkering with.It will have a clean \f(CW\*(C`CPANPLUS::Module::Status\*(C'\fR object, as well asa fake \f(CW\*(C`CPANPLUS::Module::Author\*(C'\fR object..ie n .Sh "$where\fP = \f(CW$self\->fetch".el .Sh "\f(CW$where\fP = \f(CW$self\fP\->fetch".IX Subsection "$where = $self->fetch"Fetches the module from a \s-1CPAN\s0 mirror.Look at \fICPANPLUS::Internals::Fetch::_fetch()\fR for details on theoptions you can pass..ie n .Sh "$path\fP = \f(CW$self\->extract".el .Sh "\f(CW$path\fP = \f(CW$self\fP\->extract".IX Subsection "$path = $self->extract"Extracts the fetched module.Look at \fICPANPLUS::Internals::Extract::_extract()\fR for details onthe options you can pass..ie n .Sh "$type\fP = \f(CW$self\->get_installer_type([prefer_makefile => \s-1BOOL\s0])".el .Sh "\f(CW$type\fP = \f(CW$self\fP\->get_installer_type([prefer_makefile => \s-1BOOL\s0])".IX Subsection "$type = $self->get_installer_type([prefer_makefile => BOOL])"Gets the installer type for this module. This may either be \f(CW\*(C`build\*(C'\fR or\&\f(CW\*(C`makemaker\*(C'\fR. If \f(CW\*(C`Module::Build\*(C'\fR is unavailable or no installer typeis available, it will fall back to \f(CW\*(C`makemaker\*(C'\fR. If both are available,it will pick the one indicated by your config, or by the\&\f(CW\*(C`prefer_makefile\*(C'\fR option you can pass to this function..PPReturns the installer type on success, and false on error..ie n .Sh "$dist\fP = \f(CW$self\->dist([target => 'prepare|create', format => \s-1DISTRIBUTION_TYPE\s0, args => {key => val}]);".el .Sh "\f(CW$dist\fP = \f(CW$self\fP\->dist([target => 'prepare|create', format => \s-1DISTRIBUTION_TYPE\s0, args => {key => val}]);".IX Subsection "$dist = $self->dist([target => 'prepare|create', format => DISTRIBUTION_TYPE, args => {key => val}]);"Create a distribution object, ready to be installed.Distribution type defaults to your config settings.PPThe optional \f(CW\*(C`args\*(C'\fR hashref is passed on to the specific distributiontypes' \f(CW\*(C`create\*(C'\fR method after being dereferenced..PPReturns a distribution object on success, false on failure..PPSee \f(CW\*(C`CPANPLUS::Dist\*(C'\fR for details..ie n .Sh "$bool\fP = \f(CW$mod\->prepare( )".el .Sh "\f(CW$bool\fP = \f(CW$mod\fP\->prepare( )".IX Subsection "$bool = $mod->prepare( )"Convenience method around \f(CW\*(C`install()\*(C'\fR that prepares a module without actually building it. This is equivalent to invoking \f(CW\*(C`install\*(C'\fRwith \f(CW\*(C`target\*(C'\fR set to \f(CW\*(C`prepare\*(C'\fR.PPReturns true on success, false on failure..ie n .Sh "$bool\fP = \f(CW$mod\->create( )".el .Sh "\f(CW$bool\fP = \f(CW$mod\fP\->create( )".IX Subsection "$bool = $mod->create( )"Convenience method around \f(CW\*(C`install()\*(C'\fR that creates a module. This is equivalent to invoking \f(CW\*(C`install\*(C'\fR with \f(CW\*(C`target\*(C'\fR set to \&\f(CW\*(C`create\*(C'\fR.PPReturns true on success, false on failure..ie n .Sh "$bool\fP = \f(CW$mod\->test( )".el .Sh "\f(CW$bool\fP = \f(CW$mod\fP\->test( )".IX Subsection "$bool = $mod->test( )"Convenience wrapper around \f(CW\*(C`install()\*(C'\fR that tests a module, withoutinstalling it.It's the equivalent to invoking \f(CW\*(C`install()\*(C'\fR with \f(CW\*(C`target\*(C'\fR set to\&\f(CW\*(C`create\*(C'\fR and \f(CW\*(C`skiptest\*(C'\fR set to \f(CW0\fR..PPReturns true on success, false on failure..ie n .Sh "$bool\fP = \f(CW$self\->install([ target => 'prepare|create|install', format => \s-1FORMAT_TYPE\s0, extractdir => \s-1DIRECTORY\s0, fetchdir => \s-1DIRECTORY\s0, prefer_bin => \s-1BOOL\s0, force => \s-1BOOL\s0, verbose => \s-1BOOL\s0, ..... ]);".el .Sh "\f(CW$bool\fP = \f(CW$self\fP\->install([ target => 'prepare|create|install', format => \s-1FORMAT_TYPE\s0, extractdir => \s-1DIRECTORY\s0, fetchdir => \s-1DIRECTORY\s0, prefer_bin => \s-1BOOL\s0, force => \s-1BOOL\s0, verbose => \s-1BOOL\s0, ..... ]);".IX Subsection "$bool = $self->install([ target => 'prepare|create|install', format => FORMAT_TYPE, extractdir => DIRECTORY, fetchdir => DIRECTORY, prefer_bin => BOOL, force => BOOL, verbose => BOOL, ..... ]);"Installs the current module. This includes fetching it and extractingit, if this hasn't been done yet, as well as creating a distributionobject for it..PPThis means you can pass it more arguments than described above, whichwill be passed on to the relevant methods as they are called..PPSee \f(CW\*(C`CPANPLUS::Internals::Fetch\*(C'\fR, \f(CW\*(C`CPANPLUS::Internals::Extract\*(C'\fR and\&\f(CW\*(C`CPANPLUS::Dist\*(C'\fR for details..PPReturns true on success, false on failure..PPReturns a list of module objects the Bundle specifies..PPThis requires you to have extracted the bundle already, using the\&\f(CW\*(C`extract()\*(C'\fR method..PPReturns false on error..ie n .Sh "$text\fP = \f(CW$self\->readme".el .Sh "\f(CW$text\fP = \f(CW$self\fP\->readme".IX Subsection "$text = $self->readme"Fetches the readme belonging to this module and stores it under\&\f(CW\*(C`$obj\->status\->readme\*(C'\fR. Returns the readme as a string onsuccess and returns false on failure..ie n .Sh "$version\fP = \f(CW$self\fP\->\fIinstalled_version()".el .Sh "\f(CW$version\fP = \f(CW$self\fP\->\fIinstalled_version()\fP".IX Subsection "$version = $self->installed_version()"Returns the currently installed version of this module, if any..ie n .Sh "$where\fP = \f(CW$self\fP\->\fIinstalled_file()".el .Sh "\f(CW$where\fP = \f(CW$self\fP\->\fIinstalled_file()\fP".IX Subsection "$where = $self->installed_file()"Returns the location of the currently installed file of this module,if any..ie n .Sh "$bool\fP = \f(CW$self\->is_uptodate([version => \s-1VERSION_NUMBER\s0])".el .Sh "\f(CW$bool\fP = \f(CW$self\fP\->is_uptodate([version => \s-1VERSION_NUMBER\s0])".IX Subsection "$bool = $self->is_uptodate([version => VERSION_NUMBER])"Returns a boolean indicating if this module is uptodate or not..ie n .Sh "$href\fP = \f(CW$self\fP\->\fIdetails()".el .Sh "\f(CW$href\fP = \f(CW$self\fP\->\fIdetails()\fP".IX Subsection "$href = $self->details()"Returns a hashref with key/value pairs offering more information abouta particular module. For example, for \f(CW\*(C`Time::HiRes\*(C'\fR it might look likethis:.PP.Vb 11\&    Author                  Jarkko Hietaniemi (jhi@iki.fi)\&    Description             High resolution time, sleep, and alarm\&    Development Stage       Released\&    Installed File          /usr/local/perl/lib/Time/Hires.pm\&    Interface Style         plain Functions, no references used\&    Language Used           C and perl, a C compiler will be needed\&    Package                 Time\-HiRes\-1.65.tar.gz\&    Public License          Unknown\&    Support Level           Developer\&    Version Installed       1.52\&    Version on CPAN         1.65.Ve.ie n .Sh "@list\fP = \f(CW$self\fP\->\fIcontains()".el .Sh "\f(CW@list\fP = \f(CW$self\fP\->\fIcontains()\fP".IX Subsection "@list = $self->contains()"Returns a list of module objects that represent the modules also present in the package of this module..PPFor example, for \f(CW\*(C`Archive::Tar\*(C'\fR this might return:.PP.Vb 3\&    Archive::Tar\&    Archive::Tar::Constant\&    Archive::Tar::File.Ve.ie n .Sh "@list_of_hrefs\fP = \f(CW$self\fP\->\fIfetch_report()".el .Sh "\f(CW@list_of_hrefs\fP = \f(CW$self\fP\->\fIfetch_report()\fP".IX Subsection "@list_of_hrefs = $self->fetch_report()"This function queries the \s-1CPAN\s0 testers database at\&\fIhttp://testers.cpan.org/\fR for test results of specified moduleobjects, module names or distributions..PPLook at \fICPANPLUS::Internals::Report::_query_report()\fR for details onthe options you can pass and the return value to expect..ie n .Sh "$bool\fP = \f(CW$self\->uninstall([type => [all|man|prog])".el .Sh "\f(CW$bool\fP = \f(CW$self\fP\->uninstall([type => [all|man|prog])".IX Subsection "$bool = $self->uninstall([type => [all|man|prog])"This function uninstalls the specified module object..PPYou can install 2 types of files, either \f(CW\*(C`man\*(C'\fR pages or \f(CW\*(C`prog\*(C'\fRramfiles. Alternately you can specify \f(CW\*(C`all\*(C'\fR to uninstall both (whichis the default)..PPReturns true on success and false on failure..PPDo note that this does an uninstall via the so-called \f(CW\*(C`.packlist\*(C'\fR,so if you used a module installer like say, \f(CW\*(C`ports\*(C'\fR or \f(CW\*(C`apt\*(C'\fR, youshould not use this, but use your package manager instead..ie n .Sh "@modobj\fP = \f(CW$self\fP\->\fIdistributions()".el .Sh "\f(CW@modobj\fP = \f(CW$self\fP\->\fIdistributions()\fP".IX Subsection "@modobj = $self->distributions()"Returns a list of module objects representing all releases for thismodule on success, false on failure..ie n .Sh "@list\fP = \f(CW$self\->files ()".el .Sh "\f(CW@list\fP = \f(CW$self\fP\->files ()".IX Subsection "@list = $self->files ()"Returns a list of files used by this module, if it is installed..ie n .Sh "@list\fP = \f(CW$self\->directory_tree ()".el .Sh "\f(CW@list\fP = \f(CW$self\fP\->directory_tree ()".IX Subsection "@list = $self->directory_tree ()"Returns a list of directories used by this module..ie n .Sh "@list\fP = \f(CW$self\->packlist ()".el .Sh "\f(CW@list\fP = \f(CW$self\fP\->packlist ()".IX Subsection "@list = $self->packlist ()"Returns the \f(CW\*(C`ExtUtils::Packlist\*(C'\fR object for this module..ie n .Sh "@list\fP = \f(CW$self\->validate ()".el .Sh "\f(CW@list\fP = \f(CW$self\fP\->validate ()".IX Subsection "@list = $self->validate ()"Returns a list of files that are missing for this modules, butare present in the .packlist file..ie n .Sh "$bool\fP = \f(CW$self\->add_to_includepath;".el .Sh "\f(CW$bool\fP = \f(CW$self\fP\->add_to_includepath;".IX Subsection "$bool = $self->add_to_includepath;"Adds the current modules path to \f(CW@INC\fR and \f(CW$PERL5LIB\fR. This allowsyou to add the module from it's build dir to your path..PPYou can reset \f(CW@INC\fR and \f(CW$PERL5LIB\fR to it's original state when youstarted the program, by calling:.PP.Vb 1\&    $self\->parent\->flush(\*(Aqlib\*(Aq);.Ve.ie n .Sh "$path\fP = \f(CW$self\fP\->\fIbest_path_to_module_build();".el .Sh "\f(CW$path\fP = \f(CW$self\fP\->\fIbest_path_to_module_build()\fP;".IX Subsection "$path = $self->best_path_to_module_build();"\&\fB\s-1OBSOLETE\s0\fR.PPIf a newer version of Module::Build is found in your path, it willreturn this \f(CW\*(C`special\*(C'\fR path. If the newest version of \f(CW\*(C`Module::Build\*(C'\fRis found in your regular \f(CW@INC\fR, the method will return false. Thisindicates you do not need to add a special directory to your \f(CW@INC\fR..PPNote that this is only relevant if you're building your own\&\f(CW\*(C`CPANPLUS::Dist::*\*(C'\fR plugin \*(-- the built-in dist types already havethis taken care of..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.

⌨️ 快捷键说明

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