Skip to content

Commit f0b79fa

Browse files
authored
rm dead code. (#2975)
1 parent b22016d commit f0b79fa

File tree

1 file changed

+0
-87
lines changed

1 file changed

+0
-87
lines changed

includes/environment.inc

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ function drush_error_handler($errno, $message, $filename, $line, $context) {
5555
}
5656
}
5757

58-
/**
59-
* Returns a localizable message about php.ini that
60-
* varies depending on whether the php_ini_loaded_file()
61-
* is available or not.
62-
*/
63-
function _drush_php_ini_loaded_file_message() {
64-
if (function_exists('php_ini_loaded_file')) {
65-
return dt('Please check your configuration settings in !phpini or in your drush.ini file; see examples/example.drush.ini for details.', array('!phpini' => php_ini_loaded_file()));
66-
}
67-
else {
68-
return dt('Please check your configuration settings in your php.ini file or in your drush.ini file; see examples/example.drush.ini for details.');
69-
}
70-
}
71-
7258
/**
7359
* Evalute the environment after an abnormal termination and
7460
* see if we can determine any configuration settings that the user might
@@ -82,40 +68,6 @@ function _drush_postmortem() {
8268
}
8369
}
8470

85-
/**
86-
* Evaluate the environment before command bootstrapping
87-
* begins. If the php environment is too restrictive, then
88-
* notify the user that a setting change is needed and abort.
89-
*/
90-
function _drush_environment_check_php_ini() {
91-
$ini_checks = array('safe_mode' => '', 'open_basedir' => '', 'disable_functions' => array('exec', 'system'), 'disable_classes' => '');
92-
93-
// Test to insure that certain php ini restrictions have not been enabled
94-
$prohibited_list = array();
95-
foreach ($ini_checks as $prohibited_mode => $disallowed_value) {
96-
$ini_value = ini_get($prohibited_mode);
97-
$invalid_value = FALSE;
98-
if (empty($disallowed_value)) {
99-
$invalid_value = !empty($ini_value) && (strcasecmp($ini_value, 'off') != 0);
100-
}
101-
else {
102-
foreach ($disallowed_value as $test_value) {
103-
if (preg_match('/(^|,)' . $test_value . '(,|$)/', $ini_value)) {
104-
$invalid_value = TRUE;
105-
}
106-
}
107-
}
108-
if ($invalid_value) {
109-
$prohibited_list[] = $prohibited_mode;
110-
}
111-
}
112-
if (!empty($prohibited_list)) {
113-
drush_log(dt('The following restricted PHP modes have non-empty values: !prohibited_list. This configuration is incompatible with drush. !php_ini_msg', array('!prohibited_list' => implode(' and ', $prohibited_list), '!php_ini_msg' => _drush_php_ini_loaded_file_message())), LogLevel::ERROR);
114-
}
115-
116-
return TRUE;
117-
}
118-
11971
/**
12072
* Returns the current working directory.
12173
*
@@ -359,21 +311,6 @@ function drush_find_drush() {
359311
return FALSE;
360312
}
361313

362-
/**
363-
* Verify that we are running PHP through the command line interface.
364-
*
365-
* This function is useful for making sure that code cannot be run via the web server,
366-
* such as a function that needs to write files to which the web server should not have
367-
* access to.
368-
*
369-
* @return
370-
* A boolean value that is true when PHP is being run through the command line,
371-
* and false if being run through cgi or mod_php.
372-
*/
373-
function drush_verify_cli() {
374-
return (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0));
375-
}
376-
377314
/**
378315
* Build a drush command suitable for use for Drush to call itself
379316
* e.g. in backend_invoke.
@@ -622,30 +559,6 @@ function drush_directory_cache($subdir = '') {
622559
array('@locations' => implode(',', array_keys($cache_locations)))));
623560
}
624561

625-
///**
626-
// * Get complete information for all available extensions (modules and themes).
627-
// *
628-
// * @return
629-
// * An array containing info for all available extensions. In D8, these are Extension objects.
630-
// */
631-
//function drush_get_extensions($include_hidden = TRUE) {
632-
// drush_include_engine('drupal', 'environment');
633-
// $extensions = array_merge(drush_get_modules($include_hidden), drush_get_themes($include_hidden));
634-
// foreach ($extensions as $name => $extension) {
635-
// if (isset($extension->info['name'])) {
636-
// $extensions[$name]->label = $extension->info['name'].' ('.$name.')';
637-
// }
638-
// else {
639-
// drush_log(dt("Extension !name provides no human-readable name in .info file.", array('!name' => $name), LogLevel::DEBUG));
640-
// $extensions[$name]->label = $name.' ('.$name.')';
641-
// }
642-
// if (empty($extension->info['package'])) {
643-
// $extensions[$name]->info['package'] = dt('Other');
644-
// }
645-
// }
646-
// return $extensions;
647-
//}
648-
649562
/**
650563
* Set Env. Variables for given site-alias.
651564
*/

0 commit comments

Comments
 (0)