Drush: commands/make/make.project.inc Source File

  1. 7.x doxygen/html/make_8project_8inc_source.html
  2. master doxygen/html/make_8project_8inc_source.html
Go to the documentation of this file.
1 <?php
2 /**
3  * @file
4  * Drush Make processing classes.
5  */
6 
8 
9 /**
10  * The base project class.
11  */
13 
14  /**
15  * TRUE if make() has been called, otherwise FALSE.
16  */
17  protected $made = FALSE;
18 
19  /**
20  * TRUE if download() method has been called successfully, otherwise FALSE.
21  */
22  protected $downloaded = NULL;
23 
24  /**
25  * Download location to use.
26  */
27  protected $download_location = NULL;
28 
29  /**
30  * Keep track of instances.
31  *
33  */
34  protected static $self = array();
35 
36  /**
37  * Keeps track of projects being processed to prevent recursive conflicts.
38  *
39  * Simple array of machine names.
40  *
41  * @var array
42  */
43  protected $manifest = array();
44 
45  /**
46  * Default to overwrite to allow recursive builds to process properly.
47  *
48  * TODO refactor this to be more selective. Ideally a merge would take place
49  * instead of an overwrite.
50  */
51  protected $overwrite = TRUE;
52 
53  /**
54  * Recursively process any makefiles found in downloaded projects.
55  */
56  protected $do_recursion = TRUE;
57 
58  /**
59  * Which variant of profiles to download.
60  */
61  protected $variant = 'profile-only';
62 
63  /**
64  * Set attributes and retrieve project information.
65  */
66  protected function __construct($project) {
67  $project['base_contrib_destination'] = $project['contrib_destination'];
68  foreach ($project as $key => $value) {
69  $this->{$key} = $value;
70  }
71  if (!empty($this->options['working-copy'])) {
72  $this->download['working-copy'] = TRUE;
73  }
74  // Don't recurse when we're using a pre-built profile tarball.
75  if ($this->variant == 'projects') {
76  $this->do_recursion = FALSE;
77  }
78  }
79 
80  /**
81  * Get an instance for the type and project.
82  *
83  * @param string $type
84  * Type of project: core, library, module, profile, or translation.
85  * @param array $project
86  * Project information.
87  *
88  * @return mixed
89  * An instance for the project or FALSE if invalid type.
90  */
91  public static function getInstance($type, $project) {
92  if (!isset(self::$self[$type][$project['name']])) {
93  $class = 'DrushMakeProject_' . $type;
94  self::$self[$type][$project['name']] = class_exists($class) ? new $class($project) : FALSE;
95  }
96  return self::$self[$type][$project['name']];
97  }
98 
99  /**
100  * Set the manifest array.
101  *
102  * @param array $manifest
103  * An array of projects as generated by `make_projects`.
104  */
105  public function setManifest($manifest) {
106  $this->manifest = $manifest;
107  }
108 
109  /**
110  * Download a project.
111  */
112  function download() {
113  $this->downloaded = TRUE;
114 
115  // In some cases, make_download_factory() is going to need to know the
116  // full version string of the project we're trying to download. However,
117  // the version is a project-level attribute, not a download-level
118  // attribute. So, if we don't already have a full version string in the
119  // download array (e.g. if it was initialized via the release history XML
120  // for the PM case), we take the version info from the project-level
121  // attribute, convert it into a full version string, and stuff it into
122  // $this->download so that the download backend has access to it, too.
123  if (!empty($this->version) && empty($this->download['full_version'])) {
124  $full_version = '';
125  $matches = array();
126  // Core needs different conversion rules than contrib.
127  if (!empty($this->type) && $this->type == 'core') {
128  // Generally, the version for core is already set properly.
129  $full_version = $this->version;
130  // However, it might just be something like '7' or '7.x', in which
131  // case we need to turn that into '7.x-dev';
132  if (preg_match('/^\d+(\.x)?$/', $this->version, $matches)) {
133  // If there's no '.x' already, append it.
134  if (empty($matches[1])) {
135  $full_version .= '.x';
136  }
137  $full_version .= '-dev';
138  }
139  }
140  // Contrib.
141  else {
142  // If the version doesn't already define a core version, prepend it.
143  if (!preg_match('/^\d+\.x-\d+.*$/', $this->version)) {
144  // Just find the major version from $this->core so we don't end up
145  // with version strings like '7.12-2.0'.
146  $core_parts = explode('.', $this->core);
147  $full_version = $core_parts[0] . '.x-';
148  }
149  $full_version .= $this->version;
150  // If the project-level version attribute is just a number it's a major
151  // version.
152  if (preg_match('/^\d+(\.x)?$/', $this->version, $matches)) {
153  // If there's no '.x' already, append it.
154  if (empty($matches[1])) {
155  $full_version .= '.x';
156  }
157  $full_version .= '-dev';
158  }
159  }
160  $this->download['full_version'] = $full_version;
161  }
162 
163  $this->download['variant'] = $this->variant;
164 
165  if (make_download_factory($this->name, $this->type, $this->download, $this->download_location) === FALSE) {
166  $this->downloaded = FALSE;
167  }
168  return $this->downloaded;
169  }
170 
171  /**
172  * Build a project.
173  */
174  function make() {
175  if ($this->made) {
176  drush_log(dt('Attempt to build project @project more then once prevented.', array('@project' => $this->name)));
177  return TRUE;
178  }
179  $this->made = TRUE;
180 
181  if (!isset($this->download_location)) {
182  $this->download_location = $this->findDownloadLocation();
183  }
184  if ($this->download() === FALSE) {
185  return FALSE;
186  }
187  if (!$this->addLockfile($this->download_location)) {
188  return FALSE;
189  }
190  if (!$this->applyPatches($this->download_location)) {
191  return FALSE;
192  }
193  if (!$this->getTranslations($this->download_location)) {
194  return FALSE;
195  }
196  // Handle .info file re-writing (if so desired).
197  if (!drush_get_option('no-gitinfofile', FALSE) && isset($this->download['type']) && $this->download['type'] == 'git') {
198  $this->processGitInfoFiles();
199  }
200  // Clean-up .git directories.
201  if (!_get_working_copy_option($this->download)) {
202  $this->removeGitDirectory();
203  }
204  if (!$this->recurse($this->download_location)) {
205  return FALSE;
206  }
207  return TRUE;
208  }
209 
210  /**
211  * Determine the location to download project to.
212  */
213  function findDownloadLocation() {
214  $this->path = $this->generatePath();
215  $this->project_directory = !empty($this->directory_name) ? $this->directory_name : $this->name;
216  $this->download_location = $this->path . '/' . $this->project_directory;
217  // This directory shouldn't exist yet -- if it does, stop,
218  // unless overwrite has been set to TRUE.
219  if (is_dir($this->download_location) && !$this->overwrite) {
220  return drush_set_error('MAKE_DIRECTORY_EXISTS', dt('Directory not empty: !directory', array('!directory' => $this->download_location)));
221  }
222  elseif ($this->download['type'] === 'pm') {
223  // pm-download will create the final contrib directory.
224  drush_mkdir(dirname($this->download_location));
225  }
226  else {
227  drush_mkdir($this->download_location);
228  }
230  }
231 
232  /**
233  * Rewrite relative URLs and file:/// URLs
234  *
235  * relative path -> absolute path using the make_directory
236  * local file:/// urls -> local paths
237  *
238  * @param mixed &$info
239  * Either an array or a simple url string. The `$info` variable will be
240  * transformed into an array.
241  */
242  protected function preprocessLocalFileUrl(&$info) {
243  if (is_string($info)) {
244  $info = array('url' => $info, 'local' => FALSE);
245  }
246 
247  if (!_drush_is_url($info['url']) && !drush_is_absolute_path($info['url'])) {
248  $info['url'] = $this->make_directory . '/' . $info['url'];
249  $info['local'] = TRUE;
250  } elseif (substr($info['url'], 0, 8) == 'file:///') {
251  $info['url'] = substr($info['url'], 7);
252  $info['local'] = TRUE;
253  }
254  }
255 
256  /**
257  * Retrieve and apply any patches specified by the makefile to this project.
258  */
259  function applyPatches($project_directory) {
260  if (empty($this->patch)) {
261  return TRUE;
262  }
263 
264  $patches_txt = '';
265  $local_patches = array();
266  $ignore_checksums = drush_get_option('ignore-checksums');
267  foreach ($this->patch as $info) {
268  $this->preprocessLocalFileUrl($info);
269 
270  // Download the patch.
271  if ($filename = _make_download_file($info['url'])) {
272  $patched = FALSE;
273  $output = '';
274  // Test each patch style; -p1 is the default with git. See
276  $patch_levels = array('-p1', '-p0');
277  foreach ($patch_levels as $patch_level) {
278  $checked = drush_shell_cd_and_exec($project_directory, 'git --git-dir=. apply --check %s %s --verbose', $patch_level, $filename);
279  if ($checked) {
280  // Apply the first successful style.
281  $patched = drush_shell_cd_and_exec($project_directory, 'git --git-dir=. apply %s %s --verbose', $patch_level, $filename);
282  break;
283  }
284  }
285 
286  // In some rare cases, git will fail to apply a patch, fallback to using
287  // the 'patch' command.
288  if (!$patched) {
289  foreach ($patch_levels as $patch_level) {
290  // --no-backup-if-mismatch here is a hack that fixes some
291  // differences between how patch works on windows and unix.
292  if ($patched = drush_shell_exec("patch %s --no-backup-if-mismatch -d %s < %s", $patch_level, $project_directory, $filename)) {
293  break;
294  }
295  }
296  }
297 
298  if ($output = drush_shell_exec_output()) {
299  // Log any command output, visible only in --verbose or --debug mode.
300  drush_log(implode("\n", $output));
301  }
302 
303  // Set up string placeholders to pass to dt().
304  $dt_args = array(
305  '@name' => $this->name,
306  '@filename' => basename($filename),
307  );
308 
309  if ($patched) {
310  if (!$ignore_checksums && !_make_verify_checksums($info, $filename)) {
311  return FALSE;
312  }
313  $patch_url = $info['url'];
314 
315  // If this is a local patch, copy that into place as well.
316  if ($info['local']) {
317  $local_patches[] = $info['url'];
318  // Use a local path for the PATCHES.txt file.
319  $pathinfo = pathinfo($patch_url);
320  $patch_url = $pathinfo['basename'];
321  }
322  $patches_txt .= '- ' . $patch_url . "\n";
323 
324  drush_log(dt('@name patched with @filename.', $dt_args), LogLevel::OK);
325  }
326  else {
327  make_error('PATCH_ERROR', dt("Unable to patch @name with @filename.", $dt_args));
328  }
329  drush_op('unlink', $filename);
330  }
331  else {
332  make_error('DOWNLOAD_ERROR', 'Unable to download ' . $info['url'] . '.');
333  return FALSE;
334  }
335  }
336  if (!empty($patches_txt) && !drush_get_option('no-patch-txt') && !file_exists($project_directory . '/PATCHES.txt')) {
337  $patches_txt = "The following patches have been applied to this project:\n" .
338  $patches_txt .
339  "\nThis file was automatically generated by Drush Make (http://drupal.org/project/drush).\n";
340  file_put_contents($project_directory . '/PATCHES.txt', $patches_txt);
341  drush_log('Generated PATCHES.txt file for ' . $this->name, LogLevel::OK);
342 
343  // Copy local patches into place.
344  foreach ($local_patches as $url) {
345  $pathinfo = pathinfo($url);
346  drush_copy_dir($url, $project_directory . '/' . $pathinfo['basename']);
347  }
348  }
349  return TRUE;
350  }
351 
352  /**
353  * Process info files when downloading things from git.
354  */
355  function processGitInfoFiles() {
356  // Bail out if this isn't hosted on Drupal.org (unless --force-gitinfofile option was specified).
357  if (!drush_get_option('force-gitinfofile', FALSE) && isset($this->download['url']) && strpos($this->download['url'], 'drupal.org') === FALSE) {
358  return;
359  }
360 
361  // Figure out the proper version string to use based on the .make file.
362  // Best case is the .make file author told us directly.
363  if (!empty($this->download['full_version'])) {
364  $full_version = $this->download['full_version'];
365  }
366  // Next best is if we have a tag, since those are identical to versions.
367  elseif (!empty($this->download['tag'])) {
368  $full_version = $this->download['tag'];
369  }
370  // If we have a branch, append '-dev'.
371  elseif (!empty($this->download['branch'])) {
372  $full_version = $this->download['branch'] . '-dev';
373  }
374  // Ugh. Not sure what else we can do in this case.
375  elseif (!empty($this->download['revision'])) {
376  $full_version = $this->download['revision'];
377  }
378  // Probably can never reach this case.
379  else {
380  $full_version = 'unknown';
381  }
382 
383  // If the version string ends in '.x-dev' do the Git magic to figure out
384  // the appropriate 'rebuild version' string, e.g. '7.x-1.2+7-dev'.
385  $matches = array();
386  if (preg_match('/^(.+).x-dev$/', $full_version, $matches)) {
387  require_once dirname(__FILE__) . '/../pm/package_handler/git_drupalorg.inc';
388  $rebuild_version = drush_pm_git_drupalorg_compute_rebuild_version($this->download_location, $matches[1]);
389  if ($rebuild_version) {
390  $full_version = $rebuild_version;
391  }
392  }
393  require_once dirname(__FILE__) . '/../pm/pm.drush.inc';
394  if (drush_shell_cd_and_exec($this->download_location, 'git log -1 --pretty=format:%ct')) {
395  $output = drush_shell_exec_output();
396  $datestamp = $output[0];
397  }
398  else {
399  $datestamp = time();
400  }
401  drush_pm_inject_info_file_metadata($this->download_location, $this->name, $full_version, $datestamp);
402  }
403 
404  /**
405  * Remove the .git directory from a project.
406  */
407  function removeGitDirectory() {
408  if (isset($this->download['type']) && $this->download['type'] == 'git' && file_exists($this->download_location . '/.git')) {
409  drush_delete_dir($this->download_location . '/.git', TRUE);
410  }
411  }
412 
413  /**
414  * Add a lock file.
415  */
416  function addLockfile($project_directory) {
417  if (!empty($this->lock)) {
418  file_put_contents($project_directory . '/.drush-lock-update', $this->lock);
419  }
420  return TRUE;
421  }
422 
423  /**
424  * Retrieve translations for this project.
425  */
426  function getTranslations($project_directory) {
427  static $cache = array();
428  $langcodes = $this->translations;
429  if ($langcodes && in_array($this->type, array('core', 'module', 'profile', 'theme'), TRUE)) {
430  // Support the l10n_path, l10n_url keys from l10n_update. Note that the
431  // l10n_server key is not supported.
432  if (isset($this->l10n_path)) {
433  $update_url = $this->l10n_path;
434  }
435  else {
436  if (isset($this->l10n_url)) {
437  $l10n_server = $this->l10n_url;
438  }
439  else {
440  $l10n_server = FALSE;
441  }
442  if ($l10n_server) {
443  if (!isset($cache[$l10n_server])) {
444  $this->preprocessLocalFileUrl($l10n_server);
445  $l10n_server = $l10n_server['url'];
446  if ($filename = _make_download_file($l10n_server)) {
447  $server_info = simplexml_load_string(file_get_contents($filename));
448  $cache[$l10n_server] = !empty($server_info->update_url) ? $server_info->update_url : FALSE;
449  }
450  }
451  if ($cache[$l10n_server]) {
452  $update_url = $cache[$l10n_server];
453  }
454  else {
455  make_error('XML_ERROR', dt("Could not retrieve l10n update url for !project.", array('!project' => $this->name)));
456  return FALSE;
457  }
458  }
459  }
460  if ($update_url) {
461  $failed = array();
462  foreach ($langcodes as $langcode) {
463  $variables = array(
464  '%project' => $this->name,
465  '%release' => $this->download['full_version'],
466  '%core' => $this->core,
467  '%language' => $langcode,
468  '%filename' => '%filename',
469  );
470  $url = strtr($update_url, $variables);
471 
472  // Download the translation file. Since its contents are volatile,
473  // cache for only 4 hours.
474  if ($filename = _make_download_file($url, 3600 * 4)) {
475  // If this is the core project type, download the translation file
476  // and place it in every profile and an additional copy in
477  // modules/system/translations where it can be detected for import
478  // by other non-default install profiles.
479  if ($this->type === 'core') {
480  $profiles = drush_scan_directory($project_directory . '/profiles', '/.*/', array(), 0, FALSE, 'filename', 0, TRUE);
481  foreach ($profiles as $profile) {
482  if (is_dir($project_directory . '/profiles/' . $profile->basename)) {
483  drush_mkdir($project_directory . '/profiles/' . $profile->basename . '/translations');
484  drush_copy_dir($filename, $project_directory . '/profiles/' . $profile->basename . '/translations/' . $langcode . '.po');
485  }
486  }
487  drush_mkdir($project_directory . '/modules/system/translations');
488  drush_copy_dir($filename, $project_directory . '/modules/system/translations/' . $langcode . '.po');
489  }
490  else {
491  drush_mkdir($project_directory . '/translations');
492  drush_copy_dir($filename, $project_directory . '/translations/' . $langcode . '.po', FILE_EXISTS_OVERWRITE);
493  }
494  }
495  else {
496  $failed[] = $langcode;
497  }
498  }
499  if (empty($failed)) {
500  drush_log('All translations downloaded for ' . $this->name, LogLevel::OK);
501  }
502  else {
503  drush_log('Unable to download translations for ' . $this->name . ': ' . implode(', ', $failed), LogLevel::WARNING);
504  }
505  }
506  }
507  return TRUE;
508  }
509 
510  /**
511  * Generate the proper path for this project type.
512  *
513  * @param boolean $base
514  * Whether include the base part (tmp dir). Defaults to TRUE.
515  */
516  protected function generatePath($base = TRUE) {
517  $path = array();
518  if ($base) {
519  $path[] = make_tmp();
520  $path[] = '__build__';
521  }
522  if (!empty($this->contrib_destination)) {
523  $path[] = $this->contrib_destination;
524  }
525  if (!empty($this->subdir)) {
526  $path[] = $this->subdir;
527  }
528  return implode('/', $path);
529  }
530 
531  /**
532  * Return the proper path for dependencies to be placed in.
533  *
534  * @return string
535  * The path that dependencies will be placed in.
536  */
537  protected function buildPath($directory) {
538  return $this->base_contrib_destination;
539  }
540 
541  /**
542  * Recurse to process additional makefiles that may be found during
543  * processing.
544  */
545  function recurse($path) {
546  if (!$this->do_recursion || drush_get_option('no-recursion')) {
547  drush_log(dt("Preventing recursive makefile parsing for !project",
548  array("!project" => $this->name)), LogLevel::INFO);
549  return TRUE;
550  }
551  $candidates = array(
552  $this->name . '.make.yml',
553  $this->name . '.make',
554  'drupal-org.make.yml',
555  'drupal-org.make',
556  );
557  $makefile = FALSE;
558  foreach ($candidates as $filename) {
559  if (file_exists($this->download_location . '/' . $filename)) {
560  $makefile = $this->download_location . '/' . $filename;
561  break;
562  }
563  }
564 
565  if (!$makefile) {
566  return TRUE;
567  }
568 
569  drush_log(dt("Found makefile: !makefile", array("!makefile" => basename($makefile))), LogLevel::OK);
570 
571  // Save the original state of the 'custom' context.
572  $custom_context = &drush_get_context('custom');
573  $original_custom_context_values = $custom_context;
574 
575  $info = make_parse_info_file($makefile, TRUE, $this->options);
576  if (!($info = make_validate_info_file($info))) {
577  $result = FALSE;
578  }
579  else {
580  // Inherit the translations specified in the extender makefile.
581  if (!empty($this->translations)) {
582  $info['translations'] = $this->translations;
583  }
584  // Strip out any modules that have already been processed before this.
585  foreach ($this->manifest as $name) {
586  unset($info['projects'][$name]);
587  }
588  $build_path = $this->buildPath($this->name);
589  make_projects(TRUE, trim($build_path, '/'), $info, $this->build_path, $this->download_location);
590  make_libraries(TRUE, trim($build_path, '/'), $info, $this->build_path, $this->download_location);
591  $result = TRUE;
592  }
593  // Restore original 'custom' context so that any
594  // settings changes made are used.
595  $custom_context = $original_custom_context_values;
596 
597  return $result;
598  }
599 }
600 
601 /**
602  * For processing Drupal core projects.
603  */
605  /**
606  * Override constructor for core to adjust project info.
607  */
608  protected function __construct(&$project) {
609  parent::__construct($project);
610  // subdir and contrib_destination are not allowed for core.
611  $this->subdir = '';
612  $this->contrib_destination = '';
613  }
614 
615  /**
616  * Determine the location to download project to.
617  */
618  function findDownloadLocation() {
619  $this->path = $this->download_location = $this->generatePath();
620  $this->project_directory = '';
621  if (is_dir($this->download_location)) {
622  return drush_set_error('MAKE_DIRECTORY_EXISTS', dt('Directory not empty: !directory', array('!directory' => $this->download_location)));
623  }
624  elseif ($this->download['type'] === 'pm') {
625  // pm-download will create the final __build__ directory, so nothing to do
626  // here.
627  }
628  else {
629  drush_mkdir($this->download_location);
630  }
632  }
633 }
634 
635 /**
636  * For processing libraries.
637  */
639  /**
640  * Override constructor for libraries to properly set contrib destination.
641  */
642  protected function __construct(&$project) {
643  parent::__construct($project);
644  // Allow libraries to specify where they should live in the build path.
645  if (isset($project['destination'])) {
646  $project_path = $project['destination'];
647  }
648  else {
649  $project_path = 'libraries';
650  }
651 
652  $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . $project_path;
653  }
654 
655  /**
656  * No recursion for libraries, sorry :-(
657  */
658  function recurse($path) {
659  // Return TRUE so that processing continues in the make() method.
660  return TRUE;
661  }
662 
663  /**
664  * No translations for libraries.
665  */
667  // Return TRUE so that processing continues in the make() method.
668  return TRUE;
669  }
670 }
671 
672 /**
673  * For processing modules.
674  */
676  /**
677  * Override constructor for modules to properly set contrib destination.
678  */
679  protected function __construct(&$project) {
680  parent::__construct($project);
681  $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . 'modules';
682  }
683 }
684 
685 /**
686  * For processing installation profiles.
687  */
689  /**
690  * Override contructor for installation profiles to properly set contrib
691  * destination.
692  */
693  protected function __construct(&$project) {
694  parent::__construct($project);
695  $this->contrib_destination = (!empty($this->destination) ? $this->destination : 'profiles');
696  }
697 
698  /**
699  * Find the build path.
700  */
701  protected function buildPath($directory) {
702  return $this->generatePath(FALSE) . '/' . $directory;
703  }
704 }
705 
706 /**
707  * For processing themes.
708  */
710  /**
711  * Override contructor for themes to properly set contrib destination.
712  */
713  protected function __construct(&$project) {
714  parent::__construct($project);
715  $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . 'themes';
716  }
717 }
718 
719 /**
720  * For processing translations.
721  */
723  /**
724  * Override constructor for translations to properly set contrib destination.
725  */
726  protected function __construct(&$project) {
727  parent::__construct($project);
728  switch ($project['core']) {
729  case '5.x':
730  // Don't think there's an automatic place we can put 5.x translations,
731  // so we'll toss them in a translations directory in the Drupal root.
732  $this->contrib_destination = ($this->base_contrib_destination != '.' ? $this->base_contrib_destination . '/' : '') . 'translations';
733  break;
734 
735  default:
736  $this->contrib_destination = '';
737  break;
738  }
739  }
740 }

