From feca21da2bd0f27396b93d967e34e2b935fea78f Mon Sep 17 00:00:00 2001 From: Clint Nelissen Date: Mon, 1 Dec 2014 19:26:52 -0800 Subject: [PATCH 1/4] Split File_ASN1 and File_ASN1_Element into separate files --- phpseclib/File/ASN1.php | 31 ++------------ phpseclib/File/ASN1/Element.php | 72 +++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 phpseclib/File/ASN1/Element.php diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 6fbb93fe..5f77b8c6 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -108,35 +108,10 @@ define('FILE_ASN1_TYPE_ANY', -2); /**#@-*/ /** - * ASN.1 Element - * - * Bypass normal encoding rules in File_ASN1::encodeDER() - * - * @package File_ASN1 - * @author Jim Wigginton - * @access public + * Include File_ASN1_Element */ -class File_ASN1_Element -{ - /** - * Raw element value - * - * @var String - * @access private - */ - var $element; - - /** - * Constructor - * - * @param String $encoded - * @return File_ASN1_Element - * @access public - */ - function __construct($encoded) - { - $this->element = $encoded; - } +if (!class_exists('File_ASN1_Element')) { + include_once 'ASN1/Element.php'; } /** diff --git a/phpseclib/File/ASN1/Element.php b/phpseclib/File/ASN1/Element.php new file mode 100644 index 00000000..ba5f6e30 --- /dev/null +++ b/phpseclib/File/ASN1/Element.php @@ -0,0 +1,72 @@ + + * @copyright MMXII Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +/** + * ASN.1 Element + * + * Bypass normal encoding rules in File_ASN1::encodeDER() + * + * @package File_ASN1 + * @author Jim Wigginton + * @access public + */ +class File_ASN1_Element +{ + /** + * Raw element value + * + * @var String + * @access private + */ + var $element; + + /** + * Constructor + * + * @param String $encoded + * @return File_ASN1_Element + * @access public + */ + function __construct($encoded) + { + $this->element = $encoded; + } +} \ No newline at end of file From 3129faf05d27c7fded0b1ae9b14ae45edd41e843 Mon Sep 17 00:00:00 2001 From: Clint Nelissen Date: Mon, 1 Dec 2014 19:28:02 -0800 Subject: [PATCH 2/4] Codesniff fix --- phpseclib/File/ASN1/Element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/File/ASN1/Element.php b/phpseclib/File/ASN1/Element.php index ba5f6e30..8332a147 100644 --- a/phpseclib/File/ASN1/Element.php +++ b/phpseclib/File/ASN1/Element.php @@ -69,4 +69,4 @@ class File_ASN1_Element { $this->element = $encoded; } -} \ No newline at end of file +} From 7fe400705397727fb026c6e7484ee1078eb4fc21 Mon Sep 17 00:00:00 2001 From: Clint Nelissen Date: Tue, 2 Dec 2014 08:17:53 -0800 Subject: [PATCH 3/4] Removed duplicated docblock text --- phpseclib/File/ASN1/Element.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/phpseclib/File/ASN1/Element.php b/phpseclib/File/ASN1/Element.php index 8332a147..fc2250c4 100644 --- a/phpseclib/File/ASN1/Element.php +++ b/phpseclib/File/ASN1/Element.php @@ -1,18 +1,6 @@ Date: Wed, 3 Dec 2014 08:57:41 -0800 Subject: [PATCH 4/4] Code sniffer php version fix --- phpseclib/File/ASN1/Element.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpseclib/File/ASN1/Element.php b/phpseclib/File/ASN1/Element.php index fc2250c4..a4384bdd 100644 --- a/phpseclib/File/ASN1/Element.php +++ b/phpseclib/File/ASN1/Element.php @@ -1,6 +1,9 @@