From feca21da2bd0f27396b93d967e34e2b935fea78f Mon Sep 17 00:00:00 2001 From: Clint Nelissen Date: Mon, 1 Dec 2014 19:26:52 -0800 Subject: [PATCH] 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