Page 1 of 1

(X509, ASN) Unconditionally requiring files is a bad idea

PostPosted: Thu May 24, 2012 10:07 am
by bantu
This example fails for no good reason.

Code: Select all
require('Math/BigInteger.php');
require(
'File/X509.php'); 

It first throws all sorts of notices for already defined constants, then throws a fatal error
Code: Select all
PHP Fatal error:  Cannot redeclare class Math_BigInteger


Should probably use require_once in ASN1.php and X509.php as in all the other files.

Here is a patch: https://github.com/bantu/phpseclib/comm ... 4f58d88990