| 1 | package App::LDAP::Connection; | ||
| 2 | |||
| 3 | 13 | ▶ | use Modern::Perl; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 13 | ▶ | use base 'Net::LDAP'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 13 | our $instance; | |
| 8 | |||
| 9 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 10 | 0 | $instance = Net::LDAP::new(@_); | |
| 11 | } | ||
| 12 | |||
| 13 | 0 | ▶ | sub instance { |
|
Subroutine
instance: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 14 | 0 | $instance; | |
| 15 | } | ||
| 16 | |||
| 17 | 13 | 1; | |
| 18 | |||
| 19 | =pod | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | App::LDAP::Connection - Singleton of Net::LDAP | ||
| 24 | |||
| 25 | =head1 SYNOPSIS | ||
| 26 | |||
| 27 | App::LDAP::Connection->new( | ||
| 28 | "ldap://localhost", | ||
| 29 | port => 389, | ||
| 30 | version => 3, | ||
| 31 | onerror => "die", | ||
| 32 | ); | ||
| 33 | |||
| 34 | App::LDAP::Connection->instance->bind( | ||
| 35 | "cn=admin,dc=example,dc=org", | ||
| 36 | password => "password", | ||
| 37 | ); | ||
| 38 | |||
| 39 | App::LDAP::Connection->instance->search( | ||
| 40 | base => "ou=People,dc=example,dc=org", | ||
| 41 | scope => "sub", | ||
| 42 | filter => "uid=foo", | ||
| 43 | ); | ||
| 44 | |||
| 45 | =cut | ||