Drush: commands/pm/updatecode.pm.inc Source File

  1. 7.x doxygen/html/updatecode_8pm_8inc_source.html
  2. master doxygen/html/updatecode_8pm_8inc_source.html
Go to the documentation of this file.
1 <?php
2 
3 /**
4  * @file
5  * pm-updatecode command implementation.
6  */
7 
8 /**
9  * Command callback. Displays update status info and allows to update installed projects.
10  *
11  * Pass specific projects as arguments, otherwise we update all that have
12  * candidate releases.
13  *
14  * This command prompts for confirmation before updating, so it is safe to run
15  * just to check on. In this case, say at the confirmation prompt.
16  */
17 function drush_pm_updatecode() {
18  // In --pipe mode, just run pm-updatestatus and exit.
19  if (drush_get_context('DRUSH_PIPE')) {
20  drush_set_option('strict', 0);
21  return drush_invoke('pm-updatestatus');
22  }
23 
24  // Get specific requests.
25  $requests = pm_parse_arguments(func_get_args(), FALSE);
26 
27  // Print report of modules to update, and record
28  // result of that function in $update_info.
29  $updatestatus_options = array();
30  foreach (array('lock', 'unlock', 'lock-message', 'security-only') as $option) {
31  $value = drush_get_option($option, FALSE);
32  if ($value) {
33  $updatestatus_options[$option] = $value;
34  }
35  }
36  $backend_options = array(
37  'integrate' => FALSE,
38  );
39  $values = drush_invoke_process("@self", 'pm-updatestatus', func_get_args(), $updatestatus_options, $backend_options);
40  if (!is_array($values) || $values['error_status']) {
41  return drush_set_error('pm-updatestatus failed.');
42  }
43  $updateable = $values['object'];
44  drush_print($values['output']);
45  $tmpfile = drush_tempnam('pm-updatecode.');
46 
47  $last = pm_update_last_check();
48  drush_print(dt('Update information last refreshed: ') . ($last ? format_date($last) : dt('Never')));
49 
50  // Prevent update of core if --no-core was specified.
51  if (isset($updateable['drupal']) && drush_get_option('no-core', FALSE)) {
52  unset($updateable['drupal']);
53  drush_print(dt('Skipping core update (--no-core specified).'));
54  }
55 
56  // If there are any locked projects that were not requested, then remove them.
57  foreach ($updateable as $name => $project) {
58  if ((isset($project['locked'])) && (!isset($requests[$name]))) {
59  unset($updateable[$name]);
60  }
61  }
62 
63  // Do no updates in simulated mode.
64  if (drush_get_context('DRUSH_SIMULATE')) {
65  return drush_log(dt('No action taken in simulated mode.'), 'ok');
66  return TRUE;
67  }
68 
69  $core_update_available = FALSE;
70  if (isset($updateable['drupal'])) {
71  $drupal_project = $updateable['drupal'];
72  unset($updateable['drupal']);
73 
74  // At present we need to update drupal core after non-core projects
75  // are updated.
76  if (empty($updateable)) {
77  return _pm_update_core($drupal_project, $tmpfile);
78  }
79  // If there are modules other than drupal core enabled, then update them
80  // first.
81  else {
82  $core_update_available = TRUE;
83  if ($drupal_project['status'] == UPDATE_NOT_SECURE) {
84  drush_print(dt("NOTE: A security update for the Drupal core is available."));
85  }
86  else {
87  drush_print(dt("NOTE: A code update for the Drupal core is available."));
88  }
89  drush_print(dt("Drupal core will be updated after all of the non-core projects are updated.\n"));
90  }
91  }
92 
93  // If there are no releases to update, then print a final
94  // exit message.
95  if (empty($updateable)) {
96  if (drush_get_option('security-only')) {
97  return drush_log(dt('No security updates available.'), 'ok');
98  }
99  else {
100  return drush_log(dt('No code updates available.'), 'ok');
101  }
102  }
103 
104  // Offer to update to the identified releases.
105  if (!pm_update_packages($updateable, $tmpfile)) {
106  return FALSE;
107  }
108 
109  // After projects are updated we can update core.
110  if ($core_update_available) {
111  drush_print();
112  return _pm_update_core($drupal_project, $tmpfile);
113  }
114 }
115 
116 /**
117  * Update drupal core, following interactive confirmation from the user.
118  *
119  * @param $project
120  * The drupal project information from the drupal.org update service,
121  * copied from $update_info['drupal']. @see drush_pm_updatecode.
122  */
123 function _pm_update_core(&$project, $tmpfile) {
124  $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
125 
126  drush_print(dt('Code updates will be made to drupal core.'));
127  drush_print(dt("WARNING: Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt. If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file."));
128  drush_print(dt("Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing."));
129  drush_print();
130  if (drush_get_option('notes', FALSE)) {
131  drush_print('Obtaining release notes for above projects...');
132  $requests = pm_parse_project_version(array('drupal'));
133  release_info_print_releasenotes($requests, TRUE, $tmpfile);
134  }
135  if(!drush_confirm(dt('Do you really want to continue?'))) {
136  drush_print(dt('Rolling back all changes. Run again with --no-core to update modules only.'));
137  return drush_user_abort();
138  }
139 
140  // We need write permission on $drupal_root.
141  if (!is_writable($drupal_root)) {
142  return drush_set_error('DRUSH_PATH_NO_WRITABLE', dt('Drupal root path is not writable.'));
143  }
144 
145  // Create a directory 'core' if it does not already exist.
146  $project['path'] = 'drupal-' . $project['candidate_version'];
147  $project['full_project_path'] = $drupal_root . '/' . $project['path'];
148  if (!is_dir($project['full_project_path'])) {
149  drush_mkdir($project['full_project_path']);
150  }
151 
152  // Create a list of directories to exclude from the update process.
153  $skip_list = array('sites', $project['path']);
154  // Add non-writable directories: we can't move them around.
155  // We will also use $items_to_test later for $version_control check.
156  $items_to_test = drush_scan_directory($drupal_root, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'basename', 0, TRUE);
157  foreach (array_keys($items_to_test) as $item) {
158  if (is_dir($item) && !is_writable($item)) {
159  $skip_list[] = $item;
160  unset($items_to_test[$item]);
161  }
162  elseif (is_link($item)) {
163  $skip_list[] = $item;
164  unset($items_to_test[$item]);
165  }
166  }
167  $project['skip_list'] = $skip_list;
168 
169  // Move all files and folders in $drupal_root to the new 'core' directory
170  // except for the items in the skip list
171  _pm_update_move_files($drupal_root, $project['full_project_path'], $project['skip_list']);
172 
173  // Set a context variable to indicate that rollback should reverse
174  // the _pm_update_move_files above.
175  drush_set_context('DRUSH_PM_DRUPAL_CORE', $project);
176 
177  if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {
178  return FALSE;
179  }
180 
181  $project['base_project_path'] = dirname($project['full_project_path']);
182  // Check we have a version control system, and it clears its pre-flight.
183  if (!$version_control->pre_update($project, $items_to_test)) {
184  return FALSE;
185  }
186 
187  // Package handlers want the project directory in project_dir.
188  $project['project_dir'] = $project['path'];
189 
190  // Update core.
191  if (pm_update_project($project, $version_control) === FALSE) {
192  return FALSE;
193  }
194 
195  // Take the updated files in the 'core' directory that have been updated,
196  // and move all except for the items in the skip list back to
197  // the drupal root
198  _pm_update_move_files($project['full_project_path'], $drupal_root, $project['skip_list']);
199  drush_delete_dir($project['full_project_path']);
200 
201  // Version control engines expect full_project_path to exist and be accurate.
202  $project['full_project_path'] = $project['base_project_path'];
203 
204  // If there is a backup target, then find items
205  // in the backup target that do not exist at the
206  // drupal root. These are to be moved back.
207  if (array_key_exists('backup_target', $project)) {
208  _pm_update_move_files($project['backup_target'], $drupal_root, $project['skip_list'], FALSE);
209  _pm_update_move_files($project['backup_target'] . '/profiles', $drupal_root . '/profiles', array('default'), FALSE);
210  }
211 
212  pm_update_finish($project, $version_control);
213 
214  return TRUE;
215 }
216 
217 /**
218  * Move some files from one location to another.
219  */
220 function _pm_update_move_files($src_dir, $dest_dir, $skip_list, $remove_conflicts = TRUE) {
221  $items_to_move = drush_scan_directory($src_dir, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'filename', 0, TRUE);
222  foreach ($items_to_move as $filename => $info) {
223  if ($remove_conflicts) {
224  drush_delete_dir($dest_dir . '/' . basename($filename));
225  }
226  if (!file_exists($dest_dir . '/' . basename($filename))) {
227  $move_result = drush_move_dir($filename, $dest_dir . '/' . basename($filename));
228  }
229  }
230  return TRUE;
231 }
232 
233 /**
234  * Update projects according to an array of releases and print the release notes
235  * for each project, following interactive confirmation from the user.
236  *
237  * @param $update_info
238  * An array of projects from the drupal.org update service, with an additional
239  * array key candidate_version that specifies the version to be installed.
240  */
241 function pm_update_packages($update_info, $tmpfile) {
242  $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
243 
244  $print = '';
245  $status = array();
246  foreach($update_info as $project) {
247  $print .= $project['title'] . " [" . $project['name'] . '-' . $project['candidate_version'] . "], ";
248  $status[$project['status']] = $project['status'];
249  }
250  // We print the list of the projects that need to be updated.
251  if (isset($status[UPDATE_NOT_SECURE])) {
252  if (isset($status[UPDATE_NOT_CURRENT])) {
253  $title = (dt('Security and code updates will be made to the following projects:'));
254  }
255  else {
256  $title = (dt('Security updates will be made to the following projects:'));
257  }
258  }
259  else {
260  $title = (dt('Code updates will be made to the following projects:'));
261  }
262  $print = "$title " . (substr($print, 0, strlen($print)-2));
263  drush_print($print);
264  file_put_contents($tmpfile, "\n\n$print\n\n", FILE_APPEND);
265 
266  // Print the release notes for projects to be updated.
267  if (drush_get_option('notes', FALSE)) {
268  drush_print('Obtaining release notes for above projects...');
269  $requests = pm_parse_project_version(array_keys($update_info));
270  release_info_print_releasenotes($requests, TRUE, $tmpfile);
271  }
272 
273  // We print some warnings before the user confirms the update.
274  drush_print();
275  if (drush_get_option('no-backup', FALSE)) {
276  drush_print(dt("Note: You have selected to not store backups."));
277  }
278  else {
279  drush_print(dt("Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system."));
280  drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));
281  }
282  if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {
283  return drush_user_abort();
284  }
285 
286  // Now we start the actual updating.
287  foreach($update_info as $project) {
288  if (empty($project['path'])) {
289  return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));
290  }
291  drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));
292  // Define and check the full path to project directory and base (parent) directory.
293  $project['full_project_path'] = $drupal_root . '/' . $project['path'];
294  if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {
295  return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));
296  }
297  if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {
298  return FALSE;
299  }
300  $project['base_project_path'] = dirname($project['full_project_path']);
301  // Check we have a version control system, and it clears its pre-flight.
302  if (!$version_control->pre_update($project)) {
303  return FALSE;
304  }
305 
306  // Package handlers want the name of the directory in project_dir.
307  // It may be different to the project name for pm-download.
308  // Perhaps we want here filename($project['full_project_path']).
309  $project['project_dir'] = $project['name'];
310 
311  // Run update on one project.
312  if (pm_update_project($project, $version_control) === FALSE) {
313  return FALSE;
314  }
315  pm_update_finish($project, $version_control);
316  }
317 
318  return TRUE;
319 }
320 
321 /**
322  * Update one project -- a module, theme or Drupal core.
323  *
324  * @param $project
325  * The project to upgrade. $project['full_project_path'] must be set
326  * to the location where this project is stored.
327  */
328 function pm_update_project($project, $version_control) {
329  // 1. If the version control engine is a proper vcs we need to remove project
330  // files in order to not have orphan files after update.
331  // 2. If the package-handler is cvs or git, it will remove upstream removed
332  // files and no orphans will exist after update.
333  // So, we must remove all files previous update if the directory is not a
334  // working copy of cvs or git but we don't need to remove them if the version
335  // control engine is backup, as it did already move the project out to the
336  // backup directory.
337  if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) {
338  // Find and unlink all files but the ones in the vcs control directories.
339  $skip_list = array('.', '..');
340  $skip_list = array_merge($skip_list, drush_version_control_reserved_files());
341  drush_scan_directory($project['full_project_path'], '/.*/', $skip_list, 'unlink', TRUE, 'filename', 0, TRUE);
342  }
343 
344  // Add the project to a context so we can roll back if needed.
345  $updated = drush_get_context('DRUSH_PM_UPDATED');
346  $updated[] = $project;
347  drush_set_context('DRUSH_PM_UPDATED', $updated);
348 
349  if (!package_handler_update_project($project, $project['releases'][$project['candidate_version']])) {
350  return drush_set_error('DRUSH_PM_UPDATING_FAILED', dt('Updating project !project failed. Attempting to roll back to previously installed version.', array('!project' => $project['name'])));
351  }
352 
353  // If the version control engine is a proper vcs we also need to remove
354  // orphan directories.
355  if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) {
356  $files = drush_find_empty_directories($project['full_project_path'], $version_control->reserved_files());
357  array_map('drush_delete_dir', $files);
358  }
359 
360  return TRUE;
361 }
362 
363 /**
364  * Run the post-update hooks after updatecode is finished for one project.
365  */
366 function pm_update_finish($project, $version_control) {
367  drush_print(dt('Project !project was updated successfully. Installed version is now !version.', array('!project' => $project['name'], '!version' => $project['candidate_version'])));
368  drush_command_invoke_all('pm_post_update', $project['name'], $project['releases'][$project['candidate_version']]);
369  $version_control->post_update($project);
370 }
371 
372 /**
373  * Rollback the update process.
374  */
376  $projects = array_reverse(drush_get_context('DRUSH_PM_UPDATED', array()));
377  foreach($projects as $project) {
378  drush_log(dt('Rolling back update of !project code ...', array('!project' => $project['title'])));
379 
380  // Check we have a version control system, and it clears it's pre-flight.
381  if (!$version_control = drush_pm_include_version_control($project['path'])) {
382  return FALSE;
383  }
384  $version_control->rollback($project);
385  }
386 
387  // Post rollback, we will do additional repair if the project is drupal core.
388  $drupal_core = drush_get_context('DRUSH_PM_DRUPAL_CORE', FALSE);
389  if ($drupal_core) {
390  $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
391  _pm_update_move_files($drupal_core['full_project_path'], $drupal_root, $drupal_core['skip_list']);
392  drush_delete_dir($drupal_core['full_project_path']);
393  }
394 }
395 

