This is the current code, that iv inserted into:
My Model Looks like this:
class phealModel extends EasySocialModel
{
public function getList( $userId ) {
$path = realpath(".")."/media/com_easysocial/apps/user/epoma/vendor/autoload.php";
require_once $path;
//import namespace
use Pheal\Pheal;
// create pheal object with default values
// so far this will not use caching, and since no key is supplied
// only allow access to the public parts of the EVE API
$pheal = new Pheal();
// requests /server/ServerStatus.xml.aspx
$response = $pheal->serverScope->ServerStatus();
echo sprintf(
"Hello Visitor! The EVE Online Server is: %s!, current amount of online players: %s",
$response->serverOpen ? "open" : "closed",
$response->onlinePlayers
);
}}
"]
But i have an issue implementing the use into the code.
use Pheal\Pheal;
It prints out the following error.
Parse error: syntax error, unexpected 'use' (T_USE) in /media/com_easysocial/apps/user/epoma/models/pheal.php on line 52
How can i fix this?
sourcecode for the includes can be found here:
https://github.com/3rdpartyeve/phealng
fixed it:
Foundry::import( 'admin:/includes/model' );
$path = realpath(".")."/media/com_easysocial/apps/user/epoma/vendor/autoload.php";
require_once $path;
use Pheal\Pheal;
class phealModel extends EasySocialModel
{
public function getList( $userId ) {
//import namespace
// create pheal object with default values
// so far this will not use caching, and since no key is supplied
// only allow access to the public parts of the EVE API
$pheal = new Pheal();
// requests /server/ServerStatus.xml.aspx
$response = $pheal->serverScope->ServerStatus();
echo sprintf(
"Hello Visitor! The EVE Online Server is: %s!, current amount of online players: %s",
$response->serverOpen ? "open" : "closed",
$response->onlinePlayers
);
}}