mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-15 19:16:55 +00:00
Add __construct() constructor to make namespace'ing easier for those wishing to do it
This commit is contained in:
parent
6765cb3b2b
commit
bfb04dcf4d
@ -242,6 +242,20 @@ class Crypt_AES extends Crypt_Rijndael {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param optional Integer $mode
|
||||
* @return Crypt_AES
|
||||
* @access public
|
||||
*/
|
||||
function __construct($mode = CRYPT_AES_MODE_CBC)
|
||||
{
|
||||
$this->Crypt_AES($mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dummy function
|
||||
*
|
||||
@ -255,7 +269,6 @@ class Crypt_AES extends Crypt_Rijndael {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the initialization vector. (optional)
|
||||
*
|
||||
|
@ -349,6 +349,20 @@ class Crypt_DES {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param optional Integer $mode
|
||||
* @return Crypt_DES
|
||||
* @access public
|
||||
*/
|
||||
function __construct($mode = CRYPT_DES_MODE_CBC)
|
||||
{
|
||||
$this->Crypt_DES($mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the key.
|
||||
*
|
||||
|
@ -162,6 +162,20 @@ class Crypt_Hash {
|
||||
$this->setHash($hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param optional String $hash
|
||||
* @return Crypt_Hash
|
||||
* @access public
|
||||
*/
|
||||
function __construct($hash = 'sha1')
|
||||
{
|
||||
$this->Crypt_Hash($hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the key for HMACs
|
||||
*
|
||||
|
@ -167,7 +167,6 @@ class Crypt_RC4 {
|
||||
*
|
||||
* Determines whether or not the mcrypt extension should be used.
|
||||
*
|
||||
* @param optional Integer $mode
|
||||
* @return Crypt_RC4
|
||||
* @access public
|
||||
*/
|
||||
@ -198,6 +197,19 @@ class Crypt_RC4 {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @return Crypt_RC4
|
||||
* @access public
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->Crypt_RC4();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the key.
|
||||
*
|
||||
|
@ -487,6 +487,19 @@ class Crypt_RSA {
|
||||
$this->mgfHLen = $this->mgfHash->getLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @return Crypt_RSA
|
||||
* @access public
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->Crypt_RSA();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create public / private key pair
|
||||
*
|
||||
|
@ -520,6 +520,20 @@ class Crypt_Rijndael {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param optional Integer $mode
|
||||
* @return Crypt_Rijndael
|
||||
* @access public
|
||||
*/
|
||||
function __construct($mode = CRYPT_RIJNDAEL_MODE_CBC)
|
||||
{
|
||||
$this->Crypt_Rijndael($mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the key.
|
||||
*
|
||||
|
@ -331,6 +331,20 @@ class Crypt_TripleDES {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param optional Integer $mode
|
||||
* @return Crypt_TripleDES
|
||||
* @access public
|
||||
*/
|
||||
function __construct($mode = CRYPT_DES_MODE_CBC)
|
||||
{
|
||||
$this->Crypt_TripleDES($mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the key.
|
||||
*
|
||||
|
@ -219,6 +219,19 @@ class File_ANSI {
|
||||
$this->setDimensions(80, 24);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @return Crypt_ANSI
|
||||
* @access public
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->Crypt_ANSI();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set terminal width and height
|
||||
*
|
||||
|
@ -144,6 +144,20 @@ class File_ASN1_Element {
|
||||
{
|
||||
$this->element = $encoded;
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param String $encoded
|
||||
* @return File_ASN1_Element
|
||||
* @access public
|
||||
*/
|
||||
function __construct($encoded)
|
||||
{
|
||||
$this->File_ASN1_Element($encoded);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1406,6 +1406,19 @@ class File_X509 {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @return File_X509
|
||||
* @access public
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
$this->File_X509();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load X.509 certificate
|
||||
*
|
||||
|
@ -455,6 +455,21 @@ class Math_BigInteger {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param optional $x base-10 number or base-$base number if $base set.
|
||||
* @param optional integer $base
|
||||
* @return Math_BigInteger
|
||||
* @access public
|
||||
*/
|
||||
function __construct($x = 0, $base = 10)
|
||||
{
|
||||
$this->Math_BigInteger($x, $base);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a BigInteger to a byte string (eg. base-256).
|
||||
*
|
||||
|
@ -348,6 +348,22 @@ class Net_SFTP extends Net_SSH2 {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param String $host
|
||||
* @param optional Integer $port
|
||||
* @param optional Integer $timeout
|
||||
* @return Net_SFTP
|
||||
* @access public
|
||||
*/
|
||||
function __construct($host, $port = 22, $timeout = 10)
|
||||
{
|
||||
$this->Net_SFTP($host, $port, $timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Login
|
||||
*
|
||||
|
@ -664,6 +664,23 @@ class Net_SSH1 {
|
||||
$this->bitmap = NET_SSH1_MASK_CONSTRUCTOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param String $host
|
||||
* @param optional Integer $port
|
||||
* @param optional Integer $timeout
|
||||
* @param optional Integer $cipher
|
||||
* @return Net_SSH1
|
||||
* @access public
|
||||
*/
|
||||
function __construct($host, $port = 22, $timeout = 10, $cipher = NET_SSH1_CIPHER_3DES)
|
||||
{
|
||||
$this->__construct($host, $port, $timeout, $cipher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Login
|
||||
*
|
||||
|
@ -900,6 +900,22 @@ class Net_SSH2 {
|
||||
$this->bitmap = NET_SSH2_MASK_CONSTRUCTOR;
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP5-only Default Constructor.
|
||||
*
|
||||
* Intended mainly to simplify namespacing for those who might wish to do it.
|
||||
*
|
||||
* @param String $host
|
||||
* @param optional Integer $port
|
||||
* @param optional Integer $timeout
|
||||
* @return Net_SSH2
|
||||
* @access public
|
||||
*/
|
||||
function __construct($host, $port = 22, $timeout = 10)
|
||||
{
|
||||
$this->Net_SSH2($host, $port, $timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Key Exchange
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user