<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>√-1 ♥ PROGRAMMING &#187; PHP5</title>
	<atom:link href="http://umut.mobi/blog/category/server-side/php5/feed/" rel="self" type="application/rss+xml" />
	<link>http://umut.mobi/blog</link>
	<description>by Umut Aydin</description>
	<lastBuildDate>Fri, 06 Aug 2010 13:12:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>GittiGidiyor API Client for Symfony Framework</title>
		<link>http://umut.mobi/blog/2010/07/15/gittigidiyor-api-client-for-symfony-framework/</link>
		<comments>http://umut.mobi/blog/2010/07/15/gittigidiyor-api-client-for-symfony-framework/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 16:58:33 +0000</pubDate>
		<dc:creator>Umut</dc:creator>
				<category><![CDATA[PHP5]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Client]]></category>
		<category><![CDATA[GittiGidiyor]]></category>
		<category><![CDATA[Symfony Framework]]></category>

		<guid isPermaLink="false">http://umut.mobi/blog/?p=38</guid>
		<description><![CDATA[GittiGidiyor.com provides an API to make online business. You can find more information at Developer&#8217;s Website. Here, I want to make some modifications on their PHP client to make it suitable with Symfony Framework. I prefer to use version 1.4 but it also works with older versions. Please, add these settings to your app.yml: all: [...]]]></description>
			<content:encoded><![CDATA[<p>GittiGidiyor.com provides an API to make online business. You can find more information at <a href="http://dev.gittigidiyor.com/araclar-dokumanlar" rel="no-follow">Developer&#8217;s Website</a>.</p>
<p>Here, I want to make some modifications on their PHP client to make it suitable with <strong>Symfony Framework</strong>. I prefer to use version 1.4 but it also works with older versions.</p>
<p>Please, add these settings to your <em>app.yml</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">all:
    gittigidiyor:
        apiKey: APPLICATION-KEY
        secretKey: SECRET-KEY
        nick: NICK
        password: PASSWORD
        authUser: AUTHENTICATION-USERNAME
        authPass: AUTHENTICATION-PASSWORD
        lang: LANGUAGE</pre></div></div>

<p>Now, we can reach them via <em>sfConfig::get().</em> This way is better than INI file while you&#8217;re working with Symfony Framework.</p>
<p>You can download the code at <a href="http://github.com/umaydin/sfGGClient/blob/master/sfGGClient.class.php">Github</a>. By the way, I have modified only <em>__construct</em> method. If you want to make this modification yourself please replace the original <em>__construct</em> with the code below:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">apiKey</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_apiKey'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">secretKey</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_secretKey'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nick</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_nick'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">auth_user</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_authUser'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">auth_pass</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_authPass'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lang</span> <span style="color: #339933;">=</span> sfConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'app_gittigidiyor_lang'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$usec</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sec</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">time</span> <span style="color: #339933;">=</span> <span style="color: #990000;">round</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>float<span style="color: #009900;">&#41;</span><span style="color: #000088;">$usec</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>float<span style="color: #009900;">&#41;</span><span style="color: #000088;">$sec</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'0'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sign</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">apiKey</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">secretKey</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://umut.mobi/blog/2010/07/15/gittigidiyor-api-client-for-symfony-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
