Esempio n. 1
0
     $plugindir = $cssp->config['turbine_base_dir'] . 'plugins';
     if ($handle = opendir($plugindir)) {
         while (false !== ($pluginfile = readdir($handle))) {
             if ($pluginfile != '.' && $pluginfile != '..' && is_file($plugindir . '/' . $pluginfile) && pathinfo($plugindir . '/' . $pluginfile, PATHINFO_EXTENSION) == 'php' && !function_exists(substr($pluginfile, 0, -4))) {
                 include $plugindir . '/' . $pluginfile;
                 // Include the plugin
                 $plugins_available[] = substr($pluginfile, 0, -4);
                 // Add the plugin to the list of available plugins
             }
         }
         closedir($handle);
     }
     $plugins_loaded = true;
 }
 // Load the file into cssp
 $cssp->load_file($file, true);
 // Set global filepath constant for the current file
 $filepath = dirname($file);
 if ($filepath != '.') {
     $cssp->global_constants['FILEPATH'] = $filepath;
 } else {
     $cssp->global_constants['FILEPATH'] = '';
 }
 // Get plugin settings for the before parse hook
 $plugin_list = array();
 $found = false;
 foreach ($cssp->code as $line) {
     if (!$found) {
         if (preg_match('/^[\\s\\t]*@turbine/i', $line) == 1) {
             $found = true;
         }