forked from hechoendrupal/drupal-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix constant definition (hechoendrupal#160)
* [console] Remove constants.php file. * [console] Extend DrupalFinder class. * [console] Fix docblock.
- Loading branch information
Showing
3 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Contains Drupal\Console\Core\Utils\DrupalFinder. | ||
*/ | ||
|
||
namespace Drupal\Console\Core\Utils; | ||
|
||
use DrupalFinder\DrupalFinder as DrupalFinderBase; | ||
|
||
/** | ||
* Class DrupalFinder | ||
* | ||
* @package Drupal\Console\Core\Utils | ||
*/ | ||
class DrupalFinder extends DrupalFinderBase | ||
{ | ||
public function locateRoot($start_path) | ||
{ | ||
if (parent::locateRoot($start_path)) { | ||
$composerRoot = $this->getComposerRoot(); | ||
$vendorDir = str_replace( | ||
$composerRoot .'/', '', $this->getVendorDir() | ||
); | ||
if (!defined("DRUPAL_CONSOLE_CORE")) { | ||
define( | ||
"DRUPAL_CONSOLE_CORE", | ||
"/{$vendorDir}/drupal/console-core/" | ||
); | ||
} | ||
if (!defined("DRUPAL_CONSOLE")) { | ||
define("DRUPAL_CONSOLE", "/{$vendorDir}/drupal/console/"); | ||
} | ||
if (!defined("DRUPAL_CONSOLE_LANGUAGE")) { | ||
define( | ||
"DRUPAL_CONSOLE_LANGUAGE", | ||
"/{$vendorDir}/drupal/console-%s/translations/" | ||
); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.