Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console-core / src / Utils / DrupalFinder.php
1 <?php
2
3 /**
4  * @file
5  * Contains Drupal\Console\Core\Utils\DrupalFinder.
6  */
7
8 namespace Drupal\Console\Core\Utils;
9
10 use DrupalFinder\DrupalFinder as DrupalFinderBase;
11
12 /**
13  * Class DrupalFinder
14  *
15  * @package Drupal\Console\Core\Utils
16  */
17 class DrupalFinder extends DrupalFinderBase
18 {
19     public function locateRoot($start_path)
20     {
21         if (parent::locateRoot($start_path)) {
22             $composerRoot = $this->getComposerRoot();
23             $vendorDir = str_replace(
24                 $composerRoot .'/', '', $this->getVendorDir()
25             );
26             if (!defined("DRUPAL_CONSOLE_CORE")) {
27                 define(
28                     "DRUPAL_CONSOLE_CORE",
29                     "/{$vendorDir}/drupal/console-core/"
30                 );
31             }
32             if (!defined("DRUPAL_CONSOLE")) {
33                 define("DRUPAL_CONSOLE", "/{$vendorDir}/drupal/console/");
34             }
35             if (!defined("DRUPAL_CONSOLE_LANGUAGE")) {
36                 define(
37                     "DRUPAL_CONSOLE_LANGUAGE",
38                     "/{$vendorDir}/drupal/console-%s/translations/"
39                 );
40             }
41
42             return true;
43         }
44
45         return false;
46     }
47 }