Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
removed direct.api.url config parameter. Changed to get this info din…
Browse files Browse the repository at this point in the history
…amicaly on application runtime
  • Loading branch information
Otavio Fernandes committed Mar 1, 2011
1 parent 6c43f3e commit c619a16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Api/Api.php
Expand Up @@ -72,7 +72,8 @@ protected function createApi()
}

return array(
'url' => $this->container->getParameter('direct.api.url'),
'url' => $this->container->get('request')->getBaseUrl().
$this->container->getParameter('direct.api.route_pattern'),
'type' => $this->container->getParameter('direct.api.type'),
'namespace' => $this->container->getParameter('direct.api.namespace'),
'id' => $this->container->getParameter('direct.api.id'),
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/DirectExtension.php
Expand Up @@ -38,8 +38,8 @@ public function load(array $configs, ContainerBuilder $container)
*/
protected function registerApiConfiguration($config, ContainerBuilder $container)
{
if (isset($config['api']['url'])) {
$container->setParameter('direct.api.url', $config['api']['url']);
if (isset($config['api']['route_pattern'])) {
$container->setParameter('direct.api.route_pattern', $config['api']['route_pattern']);
}

if (isset($config['api']['type'])) {
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/direct.xml
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="direct.api.url">URL</parameter>
<parameter key="direct.api.route_pattern">/route</parameter>
<parameter key="direct.api.type">remoting</parameter>
<parameter key="direct.api.namespace">Actions</parameter>
<parameter key="direct.api.id">API</parameter>
Expand Down

0 comments on commit c619a16

Please sign in to comment.