} $host_url = $scheme . '://' . $host; $full_url = !empty($path) ? $host_url . $path : $host_url; $full_url = !empty($query) ? $full_url . $query : $full_url; return array('host' => $host_url, 'full' => $full_url); } public static function load_source_class($source_name = '') { if (!$source_name) { return false; } if (!class_exists('DLN_Source_Abstract')) { include DLN_NEW_PLUGIN_DIR . '/sources/abstract-source.php'; } // Now try to load the form_name $source_class = 'DLN_Source_' . str_replace('-', '_', $source_name); $source_file = DLN_NEW_PLUGIN_DIR . '/sources/source-' . $source_name . '.php'; if (class_exists($source_class)) { return $source_class; } if (!file_exists($source_file)) { return false; } if (!class_exists($source_class)) { include $source_file; } return $source_class; } } DLN_Helper_Source::get_instance();