summaryrefslogtreecommitdiffstats
path: root/Crypt_RSA-role.patch
blob: ee1c2849361c4c26a326f8486cba53fb2b654444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff -up Crypt_RSA-1.0.0/RSA.php.role Crypt_RSA-1.0.0/RSA.php
--- Crypt_RSA-1.0.0/RSA.php.role	2015-08-03 10:04:38.075882028 +0200
+++ Crypt_RSA-1.0.0/RSA.php	2015-08-03 10:07:45.204836674 +0200
@@ -185,7 +185,7 @@ define('CRYPT_RSA_MODE_OPENSSL', 2);
 /**
  * Default openSSL configuration file.
  */
-define('CRYPT_RSA_OPENSSL_CONFIG', dirname(__FILE__) . '/../openssl.cnf');
+define('CRYPT_RSA_OPENSSL_CONFIG', 'openssl.cnf');
 
 /**#@+
  * @access public
@@ -497,7 +497,14 @@ class Crypt_RSA
             include_once 'Math/BigInteger.php';
         }
 
-        $this->configFile = CRYPT_RSA_OPENSSL_CONFIG;
+        $dir = '@cfg_dir@' . DIRECTORY_SEPARATOR . 'Crypt_RSA';
+        if (strpos($dir, '@') === false) {
+           // PEAR installer was used to install the package
+        } else {
+           // manual install
+           $dir = dirname(__FILE__);
+        }
+        $this->configFile = $dir . DIRECTORY_SEPARATOR . CRYPT_RSA_OPENSSL_CONFIG;
 
         if (!defined('CRYPT_RSA_MODE')) {
             switch (true) {