Example:
namespace MyApp\Api;
use Mautic\Auth\AuthInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
/**
* Base API class
*/
class Api implements LoggerAwareInterface
{
//do Api stuff here
If I upload this to my hosting, I am getting "Class Not found" exception. But i I do simple update:
namespace MyApp\Api;
use Mautic\Auth\AuthInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
/**
* Base API class
*/
require_once('Psr/Log/LoggerAwareInterface.php');
require_once('Psr/Log/LoggerInterface.php');
require_once('Psr/Log/NullLogger.php');
class Api implements LoggerAwareInterface
{
//do stuff
Adding keywords require_once
solves the problem and it seems that everything is usable.
Now, some of the packages I use in my PHP projects are done by someone else. So I hate the idea of changing files of someone else. Now, what should I check or change on my hosting?
Basic info of my hosting:
-- Webserver Configuration
PHP Version: 5.3.29
MySQL Version: 5.5.5
Webserver Info: Apache
Whad do I have to change on my hosting so the files work on themselves without need to add require
keywords?
EDIT I am still bit newbie in PHP programming, so I am using only Notepad++ to develop and usual FTP tool to upload files on my hosting