Include external Classes

Hey,

 

does anyone know how to add external Classes to phpvms?

I tried to add the folder to the core/common/ folder so it looks like this:

Now I want to use this Classes and files in - for example “edit_profile”. I added the required files with “require” like this:

 

require \_\_DIR\_\_.'/../../../core/common/elephant.io/Client.php'; require \_\_DIR\_\_.'/../../../core/common/elephant.io/Engine/SocketIO/Version2X.php';

Now, if I refresh the page I got an 500 error (HTTP ERROR 500).

How do I include and use the files correctly?

 

Thank you  

I think you will have to make some edits, and possibly create classes using the same method the other classes use.

Hi

 

One of the ways you can access your external class is by putting this codes that  have made for you in your codon.config

 

Make a new define to your folder elephant.io

define(‘ELEPHANTIO_PATH’, dirname(__FILE__).‘\core\common\elephant.io’);

 

require ELEPHANTIO_PATH.DS.‘client.php’;

Do the same for version2x.php

 

That should be it. Do let me know if it works for you.

1 Like