小编h3r*_*3rx的帖子

将phpseclib整合到Laravel 5中

我目前正将我的项目从Laravel 4迁移到Laravel 5,我仍然是Laravel和OOP的新手用户,但到目前为止一切顺利.

但是,在我的L4项目中,我使用phpseclib生成SSH密钥,我通过以下方式导入:

MyController.php

...
include('../app/libs/phpseclib0.3.10/Crypt/RSA.php');
$rsa = new Crypt_RSA();
...
Run Code Online (Sandbox Code Playgroud)

这似乎不再起作用了:

syntax error, unexpected 'if' (T_IF), expecting identifier (T_STRING) 
Run Code Online (Sandbox Code Playgroud)

... /应用/库/ phpseclib0.3.10 /地穴/ RSA.php

/**
* Include Crypt_Random
*/
// the class_exists() will only be called if the crypt_random_string function hasn't been defined and
// will trigger a call to __autoload() if you're wanting to auto-load classes
// call function_exists() a second time to stop the include_once from being called outside
// of the auto loader
if (!function_exists('crypt_random_string')) …
Run Code Online (Sandbox Code Playgroud)

php laravel phpseclib

3
推荐指数
2
解决办法
5561
查看次数

标签 统计

laravel ×1

php ×1

phpseclib ×1