Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Drupal 8 container via extension #97

Merged
merged 20 commits into from
Dec 14, 2015
Merged

Use Drupal 8 container via extension #97

merged 20 commits into from
Dec 14, 2015

Conversation

LionsAd
Copy link
Owner

@LionsAd LionsAd commented Dec 13, 2015

This fixes #89.

BC breaks:

Before:

$definition['services']['foo'] = array('alias' => 'bar');
$factory_service = array('factory_service' => 'x', 'factory_method' => 'get');
$factory_class = array('factory_class' => 'SomeClass', 'factory_method' => 'get');

After:

$definition['aliases']['foo'] = 'bar';
$factory_service = array('factory' => array('@x', 'get'));
$factory_service = array('factory' => 'SomeClass::get');

- Aliases syntax
- Factory syntax
@drupol
Copy link
Collaborator

drupol commented Dec 13, 2015

Ok, so, now at this point, what should we do ?

@LionsAd
Copy link
Owner Author

LionsAd commented Dec 14, 2015

We need to fix the tests :)

@@ -366,7 +366,7 @@ public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER)
* {@inheritdoc}
*/
public function has($id) {
return isset($this->services[$id]) || isset($this->serviceDefinitions[$id]);
return isset($this->aliases[$id]) || isset($this->services[$id]) || isset($this->serviceDefinitions[$id]) || array_key_exists($id, $this->services);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to go upstream.

}

- $code[$key] = [$method, $arguments];
+ $code[$key] = array($method, $arguments);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot go upstream - unless with very muck luck.

'value' => $private_service,
'id' => 'private__' . $private_hash,
),
'%some_config%'
),
);
/*
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented out code found!

@LionsAd LionsAd added RTBM and removed Needs review labels Dec 14, 2015
@LionsAd
Copy link
Owner Author

LionsAd commented Dec 14, 2015

Waiting for tests to finish, then merge.

@LionsAd
Copy link
Owner Author

LionsAd commented Dec 14, 2015

Waiting for scrutinizer

LionsAd added a commit that referenced this pull request Dec 14, 2015
Use Drupal 8 container via extension
@LionsAd LionsAd merged commit 8b8e486 into 7.x-1.x Dec 14, 2015
@LionsAd LionsAd modified the milestone: 1.0.0-beta6 Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Component again and subclass / make use of Drupal 8's service container for this project :)
2 participants