File

doxygen/html/make_8project_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/make/make.project.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="namespaces.html"><span>Namespaces</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><a href="examples.html"><span>Examples</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>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><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_71080c12e208a9908650860bfe2a57f6.html">make</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">make.project.inc</div>  </div>
</div><!--header-->
<div class="contents">
<a href="make_8project_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<span class="comment"></span></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"> * @file</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Drush Make processing classes.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;use <a class="code" href="classDrush_1_1Log_1_1LogLevel.html">Drush\Log\LogLevel</a>;</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">/**</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * The base project class.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html">   12</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {</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">  /**</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">   * TRUE if make() has been called, otherwise FALSE.</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="classDrushMakeProject.html#a313e2a2f7421adfcecdc04f985182763">   17</a></span>&#160;  <span class="keyword">protected</span> <a class="code" href="classDrushMakeProject.html#a313e2a2f7421adfcecdc04f985182763">$made</a> = FALSE;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">   * TRUE if download() method has been called successfully, otherwise FALSE.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a587bf0e79a999ae9198e3fef6d533a59">   22</a></span>&#160;  <span class="keyword">protected</span> <a class="code" href="classDrushMakeProject.html#a587bf0e79a999ae9198e3fef6d533a59">$downloaded</a> = NULL;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">   * Download location to use.</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a43efbf973ece5fbab01fb59b80267e3e">   27</a></span>&#160;  <span class="keyword">protected</span> <a class="code" href="classDrushMakeProject.html#a43efbf973ece5fbab01fb59b80267e3e">$download_location</a> = NULL;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">   * Keep track of instances.</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">   * @see DrushMakeProject::getInstance()</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a01d8c7205aba8f1c8b1395102c2ea1d3">   34</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">static</span> <a class="code" href="classDrushMakeProject.html#a01d8c7205aba8f1c8b1395102c2ea1d3">$self</a> = array();</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">   * Keeps track of projects being processed to prevent recursive conflicts.</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">   * Simple array of machine names.</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment">   * @var array</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  <span class="keyword">protected</span> $manifest = array();</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">   * Default to overwrite to allow recursive builds to process properly.</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment">   * TODO refactor this to be more selective. Ideally a merge would take place</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">   * instead of an overwrite.</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a1102ee27f914c4080acdaf2903db153b">   51</a></span>&#160;  <span class="keyword">protected</span> <a class="code" href="classDrushMakeProject.html#a1102ee27f914c4080acdaf2903db153b">$overwrite</a> = TRUE;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">   * Recursively process any makefiles found in downloaded projects.</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#ac5f1b8e82df2a5d3aacaec39461a9715">   56</a></span>&#160;  <span class="keyword">protected</span> <a class="code" href="classDrushMakeProject.html#ac5f1b8e82df2a5d3aacaec39461a9715">$do_recursion</a> = TRUE;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">   * Which variant of profiles to download.</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a92ff2f917428f023dfc22dfaca1fba49">   61</a></span>&#160;  <span class="keyword">protected</span> <a class="code" href="classDrushMakeProject.html#a92ff2f917428f023dfc22dfaca1fba49">$variant</a> = <span class="stringliteral">&#39;profile-only&#39;</span>;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment">   * Set attributes and retrieve project information.</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#afb329c0cea11e16d977e30f22636194b">   66</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#afb329c0cea11e16d977e30f22636194b">__construct</a>($project) {</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    $project[<span class="stringliteral">&#39;base_contrib_destination&#39;</span>] = $project[<span class="stringliteral">&#39;contrib_destination&#39;</span>];</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keywordflow">foreach</span> ($project as $key =&gt; $value) {</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;      $this-&gt;{$key} = $value;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    }</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordflow">if</span> (!empty($this-&gt;options[<span class="stringliteral">&#39;working-copy&#39;</span>])) {</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;      $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;working-copy&#39;</span>] = TRUE;</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">// Don&#39;t recurse when we&#39;re using a pre-built profile tarball.</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordflow">if</span> ($this-&gt;variant == <span class="stringliteral">&#39;projects&#39;</span>) {</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;      $this-&gt;do_recursion = FALSE;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    }</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"></span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="comment">   * Get an instance for the type and project.</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="comment">   * @param string $type</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment">   *   Type of project: core, library, module, profile, or translation.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment">   * @param array $project</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="comment">   *   Project information.</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="comment">   * @return mixed</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment">   *   An instance for the project or FALSE if invalid type.</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#afedb73c8a81625f02d8c25fb81df295d">   91</a></span>&#160;  <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#afedb73c8a81625f02d8c25fb81df295d">getInstance</a>($type, $project) {</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordflow">if</span> (!isset(self::$self[$type][$project[<span class="stringliteral">&#39;name&#39;</span>]])) {</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;      $class = <span class="stringliteral">&#39;DrushMakeProject_&#39;</span> . $type;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;      self::$self[$type][$project[<span class="stringliteral">&#39;name&#39;</span>]] = class_exists($class) ? <span class="keyword">new</span> $class($project) : FALSE;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    }</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordflow">return</span> self::$self[$type][$project[<span class="stringliteral">&#39;name&#39;</span>]];</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment">   * Set the manifest array.</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">   * @param array $manifest</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment">   *   An array of projects as generated by `make_projects`.</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#ab718bdc4ffa8964196fea1741189d9b3">  105</a></span>&#160;  <span class="keyword">public</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#ab718bdc4ffa8964196fea1741189d9b3">setManifest</a>($manifest) {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    $this-&gt;manifest = $manifest;</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;<span class="comment"></span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="comment">   * Download a project.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">  112</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>() {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    $this-&gt;downloaded = TRUE;</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">// In some cases, make_download_factory() is going to need to know the</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="comment">// full version string of the project we&#39;re trying to download. However,</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="comment">// the version is a project-level attribute, not a download-level</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="comment">// attribute. So, if we don&#39;t already have a full version string in the</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="comment">// download array (e.g. if it was initialized via the release history XML</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="comment">// for the PM case), we take the version info from the project-level</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="comment">// attribute, convert it into a full version string, and stuff it into</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="comment">// $this-&gt;download so that the download backend has access to it, too.</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordflow">if</span> (!empty($this-&gt;version) &amp;&amp; empty($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;full_version&#39;</span>])) {</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;      $full_version = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;      $matches = array();</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;      <span class="comment">// Core needs different conversion rules than contrib.</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;      <span class="keywordflow">if</span> (!empty($this-&gt;type) &amp;&amp; $this-&gt;type == <span class="stringliteral">&#39;core&#39;</span>) {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="comment">// Generally, the version for core is already set properly.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        $full_version = $this-&gt;version;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        <span class="comment">// However, it might just be something like &#39;7&#39; or &#39;7.x&#39;, in which</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        <span class="comment">// case we need to turn that into &#39;7.x-dev&#39;;</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <span class="keywordflow">if</span> (preg_match(<span class="stringliteral">&#39;/^\d+(\.x)?$/&#39;</span>, $this-&gt;version, $matches)) {</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;          <span class="comment">// If there&#39;s no &#39;.x&#39; already, append it.</span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;          <span class="keywordflow">if</span> (empty($matches[1])) {</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            $full_version .= <span class="stringliteral">&#39;.x&#39;</span>;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;          }</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;          $full_version .= <span class="stringliteral">&#39;-dev&#39;</span>;</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">// Contrib.</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;      <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <span class="comment">// If the version doesn&#39;t already define a core version, prepend it.</span></div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keywordflow">if</span> (!preg_match(<span class="stringliteral">&#39;/^\d+\.x-\d+.*$/&#39;</span>, $this-&gt;version)) {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;          <span class="comment">// Just find the major version from $this-&gt;core so we don&#39;t end up</span></div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;          <span class="comment">// with version strings like &#39;7.12-2.0&#39;.</span></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;          $core_parts = explode(<span class="charliteral">&#39;.&#39;</span>, $this-&gt;core);</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;          $full_version = $core_parts[0] . <span class="stringliteral">&#39;.x-&#39;</span>;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        $full_version .= $this-&gt;version;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        <span class="comment">// If the project-level version attribute is just a number it&#39;s a major</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        <span class="comment">// version.</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <span class="keywordflow">if</span> (preg_match(<span class="stringliteral">&#39;/^\d+(\.x)?$/&#39;</span>, $this-&gt;version, $matches)) {</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;          <span class="comment">// If there&#39;s no &#39;.x&#39; already, append it.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;          <span class="keywordflow">if</span> (empty($matches[1])) {</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;            $full_version .= <span class="stringliteral">&#39;.x&#39;</span>;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;          }</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;          $full_version .= <span class="stringliteral">&#39;-dev&#39;</span>;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        }</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;      }</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;      $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;full_version&#39;</span>] = $full_version;</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;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;variant&#39;</span>] = <a class="code" href="classDrushMakeProject.html#a92ff2f917428f023dfc22dfaca1fba49">$this-&gt;variant</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="make_8download_8inc.html#aaa0817e712779645b563cfb8ddfd99cd">make_download_factory</a>($this-&gt;name, $this-&gt;type, $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>, $this-&gt;download_location) === FALSE) {</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;      $this-&gt;downloaded = FALSE;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    }</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classDrushMakeProject.html#a587bf0e79a999ae9198e3fef6d533a59">$this-&gt;downloaded</a>;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  }</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="comment">   * Build a project.</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#ad59196db4820ff959dd6088fb8293b75">  174</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#ad59196db4820ff959dd6088fb8293b75">make</a>() {</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordflow">if</span> ($this-&gt;made) {</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;      <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Attempt to build project @project more then once prevented.&#39;</span>, array(<span class="stringliteral">&#39;@project&#39;</span> =&gt; $this-&gt;name)));</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;      <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    }</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    $this-&gt;made = TRUE;</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;    <span class="keywordflow">if</span> (!isset($this-&gt;download_location)) {</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;      $this-&gt;download_location = $this-&gt;<a class="code" href="classDrushMakeProject.html#a8276ef71b946cf3ae13391c2216e51bd">findDownloadLocation</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    }</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">if</span> ($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>() === FALSE) {</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;      <span class="keywordflow">return</span> FALSE;</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="keywordflow">if</span> (!$this-&gt;<a class="code" href="classDrushMakeProject.html#a5ea0e7fdb468e6b3c20ca7a5b2010966">addLockfile</a>($this-&gt;download_location)) {</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;      <span class="keywordflow">return</span> FALSE;</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="keywordflow">if</span> (!$this-&gt;<a class="code" href="classDrushMakeProject.html#a86cb2ad32088f11522e027cd7e98c6ce">applyPatches</a>($this-&gt;download_location)) {</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    }</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordflow">if</span> (!$this-&gt;<a class="code" href="classDrushMakeProject.html#af6f9c98d13bb338237d8cc96566e59f8">getTranslations</a>($this-&gt;download_location)) {</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    }</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    <span class="comment">// Handle .info file re-writing (if so desired).</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;no-gitinfofile&#39;</span>, FALSE) &amp;&amp; isset($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;type&#39;</span>]) &amp;&amp; $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;type&#39;</span>] == <span class="stringliteral">&#39;git&#39;</span>) {</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;      $this-&gt;<a class="code" href="classDrushMakeProject.html#ae64371ebab222251d13f492bb1bf7549">processGitInfoFiles</a>();</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    }</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="comment">// Clean-up .git directories.</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="make_8utilities_8inc.html#a4936fba59cad3feaaf82d602958af199">_get_working_copy_option</a>($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>)) {</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;      $this-&gt;<a class="code" href="classDrushMakeProject.html#a79be6b5aafd3dd119b5928e2dd2a7096">removeGitDirectory</a>();</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="keywordflow">if</span> (!$this-&gt;<a class="code" href="classDrushMakeProject.html#a14e2e297d82eea0e5bd316255d092da8">recurse</a>($this-&gt;download_location)) {</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;      <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    }</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;  }</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;<span class="comment">   * Determine the location to download project to.</span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a8276ef71b946cf3ae13391c2216e51bd">  213</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a8276ef71b946cf3ae13391c2216e51bd">findDownloadLocation</a>() {</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    $this-&gt;path = $this-&gt;<a class="code" href="classDrushMakeProject.html#a825d48df1bdb0d0d0e46992e175909af">generatePath</a>();</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    $this-&gt;project_directory = !empty($this-&gt;directory_name) ? $this-&gt;directory_name : $this-&gt;name;</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    $this-&gt;download_location = $this-&gt;path . <span class="charliteral">&#39;/&#39;</span> . $this-&gt;project_directory;</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="comment">// This directory shouldn&#39;t exist yet -- if it does, stop,</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="comment">// unless overwrite has been set to TRUE.</span></div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keywordflow">if</span> (is_dir($this-&gt;download_location) &amp;&amp; !$this-&gt;overwrite) {</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;MAKE_DIRECTORY_EXISTS&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Directory not empty: !directory&#39;</span>, array(<span class="stringliteral">&#39;!directory&#39;</span> =&gt; $this-&gt;download_location)));</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    }</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    elseif ($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;type&#39;</span>] === <span class="stringliteral">&#39;pm&#39;</span>) {</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;      <span class="comment">// pm-download will create the final contrib directory.</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;      <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>(dirname($this-&gt;download_location));</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">else</span> {</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;      <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($this-&gt;download_location);</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;    <span class="keywordflow">return</span> <a class="code" href="classDrushMakeProject.html#a43efbf973ece5fbab01fb59b80267e3e">$this-&gt;download_location</a>;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  }</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;<span class="comment"></span></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">   * Rewrite relative URLs and file:/// URLs</span></div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="comment">   * relative path -&gt; absolute path using the make_directory</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="comment">   * local file:/// urls -&gt; local paths</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment">   * @param mixed &amp;$info</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="comment">   *   Either an array or a simple url string. The `$info` variable will be</span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;<span class="comment">   *   transformed into an array.</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a44714696c45b971da01dd29a529fd01b">  242</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a44714696c45b971da01dd29a529fd01b">preprocessLocalFileUrl</a>(&amp;$info) {</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <span class="keywordflow">if</span> (is_string($info)) {</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;      $info = array(<span class="stringliteral">&#39;url&#39;</span> =&gt; $info, <span class="stringliteral">&#39;local&#39;</span> =&gt; FALSE);</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    }</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="drush_8inc.html#a5d3c123a1d8fa15642f08ff635dbe2a1">_drush_is_url</a>($info[<span class="stringliteral">&#39;url&#39;</span>]) &amp;&amp; !<a class="code" href="group__filesystemfunctions.html#gafa80199035259ddf98fa300d6f646aa2">drush_is_absolute_path</a>($info[<span class="stringliteral">&#39;url&#39;</span>])) {</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;      $info[<span class="stringliteral">&#39;url&#39;</span>] = $this-&gt;make_directory . <span class="charliteral">&#39;/&#39;</span> . $info[<span class="stringliteral">&#39;url&#39;</span>];</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;      $info[<span class="stringliteral">&#39;local&#39;</span>] = TRUE;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    } elseif (substr($info[<span class="stringliteral">&#39;url&#39;</span>], 0, 8) == <span class="stringliteral">&#39;file:///&#39;</span>) {</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;      $info[<span class="stringliteral">&#39;url&#39;</span>] = substr($info[<span class="stringliteral">&#39;url&#39;</span>], 7);</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;      $info[<span class="stringliteral">&#39;local&#39;</span>] = TRUE;</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    }</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="comment"></span></div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="comment">   * Retrieve and apply any patches specified by the makefile to this project.</span></div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a86cb2ad32088f11522e027cd7e98c6ce">  259</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a86cb2ad32088f11522e027cd7e98c6ce">applyPatches</a>($project_directory) {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    <span class="keywordflow">if</span> (empty($this-&gt;patch)) {</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;      <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    }</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    $patches_txt = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    $local_patches = array();</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    $ignore_checksums = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;ignore-checksums&#39;</span>);</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keywordflow">foreach</span> ($this-&gt;patch as $info) {</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;      $this-&gt;<a class="code" href="classDrushMakeProject.html#a44714696c45b971da01dd29a529fd01b">preprocessLocalFileUrl</a>($info);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;      <span class="comment">// Download the patch.</span></div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;      <span class="keywordflow">if</span> ($filename = <a class="code" href="make_8download_8inc.html#a6381bf72fa72152dd12f122dbca83d78">_make_download_file</a>($info[<span class="stringliteral">&#39;url&#39;</span>])) {</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        $patched = FALSE;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        $output = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        <span class="comment">// Test each patch style; -p1 is the default with git. See</span></div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        <span class="comment">// http://drupal.org/node/1054616</span></div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        $patch_levels = array(<span class="stringliteral">&#39;-p1&#39;</span>, <span class="stringliteral">&#39;-p0&#39;</span>);</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        <span class="keywordflow">foreach</span> ($patch_levels as $patch_level) {</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;          $checked = <a class="code" href="group__commandwrappers.html#ga59e8ee9f53442f2029080ac723ed008f">drush_shell_cd_and_exec</a>($project_directory, <span class="stringliteral">&#39;git --git-dir=. apply --check %s %s --verbose&#39;</span>, $patch_level, $filename);</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;          <span class="keywordflow">if</span> ($checked) {</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;            <span class="comment">// Apply the first successful style.</span></div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;            $patched = <a class="code" href="group__commandwrappers.html#ga59e8ee9f53442f2029080ac723ed008f">drush_shell_cd_and_exec</a>($project_directory, <span class="stringliteral">&#39;git --git-dir=. apply %s %s --verbose&#39;</span>, $patch_level, $filename);</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;          }</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">// In some rare cases, git will fail to apply a patch, fallback to using</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;        <span class="comment">// the &#39;patch&#39; command.</span></div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        <span class="keywordflow">if</span> (!$patched) {</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;          <span class="keywordflow">foreach</span> ($patch_levels as $patch_level) {</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            <span class="comment">// --no-backup-if-mismatch here is a hack that fixes some</span></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;            <span class="comment">// differences between how patch works on windows and unix.</span></div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;            <span class="keywordflow">if</span> ($patched = <a class="code" href="group__commandwrappers.html#gafd358ceac1286dbdd141ff2b8eb7d556">drush_shell_exec</a>(<span class="stringliteral">&quot;patch %s --no-backup-if-mismatch -d %s &lt; %s&quot;</span>, $patch_level, $project_directory, $filename)) {</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;              <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;            }</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;          }</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;</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;        <span class="keywordflow">if</span> ($output = <a class="code" href="group__commandwrappers.html#gadba8c59ba260dd39f615bc22ca78e1af">drush_shell_exec_output</a>()) {</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;          <span class="comment">// Log any command output, visible only in --verbose or --debug mode.</span></div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;          <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(implode(<span class="stringliteral">&quot;\n&quot;</span>, $output));</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        }</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <span class="comment">// Set up string placeholders to pass to dt().</span></div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        $dt_args = array(</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;          <span class="stringliteral">&#39;@name&#39;</span> =&gt; $this-&gt;name,</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;          <span class="stringliteral">&#39;@filename&#39;</span> =&gt; basename($filename),</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;        );</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        <span class="keywordflow">if</span> ($patched) {</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;          <span class="keywordflow">if</span> (!$ignore_checksums &amp;&amp; !<a class="code" href="make_8download_8inc.html#a5ca2e2fb1cf115e40b99acbfc79128fa">_make_verify_checksums</a>($info, $filename)) {</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;             <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;          }</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;          $patch_url = $info[<span class="stringliteral">&#39;url&#39;</span>];</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;          <span class="comment">// If this is a local patch, copy that into place as well.</span></div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;          <span class="keywordflow">if</span> ($info[<span class="stringliteral">&#39;local&#39;</span>]) {</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;            $local_patches[] = $info[<span class="stringliteral">&#39;url&#39;</span>];</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;            <span class="comment">// Use a local path for the PATCHES.txt file.</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;            $pathinfo = pathinfo($patch_url);</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;            $patch_url = $pathinfo[<span class="stringliteral">&#39;basename&#39;</span>];</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;          }</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;          $patches_txt .= <span class="stringliteral">&#39;- &#39;</span> . $patch_url . <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;          <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;@name patched with @filename.&#39;</span>, $dt_args), LogLevel::OK);</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;        }</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;          <a class="code" href="make_8utilities_8inc.html#aa2a78298291b42502718822ed5b59969">make_error</a>(<span class="stringliteral">&#39;PATCH_ERROR&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Unable to patch @name with @filename.&quot;</span>, $dt_args));</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;        }</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        <a class="code" href="drush_8inc.html#acebe9ed4e4825e6d33ab8dff2157b676">drush_op</a>(<span class="stringliteral">&#39;unlink&#39;</span>, $filename);</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;      }</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;      <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;        <a class="code" href="make_8utilities_8inc.html#aa2a78298291b42502718822ed5b59969">make_error</a>(<span class="stringliteral">&#39;DOWNLOAD_ERROR&#39;</span>, <span class="stringliteral">&#39;Unable to download &#39;</span> . $info[<span class="stringliteral">&#39;url&#39;</span>] . <span class="charliteral">&#39;.&#39;</span>);</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;      }</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    }</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="keywordflow">if</span> (!empty($patches_txt) &amp;&amp; !<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;no-patch-txt&#39;</span>) &amp;&amp; !file_exists($project_directory . <span class="stringliteral">&#39;/PATCHES.txt&#39;</span>)) {</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;      $patches_txt = <span class="stringliteral">&quot;The following patches have been applied to this project:\n&quot;</span> .</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;        $patches_txt .</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;        <span class="stringliteral">&quot;\nThis file was automatically generated by Drush Make (http://drupal.org/project/drush).\n&quot;</span>;</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;      file_put_contents($project_directory . <span class="stringliteral">&#39;/PATCHES.txt&#39;</span>, $patches_txt);</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;      <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<span class="stringliteral">&#39;Generated PATCHES.txt file for &#39;</span> . $this-&gt;name, LogLevel::OK);</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;      <span class="comment">// Copy local patches into place.</span></div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;      <span class="keywordflow">foreach</span> ($local_patches as $url) {</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;        $pathinfo = pathinfo($url);</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        <a class="code" href="group__filesystemfunctions.html#ga1d86ac8e2e56a75acb0abcdc8e0dcf09">drush_copy_dir</a>($url, $project_directory . <span class="charliteral">&#39;/&#39;</span> . $pathinfo[<span class="stringliteral">&#39;basename&#39;</span>]);</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;      }</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">return</span> TRUE;</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;  }</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;<span class="comment">   * Process info files when downloading things from git.</span></div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00355"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#ae64371ebab222251d13f492bb1bf7549">  355</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#ae64371ebab222251d13f492bb1bf7549">processGitInfoFiles</a>() {</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="comment">// Bail out if this isn&#39;t hosted on Drupal.org (unless --force-gitinfofile option was specified).</span></div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;force-gitinfofile&#39;</span>, FALSE) &amp;&amp; isset($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;url&#39;</span>]) &amp;&amp; strpos($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;url&#39;</span>], <span class="stringliteral">&#39;drupal.org&#39;</span>) === FALSE) {</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;      <span class="keywordflow">return</span>;</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;</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;    <span class="comment">// Figure out the proper version string to use based on the .make file.</span></div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    <span class="comment">// Best case is the .make file author told us directly.</span></div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;    <span class="keywordflow">if</span> (!empty($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;full_version&#39;</span>])) {</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;      $full_version = $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;full_version&#39;</span>];</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    }</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    <span class="comment">// Next best is if we have a tag, since those are identical to versions.</span></div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    elseif (!empty($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;tag&#39;</span>])) {</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;      $full_version = $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;tag&#39;</span>];</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    }</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    <span class="comment">// If we have a branch, append &#39;-dev&#39;.</span></div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    elseif (!empty($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;branch&#39;</span>])) {</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;      $full_version = $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;branch&#39;</span>] . <span class="stringliteral">&#39;-dev&#39;</span>;</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    }</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    <span class="comment">// Ugh. Not sure what else we can do in this case.</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    elseif (!empty($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;revision&#39;</span>])) {</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;      $full_version = $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;revision&#39;</span>];</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    }</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;    <span class="comment">// Probably can never reach this case.</span></div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;      $full_version = <span class="stringliteral">&#39;unknown&#39;</span>;</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    }</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    <span class="comment">// If the version string ends in &#39;.x-dev&#39; do the Git magic to figure out</span></div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    <span class="comment">// the appropriate &#39;rebuild version&#39; string, e.g. &#39;7.x-1.2+7-dev&#39;.</span></div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;    $matches = array();</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    <span class="keywordflow">if</span> (preg_match(<span class="stringliteral">&#39;/^(.+).x-dev$/&#39;</span>, $full_version, $matches)) {</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;      require_once dirname(__FILE__) . <span class="stringliteral">&#39;/../pm/package_handler/git_drupalorg.inc&#39;</span>;</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;      $rebuild_version = <a class="code" href="git__drupalorg_8inc.html#a258fb6515d2a1d8f92e54c4278acb4cb">drush_pm_git_drupalorg_compute_rebuild_version</a>($this-&gt;download_location, $matches[1]);</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;      <span class="keywordflow">if</span> ($rebuild_version) {</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;        $full_version = $rebuild_version;</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;      }</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;    }</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    require_once dirname(__FILE__) . <span class="stringliteral">&#39;/../pm/pm.drush.inc&#39;</span>;</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group__commandwrappers.html#ga59e8ee9f53442f2029080ac723ed008f">drush_shell_cd_and_exec</a>($this-&gt;download_location, <span class="stringliteral">&#39;git log -1 --pretty=format:%ct&#39;</span>)) {</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;      $output = <a class="code" href="group__commandwrappers.html#gadba8c59ba260dd39f615bc22ca78e1af">drush_shell_exec_output</a>();</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;      $datestamp = $output[0];</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;    }</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;      $datestamp = time();</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    }</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    <a class="code" href="pm_8drush_8inc.html#a2a6a34d3c5d64d6b05edab9095408b48">drush_pm_inject_info_file_metadata</a>($this-&gt;download_location, $this-&gt;name, $full_version, $datestamp);</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;  }</div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;<span class="comment">   * Remove the .git directory from a project.</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00407"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a79be6b5aafd3dd119b5928e2dd2a7096">  407</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a79be6b5aafd3dd119b5928e2dd2a7096">removeGitDirectory</a>() {</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;    <span class="keywordflow">if</span> (isset($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;type&#39;</span>]) &amp;&amp; $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;type&#39;</span>] == <span class="stringliteral">&#39;git&#39;</span> &amp;&amp; file_exists($this-&gt;download_location . <span class="stringliteral">&#39;/.git&#39;</span>)) {</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;      <a class="code" href="group__filesystemfunctions.html#gabff54c630a451976fc121257f6efd960">drush_delete_dir</a>($this-&gt;download_location . <span class="stringliteral">&#39;/.git&#39;</span>, TRUE);</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    }</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;  }</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;<span class="comment">   * Add a lock file.</span></div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00416"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a5ea0e7fdb468e6b3c20ca7a5b2010966">  416</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a5ea0e7fdb468e6b3c20ca7a5b2010966">addLockfile</a>($project_directory) {</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    <span class="keywordflow">if</span> (!empty($this-&gt;lock)) {</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;      file_put_contents($project_directory . <span class="stringliteral">&#39;/.drush-lock-update&#39;</span>, $this-&gt;lock);</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    }</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;  }</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;<span class="comment">   * Retrieve translations for this project.</span></div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00426"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#af6f9c98d13bb338237d8cc96566e59f8">  426</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#af6f9c98d13bb338237d8cc96566e59f8">getTranslations</a>($project_directory) {</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    <span class="keyword">static</span> $cache = array();</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;    $langcodes = $this-&gt;translations;</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;    <span class="keywordflow">if</span> ($langcodes &amp;&amp; in_array($this-&gt;type, array(<span class="stringliteral">&#39;core&#39;</span>, <span class="stringliteral">&#39;module&#39;</span>, <span class="stringliteral">&#39;profile&#39;</span>, <span class="stringliteral">&#39;theme&#39;</span>), TRUE)) {</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;      <span class="comment">// Support the l10n_path, l10n_url keys from l10n_update. Note that the</span></div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;      <span class="comment">// l10n_server key is not supported.</span></div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;      <span class="keywordflow">if</span> (isset($this-&gt;l10n_path)) {</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;        $update_url = $this-&gt;l10n_path;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;      }</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;      <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;        <span class="keywordflow">if</span> (isset($this-&gt;l10n_url)) {</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;          $l10n_server = $this-&gt;l10n_url;</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;        }</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;          $l10n_server = FALSE;</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;        }</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;        <span class="keywordflow">if</span> ($l10n_server) {</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;          <span class="keywordflow">if</span> (!isset($cache[$l10n_server])) {</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;            $this-&gt;<a class="code" href="classDrushMakeProject.html#a44714696c45b971da01dd29a529fd01b">preprocessLocalFileUrl</a>($l10n_server);</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;            $l10n_server = $l10n_server[<span class="stringliteral">&#39;url&#39;</span>];</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;            <span class="keywordflow">if</span> ($filename = <a class="code" href="make_8download_8inc.html#a6381bf72fa72152dd12f122dbca83d78">_make_download_file</a>($l10n_server)) {</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;              $server_info = simplexml_load_string(file_get_contents($filename));</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;              $cache[$l10n_server] = !empty($server_info-&gt;update_url) ? $server_info-&gt;update_url : FALSE;</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;            }</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;          }</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;          <span class="keywordflow">if</span> ($cache[$l10n_server]) {</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;            $update_url = $cache[$l10n_server];</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;          }</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;          <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;            <a class="code" href="make_8utilities_8inc.html#aa2a78298291b42502718822ed5b59969">make_error</a>(<span class="stringliteral">&#39;XML_ERROR&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Could not retrieve l10n update url for !project.&quot;</span>, array(<span class="stringliteral">&#39;!project&#39;</span> =&gt; $this-&gt;name)));</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;          }</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;        }</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;      }</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;      <span class="keywordflow">if</span> ($update_url) {</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;        $failed = array();</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;        <span class="keywordflow">foreach</span> ($langcodes as $langcode) {</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;          $variables = array(</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;            <span class="stringliteral">&#39;%project&#39;</span> =&gt; $this-&gt;name,</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;            <span class="stringliteral">&#39;%release&#39;</span> =&gt; $this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;full_version&#39;</span>],</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;            <span class="stringliteral">&#39;%core&#39;</span> =&gt; $this-&gt;core,</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;            <span class="stringliteral">&#39;%language&#39;</span> =&gt; $langcode,</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;            <span class="stringliteral">&#39;%filename&#39;</span> =&gt; <span class="stringliteral">&#39;%filename&#39;</span>,</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;          );</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;          $url = strtr($update_url, $variables);</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;          <span class="comment">// Download the translation file.  Since its contents are volatile,</span></div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;          <span class="comment">// cache for only 4 hours.</span></div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;          <span class="keywordflow">if</span> ($filename = <a class="code" href="make_8download_8inc.html#a6381bf72fa72152dd12f122dbca83d78">_make_download_file</a>($url, 3600 * 4)) {</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;            <span class="comment">// If this is the core project type, download the translation file</span></div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;            <span class="comment">// and place it in every profile and an additional copy in</span></div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;            <span class="comment">// modules/system/translations where it can be detected for import</span></div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;            <span class="comment">// by other non-default install profiles.</span></div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;            <span class="keywordflow">if</span> ($this-&gt;type === <span class="stringliteral">&#39;core&#39;</span>) {</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;              $profiles = <a class="code" href="group__filesystemfunctions.html#ga1c545390a8890f6ea47385f79fbe2e82">drush_scan_directory</a>($project_directory . <span class="stringliteral">&#39;/profiles&#39;</span>, <span class="stringliteral">&#39;/.*/&#39;</span>, array(), 0, FALSE, <span class="stringliteral">&#39;filename&#39;</span>, 0, TRUE);</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;              <span class="keywordflow">foreach</span> ($profiles as $profile) {</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;                <span class="keywordflow">if</span> (is_dir($project_directory . <span class="stringliteral">&#39;/profiles/&#39;</span> . $profile-&gt;basename)) {</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;                  <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($project_directory . <span class="stringliteral">&#39;/profiles/&#39;</span> . $profile-&gt;basename . <span class="stringliteral">&#39;/translations&#39;</span>);</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;                  <a class="code" href="group__filesystemfunctions.html#ga1d86ac8e2e56a75acb0abcdc8e0dcf09">drush_copy_dir</a>($filename, $project_directory . <span class="stringliteral">&#39;/profiles/&#39;</span> . $profile-&gt;basename . <span class="stringliteral">&#39;/translations/&#39;</span> . $langcode . <span class="stringliteral">&#39;.po&#39;</span>);</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;                }</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;              }</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;              <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($project_directory . <span class="stringliteral">&#39;/modules/system/translations&#39;</span>);</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;              <a class="code" href="group__filesystemfunctions.html#ga1d86ac8e2e56a75acb0abcdc8e0dcf09">drush_copy_dir</a>($filename, $project_directory . <span class="stringliteral">&#39;/modules/system/translations/&#39;</span> . $langcode . <span class="stringliteral">&#39;.po&#39;</span>);</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;            }</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;              <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($project_directory . <span class="stringliteral">&#39;/translations&#39;</span>);</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;              <a class="code" href="group__filesystemfunctions.html#ga1d86ac8e2e56a75acb0abcdc8e0dcf09">drush_copy_dir</a>($filename, $project_directory . <span class="stringliteral">&#39;/translations/&#39;</span> . $langcode . <span class="stringliteral">&#39;.po&#39;</span>, FILE_EXISTS_OVERWRITE);</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;            }</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;          }</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;          <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;            $failed[] = $langcode;</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;          }</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;        }</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;        <span class="keywordflow">if</span> (empty($failed)) {</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;          <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<span class="stringliteral">&#39;All translations downloaded for &#39;</span> . $this-&gt;name, LogLevel::OK);</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;        }</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;        <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;          <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<span class="stringliteral">&#39;Unable to download translations for &#39;</span> . $this-&gt;name . <span class="stringliteral">&#39;: &#39;</span> . implode(<span class="stringliteral">&#39;, &#39;</span>, $failed), LogLevel::WARNING);</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;        }</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;      }</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;    }</div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;  }</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;<span class="comment">   * Generate the proper path for this project type.</span></div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;<span class="comment">   * @param boolean $base</span></div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;<span class="comment">   *   Whether include the base part (tmp dir). Defaults to TRUE.</span></div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00516"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a825d48df1bdb0d0d0e46992e175909af">  516</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a825d48df1bdb0d0d0e46992e175909af">generatePath</a>($base = TRUE) {</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;    $path = array();</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;    <span class="keywordflow">if</span> ($base) {</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;      $path[] = <a class="code" href="make_8utilities_8inc.html#ab3c72a6d8be958f40fc0cbcca29a183b">make_tmp</a>();</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;      $path[] = <span class="stringliteral">&#39;__build__&#39;</span>;</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;    }</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;    <span class="keywordflow">if</span> (!empty($this-&gt;contrib_destination)) {</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;      $path[] = $this-&gt;contrib_destination;</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;    }</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;    <span class="keywordflow">if</span> (!empty($this-&gt;subdir)) {</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;      $path[] = $this-&gt;subdir;</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;    }</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;    <span class="keywordflow">return</span> implode(<span class="charliteral">&#39;/&#39;</span>, $path);</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;  }</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;<span class="comment">   * Return the proper path for dependencies to be placed in.</span></div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;<span class="comment">   *</span></div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;<span class="comment">   * @return string</span></div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;<span class="comment">   *   The path that dependencies will be placed in.</span></div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00537"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#aa52bc2ea2b9c76a9564d78e7af48452a">  537</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#aa52bc2ea2b9c76a9564d78e7af48452a">buildPath</a>($directory) {</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;    <span class="keywordflow">return</span> $this-&gt;base_contrib_destination;</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;  }</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;<span class="comment">   * Recurse to process additional makefiles that may be found during</span></div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;<span class="comment">   * processing.</span></div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00545"></a><span class="lineno"><a class="code" href="classDrushMakeProject.html#a14e2e297d82eea0e5bd316255d092da8">  545</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject.html#a14e2e297d82eea0e5bd316255d092da8">recurse</a>($path) {</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;    <span class="keywordflow">if</span> (!$this-&gt;do_recursion || <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;no-recursion&#39;</span>)) {</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;      <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Preventing recursive makefile parsing for !project&quot;</span>,</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;                array(<span class="stringliteral">&quot;!project&quot;</span> =&gt; $this-&gt;name)), LogLevel::INFO);</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;      <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;    }</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;    $candidates = array(</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;      $this-&gt;name . <span class="stringliteral">&#39;.make.yml&#39;</span>,</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;      $this-&gt;name . <span class="stringliteral">&#39;.make&#39;</span>,</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;      <span class="stringliteral">&#39;drupal-org.make.yml&#39;</span>,</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;      <span class="stringliteral">&#39;drupal-org.make&#39;</span>,</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    );</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;    $makefile = FALSE;</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;    <span class="keywordflow">foreach</span> ($candidates as $filename) {</div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;      <span class="keywordflow">if</span> (file_exists($this-&gt;download_location . <span class="charliteral">&#39;/&#39;</span> . $filename)) {</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;        $makefile = $this-&gt;download_location . <span class="charliteral">&#39;/&#39;</span> . $filename;</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;      }</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;    }</div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;</div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;    <span class="keywordflow">if</span> (!$makefile) {</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;      <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    }</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Found makefile: !makefile&quot;</span>, array(<span class="stringliteral">&quot;!makefile&quot;</span> =&gt; basename($makefile))), LogLevel::OK);</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;    <span class="comment">// Save the original state of the &#39;custom&#39; context.</span></div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;    $custom_context = &amp;<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;custom&#39;</span>);</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;    $original_custom_context_values = $custom_context;</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;    $info = <a class="code" href="make_8utilities_8inc.html#a4b0a7538764f23e358e9441aa1b4231c">make_parse_info_file</a>($makefile, TRUE, $this-&gt;options);</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;    <span class="keywordflow">if</span> (!($info = <a class="code" href="make_8utilities_8inc.html#a6be8755a0ea68b9198e1e8cebbccff89">make_validate_info_file</a>($info))) {</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;      $result = FALSE;</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    }</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;      <span class="comment">// Inherit the translations specified in the extender makefile.</span></div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;      <span class="keywordflow">if</span> (!empty($this-&gt;translations)) {</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;        $info[<span class="stringliteral">&#39;translations&#39;</span>] = $this-&gt;translations;</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;      }</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;      <span class="comment">// Strip out any modules that have already been processed before this.</span></div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;      <span class="keywordflow">foreach</span> ($this-&gt;manifest as $name) {</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        unset($info[<span class="stringliteral">&#39;projects&#39;</span>][$name]);</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;      }</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;      $build_path = $this-&gt;<a class="code" href="classDrushMakeProject.html#aa52bc2ea2b9c76a9564d78e7af48452a">buildPath</a>($this-&gt;name);</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;      <a class="code" href="make_8drush_8inc.html#a7f6c382e030da87fc401f133edd22f3b">make_projects</a>(TRUE, trim($build_path, <span class="charliteral">&#39;/&#39;</span>), $info, $this-&gt;build_path, $this-&gt;download_location);</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;      <a class="code" href="make_8drush_8inc.html#ae70f3ae23a4dcbb5f8816636d2adb4c2">make_libraries</a>(TRUE, trim($build_path, <span class="charliteral">&#39;/&#39;</span>), $info, $this-&gt;build_path, $this-&gt;download_location);</div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;      $result = TRUE;</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;    }</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;    <span class="comment">// Restore original &#39;custom&#39; context so that any</span></div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;    <span class="comment">// settings changes made are used.</span></div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;    $custom_context = $original_custom_context_values;</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    <span class="keywordflow">return</span> $result;</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;  }</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;}</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;<span class="comment"> * For processing Drupal core projects.</span></div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00604"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Core.html">  604</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject__Core.html">DrushMakeProject_Core</a> <span class="keyword">extends</span> <a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {<span class="comment"></span></div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;<span class="comment">   * Override constructor for core to adjust project info.</span></div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00608"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Core.html#a463cd38dd5917f7ad59724a33149aa71">  608</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Core.html#a463cd38dd5917f7ad59724a33149aa71">__construct</a>(&amp;$project) {</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;    <a class="code" href="classDrushMakeProject__Core.html#a463cd38dd5917f7ad59724a33149aa71">parent::__construct</a>($project);</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;    <span class="comment">// subdir and contrib_destination are not allowed for core.</span></div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;    $this-&gt;subdir = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;    $this-&gt;contrib_destination = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;  }</div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;<span class="comment">   * Determine the location to download project to.</span></div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00618"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Core.html#aeeeab034aff41fb288b7cd03cdab50db">  618</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Core.html#aeeeab034aff41fb288b7cd03cdab50db">findDownloadLocation</a>() {</div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    $this-&gt;path = $this-&gt;download_location = $this-&gt;<a class="code" href="classDrushMakeProject.html#a825d48df1bdb0d0d0e46992e175909af">generatePath</a>();</div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;    $this-&gt;project_directory = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;    <span class="keywordflow">if</span> (is_dir($this-&gt;download_location)) {</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;MAKE_DIRECTORY_EXISTS&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Directory not empty: !directory&#39;</span>, array(<span class="stringliteral">&#39;!directory&#39;</span> =&gt; $this-&gt;download_location)));</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;    }</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;    elseif ($this-&gt;<a class="code" href="classDrushMakeProject.html#adc718e2716fac54db68234aabb432e49">download</a>[<span class="stringliteral">&#39;type&#39;</span>] === <span class="stringliteral">&#39;pm&#39;</span>) {</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;      <span class="comment">// pm-download will create the final __build__ directory, so nothing to do</span></div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;      <span class="comment">// here.</span></div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;    }</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;      <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($this-&gt;download_location);</div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;    }</div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="classDrushMakeProject.html#a43efbf973ece5fbab01fb59b80267e3e">$this-&gt;download_location</a>;</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;  }</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;}</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;<span class="comment"> * For processing libraries.</span></div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00638"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Library.html">  638</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject__Library.html">DrushMakeProject_Library</a> <span class="keyword">extends</span> <a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {<span class="comment"></span></div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;<span class="comment">   * Override constructor for libraries to properly set contrib destination.</span></div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00642"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Library.html#a7ed83f5275292b1f10310b1cd8a8731a">  642</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Library.html#a7ed83f5275292b1f10310b1cd8a8731a">__construct</a>(&amp;$project) {</div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;    <a class="code" href="classDrushMakeProject__Library.html#a7ed83f5275292b1f10310b1cd8a8731a">parent::__construct</a>($project);</div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;    <span class="comment">// Allow libraries to specify where they should live in the build path.</span></div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;    <span class="keywordflow">if</span> (isset($project[<span class="stringliteral">&#39;destination&#39;</span>])) {</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;      $project_path = $project[<span class="stringliteral">&#39;destination&#39;</span>];</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;    }</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;      $project_path = <span class="stringliteral">&#39;libraries&#39;</span>;</div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;    }</div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;</div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;    $this-&gt;contrib_destination = ($this-&gt;base_contrib_destination != <span class="charliteral">&#39;.&#39;</span> ? $this-&gt;base_contrib_destination . <span class="charliteral">&#39;/&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) . $project_path;</div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;  }</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;<span class="comment">   * No recursion for libraries, sorry :-(</span></div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00658"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Library.html#acaaade1f2104694fbd741384e6b26677">  658</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Library.html#acaaade1f2104694fbd741384e6b26677">recurse</a>($path) {</div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;    <span class="comment">// Return TRUE so that processing continues in the make() method.</span></div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;  }</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;<span class="comment">   * No translations for libraries.</span></div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00666"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Library.html#a448567dd70e40d8ff0c266af5370b8c5">  666</a></span>&#160;  <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Library.html#a448567dd70e40d8ff0c266af5370b8c5">getTranslations</a>(<a class="code" href="classDrushMakeProject.html#a43efbf973ece5fbab01fb59b80267e3e">$download_location</a>) {</div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;    <span class="comment">// Return TRUE so that processing continues in the make() method.</span></div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;  }</div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;}</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;<span class="comment"> * For processing modules.</span></div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00675"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Module.html">  675</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject__Module.html">DrushMakeProject_Module</a> <span class="keyword">extends</span> <a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {<span class="comment"></span></div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;<span class="comment">   * Override constructor for modules to properly set contrib destination.</span></div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00679"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Module.html#ab61b1d4cc96eab3eae4fbdb020fe6257">  679</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Module.html#ab61b1d4cc96eab3eae4fbdb020fe6257">__construct</a>(&amp;$project) {</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;    <a class="code" href="classDrushMakeProject__Module.html#ab61b1d4cc96eab3eae4fbdb020fe6257">parent::__construct</a>($project);</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;    $this-&gt;contrib_destination = ($this-&gt;base_contrib_destination != <span class="charliteral">&#39;.&#39;</span> ? $this-&gt;base_contrib_destination . <span class="charliteral">&#39;/&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) . <span class="stringliteral">&#39;modules&#39;</span>;</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;  }</div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;}</div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;<span class="comment"> * For processing installation profiles.</span></div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00688"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Profile.html">  688</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject__Profile.html">DrushMakeProject_Profile</a> <span class="keyword">extends</span> <a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {<span class="comment"></span></div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;<span class="comment">   * Override contructor for installation profiles to properly set contrib</span></div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;<span class="comment">   * destination.</span></div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00693"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Profile.html#a30277a454441c4f87953baca9acee2d6">  693</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Profile.html#a30277a454441c4f87953baca9acee2d6">__construct</a>(&amp;$project) {</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;    <a class="code" href="classDrushMakeProject__Profile.html#a30277a454441c4f87953baca9acee2d6">parent::__construct</a>($project);</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;    $this-&gt;contrib_destination = (!empty($this-&gt;destination) ? $this-&gt;destination : <span class="stringliteral">&#39;profiles&#39;</span>);</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;  }</div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;<span class="comment">   * Find the build path.</span></div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00701"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Profile.html#a5f672c7364dddda78f966897a33a86ae">  701</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Profile.html#a5f672c7364dddda78f966897a33a86ae">buildPath</a>($directory) {</div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;    <span class="keywordflow">return</span> $this-&gt;<a class="code" href="classDrushMakeProject.html#a825d48df1bdb0d0d0e46992e175909af">generatePath</a>(FALSE) . <span class="charliteral">&#39;/&#39;</span> . $directory;</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;  }</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;}</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;<span class="comment"> * For processing themes.</span></div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00709"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Theme.html">  709</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject__Theme.html">DrushMakeProject_Theme</a> <span class="keyword">extends</span> <a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {<span class="comment"></span></div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;<span class="comment">   * Override contructor for themes to properly set contrib destination.</span></div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00713"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Theme.html#ac5d43e70207c544020f56f5f81fabbc9">  713</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Theme.html#ac5d43e70207c544020f56f5f81fabbc9">__construct</a>(&amp;$project) {</div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;    <a class="code" href="classDrushMakeProject__Theme.html#ac5d43e70207c544020f56f5f81fabbc9">parent::__construct</a>($project);</div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;    $this-&gt;contrib_destination = ($this-&gt;base_contrib_destination != <span class="charliteral">&#39;.&#39;</span> ? $this-&gt;base_contrib_destination . <span class="charliteral">&#39;/&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) . <span class="stringliteral">&#39;themes&#39;</span>;</div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;  }</div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;}</div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;<span class="comment"> * For processing translations.</span></div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00722"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Translation.html">  722</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDrushMakeProject__Translation.html">DrushMakeProject_Translation</a> <span class="keyword">extends</span> <a class="code" href="classDrushMakeProject.html">DrushMakeProject</a> {<span class="comment"></span></div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;<span class="comment">  /**</span></div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;<span class="comment">   * Override constructor for translations to properly set contrib destination.</span></div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00726"></a><span class="lineno"><a class="code" href="classDrushMakeProject__Translation.html#a944f226bec6ee1adf1aa96f59eb4b69c">  726</a></span>&#160;  <span class="keyword">protected</span> <span class="keyword">function</span> <a class="code" href="classDrushMakeProject__Translation.html#a944f226bec6ee1adf1aa96f59eb4b69c">__construct</a>(&amp;$project) {</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;    <a class="code" href="classDrushMakeProject__Translation.html#a944f226bec6ee1adf1aa96f59eb4b69c">parent::__construct</a>($project);</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    <span class="keywordflow">switch</span> ($project[<span class="stringliteral">&#39;core&#39;</span>]) {</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;      <span class="keywordflow">case</span> <span class="stringliteral">&#39;5.x&#39;</span>:</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;        <span class="comment">// Don&#39;t think there&#39;s an automatic place we can put 5.x translations,</span></div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;        <span class="comment">// so we&#39;ll toss them in a translations directory in the Drupal root.</span></div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;        $this-&gt;contrib_destination = ($this-&gt;base_contrib_destination != <span class="charliteral">&#39;.&#39;</span> ? $this-&gt;base_contrib_destination . <span class="charliteral">&#39;/&#39;</span> : <span class="stringliteral">&#39;&#39;</span>) . <span class="stringliteral">&#39;translations&#39;</span>;</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;      <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;        $this-&gt;contrib_destination = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;    }</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;  }</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 2 2016 07:28:56 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>