- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
/**
* @param array $config
* @return App_Ldap
*/
private final function __construct(array $config)
{
if (!empty($config['host'])) {
$this->_host = $config['host'];
$dnTemp = explode('.', $this->_host);
$dnTemp = array_map(function($value)
{
return 'dc=' . $value;
}, $dnTemp);
$this->_dn = implode(',', $dnTemp);
} else {
throw new Exception('I need LDAP host');
}
if (!empty($config['user'])) {
$this->_user = $config['user'];
} else {
throw new Exception('I need LDAP login');
}
if (!empty($config['pass'])) {
$this->_pass = $config['pass'];
} else {
throw new Exception('I need LDAP pass');
}
return $this;
}
Встречал еще такие вариации:
protected function __call(..)
МОЯ ХОТЕТ ЖРАТ
МОЯ ХОТЕТ СРАТ
МОЯ ХОТЕТ СРАТ
МОЯ ХОТЕТ СПАТ
МОЯ ХОТЕТ ИГРАТ
Рифмачи).
2) return $this