File

doxygen/html/updatecode_8pm_8inc_source.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Drush: commands/pm/updatecode.pm.inc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_afac61274991793aa7e9133a8f4f291e.html">commands</a></li><li class="navelem"><a class="el" href="dir_15591510fc66414792ea8adada328324.html">pm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">updatecode.pm.inc</div>  </div>
</div><!--header-->
<div class="contents">
<a href="updatecode_8pm_8inc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;&lt;?php</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * @file</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * pm-updatecode command implementation.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Command callback. Displays update status info and allows to update installed projects.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * Pass specific projects as arguments, otherwise we update all that have</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * candidate releases.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * This command prompts for confirmation before updating, so it is safe to run</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * just to check on. In this case, say at the confirmation prompt.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#a7075f7486950df7a67f512a3533fef41">   17</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#a7075f7486950df7a67f512a3533fef41">drush_pm_updatecode</a>() {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  <span class="comment">// In --pipe mode, just run pm-updatestatus and exit.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_PIPE&#39;</span>)) {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;strict&#39;</span>, 0);</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke</a>(<span class="stringliteral">&#39;pm-updatestatus&#39;</span>);</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;  }</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <span class="comment">// Get specific requests.</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  $requests = <a class="code" href="pm_8drush_8inc.html#a34b2e74a73c176eed08207d9bcb4c587">pm_parse_arguments</a>(func_get_args(), FALSE);</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  <span class="comment">// Print report of modules to update, and record</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <span class="comment">// result of that function in $update_info.</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  $updatestatus_options = array();</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  <span class="keywordflow">foreach</span> (array(<span class="stringliteral">&#39;lock&#39;</span>, <span class="stringliteral">&#39;unlock&#39;</span>, <span class="stringliteral">&#39;lock-message&#39;</span>, <span class="stringliteral">&#39;security-only&#39;</span>) as $option) {</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    $value = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>($option, FALSE);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keywordflow">if</span> ($value) {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;      $updatestatus_options[$option] = $value;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    }</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;  }</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  $backend_options = array(</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="stringliteral">&#39;integrate&#39;</span> =&gt; FALSE,</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  );</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  $values = <a class="code" href="group__dispatching.html#ga125471885af052278a0874446b332cf9">drush_invoke_process</a>(<span class="stringliteral">&quot;@self&quot;</span>, <span class="stringliteral">&#39;pm-updatestatus&#39;</span>, func_get_args(), $updatestatus_options, $backend_options);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  <span class="keywordflow">if</span> (!is_array($values) || $values[<span class="stringliteral">&#39;error_status&#39;</span>]) {</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;pm-updatestatus failed.&#39;</span>);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  }</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  $updateable = $values[<span class="stringliteral">&#39;object&#39;</span>];</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>($values[<span class="stringliteral">&#39;output&#39;</span>]);</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  $tmpfile = <a class="code" href="group__filesystemfunctions.html#ga01729c5c432a2f30974966d888146d09">drush_tempnam</a>(<span class="stringliteral">&#39;pm-updatecode.&#39;</span>);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  $last = <a class="code" href="commands_2pm_2update__info_2drupal_8inc.html#a35cf870938c0ecdd3e2cead6aec212d2">pm_update_last_check</a>();</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Update information last refreshed: &#39;</span>) . ($last  ? format_date($last) : <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Never&#39;</span>)));</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  <span class="comment">// Prevent update of core if --no-core was specified.</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="keywordflow">if</span> (isset($updateable[<span class="stringliteral">&#39;drupal&#39;</span>]) &amp;&amp; <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;no-core&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    unset($updateable[<span class="stringliteral">&#39;drupal&#39;</span>]);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Skipping core update (--no-core specified).&#39;</span>));</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  }</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  <span class="comment">// If there are any locked projects that were not requested, then remove them.</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  <span class="keywordflow">foreach</span> ($updateable as $name =&gt; $project) {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordflow">if</span> ((isset($project[<span class="stringliteral">&#39;locked&#39;</span>])) &amp;&amp; (!isset($requests[$name]))) {</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;      unset($updateable[$name]);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  }</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="comment">// Do no updates in simulated mode.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_SIMULATE&#39;</span>)) {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__logging.html#gad820f489a93518301794ada4ff7816b6">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;No action taken in simulated mode.&#39;</span>), <span class="stringliteral">&#39;ok&#39;</span>);</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  $core_update_available = FALSE;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <span class="keywordflow">if</span> (isset($updateable[<span class="stringliteral">&#39;drupal&#39;</span>])) {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    $drupal_project = $updateable[<span class="stringliteral">&#39;drupal&#39;</span>];</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    unset($updateable[<span class="stringliteral">&#39;drupal&#39;</span>]);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="comment">// At present we need to update drupal core after non-core projects</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="comment">// are updated.</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordflow">if</span> (empty($updateable)) {</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="updatecode_8pm_8inc.html#a86e03f91bb50878663449ddf74b8658d">_pm_update_core</a>($drupal_project, $tmpfile);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    }</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="comment">// If there are modules other than drupal core enabled, then update them</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="comment">// first.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;      $core_update_available = TRUE;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      <span class="keywordflow">if</span> ($drupal_project[<span class="stringliteral">&#39;status&#39;</span>] == UPDATE_NOT_SECURE) {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;NOTE: A security update for the Drupal core is available.&quot;</span>));</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      }</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;NOTE: A code update for the Drupal core is available.&quot;</span>));</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;      }</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;      <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Drupal core will be updated after all of the non-core projects are updated.\n&quot;</span>));</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    }</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  }</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="comment">// If there are no releases to update, then print a final</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  <span class="comment">// exit message.</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="keywordflow">if</span> (empty($updateable)) {</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;security-only&#39;</span>)) {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__logging.html#gad820f489a93518301794ada4ff7816b6">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;No security updates available.&#39;</span>), <span class="stringliteral">&#39;ok&#39;</span>);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    }</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__logging.html#gad820f489a93518301794ada4ff7816b6">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;No code updates available.&#39;</span>), <span class="stringliteral">&#39;ok&#39;</span>);</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    }</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  <span class="comment">// Offer to update to the identified releases.</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keywordflow">if</span> (!<a class="code" href="updatecode_8pm_8inc.html#a604cbac2dc913cf35f3d4f7f79f4bc4b">pm_update_packages</a>($updateable, $tmpfile)) {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  <span class="comment">// After projects are updated we can update core.</span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  <span class="keywordflow">if</span> ($core_update_available) {</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>();</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="updatecode_8pm_8inc.html#a86e03f91bb50878663449ddf74b8658d">_pm_update_core</a>($drupal_project, $tmpfile);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;}</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment"> * Update drupal core, following interactive confirmation from the user.</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment"> * @param $project</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment"> *   The drupal project information from the drupal.org update service,</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment"> *   copied from $update_info[&#39;drupal&#39;].  @see drush_pm_updatecode.</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#a86e03f91bb50878663449ddf74b8658d">  123</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#a86e03f91bb50878663449ddf74b8658d">_pm_update_core</a>(&amp;$project, $tmpfile) {</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  $drupal_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_ROOT&#39;</span>);</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Code updates will be made to drupal core.&#39;</span>));</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.&quot;</span>));</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.&quot;</span>));</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>();</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;notes&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<span class="stringliteral">&#39;Obtaining release notes for above projects...&#39;</span>);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    $requests = <a class="code" href="pm_8drush_8inc.html#a66b0def0d14711d5c10884363c8ae1b5">pm_parse_project_version</a>(array(<span class="stringliteral">&#39;drupal&#39;</span>));</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <a class="code" href="updatexml_8inc.html#a4c90192cc502c7c05a5b4554c7d50258">release_info_print_releasenotes</a>($requests, TRUE, $tmpfile);</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;  }</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  <span class="keywordflow">if</span>(!<a class="code" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b">drush_confirm</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Do you really want to continue?&#39;</span>))) {</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Rolling back all changes. Run again with --no-core to update modules only.&#39;</span>));</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga366aaafdf8c774a58653c64a65b6d91c">drush_user_abort</a>();</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  }</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;  <span class="comment">// We need write permission on $drupal_root.</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;  <span class="keywordflow">if</span> (!is_writable($drupal_root)) {</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_PATH_NO_WRITABLE&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Drupal root path is not writable.&#39;</span>));</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;  <span class="comment">// Create a directory &#39;core&#39; if it does not already exist.</span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;  $project[<span class="stringliteral">&#39;path&#39;</span>] = <span class="stringliteral">&#39;drupal-&#39;</span> . $project[<span class="stringliteral">&#39;candidate_version&#39;</span>];</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  $project[<span class="stringliteral">&#39;full_project_path&#39;</span>] = $drupal_root . <span class="charliteral">&#39;/&#39;</span> . $project[<span class="stringliteral">&#39;path&#39;</span>];</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;  <span class="keywordflow">if</span> (!is_dir($project[<span class="stringliteral">&#39;full_project_path&#39;</span>])) {</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>]);</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  }</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;  <span class="comment">// Create a list of directories to exclude from the update process.</span></div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;  $skip_list = array(<span class="stringliteral">&#39;sites&#39;</span>, $project[<span class="stringliteral">&#39;path&#39;</span>]);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;  <span class="comment">// Add non-writable directories: we can&#39;t move them around.</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="comment">// We will also use $items_to_test later for $version_control check.</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;  $items_to_test = <a class="code" href="group__filesystemfunctions.html#ga1c545390a8890f6ea47385f79fbe2e82">drush_scan_directory</a>($drupal_root, <span class="stringliteral">&#39;/.*/&#39;</span>, array_merge(array(<span class="charliteral">&#39;.&#39;</span>, <span class="stringliteral">&#39;..&#39;</span>), $skip_list), 0, FALSE, <span class="stringliteral">&#39;basename&#39;</span>, 0, TRUE);</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;  <span class="keywordflow">foreach</span> (array_keys($items_to_test) as $item) {</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">if</span> (is_dir($item) &amp;&amp; !is_writable($item)) {</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;      $skip_list[] = $item;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;      unset($items_to_test[$item]);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    }</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    elseif (is_link($item)) {</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;      $skip_list[] = $item;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;      unset($items_to_test[$item]);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    }</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  }</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  $project[<span class="stringliteral">&#39;skip_list&#39;</span>] = $skip_list;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <span class="comment">// Move all files and folders in $drupal_root to the new &#39;core&#39; directory</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  <span class="comment">// except for the items in the skip list</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  <a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">_pm_update_move_files</a>($drupal_root, $project[<span class="stringliteral">&#39;full_project_path&#39;</span>], $project[<span class="stringliteral">&#39;skip_list&#39;</span>]);</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;  <span class="comment">// Set a context variable to indicate that rollback should reverse</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;  <span class="comment">// the _pm_update_move_files above.</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  <a class="code" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba">drush_set_context</a>(<span class="stringliteral">&#39;DRUSH_PM_DRUPAL_CORE&#39;</span>, $project);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  <span class="keywordflow">if</span> (!$version_control = <a class="code" href="pm_8drush_8inc.html#a7a7640133c515e06c96d0f4262b98c51">drush_pm_include_version_control</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>])) {</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  }</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  $project[<span class="stringliteral">&#39;base_project_path&#39;</span>] = dirname($project[<span class="stringliteral">&#39;full_project_path&#39;</span>]);</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;  <span class="comment">// Check we have a version control system, and it clears its pre-flight.</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  <span class="keywordflow">if</span> (!$version_control-&gt;pre_update($project, $items_to_test)) {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  }</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  <span class="comment">// Package handlers want the project directory in project_dir.</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  $project[<span class="stringliteral">&#39;project_dir&#39;</span>] = $project[<span class="stringliteral">&#39;path&#39;</span>];</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;  <span class="comment">// Update core.</span></div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="updatecode_8pm_8inc.html#a5a3737ff6d07b1666960729bf8e2d684">pm_update_project</a>($project, $version_control) === FALSE) {</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  }</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;  <span class="comment">// Take the updated files in the &#39;core&#39; directory that have been updated,</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;  <span class="comment">// and move all except for the items in the skip list back to</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  <span class="comment">// the drupal root</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;  <a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">_pm_update_move_files</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>], $drupal_root, $project[<span class="stringliteral">&#39;skip_list&#39;</span>]);</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  <a class="code" href="group__filesystemfunctions.html#gabff54c630a451976fc121257f6efd960">drush_delete_dir</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>]);</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;  <span class="comment">// Version control engines expect full_project_path to exist and be accurate.</span></div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;  $project[<span class="stringliteral">&#39;full_project_path&#39;</span>] = $project[<span class="stringliteral">&#39;base_project_path&#39;</span>];</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="comment">// If there is a backup target, then find items</span></div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  <span class="comment">// in the backup target that do not exist at the</span></div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <span class="comment">// drupal root.  These are to be moved back.</span></div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  <span class="keywordflow">if</span> (array_key_exists(<span class="stringliteral">&#39;backup_target&#39;</span>, $project)) {</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">_pm_update_move_files</a>($project[<span class="stringliteral">&#39;backup_target&#39;</span>], $drupal_root, $project[<span class="stringliteral">&#39;skip_list&#39;</span>], FALSE);</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">_pm_update_move_files</a>($project[<span class="stringliteral">&#39;backup_target&#39;</span>] . <span class="stringliteral">&#39;/profiles&#39;</span>, $drupal_root . <span class="stringliteral">&#39;/profiles&#39;</span>, array(<span class="stringliteral">&#39;default&#39;</span>), FALSE);</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  }</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  <a class="code" href="updatecode_8pm_8inc.html#af30934cd040bba74ca1b7c51796bd2aa">pm_update_finish</a>($project, $version_control);</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;  <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;}</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="comment"> * Move some files from one location to another.</span></div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">  220</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">_pm_update_move_files</a>($src_dir, $dest_dir, $skip_list, $remove_conflicts = TRUE) {</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;  $items_to_move = <a class="code" href="group__filesystemfunctions.html#ga1c545390a8890f6ea47385f79fbe2e82">drush_scan_directory</a>($src_dir, <span class="stringliteral">&#39;/.*/&#39;</span>, array_merge(array(<span class="charliteral">&#39;.&#39;</span>, <span class="stringliteral">&#39;..&#39;</span>), $skip_list), 0, FALSE, <span class="stringliteral">&#39;filename&#39;</span>, 0, TRUE);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  <span class="keywordflow">foreach</span> ($items_to_move as $filename =&gt; $info) {</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keywordflow">if</span> ($remove_conflicts) {</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;      <a class="code" href="group__filesystemfunctions.html#gabff54c630a451976fc121257f6efd960">drush_delete_dir</a>($dest_dir . <span class="charliteral">&#39;/&#39;</span> . basename($filename));</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    }</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keywordflow">if</span> (!file_exists($dest_dir . <span class="charliteral">&#39;/&#39;</span> . basename($filename))) {</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;      $move_result = <a class="code" href="group__filesystemfunctions.html#gaac7379e8cfa2163a874542fc021bf521">drush_move_dir</a>($filename,  $dest_dir . <span class="charliteral">&#39;/&#39;</span> . basename($filename));</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    }</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;  }</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;}</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="comment"> * Update projects according to an array of releases and print the release notes</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="comment"> * for each project, following interactive confirmation from the user.</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment"> * @param $update_info</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment"> *   An array of projects from the drupal.org update service, with an additional</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="comment"> *   array key candidate_version that specifies the version to be installed.</span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#a604cbac2dc913cf35f3d4f7f79f4bc4b">  241</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#a604cbac2dc913cf35f3d4f7f79f4bc4b">pm_update_packages</a>($update_info, $tmpfile) {</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;  $drupal_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_ROOT&#39;</span>);</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  $print = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  $status = array();</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  <span class="keywordflow">foreach</span>($update_info as $project) {</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    $print .= $project[<span class="stringliteral">&#39;title&#39;</span>] . <span class="stringliteral">&quot; [&quot;</span> . $project[<span class="stringliteral">&#39;name&#39;</span>] . <span class="charliteral">&#39;-&#39;</span> . $project[<span class="stringliteral">&#39;candidate_version&#39;</span>] . <span class="stringliteral">&quot;], &quot;</span>;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    $status[$project[<span class="stringliteral">&#39;status&#39;</span>]] = $project[<span class="stringliteral">&#39;status&#39;</span>];</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;  }</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;  <span class="comment">// We print the list of the projects that need to be updated.</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  <span class="keywordflow">if</span> (isset($status[UPDATE_NOT_SECURE])) {</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="keywordflow">if</span> (isset($status[UPDATE_NOT_CURRENT])) {</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;      $title = (<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Security and code updates will be made to the following projects:&#39;</span>));</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    }</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;      $title = (<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Security updates will be made to the following projects:&#39;</span>));</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    }</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;  }</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    $title = (<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Code updates will be made to the following projects:&#39;</span>));</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;  }</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;  $print = <span class="stringliteral">&quot;$title &quot;</span> . (substr($print, 0, strlen($print)-2));</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>($print);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;  file_put_contents($tmpfile, <span class="stringliteral">&quot;\n\n$print\n\n&quot;</span>, FILE_APPEND);</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  <span class="comment">// Print the release notes for projects to be updated.</span></div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;notes&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<span class="stringliteral">&#39;Obtaining release notes for above projects...&#39;</span>);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    $requests = <a class="code" href="pm_8drush_8inc.html#a66b0def0d14711d5c10884363c8ae1b5">pm_parse_project_version</a>(array_keys($update_info));</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <a class="code" href="updatexml_8inc.html#a4c90192cc502c7c05a5b4554c7d50258">release_info_print_releasenotes</a>($requests, TRUE, $tmpfile);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;  }</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  <span class="comment">// We print some warnings before the user confirms the update.</span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>();</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;no-backup&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Note: You have selected to not store backups.&quot;</span>));</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;  }</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.&quot;</span>));</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.&#39;</span>));</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;  }</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;  <span class="keywordflow">if</span>(!<a class="code" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b">drush_confirm</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Do you really want to continue with the update process?&#39;</span>))) {</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga366aaafdf8c774a58653c64a65b6d91c">drush_user_abort</a>();</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;  }</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;  <span class="comment">// Now we start the actual updating.</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;  <span class="keywordflow">foreach</span>($update_info as $project) {</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <span class="keywordflow">if</span> (empty($project[<span class="stringliteral">&#39;path&#39;</span>])) {</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_PM_UPDATING_NO_PROJECT_PATH&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.&#39;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $project[<span class="stringliteral">&#39;name&#39;</span>], <span class="stringliteral">&#39;!type&#39;</span> =&gt; $project[<span class="stringliteral">&#39;project_type&#39;</span>])));</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    }</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <a class="code" href="group__logging.html#gad820f489a93518301794ada4ff7816b6">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Starting to update !project code at !dir...&#39;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $project[<span class="stringliteral">&#39;title&#39;</span>], <span class="stringliteral">&#39;!dir&#39;</span> =&gt; $project[<span class="stringliteral">&#39;path&#39;</span>])));</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <span class="comment">// Define and check the full path to project directory and base (parent) directory.</span></div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    $project[<span class="stringliteral">&#39;full_project_path&#39;</span>] = $drupal_root . <span class="charliteral">&#39;/&#39;</span> . $project[<span class="stringliteral">&#39;path&#39;</span>];</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keywordflow">if</span> (stripos($project[<span class="stringliteral">&#39;path&#39;</span>], $project[<span class="stringliteral">&#39;project_type&#39;</span>]) === FALSE || !is_dir($project[<span class="stringliteral">&#39;full_project_path&#39;</span>])) {</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_PM_UPDATING_PATH_NOT_FOUND&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.&#39;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $project[<span class="stringliteral">&#39;name&#39;</span>], <span class="stringliteral">&#39;!type&#39;</span> =&gt; $project[<span class="stringliteral">&#39;project_type&#39;</span>], <span class="stringliteral">&#39;!full_project_path&#39;</span> =&gt; $project[<span class="stringliteral">&#39;full_project_path&#39;</span>])));</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    }</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    <span class="keywordflow">if</span> (!$version_control = <a class="code" href="pm_8drush_8inc.html#a7a7640133c515e06c96d0f4262b98c51">drush_pm_include_version_control</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>])) {</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    }</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    $project[<span class="stringliteral">&#39;base_project_path&#39;</span>] = dirname($project[<span class="stringliteral">&#39;full_project_path&#39;</span>]);</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    <span class="comment">// Check we have a version control system, and it clears its pre-flight.</span></div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="keywordflow">if</span> (!$version_control-&gt;pre_update($project)) {</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    }</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <span class="comment">// Package handlers want the name of the directory in project_dir.</span></div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    <span class="comment">// It may be different to the project name for pm-download.</span></div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="comment">// Perhaps we want here filename($project[&#39;full_project_path&#39;]).</span></div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    $project[<span class="stringliteral">&#39;project_dir&#39;</span>] = $project[<span class="stringliteral">&#39;name&#39;</span>];</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    <span class="comment">// Run update on one project.</span></div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="updatecode_8pm_8inc.html#a5a3737ff6d07b1666960729bf8e2d684">pm_update_project</a>($project, $version_control) === FALSE) {</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    }</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <a class="code" href="updatecode_8pm_8inc.html#af30934cd040bba74ca1b7c51796bd2aa">pm_update_finish</a>($project, $version_control);</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;  }</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;}</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;<span class="comment"> * Update one project -- a module, theme or Drupal core.</span></div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="comment"> * @param $project</span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;<span class="comment"> *   The project to upgrade.  $project[&#39;full_project_path&#39;] must be set</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;<span class="comment"> *   to the location where this project is stored.</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00328"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#a5a3737ff6d07b1666960729bf8e2d684">  328</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#a5a3737ff6d07b1666960729bf8e2d684">pm_update_project</a>($project, $version_control) {</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  <span class="comment">// 1. If the version control engine is a proper vcs we need to remove project</span></div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;  <span class="comment">// files in order to not have orphan files after update.</span></div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="comment">// 2. If the package-handler is cvs or git, it will remove upstream removed</span></div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <span class="comment">// files and no orphans will exist after update.</span></div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;  <span class="comment">// So, we must remove all files previous update if the directory is not a</span></div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  <span class="comment">// working copy of cvs or git but we don&#39;t need to remove them if the version</span></div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;  <span class="comment">// control engine is backup, as it did already move the project out to the</span></div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;  <span class="comment">// backup directory.</span></div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;  <span class="keywordflow">if</span> (($version_control-&gt;engine != <span class="stringliteral">&#39;backup&#39;</span>) &amp;&amp; (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;package-handler&#39;</span>, <span class="stringliteral">&#39;wget&#39;</span>) == <span class="stringliteral">&#39;wget&#39;</span>)) {</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    <span class="comment">// Find and unlink all files but the ones in the vcs control directories.</span></div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    $skip_list = array(<span class="charliteral">&#39;.&#39;</span>, <span class="stringliteral">&#39;..&#39;</span>);</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    $skip_list = array_merge($skip_list, <a class="code" href="drush_8inc.html#aa61cd59315f7a89a8c7df8649f480a31">drush_version_control_reserved_files</a>());</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    <a class="code" href="group__filesystemfunctions.html#ga1c545390a8890f6ea47385f79fbe2e82">drush_scan_directory</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>], <span class="stringliteral">&#39;/.*/&#39;</span>, $skip_list, <span class="stringliteral">&#39;unlink&#39;</span>, TRUE, <span class="stringliteral">&#39;filename&#39;</span>, 0, TRUE);</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;  }</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;  <span class="comment">// Add the project to a context so we can roll back if needed.</span></div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;  $updated = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_PM_UPDATED&#39;</span>);</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;  $updated[] = $project;</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;  <a class="code" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba">drush_set_context</a>(<span class="stringliteral">&#39;DRUSH_PM_UPDATED&#39;</span>, $updated);</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;  <span class="keywordflow">if</span> (!<a class="code" href="git__drupalorg_8inc.html#a842ef59d187c73488ad44f832cd8974f">package_handler_update_project</a>($project, $project[<span class="stringliteral">&#39;releases&#39;</span>][$project[<span class="stringliteral">&#39;candidate_version&#39;</span>]])) {</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_PM_UPDATING_FAILED&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Updating project !project failed. Attempting to roll back to previously installed version.&#39;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $project[<span class="stringliteral">&#39;name&#39;</span>])));</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;  }</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  <span class="comment">// If the version control engine is a proper vcs we also need to remove</span></div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;  <span class="comment">// orphan directories.</span></div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;  <span class="keywordflow">if</span> (($version_control-&gt;engine != <span class="stringliteral">&#39;backup&#39;</span>) &amp;&amp; (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;package-handler&#39;</span>, <span class="stringliteral">&#39;wget&#39;</span>) == <span class="stringliteral">&#39;wget&#39;</span>)) {</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    $files = <a class="code" href="pm_8drush_8inc.html#ab63ba263a636da9a21cd05af4c1613af">drush_find_empty_directories</a>($project[<span class="stringliteral">&#39;full_project_path&#39;</span>], $version_control-&gt;reserved_files());</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    array_map(<span class="stringliteral">&#39;drush_delete_dir&#39;</span>, $files);</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;  }</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;  <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;}</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;<span class="comment"> * Run the post-update hooks after updatecode is finished for one project.</span></div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00366"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#af30934cd040bba74ca1b7c51796bd2aa">  366</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#af30934cd040bba74ca1b7c51796bd2aa">pm_update_finish</a>($project, $version_control) {</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Project !project was updated successfully. Installed version is now !version.&#39;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $project[<span class="stringliteral">&#39;name&#39;</span>], <span class="stringliteral">&#39;!version&#39;</span> =&gt; $project[<span class="stringliteral">&#39;candidate_version&#39;</span>])));</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;  <a class="code" href="includes_2command_8inc.html#a19eba9666aba673a64fbd78a2c5ef4f9">drush_command_invoke_all</a>(<span class="stringliteral">&#39;pm_post_update&#39;</span>, $project[<span class="stringliteral">&#39;name&#39;</span>], $project[<span class="stringliteral">&#39;releases&#39;</span>][$project[<span class="stringliteral">&#39;candidate_version&#39;</span>]]);</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;  $version_control-&gt;post_update($project);</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;}</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;<span class="comment"> * Rollback the update process.</span></div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00375"></a><span class="lineno"><a class="code" href="updatecode_8pm_8inc.html#a72c100c43f73f1c3d0f713227ae736cb">  375</a></span>&#160;<span class="keyword">function</span> <a class="code" href="updatecode_8pm_8inc.html#a72c100c43f73f1c3d0f713227ae736cb">drush_pm_updatecode_rollback</a>() {</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;  $projects = array_reverse(<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_PM_UPDATED&#39;</span>, array()));</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <span class="keywordflow">foreach</span>($projects as $project) {</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;    <a class="code" href="group__logging.html#gad820f489a93518301794ada4ff7816b6">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Rolling back update of !project code ...&#39;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $project[<span class="stringliteral">&#39;title&#39;</span>])));</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    <span class="comment">// Check we have a version control system, and it clears it&#39;s pre-flight.</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    <span class="keywordflow">if</span> (!$version_control = <a class="code" href="pm_8drush_8inc.html#a7a7640133c515e06c96d0f4262b98c51">drush_pm_include_version_control</a>($project[<span class="stringliteral">&#39;path&#39;</span>])) {</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    }</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    $version_control-&gt;rollback($project);</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;  }</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  <span class="comment">// Post rollback, we will do additional repair if the project is drupal core.</span></div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;  $drupal_core = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_PM_DRUPAL_CORE&#39;</span>, FALSE);</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;  <span class="keywordflow">if</span> ($drupal_core) {</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;    $drupal_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_ROOT&#39;</span>);</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;    <a class="code" href="updatecode_8pm_8inc.html#ab11eea54f55781b92561a28a8e39f224">_pm_update_move_files</a>($drupal_core[<span class="stringliteral">&#39;full_project_path&#39;</span>], $drupal_root, $drupal_core[<span class="stringliteral">&#39;skip_list&#39;</span>]);</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;    <a class="code" href="group__filesystemfunctions.html#gabff54c630a451976fc121257f6efd960">drush_delete_dir</a>($drupal_core[<span class="stringliteral">&#39;full_project_path&#39;</span>]);</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;  }</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;}</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 8 2014 09:04:54 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>