Loading and running 3rd party php files
You can include this library to your code file by typing the below code;
use Ness\Tool\Library
Required Namespace
- Ness
- Tool
- Library
- Tool
You can include this library to your code file by typing the below code;
use Ness\Tool\Library
About Library Class #top
Library class is used to include third party class and code files to your project. It is simply a replacement for php's include and require functions.
Methods #top
Load
Library::Load(string $filename, IncludeType $type);
Loads a third party class. (Class must be in library folder) | ||
Return | Void | |
Parameters | $filename String; filename in 'library' directory $type; ModeRequire, ModeRequireOnce, ModeInclude, ModeIncludeOnce, ModeDefault |
LoadConfig
Library::LoadConfig(string $filename, IncludeType $type);
Loads your configuration files | ||
Return | Void | |
Parameters | $filename String; filename $type; ModeRequire, ModeRequireOnce, ModeInclude, ModeIncludeOnce, ModeDefault |
isAvailable
Library::isAvailable(string $filename);
Loads your configuration files | ||
Return | Boolean | |
Parameters | $filename String; filename |
Example #top
if(Library::isAvailable('Library\bcrypt.php'))
{
Library::Load("Library\bcrypt.php");
}