diff --git a/phpseclib/Crypt/AES.php b/phpseclib/Crypt/AES.php index ad4c48fb..6a75ceb2 100644 --- a/phpseclib/Crypt/AES.php +++ b/phpseclib/Crypt/AES.php @@ -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) * diff --git a/phpseclib/Crypt/DES.php b/phpseclib/Crypt/DES.php index 1197a50a..a7a5c1bc 100644 --- a/phpseclib/Crypt/DES.php +++ b/phpseclib/Crypt/DES.php @@ -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. * diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index c5d314f0..1aef12dd 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -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 * diff --git a/phpseclib/Crypt/RC4.php b/phpseclib/Crypt/RC4.php index b709590a..d6e5fbfc 100644 --- a/phpseclib/Crypt/RC4.php +++ b/phpseclib/Crypt/RC4.php @@ -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. * diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index db1ba158..2b60c0b0 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -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 * diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index 335d5233..5997461a 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -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. * diff --git a/phpseclib/Crypt/TripleDES.php b/phpseclib/Crypt/TripleDES.php index 3b4c8c36..954f0d5b 100644 --- a/phpseclib/Crypt/TripleDES.php +++ b/phpseclib/Crypt/TripleDES.php @@ -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. * diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 29ad949e..fd0b8953 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -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 * diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 766c6e7e..e812a416 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -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); + } } /** diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 8a2acb20..1da4c317 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -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 * diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index d048cb03..08fb7c09 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -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). * diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 8db087d3..2af34bfc 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -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 * diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index 8f5c7993..781c7741 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -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 * diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 43bfbca2..358802b8 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -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 *