Commit 87809143 authored by internetdevels.daylioti's avatar internetdevels.daylioti Committed by Konstantin Komelin
Browse files

Issue #2220915 by daylioti, ipo4ka704: Performed initial migration to Drupal 8.

parent 0f00b391
simplehtmldom 8.x-2.x, xxxx-xx-xx
Issue #2220915 by daylioti, ipo4ka704: Performed initial migration to Drupal 8.
\ No newline at end of file
......@@ -22,7 +22,7 @@ function _simplhtmldom_get_library_path() {
}
// Support libraries module.
if (module_exists('libraries') && function_exists('libraries_get_path')) {
if (\Drupal::moduleHandler()->moduleExists('libraries') && function_exists('libraries_get_path')) {
$library_path = libraries_get_path($library) . "/$file";
if (file_exists($library_path)) {
return $library_path;
......@@ -33,8 +33,9 @@ function _simplhtmldom_get_library_path() {
'sites/all/libraries/' . $library,
drupal_get_path('module', 'simplehtmldom') . '/' . $library,
drupal_get_path('module', 'simplehtmldom') . "/libraries",
'profiles/' . variable_get('install_profile', 'default') . '/libraries/' . $library,
'profiles/' . drupal_get_profile() . '/libraries/' . $library,
);
foreach ($paths as $library_dir) {
$library_path = $library_dir . "/$file";
if (file_exists($library_path)) {
......
name = simplehtmldom API
description = A bridge between the PHP Simple HTML DOM Parser library and Drupal.
core = 7.x
name: simplehtmldom API
type: module
description: 'A bridge between the PHP Simple HTML DOM Parser library and Drupal.'
version: VERSION
core: 8.x
......@@ -10,23 +10,22 @@
function simplehtmldom_requirements($phase) {
$requirements = array();
// Ensure translations do not break at install time.
$t = get_t();
$requirements['simple_html_dom'] = array(
'title' => $t('"PHP Simple HTML DOM Parser" library'),
'title' => t('PHP Simple HTML DOM Parser library'),
);
// Include the helper file.
module_load_include('inc', 'simplehtmldom', 'helper');
if (_simplhtmldom_get_library_path()) {
$requirements['simple_html_dom']['value'] = $t('Installed');
$requirements['simple_html_dom']['value'] = t('Installed');
$requirements['simple_html_dom']['severity'] = REQUIREMENT_OK;
}
else {
$requirements['simple_html_dom']['value'] = $t('not installed');
$requirements['simple_html_dom']['value'] = t('not installed');
$requirements['simple_html_dom']['severity'] = REQUIREMENT_ERROR;
$requirements['simple_html_dom']['description'] = $t('simple_html_dom.php is missing. Please copy the latest version of simple_html_dom.php (PHP Simple HTML DOM Parser library) from http://sourceforge.net/projects/simplehtmldom/ to you libraries folder, for example sites/all/libraries/simplehtmldom/simple_html_dom.php');
$requirements['simple_html_dom']['description'] = t('simple_html_dom.php is missing. Please copy the latest version of simple_html_dom.php (PHP Simple HTML DOM Parser library) from http://sourceforge.net/projects/simplehtmldom/ to you libraries folder, for example sites/all/libraries/simplehtmldom/simple_html_dom.php');
}
return $requirements;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment