Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
yos-social-php: refactored oauth to match yap 1.6 + added oauth unit
Browse files Browse the repository at this point in the history
tests + yql open tables support + improved phpdoc + INSTALL
  • Loading branch information
dustinwhittle committed Jul 18, 2009
1 parent 8294eb2 commit c2cc55a
Show file tree
Hide file tree
Showing 18 changed files with 1,423 additions and 430 deletions.
14 changes: 8 additions & 6 deletions INSTALL.txt
@@ -1,5 +1,7 @@
=================
Yahoo! OS PHP SDK
=============
=================

After downloading and unpackaging the release, copy the contents of yosdk/lib
to a directory that is accessible via the PHP require/require_once methods. In
your PHP scripts, require the Yahoo.inc file:
Expand Down Expand Up @@ -46,8 +48,8 @@ YahooLogger::setDebugDestination('LOG');
Storing OAuth credentials on filesystem, memcache, cookies
==========================================================

By default OAuth credential (request + access tokens) are stored in PHP sessions.
PHP sessions can easily be configured to work from local filesystem, database, or
By default, OAuth credentials (request + access tokens) are stored in PHP sessions.
PHP sessions can easily be configured to work from a local filesystem, a database, or
a memcache instance. The sample apps provide working examples of filesystem storage
and memcache storage.

Expand All @@ -58,9 +60,9 @@ Filesystem Session Storage (default)
// Include the YOS library.
require dirname(__FILE__).'/../lib/Yahoo.inc';

// use memcache to store oauth credentials via php native sessions
ini_set('session.save_handler', 'memcache');
session_save_path('tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15');
// use local filesystem to store oauth credentials via php native sessions
ini_set('session.save_handler', 'files');
session_save_path('/tmp/');
session_start();

========================
Expand Down
5 changes: 1 addition & 4 deletions lib/JSON.php
@@ -1,5 +1,4 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
* Converts to and from JSON format.
Expand Down Expand Up @@ -666,7 +665,7 @@ function decode($str)
// element in an associative array,
// for now
$parts = array();

if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
// "name":value pair
$key = $this->decode($parts[1]);
Expand Down Expand Up @@ -802,5 +801,3 @@ function Services_JSON_Error($message = 'unknown error', $code = null,
}

}

?>

0 comments on commit c2cc55a

Please sign in to comment.