Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4f69c2e
composer.json updated for Packagist submission
inakiabt Jun 24, 2013
1a98301
Updated for packagist submission
inakiabt Jun 24, 2013
131b7d4
Mmmm
inakiabt Jun 24, 2013
f93bda5
Added require all default config
inakiabt Jun 24, 2013
69af3a1
Rollback customcode import
inakiabt Jun 24, 2013
7ec0982
Missing Stackmob require
inakiabt Jun 24, 2013
da6e568
Better erro handling
inakiabt Jul 6, 2013
1b165fa
Bugfix: request result object is empty
inakiabt Jul 10, 2013
8065cc0
Removed default StackMob log4php configuration
inakiabt Jul 11, 2013
4105ca4
Merge branch 'master' of /Users/Ina/Documents/ProductGram/src/pg-work…
inakiabt Jul 12, 2013
4860057
Add push notifications
inakiabt Aug 6, 2013
4a30674
Update composer.json
inakiabt Aug 8, 2013
f470b47
Composer updated
Aug 20, 2013
c2d005d
Apache Log4PHP removed.
Aug 21, 2013
8d67a83
Merge branch 'log4php-removed'
Aug 21, 2013
7372cdf
OAuth library changed.
Aug 21, 2013
4db31ae
Fixed OAuth namespace usage.
Aug 21, 2013
d98934e
Namespace fixed in composer. Namespace conflict fixed in Rest.php
Aug 21, 2013
31065cc
Namespaces references added.
Aug 21, 2013
49921c4
Missing namespace use un Rest
Aug 21, 2013
b9f0989
Query class fixed to expect single object in the response.
Aug 26, 2013
93ff95d
Update composer.json
inakiabt Aug 30, 2013
216385d
Rest class is now configured by new Configuration class.
Aug 31, 2013
24de56e
Merge branch 'configuration-class'
Aug 31, 2013
df81dca
Merge remote-tracking branch 'github/master'
inakiabt Aug 31, 2013
25f1d38
Configuration logger getter replaced in Rest, Object and Query classes.
Sep 1, 2013
79936e4
Merge branch 'master' of bitbucket.org:productgram/stackmobphp
inakiabt Sep 1, 2013
12bbefb
getVersion method added to Configuration class.
Sep 1, 2013
f73ffb3
Merge remote-tracking branch 'origin/master'
Sep 2, 2013
159e5c9
Fixed getVersion signature in Configuration class.
Sep 2, 2013
87a2b77
Depth parameter added to Rest::getObject method.
Sep 2, 2013
667b5c4
Add DummyLogger as default logger
inakiabt Sep 24, 2013
ee0f3d1
Depth parameter added to Query.
Oct 15, 2013
6bc5081
Merge remote-tracking branch 'origin/master'
Oct 15, 2013
df97bfe
Empty check added to query.
Nov 12, 2013
d129333
Order by functionality fixed for Query.
Jan 22, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
{
"name": "jobiwankanobi/stackmobphp",
"name": "inakiabt/stackmobphp",
"description": "Simple PHP API for Stackmob based on inakiabt/stackmob project",
"license": "MIT",
"authors": [
{
"name": "Iñaki Abete",
"email": "inakiabt@gmail.com"
},
{
"name": "Federico Freire",
"email": "nerdscape@gmail.com"
}
],
"repositories": [
{
"type": "vcs",
"url": "git@github.com:fefuts/oauth.git"
}
],
"require": {
"php": ">=5.4.0",
"apache/log4php": "2.3.0"
"php": ">=5.3.0",
"fefuts/oauth": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.7.5",
"phpunit/phpunit": "3.7.5",
"phpunit/php-invoker": ">=1.1.0",
"phpunit/php-code-coverage": "1.2.6"
"phpunit/php-code-coverage": "1.2.6"
},
"autoload": {
"psr-0": { "Stackmob": "src/" }
}
}
72 changes: 72 additions & 0 deletions src/Stackmob/Configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

/**
* @author Federico Freire <nerdscape@gmail.com>
*/

namespace Stackmob;

class Configuration
{
private static $key;
private static $secret;
private static $logger;
private static $environment = 'dev';

public static function getKey()
{
if (empty(self::$key)) {
throw new \Exception(__METHOD__ . " - Stackmob key must be set.", 1);

}
return self::$key;
}

public static function setKey($key)
{
self::$key = $key;
}

public static function getSecret()
{
if (empty(self::$secret)) {
throw new \Exception(__METHOD__ . " - Stackmob secret must be set.", 1);

}
return self::$secret;
}

public static function setSecret($secret)
{
self::$secret = $secret;
}

public static function getLogger()
{
if (self::$logger === NULL)
{
self::$logger = new DummyLogger();
}
return self::$logger;
}

public static function setLogger($logger)
{
self::$logger = $logger;
}

public static function getEnvironment()
{
return self::$environment;
}

public static function setEnvironment($environment)
{
self::$environment = $environment;
}

public static function getVersion()
{
return (self::$environment === 'prod') ? 1 : 0;
}
}
2 changes: 2 additions & 0 deletions src/Stackmob/CustomCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

namespace Stackmob;

use Stackmob\Rest;

class CustomCode extends Stackmob {

const API_PATH = 'http://api.mob1.stackmob.com/';
Expand Down
27 changes: 27 additions & 0 deletions src/Stackmob/DummyLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* Used if no logger object was passed to the class that needs to log.
* @author Federico Freire
*/

namespace Stackmob;

class DummyLogger
{
public function info($msg, $other = null)
{
}
public function critical($msg, $other = null)
{
}
public function warn($msg, $other = null)
{
}
public function error($msg, $other = null)
{
}
public function debug($msg, $other = null)
{
}
}
Loading