You are here

function smarty_core_get_include_path in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/lib/smarty/core/core.get_include_path.php \smarty_core_get_include_path()
3 calls to smarty_core_get_include_path()
Smarty::_parse_resource_name in includes/moodle/lib/smarty/Smarty.class.php
parse out the type and name from the resource
smarty_core_assemble_plugin_filepath in includes/moodle/lib/smarty/core/core.assemble_plugin_filepath.php
assemble filepath of requested plugin
smarty_core_get_php_resource in includes/moodle/lib/smarty/core/core.get_php_resource.php
Retrieves PHP script resource

File

includes/moodle/lib/smarty/core/core.get_include_path.php, line 19

Code

function smarty_core_get_include_path(&$params, &$smarty) {
  static $_path_array = null;
  if (!isset($_path_array)) {
    $_ini_include_path = ini_get('include_path');
    if (strstr($_ini_include_path, ';')) {

      // windows pathnames
      $_path_array = explode(';', $_ini_include_path);
    }
    else {
      $_path_array = explode(':', $_ini_include_path);
    }
  }
  foreach ($_path_array as $_include_path) {
    if (@is_readable($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
      $params['new_file_path'] = $_include_path . DIRECTORY_SEPARATOR . $params['file_path'];
      return true;
    }
  }
  return false;
}