Skip to content

Commit

Permalink
New extension system: Add ProfileName* classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed May 10, 2016
1 parent 21bb192 commit fac787d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
@@ -0,0 +1,12 @@
<?php

namespace Drupal\Core\Extension\ProfileName;

interface ProfileNameInterface {

/**
* @return string|null
*/
public function getProfileName();

}
@@ -0,0 +1,13 @@
<?php

namespace Drupal\Core\Extension\ProfileName;

class ProfileName_DrupalGetProfile implements ProfileNameInterface {

/**
* @return string|null
*/
public function getProfileName() {
return drupal_get_profile() ?: NULL;
}
}
25 changes: 25 additions & 0 deletions core/lib/Drupal/Core/Extension/ProfileName/ProfileName_Static.php
@@ -0,0 +1,25 @@
<?php

namespace Drupal\Core\Extension\ProfileName;

class ProfileName_Static implements ProfileNameInterface {

/**
* @var string
*/
private $profileName;

/**
* @param string $profileName
*/
public function __construct($profileName) {
$this->profileName = $profileName;
}

/**
* @return string|null
*/
public function getProfileName() {
return $this->profileName;
}
}

0 comments on commit fac787d

Please sign in to comment.