Skip to content

Commit

Permalink
fixed bug that did not validate api details before updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Shipley committed Aug 27, 2013
1 parent f61ecbe commit 3b0ff60
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 142 deletions.
24 changes: 12 additions & 12 deletions docs/class-ApiAxle.Shared.Config.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h1>Class Config</h1>
<b>Author:</b>
Phillip Shipley &lt;<a
href="mailto:phillip&#64;phillipshipley.com">phillip&#64;<!---->phillipshipley.com</a>&gt;<br />
<b>Located at</b> <a href="source-class-ApiAxle.Shared.Config.html#10-174" title="Go to source code">src/ApiAxle/Shared/Config.php</a><br />
<b>Located at</b> <a href="source-class-ApiAxle.Shared.Config.html#10-178" title="Go to source code">src/ApiAxle/Shared/Config.php</a><br />
</div>


Expand All @@ -144,7 +144,7 @@ <h1>Class Config</h1>

<td class="name"><div>
<a class="anchor" href="#___construct">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#44-62" title="Go to source code">__construct</a>( <span>array <var>$config</var> = <span class="php-keyword1">array</span>()</span> )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#44-66" title="Go to source code">__construct</a>( <span>array <var>$config</var> = <span class="php-keyword1">array</span>()</span> )</code>

<div class="description short">

Expand Down Expand Up @@ -184,7 +184,7 @@ <h4>Parameters</h4>

<td class="name"><div>
<a class="anchor" href="#_setConfg">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#64-74" title="Go to source code">setConfg</a>( <span>array <var>$config</var></span> )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#68-78" title="Go to source code">setConfg</a>( <span>array <var>$config</var></span> )</code>

<div class="description short">

Expand Down Expand Up @@ -222,7 +222,7 @@ <h4>Parameters</h4>

<td class="name"><div>
<a class="anchor" href="#_getConfig">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#76-88" title="Go to source code">getConfig</a>( )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#80-92" title="Go to source code">getConfig</a>( )</code>

<div class="description short">

Expand Down Expand Up @@ -259,7 +259,7 @@ <h4>Returns</h4>

<td class="name"><div>
<a class="anchor" href="#_loadConfigFile">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#90-108" title="Go to source code">loadConfigFile</a>( <span>string <var>$file</var> = <span class="php-keyword1">false</span></span> )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#94-112" title="Go to source code">loadConfigFile</a>( <span>string <var>$file</var> = <span class="php-keyword1">false</span></span> )</code>

<div class="description short">

Expand Down Expand Up @@ -307,7 +307,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_getEndpoint">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#110-113" title="Go to source code">getEndpoint</a>( )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#114-117" title="Go to source code">getEndpoint</a>( )</code>

<div class="description short">

Expand Down Expand Up @@ -336,7 +336,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_setEndpoint">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#115-129" title="Go to source code">setEndpoint</a>( <span>mixed <var>$endpoint</var></span> )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#119-133" title="Go to source code">setEndpoint</a>( <span>mixed <var>$endpoint</var></span> )</code>

<div class="description short">

Expand Down Expand Up @@ -365,7 +365,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_getKey">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#131-134" title="Go to source code">getKey</a>( )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#135-138" title="Go to source code">getKey</a>( )</code>

<div class="description short">

Expand Down Expand Up @@ -394,7 +394,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_setKey">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#136-139" title="Go to source code">setKey</a>( <span>mixed <var>$key</var></span> )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#140-143" title="Go to source code">setKey</a>( <span>mixed <var>$key</var></span> )</code>

<div class="description short">

Expand Down Expand Up @@ -423,7 +423,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_getSecret">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#141-144" title="Go to source code">getSecret</a>( )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#145-148" title="Go to source code">getSecret</a>( )</code>

<div class="description short">

Expand Down Expand Up @@ -452,7 +452,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_setSecret">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#146-149" title="Go to source code">setSecret</a>( <span>mixed <var>$secret</var></span> )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#150-153" title="Go to source code">setSecret</a>( <span>mixed <var>$secret</var></span> )</code>

<div class="description short">

Expand Down Expand Up @@ -481,7 +481,7 @@ <h4>Throws</h4>

<td class="name"><div>
<a class="anchor" href="#_getSignature">#</a>
<code><a href="source-class-ApiAxle.Shared.Config.html#151-172" title="Go to source code">getSignature</a>( )</code>
<code><a href="source-class-ApiAxle.Shared.Config.html#155-176" title="Go to source code">getSignature</a>( )</code>

<div class="description short">

Expand Down
6 changes: 3 additions & 3 deletions docs/source-class-ApiAxle.Api.Api.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ <h3>Classes</h3>
</span><span id="234" class="l"><a class="l" href="#234">234: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>, <span class="php-quote">'GET'</span>, <span class="php-var">$params</span>, <span class="php-var">$this</span>-&gt;getConfig());
</span><span id="235" class="l"><a class="l" href="#235">235: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
</span><span id="236" class="l"><a class="l" href="#236">236: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$request</span> <span class="php-keyword1">as</span> <span class="php-var">$name</span> =&gt; <span class="php-var">$data</span>){
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-var">$api</span> = <span class="php-keyword1">new</span> Api();
</span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-var">$api</span> = <span class="php-keyword1">new</span> Api(<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="238" class="l"><a class="l" href="#238">238: </a> <span class="php-var">$api</span>-&gt;setName(<span class="php-var">$name</span>);
</span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-var">$api</span>-&gt;setData(<span class="php-var">$data</span>);
</span><span id="240" class="l"><a class="l" href="#240">240: </a> <span class="php-var">$apiList</span>-&gt;addItem(<span class="php-var">$api</span>);
Expand Down Expand Up @@ -370,7 +370,7 @@ <h3>Classes</h3>
</span></span><span id="273" class="l"><a class="l" href="#273">273: </a><span class="php-comment"> */</span>
</span><span id="274" class="l"><a class="l" href="#274">274: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_update" href="#_update">update</a>(<span class="php-var">$data</span>)
</span><span id="275" class="l"><a class="l" href="#275">275: </a> {
</span><span id="276" class="l"><a class="l" href="#276">276: </a> <span class="php-keyword1">if</span>(!<span class="php-keyword2">is_null</span>(<span class="php-var">$this</span>-&gt;getName())){
</span><span id="276" class="l"><a class="l" href="#276">276: </a> <span class="php-keyword1">if</span>(!<span class="php-keyword2">is_null</span>(<span class="php-var">$this</span>-&gt;getName()) &amp;&amp; <span class="php-var">$this</span>-&gt;isValid()){
</span><span id="277" class="l"><a class="l" href="#277">277: </a> <span class="php-var">$apiPath</span> = <span class="php-quote">'api/'</span>.<span class="php-var">$this</span>-&gt;getName();
</span><span id="278" class="l"><a class="l" href="#278">278: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>,<span class="php-quote">'PUT'</span>,<span class="php-var">$data</span>,<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="279" class="l"><a class="l" href="#279">279: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
Expand Down Expand Up @@ -506,7 +506,7 @@ <h3>Classes</h3>
</span><span id="409" class="l"><a class="l" href="#409">409: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>, <span class="php-quote">'GET'</span>, <span class="php-var">$data</span>,<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="410" class="l"><a class="l" href="#410">410: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
</span><span id="411" class="l"><a class="l" href="#411">411: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$request</span> <span class="php-keyword1">as</span> <span class="php-var">$item</span> =&gt; <span class="php-var">$value</span>){
</span><span id="412" class="l"><a class="l" href="#412">412: </a> <span class="php-var">$key</span> = <span class="php-keyword1">new</span> <span class="php-keyword2">Key</span>();
</span><span id="412" class="l"><a class="l" href="#412">412: </a> <span class="php-var">$key</span> = <span class="php-keyword1">new</span> <span class="php-keyword2">Key</span>(<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="413" class="l"><a class="l" href="#413">413: </a> <span class="php-var">$key</span>-&gt;setKey(<span class="php-var">$item</span>);
</span><span id="414" class="l"><a class="l" href="#414">414: </a> <span class="php-var">$key</span>-&gt;setData(<span class="php-var">$value</span>);
</span><span id="415" class="l"><a class="l" href="#415">415: </a> <span class="php-var">$keyList</span>-&gt;addItem(<span class="php-var">$key</span>);
Expand Down
6 changes: 3 additions & 3 deletions docs/source-class-ApiAxle.Api.Key.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ <h3>Classes</h3>
</span></span><span id="257" class="l"><a class="l" href="#257">257: </a><span class="php-comment"> */</span>
</span><span id="258" class="l"><a class="l" href="#258">258: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_update" href="#_update">update</a>(<span class="php-var">$data</span>)
</span><span id="259" class="l"><a class="l" href="#259">259: </a> {
</span><span id="260" class="l"><a class="l" href="#260">260: </a> <span class="php-keyword1">if</span>(!<span class="php-keyword2">is_null</span>(<span class="php-var">$this</span>-&gt;getKey())){
</span><span id="260" class="l"><a class="l" href="#260">260: </a> <span class="php-keyword1">if</span>(!<span class="php-keyword2">is_null</span>(<span class="php-var">$this</span>-&gt;getKey()) &amp;&amp; <span class="php-var">$this</span>-&gt;isValid()){
</span><span id="261" class="l"><a class="l" href="#261">261: </a> <span class="php-var">$apiPath</span> = <span class="php-quote">'key/'</span>.<span class="php-var">$this</span>-&gt;getKey();
</span><span id="262" class="l"><a class="l" href="#262">262: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>,<span class="php-quote">'PUT'</span>,<span class="php-var">$data</span>,<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="263" class="l"><a class="l" href="#263">263: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
Expand Down Expand Up @@ -418,7 +418,7 @@ <h3>Classes</h3>
</span><span id="321" class="l"><a class="l" href="#321">321: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>, <span class="php-quote">'GET'</span>, <span class="php-var">$params</span>, <span class="php-var">$this</span>-&gt;getConfig());
</span><span id="322" class="l"><a class="l" href="#322">322: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
</span><span id="323" class="l"><a class="l" href="#323">323: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$request</span> <span class="php-keyword1">as</span> <span class="php-var">$name</span> =&gt; <span class="php-var">$data</span>){
</span><span id="324" class="l"><a class="l" href="#324">324: </a> <span class="php-var">$key</span> = <span class="php-keyword1">new</span> <span class="php-keyword2">Key</span>();
</span><span id="324" class="l"><a class="l" href="#324">324: </a> <span class="php-var">$key</span> = <span class="php-keyword1">new</span> <span class="php-keyword2">Key</span>(<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="325" class="l"><a class="l" href="#325">325: </a> <span class="php-var">$key</span>-&gt;setKey(<span class="php-var">$name</span>);
</span><span id="326" class="l"><a class="l" href="#326">326: </a> <span class="php-var">$key</span>-&gt;setData(<span class="php-var">$data</span>);
</span><span id="327" class="l"><a class="l" href="#327">327: </a> <span class="php-var">$keyList</span>-&gt;addItem(<span class="php-var">$key</span>);
Expand Down Expand Up @@ -447,7 +447,7 @@ <h3>Classes</h3>
</span><span id="350" class="l"><a class="l" href="#350">350: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>, <span class="php-quote">'GET'</span>, <span class="php-var">$data</span>, <span class="php-var">$this</span>-&gt;getConfig());
</span><span id="351" class="l"><a class="l" href="#351">351: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
</span><span id="352" class="l"><a class="l" href="#352">352: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$request</span> <span class="php-keyword1">as</span> <span class="php-var">$name</span> =&gt; <span class="php-var">$value</span>){
</span><span id="353" class="l"><a class="l" href="#353">353: </a> <span class="php-var">$api</span> = <span class="php-keyword1">new</span> Api();
</span><span id="353" class="l"><a class="l" href="#353">353: </a> <span class="php-var">$api</span> = <span class="php-keyword1">new</span> Api(<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="354" class="l"><a class="l" href="#354">354: </a> <span class="php-var">$api</span>-&gt;setName(<span class="php-var">$name</span>);
</span><span id="355" class="l"><a class="l" href="#355">355: </a> <span class="php-var">$api</span>-&gt;setData(<span class="php-var">$value</span>);
</span><span id="356" class="l"><a class="l" href="#356">356: </a> <span class="php-var">$apiList</span>-&gt;addItem(<span class="php-var">$api</span>);
Expand Down
4 changes: 2 additions & 2 deletions docs/source-class-ApiAxle.Api.Keyring.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ <h3>Classes</h3>
</span><span id="175" class="l"><a class="l" href="#175">175: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>, <span class="php-quote">'GET'</span>, <span class="php-var">$params</span>, <span class="php-var">$this</span>-&gt;getConfig());
</span><span id="176" class="l"><a class="l" href="#176">176: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
</span><span id="177" class="l"><a class="l" href="#177">177: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$request</span> <span class="php-keyword1">as</span> <span class="php-var">$name</span> =&gt; <span class="php-var">$data</span>){
</span><span id="178" class="l"><a class="l" href="#178">178: </a> <span class="php-var">$keyring</span> = <span class="php-keyword1">new</span> Keyring();
</span><span id="178" class="l"><a class="l" href="#178">178: </a> <span class="php-var">$keyring</span> = <span class="php-keyword1">new</span> Keyring(<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="179" class="l"><a class="l" href="#179">179: </a> <span class="php-var">$keyring</span>-&gt;setName(<span class="php-var">$name</span>);
</span><span id="180" class="l"><a class="l" href="#180">180: </a> <span class="php-var">$keyring</span>-&gt;setData(<span class="php-var">$data</span>);
</span><span id="181" class="l"><a class="l" href="#181">181: </a> <span class="php-var">$keyringList</span>-&gt;addItem(<span class="php-var">$keyring</span>);
Expand Down Expand Up @@ -336,7 +336,7 @@ <h3>Classes</h3>
</span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-var">$request</span> = Utilities::callApi(<span class="php-var">$apiPath</span>, <span class="php-quote">'GET'</span>, <span class="php-var">$data</span>,<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="240" class="l"><a class="l" href="#240">240: </a> <span class="php-keyword1">if</span>(<span class="php-var">$request</span>){
</span><span id="241" class="l"><a class="l" href="#241">241: </a> <span class="php-keyword1">foreach</span>(<span class="php-var">$request</span> <span class="php-keyword1">as</span> <span class="php-var">$item</span> =&gt; <span class="php-var">$value</span>){
</span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-var">$key</span> = <span class="php-keyword1">new</span> <span class="php-keyword2">Key</span>();
</span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-var">$key</span> = <span class="php-keyword1">new</span> <span class="php-keyword2">Key</span>(<span class="php-var">$this</span>-&gt;getConfig());
</span><span id="243" class="l"><a class="l" href="#243">243: </a> <span class="php-var">$key</span>-&gt;setKey(<span class="php-var">$item</span>);
</span><span id="244" class="l"><a class="l" href="#244">244: </a> <span class="php-var">$key</span>-&gt;setData(<span class="php-var">$value</span>);
</span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-var">$keyList</span>-&gt;addItem(<span class="php-var">$key</span>);
Expand Down
Loading

0 comments on commit 3b0ff60

Please sign in to comment.