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

Get help with using the PHP Secure Communications Library.

Moderator: Nuxius

Forum rules
The purpose of this forum is to provide support for phpseclib, a pure PHP SSH / SFTP / RSA library.

Posts by new users are held in a moderation queue and are not publicly visible until the post is approved.

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

Postby bantu » Thu May 24, 2012 10:07 am

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
bantu
Traveler
 
Posts: 14
Joined: Wed Nov 02, 2011 3:59 pm

Return to phpseclib support

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron