Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_plugin_path()

Parameters

ColumnTypeDefaultDescription
$plugin
$url false

Location

include/plugin_functions.php lines 1463 to 1479

Definition

 
function get_plugin_path($plugin,$url=false)
    {
    
# For the given plugin shortname, return the path on disk
    # Supports plugins being in the filestore folder (for user uploaded plugins)
    
global $baseurl_short,$storagedir,$storageurl;
    
    
# Sanitise $plugin
    
$plugin=safe_file_name($plugin);
    
    
# Standard location    
    
$pluginpath=dirname(__FILE__) . "/../plugins/" $plugin;
    if (
file_exists($pluginpath)) {return $url $baseurl_short "plugins/" $plugin $pluginpath;}

    
# Filestore location
    
$pluginpath=$storagedir "/plugins/" $plugin;
    if (
file_exists($pluginpath)) {return $url $storageurl "/plugins/" $plugin $pluginpath;}
    }

This article was last updated 11th September 2024 10:35 Europe/London time based on the source file dated 29th July 2024 11:00 Europe/London time.