Error with the same name functions
jafamo opened this issue · comments
Javier commented
I created a new plugin in wordpress with MVC WP
private $ojsBridge;
public function __construct()
{
parent::__construct();
$this->ojsBridge = new OJSBridge('/project/ojs/gitlab/ojs');
}
public function index(){
echo "entrando";
$application = $this->ojsBridge->start();
$request = $application->getRequest();
My error:
Fatal error: Cannot redeclare __() (previously declared in /project/ojs/wordpress/wp-includes/l10n.php:201) in /project/ojs/gitlab/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php on line 753
The function in wordpress:
function __( $text, $domain = 'default' ) {
return translate( $text, $domain );
}
The function in OJS
function __($key, $params = array(), $locale = null) {
return AppLocale::translate($key, $params, $locale);
}
Now I have two functions which name is the same.This functions are from core of App.
Two functions with different params ...
What can I do ?
Regards.
David Fernández Aldana commented