Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Adding build instructions #39

Merged
merged 1 commit into from
Apr 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,27 @@
</phingcall>
</target>

<!-- Meetup Bundle -->
<target name="release_meetup" description="Releases a new version">
<propertyprompt propertyName="version" defaultValue="invalid-version"
promptText="Which version do you wish to tag? (do not include a 'v')" />

<phingcall target="split_meetup" />

<phingcall target="tag_release">
<property name="tagVersion" value="${version}"/>
<property name="repoDir" value="Bundle/MeetupApiBundle" override="true"/>
</phingcall>
</target>

<target name="split_meetup" description="Does a Sub-Tree split for Meetup Bundle">
<phingcall target="split_repository">
<property name="splitTargetDir" value="Bundle/MeetupApiBundle" />
<property name="splitFilterDir" value="src/DMS/Bundle/MeetupApiBundle" />
<property name="splitTargetRepo" value="git@github.com:rdohms/DMSMeetupApiBundle.git" />
</phingcall>
</target>

<!-- Laucher Bundle -->
<!-- TODO -->

Expand Down
32 changes: 30 additions & 2 deletions src/DMS/Bundle/MeetupApiBundle/Service/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class ClientFactory
const CLIENT_KEY = 'key';
const CLIENT_OAUTH = 'oauth';

const SESSION_TOKEN_KEY = 'meetup_token';
const SESSION_TOKEN_SECRET_KEY = 'meetup_token_secret';
/**
* @var SessionInterface
*/
Expand Down Expand Up @@ -73,12 +75,38 @@ public function getOauthClient($forceNew = false)
*/
public function getUpdatedOauthConfig()
{
$token = $this->session->has('meetup_token')? $this->session->get('meetup_token') : null;
$tokenSecret = $this->session->has('meetup_token_secret')? $this->session->get('meetup_token_secret') : null;
$token = $this->session->has(self::SESSION_TOKEN_KEY)
? $this->session->get(self::SESSION_TOKEN_KEY)
: false;

$tokenSecret = $this->session->has(self::SESSION_TOKEN_SECRET_KEY)
? $this->session->get(self::SESSION_TOKEN_SECRET_KEY)
: false;

return array_merge(
array('token' => $token, 'token_secret' => $tokenSecret),
$this->config
);
}

/**
* Set the necessary token in the session for future OAuth Clients
*
* @param string $token
* @param string $tokenSecret
*/
public function setSessionTokens($token, $tokenSecret = null)
{
$this->session->set(self::SESSION_TOKEN_KEY, $token);
$this->session->set(self::SESSION_TOKEN_SECRET_KEY, $tokenSecret);
}

/**
* Removes tokens from session
*/
public function clearSessionTokens()
{
$this->session->remove(self::SESSION_TOKEN_KEY);
$this->session->remove(self::SESSION_TOKEN_SECRET_KEY);
}
}