├── vendor ├── asimlqt │ └── php-google-spreadsheet-client │ │ ├── .gitignore │ │ ├── tests │ │ ├── bootstrap.php │ │ └── Google │ │ │ └── Spreadsheet │ │ │ ├── WorksheetFeedTest.php │ │ │ ├── SpreadsheetFeedTest.php │ │ │ ├── ServiceRequestFactoryTest.php │ │ │ ├── TestBase.php │ │ │ ├── SpreadsheetServiceTest.php │ │ │ ├── TestServiceRequest.php │ │ │ ├── UtilTest.php │ │ │ ├── xml │ │ │ ├── spreadsheet.xml │ │ │ ├── worksheet.xml │ │ │ ├── spreadsheet-feed.xml │ │ │ ├── worksheet-feed.xml │ │ │ └── list-feed.xml │ │ │ ├── ListEntryTest.php │ │ │ ├── ListFeedTest.php │ │ │ ├── SpreadsheetTest.php │ │ │ └── WorksheetTest.php │ │ ├── composer.json │ │ └── src │ │ └── Google │ │ └── Spreadsheet │ │ ├── UnauthorizedException.php │ │ ├── Exception.php │ │ ├── ServiceRequestInterface.php │ │ ├── ServiceRequestFactory.php │ │ ├── Batch │ │ ├── BatchResponse.php │ │ └── BatchRequest.php │ │ ├── SpreadsheetService.php │ │ ├── Util.php │ │ ├── SpreadsheetFeed.php │ │ ├── WorksheetFeed.php │ │ ├── ListEntry.php │ │ ├── ListFeed.php │ │ ├── Spreadsheet.php │ │ └── CellFeed.php ├── google │ └── apiclient │ │ ├── examples │ │ ├── key.p12 │ │ ├── index.php │ │ ├── appengineauth.php │ │ ├── styles │ │ │ └── style.css │ │ ├── templates │ │ │ └── base.php │ │ ├── batch.php │ │ ├── simple-query.php │ │ ├── service-account.php │ │ ├── idtoken.php │ │ └── simplefileupload.php │ │ ├── tests │ │ ├── bootstrap.php │ │ ├── README │ │ ├── general │ │ │ ├── testdata │ │ │ │ ├── cert.p12 │ │ │ │ ├── test.ini │ │ │ │ ├── privkey.pem │ │ │ │ ├── cacert.json │ │ │ │ ├── cacert.pem │ │ │ │ └── test_public_key.pem │ │ │ ├── GeneralTests.php │ │ │ ├── ServiceTest.php │ │ │ ├── ApiBatchRequestTest.php │ │ │ ├── RequestTest.php │ │ │ ├── ApiMediaFileUploadTest.php │ │ │ └── CacheTest.php │ │ ├── phpunit.xml │ │ ├── tasks │ │ │ ├── AllTasksTests.php │ │ │ └── TasksTest.php │ │ ├── pagespeed │ │ │ ├── AllPageSpeedTests.php │ │ │ └── PageSpeedTest.php │ │ ├── urlshortener │ │ │ ├── AllUrlShortenerTests.php │ │ │ └── UrlShortenerTests.php │ │ ├── OAuthHelper.php │ │ ├── AllTests.php │ │ ├── BaseTest.php │ │ ├── plus │ │ │ └── PlusTest.php │ │ └── youtube │ │ │ └── YouTubeTest.php │ │ ├── composer.json │ │ ├── src │ │ └── Google │ │ │ ├── Exception.php │ │ │ ├── Cache │ │ │ ├── Exception.php │ │ │ ├── Null.php │ │ │ ├── Abstract.php │ │ │ ├── Apc.php │ │ │ ├── Memcache.php │ │ │ └── File.php │ │ │ ├── IO │ │ │ └── Exception.php │ │ │ ├── Auth │ │ │ ├── Exception.php │ │ │ ├── Abstract.php │ │ │ ├── LoginTicket.php │ │ │ ├── Simple.php │ │ │ ├── AppIdentity.php │ │ │ └── AssertionCredentials.php │ │ │ ├── Signer │ │ │ ├── Abstract.php │ │ │ └── P12.php │ │ │ ├── Verifier │ │ │ ├── Abstract.php │ │ │ └── Pem.php │ │ │ ├── Service.php │ │ │ ├── Service │ │ │ ├── Exception.php │ │ │ └── GroupsMigration.php │ │ │ ├── Collection.php │ │ │ └── Utils.php │ │ ├── .travis.yml │ │ └── CONTRIBUTING.md ├── autoload.php └── composer │ ├── autoload_namespaces.php │ ├── include_paths.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ └── installed.json ├── composer.phar ├── screenshot-1.gif ├── screenshot-2.png ├── composer.json ├── gdrsvp.css ├── .gitattributes ├── .gitignore ├── readme.md ├── composer.lock └── readme.txt /vendor/asimlqt/php-google-spreadsheet-client/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | -------------------------------------------------------------------------------- /composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wolf1994722/Wordpress-Google-Doc-REVP/HEAD/composer.phar -------------------------------------------------------------------------------- /screenshot-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wolf1994722/Wordpress-Google-Doc-REVP/HEAD/screenshot-1.gif -------------------------------------------------------------------------------- /screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wolf1994722/Wordpress-Google-Doc-REVP/HEAD/screenshot-2.png -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/key.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wolf1994722/Wordpress-Google-Doc-REVP/HEAD/vendor/google/apiclient/examples/key.p12 -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ./ 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /vendor/composer/include_paths.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/asimlqt/php-google-spreadsheet-client/src/Google'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/testdata/test.ini: -------------------------------------------------------------------------------- 1 | ; Test.ini file 2 | application_name = My Test application 3 | auth_class = Google_Auth_OAuth2 4 | [classes] 5 | Google_Auth_OAuth2[client_id] = 12345.apps.googleusercontent.com 6 | Google_Auth_OAuth2[client_secret] = gjfiwnGinpena3 7 | Google_Auth_OAuth2[redirect_uri] = http://example.com -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | assertTrue($worksheetFeed->getByTitle('Sheet1') instanceof Worksheet); 14 | $this->assertTrue(is_null($worksheetFeed->getByTitle('Sheet3'))); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/SpreadsheetFeedTest.php: -------------------------------------------------------------------------------- 1 | assertTrue($spreadsheetFeed->getByTitle('Test Spreadsheet') instanceof Spreadsheet); 14 | $this->assertTrue(is_null($spreadsheetFeed->getByTitle('No Spreadsheet'))); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "google/apiclient", 3 | "type": "library", 4 | "description": "Client library for Google APIs", 5 | "keywords": ["google"], 6 | "homepage": "http://developers.google.com/api-client-library/php", 7 | "license": "Apache-2.0", 8 | "require": { 9 | "php": ">=5.2.1" 10 | }, 11 | "require-dev": { 12 | "phpunit/phpunit": "3.7.*" 13 | }, 14 | "autoload": { 15 | "classmap": [ 16 | "src/" 17 | ] 18 | }, 19 | "include-path": ["src/"], 20 | "extra": { 21 | "branch-alias": { 22 | "dev-master": "1.0.x-dev" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/ServiceRequestFactoryTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(ServiceRequestFactory::getInstance() instanceof ServiceRequestInterface); 13 | } 14 | 15 | /** 16 | * @expectedException Exception 17 | */ 18 | public function testGetInstanceException() 19 | { 20 | ServiceRequestFactory::setInstance(null); 21 | ServiceRequestFactory::getInstance(); 22 | } 23 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Exception.php: -------------------------------------------------------------------------------- 1 | setExecuteReturn($xml); 22 | ServiceRequestFactory::setInstance($serviceRequest); 23 | } 24 | } -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/SpreadsheetServiceTest.php: -------------------------------------------------------------------------------- 1 | setServiceRequest('spreadsheet-feed.xml'); 9 | 10 | $spreadsheetService = new SpreadsheetService(); 11 | $feed = $spreadsheetService->getSpreadsheets(); 12 | 13 | $this->assertTrue($feed instanceof SpreadsheetFeed); 14 | } 15 | 16 | public function testGetSpreadsheetById() 17 | { 18 | $this->setServiceRequest('spreadsheet.xml', false); 19 | 20 | $spreadsheetService = new SpreadsheetService(); 21 | $spreadsheet = $spreadsheetService->getSpreadsheetById('spreadsheet-id'); 22 | 23 | $this->assertTrue($spreadsheet instanceof Spreadsheet); 24 | } 25 | } -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asimlqt/php-google-spreadsheet-client", 3 | "type": "library", 4 | "description": "Google Spreadsheet PHP Client", 5 | "keywords": ["google", "spreadsheet"], 6 | "homepage": "https://github.com/asimlqt/php-google-spreadsheet-client", 7 | "license": "Apache-2.0", 8 | "authors": [ 9 | { 10 | "name": "Asim Liaquat", 11 | "email": "asimlqt22@gmail.com", 12 | "role": "Developer" 13 | }, 14 | { 15 | "name": "Martin Czygan", 16 | "email": "martin.czygan@gmail.com", 17 | "homepage": "http://twitter.com/cvvfj", 18 | "role": "Packager" 19 | } 20 | ], 21 | "require": { 22 | "php": ">=5.3.0" 23 | }, 24 | "autoload": { 25 | "psr-4": {"Google\\": "src/Google"} 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/TestServiceRequest.php: -------------------------------------------------------------------------------- 1 | retVal = $retVal; 11 | } 12 | 13 | public function execute() 14 | { 15 | if($this->retVal instanceof \Exception) { 16 | throw new $this->retVal; 17 | } 18 | 19 | return $this->retVal; 20 | } 21 | 22 | public function delete($url) 23 | { 24 | return $this->execute(); 25 | } 26 | 27 | public function get($url) 28 | { 29 | return $this->execute(); 30 | } 31 | 32 | public function post($url, $postData) 33 | { 34 | return $this->execute(); 35 | } 36 | 37 | public function put($url, $postData) 38 | { 39 | return $this->execute(); 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Signer/Abstract.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | abstract class Google_Signer_Abstract 24 | { 25 | /** 26 | * Signs data, returns the signature as binary data. 27 | */ 28 | abstract public function sign($data); 29 | } 30 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/UnauthorizedException.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | class UnauthorizedException extends Exception 27 | { 28 | } -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/Exception.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class Exception extends BaseException 29 | { 30 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | services: 4 | - memcached 5 | 6 | env: 7 | - MEMCACHE_HOST=127.0.0.1 MEMCACHE_PORT=11211 8 | 9 | php: 10 | # Can't test against 5.2; openssl is not available: 11 | # http://docs.travis-ci.com/user/languages/php/#PHP-installation 12 | - 5.3 13 | - 5.4 14 | - 5.5 15 | - 5.6 16 | - hhvm 17 | 18 | before_script: 19 | - composer install 20 | - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "extension=memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' 21 | - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' 22 | - phpenv version-name | grep ^5.[34] && echo "extension=apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true 23 | - phpenv version-name | grep ^5.[34] && echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true 24 | 25 | script: 26 | - cd tests ; phpunit . 27 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/UtilTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($expected, $actual); 17 | } 18 | 19 | public function testGetLinkHref() 20 | { 21 | $xml = new SimpleXMLElement(file_get_contents(__DIR__.'/xml/worksheet.xml')); 22 | $expected = 'https://spreadsheets.google.com/feeds/worksheets/tA3TdJ0RIVEem3xQZhG2Ceg/private/full/od8'; 23 | $actual = Util::getLinkHref($xml, 'self'); 24 | 25 | $this->assertEquals($expected, $actual); 26 | } 27 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/testdata/cacert.json: -------------------------------------------------------------------------------- 1 | {"a": "-----BEGIN CERTIFICATE-----\nMIICrDCCAlagAwIBAgIJAIhhwVyFHrVfMA0GCSqGSIb3DQEBBQUAMG8xCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQxCjAIBgNVBAsTAWExCjAIBgNVBAMTAWIxEDAOBgkqhkiG\n9w0BCQEWAWMwHhcNMTIwMjE5MDExMzQxWhcNMTUwMjE4MDExMzQxWjBvMQswCQYD\nVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQg\nV2lkZ2l0cyBQdHkgTHRkMQowCAYDVQQLEwFhMQowCAYDVQQDEwFiMRAwDgYJKoZI\nhvcNAQkBFgFjMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAM4Aozh3TMZYcPx7MHln\nD8MtyVUjzo6OdT32JwRHzHHNMMm88lNVfLYIT9C/jgXlDqG0h5wSClMvTQbdihNd\nFOkCAwEAAaOB1DCB0TAdBgNVHQ4EFgQUv0Ahb7HD9TLfdtLeaatjFj91NqYwgaEG\nA1UdIwSBmTCBloAUv0Ahb7HD9TLfdtLeaatjFj91Nqahc6RxMG8xCzAJBgNVBAYT\nAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRn\naXRzIFB0eSBMdGQxCjAIBgNVBAsTAWExCjAIBgNVBAMTAWIxEDAOBgkqhkiG9w0B\nCQEWAWOCCQCIYcFchR61XzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA0EA\nKAbxbWHsaVPnYc0YqG/Pn4HbcI1+xnVQSt3hdzq+yC0lP9H7hBMCVSykhhBkZ5XQ\nHA2t6LHuYsjcCO+LBX/4fA==\n-----END CERTIFICATE-----"} -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/index.php: -------------------------------------------------------------------------------- 1 | 9 | 19 | 22 | */ 23 | abstract class Google_Verifier_Abstract 24 | { 25 | /** 26 | * Checks a signature, returns true if the signature is correct, 27 | * false otherwise. 28 | */ 29 | abstract public function verify($data, $signature); 30 | } 31 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/testdata/cacert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICrDCCAlagAwIBAgIJAIhhwVyFHrVfMA0GCSqGSIb3DQEBBQUAMG8xCzAJBgNV 3 | BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX 4 | aWRnaXRzIFB0eSBMdGQxCjAIBgNVBAsTAWExCjAIBgNVBAMTAWIxEDAOBgkqhkiG 5 | 9w0BCQEWAWMwHhcNMTIwMjE5MDExMzQxWhcNMTUwMjE4MDExMzQxWjBvMQswCQYD 6 | VQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQg 7 | V2lkZ2l0cyBQdHkgTHRkMQowCAYDVQQLEwFhMQowCAYDVQQDEwFiMRAwDgYJKoZI 8 | hvcNAQkBFgFjMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAM4Aozh3TMZYcPx7MHln 9 | D8MtyVUjzo6OdT32JwRHzHHNMMm88lNVfLYIT9C/jgXlDqG0h5wSClMvTQbdihNd 10 | FOkCAwEAAaOB1DCB0TAdBgNVHQ4EFgQUv0Ahb7HD9TLfdtLeaatjFj91NqYwgaEG 11 | A1UdIwSBmTCBloAUv0Ahb7HD9TLfdtLeaatjFj91Nqahc6RxMG8xCzAJBgNVBAYT 12 | AkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRn 13 | aXRzIFB0eSBMdGQxCjAIBgNVBAsTAWExCjAIBgNVBAMTAWIxEDAOBgkqhkiG9w0B 14 | CQEWAWOCCQCIYcFchR61XzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA0EA 15 | KAbxbWHsaVPnYc0YqG/Pn4HbcI1+xnVQSt3hdzq+yC0lP9H7hBMCVSykhhBkZ5XQ 16 | HA2t6LHuYsjcCO+LBX/4fA== 17 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/xml/spreadsheet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://spreadsheets.google.com/feeds/spreadsheets/private/full/tFEgU8ywJkkjcZjG 4 | 2014-02-07T18:33:44.826Z 5 | 6 | Test Spreadsheet 7 | Test Spreadsheet 8 | 9 | 10 | 11 | 12 | asimlqt22 13 | asimlqt22@gmail.com 14 | 15 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/ServiceRequestInterface.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | interface ServiceRequestInterface 27 | { 28 | public function get($url); 29 | public function post($url, $postData); 30 | public function put($url, $postData); 31 | public function delete($url); 32 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Service.php: -------------------------------------------------------------------------------- 1 | client = $client; 29 | } 30 | 31 | /** 32 | * Return the associated Google_Client class. 33 | * @return Google_Client 34 | */ 35 | public function getClient() 36 | { 37 | return $this->client; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/tasks/AllTasksTests.php: -------------------------------------------------------------------------------- 1 | setName('Google Tasks API tests'); 27 | $suite->addTestSuite('TasksTest'); 28 | return $suite; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/pagespeed/AllPageSpeedTests.php: -------------------------------------------------------------------------------- 1 | setName('Google PageSpeed API tests'); 27 | $suite->addTestSuite('PageSpeedTest'); 28 | return $suite; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/urlshortener/AllUrlShortenerTests.php: -------------------------------------------------------------------------------- 1 | setName('Google UrlShortener API tests'); 27 | $suite->addTestSuite('UrlShortenerTests'); 28 | return $suite; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/testdata/test_public_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDQjCCAiqgAwIBAgIJAMJ1Z12ZdGgLMA0GCSqGSIb3DQEBBQUAMB8xHTAbBgNV 3 | BAMTFHRlc3Qtc2VydmljZS1hY2NvdW50MB4XDTExMDgyMzIwNTczNFoXDTIxMDgy 4 | MDIwNTczNFowHzEdMBsGA1UEAxMUdGVzdC1zZXJ2aWNlLWFjY291bnQwggEiMA0G 5 | CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDpbFTjUXd02HFluI2G0kGKp1J5K2F8 6 | cYr7hKXHcsmKo6S/5g8AEYnnV1fEbiopoGt7UWV4T0LA99K0gqQ7QmvZKvFHXlgR 7 | XJH1aO+ZipVs3ycZOcjBMcw4hspFSi4IyQta64gASFUT5NaxRVGhzAuPlzH09dZQ 8 | RJ0NL54HccGNzEDaLx5usB8t2aRHbE4zRWJlNIsjgWnfVoiXwOv5oRhyfFMIaTu1 9 | eIp3XP1QAv5cuYS2U4ZJ+J7Gzg6E7t4PWqK7rGjnc5BJsVIoiL77K/xKUWABNgHz 10 | b6JuiEp3LX9f2H5+CKo/IJFWoyIYWdZiu69LZivife9sTXmDnOcZkisRAgMBAAGj 11 | gYAwfjAdBgNVHQ4EFgQU0RkXlevVO2zuTFP/ksFUbNkpm+kwTwYDVR0jBEgwRoAU 12 | 0RkXlevVO2zuTFP/ksFUbNkpm+mhI6QhMB8xHTAbBgNVBAMTFHRlc3Qtc2Vydmlj 13 | ZS1hY2NvdW50ggkAwnVnXZl0aAswDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUF 14 | AAOCAQEAT+3VKautn+uV7ZQWbfx6xrGaDZ5wVK9FWOTVKsjdXyp11jtoVkDONLz5 15 | 3J7wgppZWabPargIZUHe9/P6j7QTgNV2na2thGHtVRIRyDECnVrvhCn/IDpMeJjj 16 | IAuysmSITHGEwb4AvRC5HdqfWzBqAvRhjJ2crcHZpx5/KkYZgJz9ylGJCynxpbHU 17 | 1aRu4qpkQNB4t4z5EzNOSLkFw9vEtm0hNX76CsNJFd0XDEKDQI2Lsc0WfDzQ1ZQH 18 | UVzIoTmQDkYGylQOBVyxZoGI6fuSo8c2I1BKvsdBGhSPjePNvaKUbmLSwUsranhX 19 | 2Y1kn7xbDTUHymZ0+g5rDM9kWmhZfg== 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Auth/Abstract.php: -------------------------------------------------------------------------------- 1 | 22 | * 23 | */ 24 | abstract class Google_Auth_Abstract 25 | { 26 | /** 27 | * An utility function that first calls $this->auth->sign($request) and then 28 | * executes makeRequest() on that signed request. Used for when a request 29 | * should be authenticated 30 | * @param Google_Http_Request $request 31 | * @return Google_Http_Request $request 32 | */ 33 | abstract public function authenticatedRequest(Google_Http_Request $request); 34 | abstract public function sign(Google_Http_Request $request); 35 | } 36 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Cache/Null.php: -------------------------------------------------------------------------------- 1 | = 0) { 28 | parent::__construct($message, $code, $previous); 29 | } else { 30 | parent::__construct($message, $code); 31 | } 32 | 33 | $this->errors = $errors; 34 | } 35 | 36 | /** 37 | * An example of the possible errors returned. 38 | * 39 | * { 40 | * "domain": "global", 41 | * "reason": "authError", 42 | * "message": "Invalid Credentials", 43 | * "locationType": "header", 44 | * "location": "Authorization", 45 | * } 46 | * 47 | * @return [{string, string}] List of errors return in an HTTP response or []. 48 | */ 49 | public function getErrors() 50 | { 51 | return $this->errors; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/xml/worksheet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://spreadsheets.google.com/feeds/worksheets/tA3TdJ0RIVEem3xQZhG2Ceg/private/full/od8 4 | 2013-02-10T21:12:33.843Z 5 | 6 | Test 7 | Test 8 | 9 | 10 | 11 | 12 | 13 | 100 14 | 10 15 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/pagespeed/PageSpeedTest.php: -------------------------------------------------------------------------------- 1 | service = new Google_Service_Pagespeedonline($this->getClient()); 25 | } 26 | 27 | public function testPageSpeed() { 28 | $this->checkToken(); 29 | $psapi = $this->service->pagespeedapi; 30 | $result = $psapi->runpagespeed('http://code.google.com'); 31 | $this->assertArrayHasKey('kind', $result); 32 | $this->assertArrayHasKey('id', $result); 33 | $this->assertArrayHasKey('responseCode', $result); 34 | $this->assertArrayHasKey('title', $result); 35 | $this->assertArrayHasKey('score', $result); 36 | $this->assertInstanceOf('Google_Service_Pagespeedonline_ResultPageStats', $result->pageStats); 37 | $this->assertArrayHasKey('minor', $result['version']); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google/apiclient/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your code patches! However, before we can take them, we have to jump a couple of legal hurdles. 6 | 7 | Please fill out either the individual or corporate Contributor License Agreement (CLA). 8 | 9 | * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html). 10 | * If you work for a company that wants to allow you to contribute your work to this client library, then you'll need to sign a[corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html). 11 | 12 | Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll add you to the official list of contributors and be able to accept your patches. 13 | 14 | ## Submitting Patches 15 | 16 | 1. Fork the PHP client library on GitHub 17 | 1. Decide which code you want to submit. A submission should be a set of changes that addresses one issue in the issue tracker. Please file one change per issue, and address one issue per change. If you want to make a change that doesn't have a corresponding issue in the issue tracker, please file a new ticket! 18 | 1. Ensure that your code adheres to standard PHP conventions, as used in the rest of the library. 19 | 1. Ensure that there are unit tests for your code. 20 | 1. Sign a Contributor License Agreement (see above). 21 | 1. Submit a pull request with your patch on Github. 22 | 23 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/ServiceRequestFactory.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | class ServiceRequestFactory 27 | { 28 | private static $instance; 29 | 30 | /** 31 | * [setInstance description] 32 | * 33 | * @param ServiceRequestInterface $instance 34 | */ 35 | public static function setInstance(ServiceRequestInterface $instance = null) 36 | { 37 | self::$instance = $instance; 38 | } 39 | 40 | /** 41 | * [getInstance description] 42 | * 43 | * @return ServiceRequestInterface 44 | * 45 | * @throws \Google\Spreadsheet\Exception 46 | */ 47 | public static function getInstance() 48 | { 49 | if(is_null(self::$instance)) { 50 | throw new Exception(); 51 | } 52 | return self::$instance; 53 | } 54 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/urlshortener/UrlShortenerTests.php: -------------------------------------------------------------------------------- 1 | service = new Google_Service_Urlshortener($this->getClient()); 28 | } 29 | 30 | public function testUrlShort() { 31 | $url = new Google_Service_Urlshortener_Url(); 32 | $url->longUrl = "http://google.com"; 33 | 34 | $shortUrl = $this->service->url->insert($url); 35 | $this->assertEquals('urlshortener#url', $shortUrl['kind']); 36 | $this->assertEquals('http://google.com/', $shortUrl['longUrl']); 37 | } 38 | 39 | public function testEmptyJsonResponse() { 40 | $optParams = array('fields' => ''); 41 | $resp = $this->service->url->get('http://goo.gl/KkHq8', $optParams); 42 | 43 | $this->assertEquals("", $resp->longUrl); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/ListEntryTest.php: -------------------------------------------------------------------------------- 1 | getEntries()); 14 | 15 | $this->assertEquals( 16 | 'https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full/cokwr/bnkj8i7jo6c', 17 | $listEntry->getEditUrl() 18 | ); 19 | } 20 | 21 | public function testUpdate() 22 | { 23 | $mockServiceRequest = $this->getMockBuilder('Google\Spreadsheet\DefaultServiceRequest') 24 | ->setMethods(array("put")) 25 | ->disableOriginalConstructor() 26 | ->getMock(); 27 | 28 | $mockServiceRequest->expects($this->once()) 29 | ->method('put') 30 | ->with( 31 | $this->equalTo('https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full/cokwr/bnkj8i7jo6c'), 32 | $this->stringContains('') 33 | ); 34 | 35 | ServiceRequestFactory::setInstance($mockServiceRequest); 36 | 37 | $listFeed = new ListFeed(file_get_contents(__DIR__.'/xml/list-feed.xml')); 38 | $entry = current($listFeed->getEntries()); 39 | $data = $entry->getValues(); 40 | $data["nname"] = "Asim"; 41 | $entry->update($data); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Cache/Abstract.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | abstract class Google_Cache_Abstract 24 | { 25 | 26 | abstract public function __construct(Google_Client $client); 27 | 28 | /** 29 | * Retrieves the data for the given key, or false if they 30 | * key is unknown or expired 31 | * 32 | * @param String $key The key who's data to retrieve 33 | * @param boolean|int $expiration Expiration time in seconds 34 | * 35 | */ 36 | abstract public function get($key, $expiration = false); 37 | 38 | /** 39 | * Store the key => $value set. The $value is serialized 40 | * by this function so can be of any type 41 | * 42 | * @param string $key Key of the data 43 | * @param string $value data 44 | */ 45 | abstract public function set($key, $value); 46 | 47 | /** 48 | * Removes the key/data pair for the given $key 49 | * 50 | * @param String $key 51 | */ 52 | abstract public function delete($key); 53 | } 54 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/OAuthHelper.php: -------------------------------------------------------------------------------- 1 | setScopes(array( 22 | "https://www.googleapis.com/auth/plus.me", 23 | "https://www.googleapis.com/auth/urlshortener", 24 | "https://www.googleapis.com/auth/tasks", 25 | "https://www.googleapis.com/auth/adsense", 26 | "https://www.googleapis.com/auth/youtube" 27 | )); 28 | $client->setRedirectUri("urn:ietf:wg:oauth:2.0:oob"); 29 | // Visit https://code.google.com/apis/console to 30 | // generate your oauth2_client_id, oauth2_client_secret, and to 31 | // register your oauth2_redirect_uri. 32 | $client->setClientId(""); 33 | $client->setClientSecret(""); 34 | 35 | 36 | $authUrl = $client->createAuthUrl(); 37 | 38 | `open '$authUrl'`; 39 | echo "\nPlease enter the auth code:\n"; 40 | $authCode = trim(fgets(STDIN)); 41 | 42 | $accessToken = $client->authenticate($authCode); 43 | 44 | echo "\n", 'Add the following to BaseTest.php as the $token value:', "\n\n"; 45 | echo $accessToken, "\n\n"; 46 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/ListFeedTest.php: -------------------------------------------------------------------------------- 1 | assertEquals( 15 | 'https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full', 16 | $listFeed->getPostUrl() 17 | ); 18 | } 19 | 20 | public function testInsert() 21 | { 22 | $mockServiceRequest = $this->getMockBuilder('Google\Spreadsheet\DefaultServiceRequest') 23 | ->setMethods(array("post")) 24 | ->disableOriginalConstructor() 25 | ->getMock(); 26 | 27 | $mockServiceRequest->expects($this->once()) 28 | ->method('post') 29 | ->with( 30 | $this->equalTo('https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full'), 31 | $this->stringContains('') 32 | ); 33 | 34 | ServiceRequestFactory::setInstance($mockServiceRequest); 35 | 36 | $listFeed = new ListFeed(file_get_contents(__DIR__.'/xml/list-feed.xml')); 37 | $listFeed->insert(["name" => "asim", "occupation" => "software engineer"]); 38 | } 39 | 40 | public function testGetEntries() 41 | { 42 | $xml = file_get_contents(__DIR__.'/xml/list-feed.xml'); 43 | $listFeed = new ListFeed($xml); 44 | 45 | $this->assertEquals(4, count($listFeed->getEntries())); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | $path) { 32 | $loader->set($namespace, $path); 33 | } 34 | 35 | $map = require __DIR__ . '/autoload_psr4.php'; 36 | foreach ($map as $namespace => $path) { 37 | $loader->setPsr4($namespace, $path); 38 | } 39 | 40 | $classMap = require __DIR__ . '/autoload_classmap.php'; 41 | if ($classMap) { 42 | $loader->addClassMap($classMap); 43 | } 44 | 45 | $loader->register(true); 46 | 47 | return $loader; 48 | } 49 | } 50 | 51 | function composerRequiref56a5de53e5104d7e243964627150826($file) 52 | { 53 | require $file; 54 | } 55 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/Batch/BatchResponse.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class BatchResponse 29 | { 30 | /** 31 | * 32 | * @var SimpleXMLElement 33 | */ 34 | protected $xml; 35 | 36 | /** 37 | * 38 | * @param SimpleXMLElement $xml 39 | */ 40 | public function __construct(SimpleXMLElement $xml) 41 | { 42 | $this->xml = $xml; 43 | } 44 | 45 | /** 46 | * 47 | * @return SimpleXMLElement 48 | */ 49 | public function getXml() 50 | { 51 | return $this->getXml(); 52 | } 53 | 54 | /** 55 | * 56 | * @return boolean 57 | */ 58 | public function hasErrors() 59 | { 60 | foreach ($this->xml->xpath("//batch:status/@code") as $el) { 61 | if($el->__toString() !== "200") { 62 | return true; 63 | } 64 | } 65 | 66 | return false; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/appengineauth.php: -------------------------------------------------------------------------------- 1 | setApplicationName("Client_Library_Examples"); 33 | 34 | $auth = new Google_Auth_AppIdentity($client); 35 | $token = $auth->authenticateForScope(Google_Service_Storage::DEVSTORAGE_READ_ONLY); 36 | if (!$token) { 37 | die("Could not authenticate to AppIdentity service"); 38 | } 39 | $client->setAuth($auth); 40 | 41 | $service = new Google_Service_Storage($client); 42 | $results = $service->buckets->listBuckets(str_replace("s~", "", $_SERVER['APPLICATION_ID'])); 43 | 44 | echo "

Results Of Call:

"; 45 | echo "
";
46 | var_dump($results);
47 | echo "
"; 48 | 49 | echo pageFooter(__FILE__); 50 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/AllTests.php: -------------------------------------------------------------------------------- 1 | setName('All Google API PHP Client tests'); 38 | $suite->addTestSuite(YouTubeTests::suite()); 39 | $suite->addTestSuite(AllTasksTests::suite()); 40 | $suite->addTestSuite(AllPageSpeedTests::suite()); 41 | $suite->addTestSuite(AllUrlShortenerTests::suite()); 42 | $suite->addTestSuite(AllPlusTests::suite()); 43 | $suite->addTestSuite(AdsenseTests::suite()); 44 | $suite->addTestSuite(GeneralTests::suite()); 45 | return $suite; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetService.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class SpreadsheetService 29 | { 30 | /** 31 | * Fetches a list of spreadhsheet spreadsheets from google drive. 32 | * 33 | * @return \Google\Spreadsheet\SpreadsheetFeed 34 | */ 35 | public function getSpreadsheets() 36 | { 37 | return new SpreadsheetFeed( 38 | ServiceRequestFactory::getInstance()->get('feeds/spreadsheets/private/full') 39 | ); 40 | } 41 | 42 | /** 43 | * Fetches a single spreadsheet from google drive by id if you decide 44 | * to store the id locally. This can help reduce api calls. 45 | * 46 | * @param string $id the url of the spreadsheet 47 | * 48 | * @return \Google\Spreadsheet\Spreadsheet 49 | */ 50 | public function getSpreadsheetById($id) 51 | { 52 | return new Spreadsheet( 53 | new SimpleXMLElement( 54 | ServiceRequestFactory::getInstance()->get('feeds/spreadsheets/private/full/'. $id) 55 | ) 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/Util.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class Util 29 | { 30 | /** 31 | * Extracts the endpoint from a full google spreadsheet url. 32 | * 33 | * @param string $url 34 | * 35 | * @return string 36 | */ 37 | public static function extractEndpoint($url) 38 | { 39 | return parse_url($url, PHP_URL_PATH); 40 | } 41 | 42 | /** 43 | * Extracts the href for a specific rel from an xml object. 44 | * 45 | * @param \SimpleXMLElement $xml 46 | * @param string $rel the value of the rel attribute whose href you want 47 | * 48 | * @return string 49 | */ 50 | public static function getLinkHref(SimpleXMLElement $xml, $rel) 51 | { 52 | foreach($xml->link as $link) { 53 | $attributes = $link->attributes(); 54 | if($attributes['rel']->__toString() === $rel) { 55 | return $attributes['href']->__toString(); 56 | } 57 | } 58 | throw new Exception('No link found with rel "'.$rel.'"'); 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/GeneralTests.php: -------------------------------------------------------------------------------- 1 | addTestSuite('AuthTest'); 40 | $suite->addTestSuite('CacheTest'); 41 | $suite->addTestSuite('IoTest'); 42 | $suite->addTestSuite('ServiceTest'); 43 | $suite->addTestSuite('ApiBatchRequestTest'); 44 | $suite->addTestSuite('ApiClientTest'); 45 | $suite->addTestSuite('ApiModelTest'); 46 | $suite->addTestSuite('ApiOAuth2Test'); 47 | $suite->addTestSuite('ApiCacheParserTest'); 48 | $suite->addTestSuite('ApiMediaFileUploadTest'); 49 | $suite->addTestSuite('RestTest'); 50 | $suite->addTestSuite('RequestTest'); 51 | $suite->addTestSuite('ServiceTest'); 52 | $suite->addTestSuite('URITemplateTest'); 53 | return $suite; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Auth/LoginTicket.php: -------------------------------------------------------------------------------- 1 | 24 | */ 25 | class Google_Auth_LoginTicket 26 | { 27 | const USER_ATTR = "sub"; 28 | 29 | // Information from id token envelope. 30 | private $envelope; 31 | 32 | // Information from id token payload. 33 | private $payload; 34 | 35 | /** 36 | * Creates a user based on the supplied token. 37 | * 38 | * @param string $envelope Header from a verified authentication token. 39 | * @param string $payload Information from a verified authentication token. 40 | */ 41 | public function __construct($envelope, $payload) 42 | { 43 | $this->envelope = $envelope; 44 | $this->payload = $payload; 45 | } 46 | 47 | /** 48 | * Returns the numeric identifier for the user. 49 | * @throws Google_Auth_Exception 50 | * @return 51 | */ 52 | public function getUserId() 53 | { 54 | if (array_key_exists(self::USER_ATTR, $this->payload)) { 55 | return $this->payload[self::USER_ATTR]; 56 | } 57 | throw new Google_Auth_Exception("No user_id in token"); 58 | } 59 | 60 | /** 61 | * Returns attributes from the login ticket. This can contain 62 | * various information about the user session. 63 | * @return array 64 | */ 65 | public function getAttributes() 66 | { 67 | return array("envelope" => $this->envelope, "payload" => $this->payload); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Cache/Apc.php: -------------------------------------------------------------------------------- 1 | 28 | */ 29 | class Google_Cache_Apc extends Google_Cache_Abstract 30 | { 31 | public function __construct(Google_Client $client) 32 | { 33 | if (! function_exists('apc_add') ) { 34 | throw new Google_Cache_Exception("Apc functions not available"); 35 | } 36 | } 37 | 38 | /** 39 | * @inheritDoc 40 | */ 41 | public function get($key, $expiration = false) 42 | { 43 | $ret = apc_fetch($key); 44 | if ($ret === false) { 45 | return false; 46 | } 47 | if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) { 48 | $this->delete($key); 49 | return false; 50 | } 51 | return $ret['data']; 52 | } 53 | 54 | /** 55 | * @inheritDoc 56 | */ 57 | public function set($key, $value) 58 | { 59 | $rc = apc_store($key, array('time' => time(), 'data' => $value)); 60 | if ($rc == false) { 61 | throw new Google_Cache_Exception("Couldn't store data"); 62 | } 63 | } 64 | 65 | /** 66 | * @inheritDoc 67 | * @param String $key 68 | */ 69 | public function delete($key) 70 | { 71 | apc_delete($key); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Auth/Simple.php: -------------------------------------------------------------------------------- 1 | 26 | * @author Chirag Shah 27 | */ 28 | class Google_Auth_Simple extends Google_Auth_Abstract 29 | { 30 | private $key = null; 31 | private $client; 32 | 33 | public function __construct(Google_Client $client, $config = null) 34 | { 35 | $this->client = $client; 36 | } 37 | 38 | /** 39 | * Perform an authenticated / signed apiHttpRequest. 40 | * This function takes the apiHttpRequest, calls apiAuth->sign on it 41 | * (which can modify the request in what ever way fits the auth mechanism) 42 | * and then calls apiCurlIO::makeRequest on the signed request 43 | * 44 | * @param Google_Http_Request $request 45 | * @return Google_Http_Request The resulting HTTP response including the 46 | * responseHttpCode, responseHeaders and responseBody. 47 | */ 48 | public function authenticatedRequest(Google_Http_Request $request) 49 | { 50 | $request = $this->sign($request); 51 | return $this->io->makeRequest($request); 52 | } 53 | 54 | public function sign(Google_Http_Request $request) 55 | { 56 | $key = $this->client->getClassConfig($this, 'developer_key'); 57 | if ($key) { 58 | $request->setQueryParam('key', $key); 59 | } 60 | return $request; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/SpreadsheetTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($this->serviceUrl . 'tFEgU8ywJkkjcZjG', $spreadsheet->getId()); 15 | } 16 | 17 | public function testGetUpdated() 18 | { 19 | $xml = file_get_contents(__DIR__.'/xml/spreadsheet.xml'); 20 | $spreadsheet = new Spreadsheet(new SimpleXMLElement($xml)); 21 | 22 | $this->assertTrue($spreadsheet->getUpdated() instanceof DateTime); 23 | $this->assertEquals('2014-02-07 18:33:44', $spreadsheet->getUpdated()->format('Y-m-d H:i:s')); 24 | } 25 | 26 | public function testGetTitle() 27 | { 28 | $xml = file_get_contents(__DIR__.'/xml/spreadsheet.xml'); 29 | $spreadsheet = new Spreadsheet(new SimpleXMLElement($xml)); 30 | 31 | $this->assertEquals('Test Spreadsheet', $spreadsheet->getTitle()); 32 | } 33 | 34 | public function testGetWorksheets() 35 | { 36 | $this->setServiceRequest('worksheet-feed.xml'); 37 | 38 | $xml = file_get_contents(__DIR__.'/xml/spreadsheet.xml'); 39 | $spreadsheet = new Spreadsheet(new SimpleXMLElement($xml)); 40 | 41 | $this->assertTrue($spreadsheet->getWorksheets() instanceof WorksheetFeed); 42 | } 43 | 44 | public function testAddWorksheet() 45 | { 46 | $this->setServiceRequest('worksheet.xml'); 47 | 48 | $xml = file_get_contents(__DIR__.'/xml/spreadsheet.xml'); 49 | $spreadsheet = new Spreadsheet(new SimpleXMLElement($xml)); 50 | 51 | $this->assertTrue($spreadsheet->addWorksheet('Sheet 3') instanceof Worksheet); 52 | } 53 | 54 | public function testGetWorksheetsFeedUrl() 55 | { 56 | $xml = file_get_contents(__DIR__.'/xml/spreadsheet.xml'); 57 | $spreadsheet = new Spreadsheet(new SimpleXMLElement($xml)); 58 | 59 | $this->assertEquals('https://spreadsheets.google.com/feeds/worksheets/tFEgU8ywJkkjcZjG/private/full', $spreadsheet->getWorksheetsFeedUrl()); 60 | } 61 | } -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetFeed.php: -------------------------------------------------------------------------------- 1 | 28 | */ 29 | class SpreadsheetFeed extends ArrayIterator 30 | { 31 | /** 32 | * The spreadsheet feed xml object 33 | * 34 | * @var \SimpleXMLElement 35 | */ 36 | protected $xml; 37 | 38 | /** 39 | * Initializes the the spreadsheet feed object 40 | * 41 | * @param string $xml the raw xml string of a spreadsheet feed 42 | */ 43 | public function __construct($xml) 44 | { 45 | $this->xml = new SimpleXMLElement($xml); 46 | 47 | $spreadsheets = array(); 48 | foreach ($this->xml->entry as $entry) { 49 | $spreadsheets[] = new Spreadsheet($entry); 50 | } 51 | parent::__construct($spreadsheets); 52 | } 53 | 54 | /** 55 | * Gets a spreadhseet from the feed by its title. i.e. the name of 56 | * the spreadsheet in google drive. This method will return only the 57 | * first spreadsheet found with the specified title. 58 | * 59 | * @param string $title 60 | * 61 | * @return \Google\Spreadsheet\Spreadsheet|null 62 | */ 63 | public function getByTitle($title) 64 | { 65 | foreach($this->xml->entry as $entry) { 66 | if($entry->title->__toString() == $title) { 67 | return new Spreadsheet($entry); 68 | } 69 | } 70 | return null; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Verifier/Pem.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | class Google_Verifier_Pem extends Google_Verifier_Abstract 27 | { 28 | private $publicKey; 29 | 30 | /** 31 | * Constructs a verifier from the supplied PEM-encoded certificate. 32 | * 33 | * $pem: a PEM encoded certificate (not a file). 34 | * @param $pem 35 | * @throws Google_Auth_Exception 36 | * @throws Google_Exception 37 | */ 38 | public function __construct($pem) 39 | { 40 | if (!function_exists('openssl_x509_read')) { 41 | throw new Google_Exception('Google API PHP client needs the openssl PHP extension'); 42 | } 43 | $this->publicKey = openssl_x509_read($pem); 44 | if (!$this->publicKey) { 45 | throw new Google_Auth_Exception("Unable to parse PEM: $pem"); 46 | } 47 | } 48 | 49 | public function __destruct() 50 | { 51 | if ($this->publicKey) { 52 | openssl_x509_free($this->publicKey); 53 | } 54 | } 55 | 56 | /** 57 | * Verifies the signature on data. 58 | * 59 | * Returns true if the signature is valid, false otherwise. 60 | * @param $data 61 | * @param $signature 62 | * @throws Google_Auth_Exception 63 | * @return bool 64 | */ 65 | public function verify($data, $signature) 66 | { 67 | $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256"; 68 | $status = openssl_verify($data, $signature, $this->publicKey, $hash); 69 | if ($status === -1) { 70 | throw new Google_Auth_Exception('Signature verification error: ' . openssl_error_string()); 71 | } 72 | return $status === 1; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/styles/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Google Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | body { 17 | font-family: Arial,sans-serif; 18 | margin: auto; 19 | white-space: nowrap; 20 | padding: 10px; 21 | } 22 | 23 | .box { 24 | border: .5em solid #E3E9FF; 25 | -webkit-box-orient: vertical; 26 | -webkit-box-align: center; 27 | 28 | -moz-box-orient: vertical; 29 | -moz-box-align: center; 30 | 31 | display: block; 32 | box-orient: vertical; 33 | box-align: center; 34 | 35 | width: 400px; 36 | height: auto; 37 | 38 | margin: auto; 39 | padding: 10px; 40 | } 41 | 42 | .request { 43 | -webkit-box-flex: 1; 44 | -moz-box-flex: 1; 45 | box-flex: 1; 46 | } 47 | 48 | .result { 49 | -webkit-box-flex: 2; 50 | -moz-box-flex: 2; 51 | box-flex: 2; 52 | } 53 | 54 | header { 55 | color:#000; 56 | padding:2px 5px; 57 | font-size:100%; 58 | margin: auto; 59 | text-align: center 60 | } 61 | 62 | header h1.logo { 63 | margin:6px 0; 64 | padding:0; 65 | font-size:24px; 66 | line-height:20px; 67 | text-align: center 68 | } 69 | 70 | .login { 71 | font-size: 200%; 72 | display: block; 73 | margin: auto; 74 | cursor: pointer; 75 | text-align: center; 76 | font-weight: bold; 77 | color: #2779AA; 78 | line-height: normal; 79 | } 80 | 81 | .logout { 82 | font-weight: normal; 83 | margin-top: 0; 84 | } 85 | 86 | .shortened { 87 | overflow: scroll; 88 | } 89 | 90 | .url { 91 | color: #019; 92 | font-size: 100%; 93 | vertical-align: middle; 94 | padding: 1px; 95 | background-color: white; 96 | border: 1px inset; 97 | cursor: auto; 98 | margin: 0; 99 | text-indent: 0; 100 | display: inline-block; 101 | } 102 | 103 | pre.code { 104 | padding: 10px; 105 | border: .5em solid #E3E9FF; 106 | margin: 10px; 107 | height: 400px; 108 | overflow: scroll; 109 | } 110 | 111 | .warn { 112 | color: red; 113 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/BaseTest.php: -------------------------------------------------------------------------------- 1 | "; 22 | private $token; 23 | private $memcacheHost; 24 | private $memcachePort; 25 | 26 | public function __construct() 27 | { 28 | parent::__construct(); 29 | // Fill in a token JSON here and you can test the oauth token 30 | // requiring functions. 31 | // $this->token = ''; 32 | 33 | $this->memcacheHost = getenv('MEMCACHE_HOST') ? getenv('MEMCACHE_HOST') : null; 34 | $this->memcachePort = getenv('MEMCACHE_PORT') ? getenv('MEMCACHE_PORT') : null; 35 | } 36 | 37 | public function getClient() { 38 | $client = new Google_Client(); 39 | $client->setDeveloperKey(self::KEY); 40 | if (strlen($this->token)) { 41 | $client->setAccessToken($this->token); 42 | } 43 | if (strlen($this->memcacheHost)) { 44 | $client->setClassConfig('Google_Cache_Memcache', 'host', $this->memcacheHost); 45 | $client->setClassConfig('Google_Cache_Memcache', 'port', $this->memcachePort); 46 | } 47 | return $client; 48 | } 49 | 50 | public function testClientConstructor() 51 | { 52 | $this->assertInstanceOf('Google_Client', $this->getClient()); 53 | } 54 | 55 | public function testIncludes() { 56 | $prefix = dirname(dirname(__FILE__)) . '/src/'; 57 | $path = dirname(dirname(__FILE__)) . '/src/Google/Service'; 58 | foreach(glob($path . "/*.php") as $file) { 59 | // Munge prefix so we don't double require. 60 | $this->assertEquals(1, require_once(str_replace($prefix, '', $file))); 61 | } 62 | } 63 | 64 | public function checkToken() 65 | { 66 | if (!strlen($this->token)) { 67 | $this->markTestSkipped('Test requires access token'); 68 | return false; 69 | } 70 | return true; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/templates/base.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | " . $title . " 16 | 17 | 18 | \n"; 19 | if ($_SERVER['PHP_SELF'] != "/index.php") { 20 | $ret .= "

Back

"; 21 | } 22 | $ret .= "

" . $title . "

"; 23 | } 24 | return $ret; 25 | } 26 | 27 | 28 | function pageFooter($file = null) 29 | { 30 | $ret = ""; 31 | if (isWebRequest()) { 32 | // Echo the code if in an example. 33 | if ($file) { 34 | $ret .= "

Code:

"; 35 | $ret .= "
";
36 |       $ret .= htmlspecialchars(file_get_contents($file));
37 |       $ret .= "
"; 38 | } 39 | $ret .= ""; 40 | } 41 | return $ret; 42 | } 43 | 44 | function missingApiKeyWarning() 45 | { 46 | $ret = ""; 47 | if (isWebRequest()) { 48 | $ret = " 49 |

50 | Warning: You need to set a Simple API Access key from the 51 | Google API console 52 |

"; 53 | } else { 54 | $ret = "Warning: You need to set a Simple API Access key from the Google API console:"; 55 | $ret .= "\nhttp://developers.google.com/console"; 56 | } 57 | return $ret; 58 | } 59 | 60 | function missingClientSecretsWarning() 61 | { 62 | $ret = ""; 63 | if (isWebRequest()) { 64 | $ret = " 65 |

66 | Warning: You need to set Client ID, Client Secret and Redirect URI from the 67 | Google API console 68 |

"; 69 | } else { 70 | $ret = "Warning: You need to set Client ID, Client Secret and Redirect URI from the"; 71 | $ret .= "Google API console:\nhttp://developers.google.com/console"; 72 | } 73 | return $ret; 74 | } 75 | 76 | function missingServiceAccountDetailsWarning() 77 | { 78 | $ret = ""; 79 | if (isWebRequest()) { 80 | $ret = " 81 |

82 | Warning: You need to set Client ID, Email address and the location of the Key from the 83 | Google API console 84 |

"; 85 | } else { 86 | $ret = "Warning: You need to set Client ID, Email address and the location of the Key from the"; 87 | $ret .= "Google API console:\nhttp://developers.google.com/console"; 88 | } 89 | return $ret; 90 | } 91 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/WorksheetFeed.php: -------------------------------------------------------------------------------- 1 | 28 | */ 29 | class WorksheetFeed extends ArrayIterator 30 | { 31 | /** 32 | * Worksheet feed xml object 33 | * 34 | * @var \SimpleXMLElement 35 | */ 36 | private $xml; 37 | 38 | /** 39 | * Initializes thie worksheet feed object 40 | * 41 | * @param string $xml 42 | */ 43 | public function __construct($xml) 44 | { 45 | $this->xml = new SimpleXMLElement($xml); 46 | 47 | $worksheets = array(); 48 | foreach ($this->xml->entry as $entry) { 49 | $worksheet = new Worksheet($entry); 50 | $worksheet->setPostUrl($this->getPostUrl()); 51 | $worksheets[] = $worksheet; 52 | } 53 | parent::__construct($worksheets); 54 | } 55 | 56 | /** 57 | * Get the worksheet feed post url 58 | * 59 | * @return string 60 | */ 61 | private function getPostUrl() 62 | { 63 | return Util::getLinkHref($this->xml, 'http://schemas.google.com/g/2005#post'); 64 | } 65 | 66 | /** 67 | * Get the cell feed url 68 | * 69 | * @return stirng 70 | */ 71 | public function getCellFeedUrl() 72 | { 73 | return Util::getLinkHref($this->xml, 'http://schemas.google.com/spreadsheets/2006#cellsfeed'); 74 | } 75 | 76 | /** 77 | * Get a worksheet by title (name) 78 | * 79 | * @param string $title name of the worksheet 80 | * 81 | * @return \Google\Spreadsheet\Worksheet 82 | */ 83 | public function getByTitle($title) 84 | { 85 | foreach ($this->xml->entry as $entry) { 86 | if ($entry->title->__toString() == $title) { 87 | $worksheet = new Worksheet($entry); 88 | $worksheet->setPostUrl($this->getPostUrl()); 89 | return $worksheet; 90 | } 91 | } 92 | return null; 93 | } 94 | 95 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Collection.php: -------------------------------------------------------------------------------- 1 | modelData[$this->collection_key]) 17 | && is_array($this->modelData[$this->collection_key])) { 18 | reset($this->modelData[$this->collection_key]); 19 | } 20 | } 21 | 22 | public function current() 23 | { 24 | $this->coerceType($this->key()); 25 | if (is_array($this->modelData[$this->collection_key])) { 26 | return current($this->modelData[$this->collection_key]); 27 | } 28 | } 29 | 30 | public function key() 31 | { 32 | if (isset($this->modelData[$this->collection_key]) 33 | && is_array($this->modelData[$this->collection_key])) { 34 | return key($this->modelData[$this->collection_key]); 35 | } 36 | } 37 | 38 | public function next() 39 | { 40 | return next($this->modelData[$this->collection_key]); 41 | } 42 | 43 | public function valid() 44 | { 45 | $key = $this->key(); 46 | return $key !== null && $key !== false; 47 | } 48 | 49 | public function count() 50 | { 51 | return count($this->modelData[$this->collection_key]); 52 | } 53 | 54 | public function offsetExists ($offset) 55 | { 56 | if (!is_numeric($offset)) { 57 | return parent::offsetExists($offset); 58 | } 59 | return isset($this->modelData[$this->collection_key][$offset]); 60 | } 61 | 62 | public function offsetGet($offset) 63 | { 64 | if (!is_numeric($offset)) { 65 | return parent::offsetGet($offset); 66 | } 67 | $this->coerceType($offset); 68 | return $this->modelData[$this->collection_key][$offset]; 69 | } 70 | 71 | public function offsetSet($offset, $value) 72 | { 73 | if (!is_numeric($offset)) { 74 | return parent::offsetSet($offset, $value); 75 | } 76 | $this->modelData[$this->collection_key][$offset] = $value; 77 | } 78 | 79 | public function offsetUnset($offset) 80 | { 81 | if (!is_numeric($offset)) { 82 | return parent::offsetUnset($offset); 83 | } 84 | unset($this->modelData[$this->collection_key][$offset]); 85 | } 86 | 87 | private function coerceType($offset) 88 | { 89 | $typeKey = $this->keyType($this->collection_key); 90 | if (isset($this->$typeKey) && !is_object($this->modelData[$this->collection_key][$offset])) { 91 | $type = $this->$typeKey; 92 | $this->modelData[$this->collection_key][$offset] = 93 | new $type($this->modelData[$this->collection_key][$offset]); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/tasks/TasksTest.php: -------------------------------------------------------------------------------- 1 | taskService = new Google_Service_Tasks($this->getClient()); 27 | } 28 | 29 | public function testInsertTask() { 30 | if (!$this->checkToken()) { 31 | return; 32 | } 33 | $list = $this->createTaskList('List: ' . __METHOD__); 34 | $task = $this->createTask('Task: '.__METHOD__, $list->id); 35 | $this->assertIsTask($task); 36 | } 37 | 38 | /** 39 | * @depends testInsertTask 40 | */ 41 | public function testGetTask() { 42 | $tasks = $this->taskService->tasks; 43 | $list = $this->createTaskList('List: ' . __METHOD__); 44 | $task = $this->createTask('Task: '. __METHOD__, $list['id']); 45 | 46 | $task = $tasks->get($list['id'], $task['id']); 47 | $this->assertIsTask($task); 48 | } 49 | 50 | /** 51 | * @depends testInsertTask 52 | */ 53 | public function testListTask() { 54 | $tasks = $this->taskService->tasks; 55 | $list = $this->createTaskList('List: ' . __METHOD__); 56 | 57 | for ($i=0; $i<4; $i++) { 58 | $this->createTask("Task: $i ".__METHOD__, $list['id']); 59 | } 60 | 61 | $tasksArray = $tasks->listTasks($list['id']); 62 | $this->assertTrue(sizeof($tasksArray) > 1); 63 | foreach ($tasksArray['items'] as $task) { 64 | $this->assertIsTask($task); 65 | } 66 | } 67 | 68 | private function createTaskList($name) { 69 | $list = new Google_Service_Tasks_TaskList(); 70 | $list->title = $name; 71 | return $this->taskService->tasklists->insert($list); 72 | } 73 | 74 | private function createTask($title, $listId) { 75 | $tasks = $this->taskService->tasks; 76 | $task = new Google_Service_Tasks_Task(); 77 | $task->title = $title; 78 | return $tasks->insert($listId, $task); 79 | } 80 | 81 | private function assertIsTask($task) { 82 | $this->assertArrayHasKey('title', $task); 83 | $this->assertArrayHasKey('kind', $task); 84 | $this->assertArrayHasKey('id', $task); 85 | $this->assertArrayHasKey('position', $task); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/plus/PlusTest.php: -------------------------------------------------------------------------------- 1 | setName('Google Plus API tests'); 24 | $suite->addTestSuite('PlusTest'); 25 | return $suite; 26 | } 27 | } 28 | 29 | class PlusTest extends BaseTest { 30 | /** @var Google_PlusService */ 31 | public $plus; 32 | public function __construct() { 33 | parent::__construct(); 34 | $this->plus = new Google_Service_Plus($this->getClient()); 35 | } 36 | 37 | public function testGetPerson() { 38 | $this->checkToken(); 39 | $person = $this->plus->people->get("118051310819094153327"); 40 | $this->assertArrayHasKey('kind', $person); 41 | $this->assertArrayHasKey('displayName', $person); 42 | $this->assertArrayHasKey('gender', $person); 43 | $this->assertArrayHasKey('id', $person); 44 | } 45 | 46 | public function testListActivities() { 47 | $this->checkToken(); 48 | $activities = $this->plus->activities 49 | ->listActivities("118051310819094153327", "public"); 50 | 51 | $this->assertArrayHasKey('kind', $activities); 52 | $this->assertGreaterThan(0, count($activities)); 53 | 54 | // Test a variety of access methods. 55 | $this->assertItem($activities['items'][0]); 56 | $this->assertItem($activities[0]); 57 | foreach($activities as $item) { 58 | $this->assertItem($item); 59 | break; 60 | } 61 | 62 | // Test deeper type transformations 63 | $this->assertGreaterThan(0, strlen($activities[0]->actor->displayName)); 64 | } 65 | 66 | public function assertItem($item) { 67 | // assertArrayHasKey uses array_key_exists, which is not great: 68 | // it doesn't understand SPL ArrayAccess 69 | $this->assertTrue(isset($item['actor'])); 70 | $this->assertInstanceOf('Google_Service_Plus_ActivityActor', $item->actor); 71 | $this->assertTrue(isset($item['actor']['displayName'])); 72 | $this->assertTrue(isset($item['actor']->url)); 73 | $this->assertTrue(isset($item['object'])); 74 | $this->assertTrue(isset($item['access'])); 75 | $this->assertTrue(isset($item['provider'])); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/ListEntry.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class ListEntry 29 | { 30 | /** 31 | * The xml representation of this list entry 32 | * 33 | * @var \SimpleXMLElement 34 | */ 35 | protected $xml; 36 | 37 | /** 38 | * The data for this list entry 39 | * 40 | * @var array 41 | */ 42 | protected $data; 43 | 44 | /** 45 | * Constructor 46 | * 47 | * @param \SimpleXMLElement $xml 48 | * @param array $data 49 | */ 50 | public function __construct($xml, $data) 51 | { 52 | $this->xml = $xml; 53 | $this->data = $data; 54 | } 55 | 56 | /** 57 | * Get the values of this list entry 58 | * 59 | * @return array 60 | */ 61 | public function getValues() 62 | { 63 | return $this->data; 64 | } 65 | 66 | /** 67 | * Update this entry 68 | * 69 | * @param array $values 70 | */ 71 | public function update($values) 72 | { 73 | $entry = ''; 74 | $entry .= ''.$this->xml->id->__toString().''; 75 | 76 | foreach($values as $colName => $value) { 77 | $entry .= sprintf( 78 | '', 79 | $colName, 80 | $value, 81 | $colName 82 | ); 83 | } 84 | 85 | $entry .= ''; 86 | 87 | ServiceRequestFactory::getInstance()->put($this->getEditUrl(), $entry); 88 | } 89 | 90 | /** 91 | * Delete the current entry. 92 | */ 93 | public function delete() 94 | { 95 | ServiceRequestFactory::getInstance()->delete($this->getEditUrl()); 96 | } 97 | 98 | /** 99 | * Get the edit url 100 | * 101 | * @return string 102 | */ 103 | public function getEditUrl() 104 | { 105 | return Util::getLinkHref($this->xml, 'edit'); 106 | } 107 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/ServiceTest.php: -------------------------------------------------------------------------------- 1 | mapTypes(array( 41 | 'name' => 'asdf', 42 | 'gender' => 'z', 43 | )); 44 | $this->assertEquals('asdf', $model->name); 45 | $this->assertEquals('z', $model->gender); 46 | $model->mapTypes(array( 47 | '__infoType' => 'Google_Model', 48 | '__infoDataType' => 'map', 49 | 'info' => array ( 50 | 'location' => 'mars', 51 | 'timezone' => 'mst', 52 | ), 53 | 'name' => 'asdf', 54 | 'gender' => 'z', 55 | )); 56 | $this->assertEquals('asdf', $model->name); 57 | $this->assertEquals('z', $model->gender); 58 | 59 | $this->assertEquals(false, $model->isAssociativeArray("")); 60 | $this->assertEquals(false, $model->isAssociativeArray(false)); 61 | $this->assertEquals(false, $model->isAssociativeArray(null)); 62 | $this->assertEquals(false, $model->isAssociativeArray(array())); 63 | $this->assertEquals(false, $model->isAssociativeArray(array(1, 2))); 64 | $this->assertEquals(false, $model->isAssociativeArray(array(1 => 2))); 65 | 66 | $this->assertEquals(true, $model->isAssociativeArray(array('test' => 'a'))); 67 | $this->assertEquals(true, $model->isAssociativeArray(array("a", "b" => 2))); 68 | } 69 | 70 | public function testStrLen() { 71 | $this->assertEquals(0, Google_Utils::getStrLen(null)); 72 | $this->assertEquals(0, Google_Utils::getStrLen(false)); 73 | $this->assertEquals(0, Google_Utils::getStrLen("")); 74 | 75 | $this->assertEquals(1, Google_Utils::getStrLen(" ")); 76 | $this->assertEquals(2, Google_Utils::getStrLen(" 1")); 77 | $this->assertEquals(7, Google_Utils::getStrLen("0a\\n\n\r\n")); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/WorksheetTest.php: -------------------------------------------------------------------------------- 1 | assertEquals('https://spreadsheets.google.com/feeds/worksheets/tA3TdJ0RIVEem3xQZhG2Ceg/private/full/od8', $worksheet->getId()); 15 | } 16 | 17 | public function testGetUpdated() 18 | { 19 | $xml = file_get_contents(__DIR__.'/xml/worksheet.xml'); 20 | $worksheet = new Worksheet(new SimpleXMLElement($xml)); 21 | 22 | $this->assertTrue($worksheet->getUpdated() instanceof DateTime); 23 | $this->assertEquals('2013-02-10 21:12:33', $worksheet->getUpdated()->format('Y-m-d H:i:s')); 24 | } 25 | 26 | public function testGetTitle() 27 | { 28 | $xml = file_get_contents(__DIR__.'/xml/worksheet.xml'); 29 | $worksheet = new Worksheet(new SimpleXMLElement($xml)); 30 | 31 | $this->assertEquals('Test', $worksheet->getTitle()); 32 | } 33 | 34 | public function testGetListFeedDefault() 35 | { 36 | $feedUrl = "https://spreadsheets.google.com/feeds/list/tA3TdJ0RIVEem3xQZhG2Ceg/od8/private/full"; 37 | 38 | $mockServiceRequest = $this->getMockBuilder('Google\Spreadsheet\DefaultServiceRequest') 39 | ->setMethods(array("get")) 40 | ->disableOriginalConstructor() 41 | ->getMock(); 42 | 43 | $mockServiceRequest 44 | ->expects($this->once()) 45 | ->method('get') 46 | ->with($this->equalTo($feedUrl)) 47 | ->willReturn(file_get_contents(__DIR__.'/xml/list-feed.xml')); 48 | 49 | ServiceRequestFactory::setInstance($mockServiceRequest); 50 | 51 | $worksheet = new Worksheet(new SimpleXMLElement(file_get_contents(__DIR__.'/xml/worksheet.xml'))); 52 | $worksheet->getListFeed(); 53 | } 54 | 55 | public function testGetListFeedWithQuery() 56 | { 57 | $feedUrl = "https://spreadsheets.google.com/feeds/list/tA3TdJ0RIVEem3xQZhG2Ceg/od8/private/full?reverse=true&sq=age+%3E+45"; 58 | 59 | $mockServiceRequest = $this->getMockBuilder('Google\Spreadsheet\DefaultServiceRequest') 60 | ->setMethods(array("get")) 61 | ->disableOriginalConstructor() 62 | ->getMock(); 63 | 64 | $mockServiceRequest 65 | ->expects($this->once()) 66 | ->method('get') 67 | ->with($this->equalTo($feedUrl)) 68 | ->willReturn(file_get_contents(__DIR__.'/xml/list-feed.xml')); 69 | 70 | ServiceRequestFactory::setInstance($mockServiceRequest); 71 | 72 | $worksheet = new Worksheet(new SimpleXMLElement(file_get_contents(__DIR__.'/xml/worksheet.xml'))); 73 | $worksheet->getListFeed(array("reverse" => "true", "sq" => "age > 45")); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/tests/Google/Spreadsheet/xml/spreadsheet-feed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://spreadsheets.google.com/feeds/spreadsheets/private/full 4 | 2014-02-22T22:35:38.954Z 5 | 6 | Available Spreadsheets - asimlqt22@gmail.com 7 | 8 | 9 | 10 | 2 11 | 1 12 | 13 | https://spreadsheets.google.com/feeds/spreadsheets/private/full/tFEgU8ywJkkjcZjGs 14 | 2014-02-07T18:33:44.826Z 15 | 16 | Notes 17 | Notes 18 | 19 | 20 | 21 | 22 | asimlqt22 23 | asimlqt22@gmail.com 24 | 25 | 26 | 27 | https://spreadsheets.google.com/feeds/spreadsheets/private/full/t0Zf6pG69DruUL6qAqD 28 | 2013-08-18T23:40:45.357Z 29 | 30 | Test Spreadsheet 31 | Test Spreadsheet 32 | 33 | 34 | 35 | 36 | asimlqt22 37 | asimlqt22@gmail.com 38 | 39 | 40 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/ApiBatchRequestTest.php: -------------------------------------------------------------------------------- 1 | checkToken()) { 31 | return; 32 | } 33 | $client = $this->getClient(); 34 | $batch = new Google_Http_Batch($client); 35 | $this->plus = new Google_Service_Plus($client); 36 | 37 | $client->setUseBatch(true); 38 | $batch->add($this->plus->people->get('me'), 'key1'); 39 | $batch->add($this->plus->people->get('me'), 'key2'); 40 | $batch->add($this->plus->people->get('me'), 'key3'); 41 | 42 | $result = $batch->execute(); 43 | $this->assertTrue(isset($result['response-key1'])); 44 | $this->assertTrue(isset($result['response-key2'])); 45 | $this->assertTrue(isset($result['response-key3'])); 46 | } 47 | 48 | public function testBatchRequest() 49 | { 50 | $client = $this->getClient(); 51 | $batch = new Google_Http_Batch($client); 52 | $this->plus = new Google_Service_Plus($client); 53 | 54 | $client->setUseBatch(true); 55 | $batch->add($this->plus->people->get('+LarryPage'), 'key1'); 56 | $batch->add($this->plus->people->get('+LarryPage'), 'key2'); 57 | $batch->add($this->plus->people->get('+LarryPage'), 'key3'); 58 | 59 | $result = $batch->execute(); 60 | $this->assertTrue(isset($result['response-key1'])); 61 | $this->assertTrue(isset($result['response-key2'])); 62 | $this->assertTrue(isset($result['response-key3'])); 63 | } 64 | 65 | public function testInvalidBatchRequest() 66 | { 67 | $client = $this->getClient(); 68 | $batch = new Google_Http_Batch($client); 69 | $this->plus = new Google_Service_Plus($client); 70 | 71 | $client->setUseBatch(true); 72 | $batch->add($this->plus->people->get('123456789987654321'), 'key1'); 73 | $batch->add($this->plus->people->get('+LarryPage'), 'key2'); 74 | 75 | $result = $batch->execute(); 76 | $this->assertTrue(isset($result['response-key2'])); 77 | $this->assertInstanceOf('Google_Service_Exception', 78 | $result['response-key1']); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/ListFeed.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class ListFeed 29 | { 30 | /** 31 | * Xml representation of this feed 32 | * 33 | * @var \SimpleXMLElement 34 | */ 35 | protected $xml; 36 | 37 | /** 38 | * Constructor 39 | * 40 | * @param string $xmlString 41 | */ 42 | public function __construct($xmlString) 43 | { 44 | $xml = new SimpleXMLElement($xmlString); 45 | $xml->registerXPathNamespace('gsx', 'http://schemas.google.com/spreadsheets/2006/extended'); 46 | $this->xml = $xml; 47 | } 48 | 49 | /** 50 | * Get the post url for this feed 51 | * 52 | * @return string 53 | */ 54 | public function getPostUrl() 55 | { 56 | return Util::getLinkHref($this->xml, 'http://schemas.google.com/g/2005#post'); 57 | } 58 | 59 | /** 60 | * Insert a new row into this feed 61 | * 62 | * @param array $row 63 | * 64 | * @return void 65 | */ 66 | public function insert($row) 67 | { 68 | $entry = ''; 69 | foreach($row as $colName => $value) { 70 | $entry .= sprintf( 71 | '', 72 | $colName, 73 | $value, 74 | $colName 75 | ); 76 | } 77 | $entry .= ''; 78 | 79 | ServiceRequestFactory::getInstance()->post($this->getPostUrl(), $entry); 80 | } 81 | 82 | /** 83 | * Get the entries of this feed 84 | * 85 | * @return array \Google\Spreadsheet\ListEntry 86 | */ 87 | public function getEntries() 88 | { 89 | $rows = array(); 90 | 91 | if(count($this->xml->entry) > 0) { 92 | 93 | foreach ($this->xml->entry as $entry) { 94 | $data = array(); 95 | foreach($entry->xpath('gsx:*') as $col) { 96 | $data[$col->getName()] = $col->__toString(); 97 | } 98 | 99 | $rows[] = new ListEntry($entry, $data); 100 | } 101 | } 102 | 103 | return $rows; 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Signer/P12.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | class Google_Signer_P12 extends Google_Signer_Abstract 29 | { 30 | // OpenSSL private key resource 31 | private $privateKey; 32 | 33 | // Creates a new signer from a .p12 file. 34 | public function __construct($p12, $password) 35 | { 36 | if (!function_exists('openssl_x509_read')) { 37 | throw new Google_Exception( 38 | 'The Google PHP API library needs the openssl PHP extension' 39 | ); 40 | } 41 | 42 | // If the private key is provided directly, then this isn't in the p12 43 | // format. Different versions of openssl support different p12 formats 44 | // and the key from google wasn't being accepted by the version available 45 | // at the time. 46 | if (!$password && strpos($p12, "-----BEGIN RSA PRIVATE KEY-----") !== false) { 47 | $this->privateKey = openssl_pkey_get_private($p12); 48 | } else { 49 | // This throws on error 50 | $certs = array(); 51 | if (!openssl_pkcs12_read($p12, $certs, $password)) { 52 | throw new Google_Auth_Exception( 53 | "Unable to parse the p12 file. " . 54 | "Is this a .p12 file? Is the password correct? OpenSSL error: " . 55 | openssl_error_string() 56 | ); 57 | } 58 | // TODO(beaton): is this part of the contract for the openssl_pkcs12_read 59 | // method? What happens if there are multiple private keys? Do we care? 60 | if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) { 61 | throw new Google_Auth_Exception("No private key found in p12 file."); 62 | } 63 | $this->privateKey = openssl_pkey_get_private($certs['pkey']); 64 | } 65 | 66 | if (!$this->privateKey) { 67 | throw new Google_Auth_Exception("Unable to load private key"); 68 | } 69 | } 70 | 71 | public function __destruct() 72 | { 73 | if ($this->privateKey) { 74 | openssl_pkey_free($this->privateKey); 75 | } 76 | } 77 | 78 | public function sign($data) 79 | { 80 | if (version_compare(PHP_VERSION, '5.3.0') < 0) { 81 | throw new Google_Auth_Exception( 82 | "PHP 5.3.0 or higher is required to use service accounts." 83 | ); 84 | } 85 | $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256"; 86 | if (!openssl_sign($data, $signature, $this->privateKey, $hash)) { 87 | throw new Google_Auth_Exception("Unable to sign data"); 88 | } 89 | return $signature; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/RequestTest.php: -------------------------------------------------------------------------------- 1 | setExpectedClass("Google_Client"); 32 | $this->assertEquals(2, count($request->getQueryParams())); 33 | $request->setQueryParam("hi", "there"); 34 | $this->assertEquals($url2, $request->getUrl()); 35 | $this->assertEquals("Google_Client", $request->getExpectedClass()); 36 | 37 | $urlPath = "/foo/bar"; 38 | $request = new Google_Http_Request($urlPath); 39 | $this->assertEquals($urlPath, $request->getUrl()); 40 | $request->setBaseComponent("http://example.com"); 41 | $this->assertEquals("http://example.com" . $urlPath, $request->getUrl()); 42 | 43 | $url3a = 'http://localhost:8080/foo/bar'; 44 | $url3b = 'foo=a&foo=b&wowee=oh+my'; 45 | $url3c = 'foo=a&foo=b&wowee=oh+my&hi=there'; 46 | $request = new Google_Http_Request($url3a."?".$url3b, "POST"); 47 | $request->setQueryParam("hi", "there"); 48 | $request->maybeMoveParametersToBody(); 49 | $this->assertEquals($url3a, $request->getUrl()); 50 | $this->assertEquals($url3c, $request->getPostBody()); 51 | 52 | $url4 = 'http://localhost:8080/upload/foo/bar?foo=a&foo=b&wowee=oh+my&hi=there'; 53 | $request = new Google_Http_Request($url); 54 | $this->assertEquals(2, count($request->getQueryParams())); 55 | $request->setQueryParam("hi", "there"); 56 | $base = $request->getBaseComponent(); 57 | $request->setBaseComponent($base . '/upload'); 58 | $this->assertEquals($url4, $request->getUrl()); 59 | } 60 | 61 | public function testGzipSupport() 62 | { 63 | $url = 'http://localhost:8080/foo/bar?foo=a&foo=b&wowee=oh+my'; 64 | $request = new Google_Http_Request($url); 65 | $request->enableGzip(); 66 | $this->assertStringEndsWith(Google_Http_Request::GZIP_UA, $request->getUserAgent()); 67 | $this->assertArrayHasKey('accept-encoding', $request->getRequestHeaders()); 68 | $this->assertTrue($request->canGzip()); 69 | $request->disableGzip(); 70 | $this->assertStringEndsNotWith(Google_Http_Request::GZIP_UA, $request->getUserAgent()); 71 | $this->assertArrayNotHasKey('accept-encoding', $request->getRequestHeaders()); 72 | $this->assertFalse($request->canGzip()); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/batch.php: -------------------------------------------------------------------------------- 1 | setApplicationName("Client_Library_Examples"); 38 | $apiKey = ""; // Change to your API key. 39 | // Warn if the API key isn't changed! 40 | if ($apiKey == '') { 41 | echo missingApiKeyWarning(); 42 | } else { 43 | $client->setDeveloperKey($apiKey); 44 | 45 | $service = new Google_Service_Books($client); 46 | 47 | /************************************************ 48 | To actually make the batch call we need to 49 | enable batching on the client - this will apply 50 | globally until we set it to false. This causes 51 | call to the service methods to return the query 52 | rather than immediately executing. 53 | ************************************************/ 54 | $client->setUseBatch(true); 55 | 56 | /************************************************ 57 | We then create a batch, and add each query we 58 | want to execute with keys of our choice - these 59 | keys will be reflected in the returned array. 60 | ************************************************/ 61 | $batch = new Google_Http_Batch($client); 62 | $optParams = array('filter' => 'free-ebooks'); 63 | $req1 = $service->volumes->listVolumes('Henry David Thoreau', $optParams); 64 | $batch->add($req1, "thoreau"); 65 | $req2 = $service->volumes->listVolumes('George Bernard Shaw', $optParams); 66 | $batch->add($req2, "shaw"); 67 | 68 | /************************************************ 69 | Executing the batch will send all requests off 70 | at once. 71 | ************************************************/ 72 | $results = $batch->execute(); 73 | 74 | echo "

Results Of Call 1:

"; 75 | foreach ($results['response-thoreau'] as $item) { 76 | echo $item['volumeInfo']['title'], "
\n"; 77 | } 78 | echo "

Results Of Call 2:

"; 79 | foreach ($results['response-shaw'] as $item) { 80 | echo $item['volumeInfo']['title'], "
\n"; 81 | } 82 | } 83 | 84 | echo pageFooter(__FILE__); 85 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/Batch/BatchRequest.php: -------------------------------------------------------------------------------- 1 | 29 | */ 30 | class BatchRequest 31 | { 32 | /** 33 | * 34 | * @var CellEntry[] 35 | */ 36 | protected $entries; 37 | 38 | 39 | public function __construct() 40 | { 41 | $this->entries = array(); 42 | } 43 | 44 | /** 45 | * 46 | * @param \Google\Spreadsheet\CellEntry $cellEntry 47 | */ 48 | public function addEntry(CellEntry $cellEntry) 49 | { 50 | $this->entries[] = $cellEntry; 51 | } 52 | 53 | /** 54 | * 55 | * @param \Google\Spreadsheet\CellFeed $cellFeed 56 | * 57 | * @return string|null 58 | */ 59 | public function createRequestXml(CellFeed $cellFeed) 60 | { 61 | if(count($this->entries) === 0) { 62 | return null; 63 | } 64 | 65 | $xml = ' 66 | '; 69 | 70 | $xml .= ''. $cellFeed->getPostUrl() .'/batch'; 71 | 72 | $i = 1; 73 | foreach($this->entries as $cellEntry) { 74 | $xml .= $this->createEntry($cellEntry, $i++, $cellFeed); 75 | } 76 | 77 | $xml .= ''; 78 | 79 | return $xml; 80 | } 81 | 82 | /** 83 | * 84 | * @param \Google\Spreadsheet\CellEntry $cellEntry 85 | * @param string $index 86 | * @param \Google\Spreadsheet\CellFeed $cellFeed 87 | * 88 | * @return string 89 | */ 90 | protected function createEntry(CellEntry $cellEntry, $index, CellFeed $cellFeed) 91 | { 92 | return sprintf( 93 | ' 94 | %s 95 | 96 | %s 97 | 99 | 100 | ', 101 | 'A'.$index, 102 | $cellFeed->getPostUrl() . "/" . $cellEntry->getCellIdString(), 103 | $cellEntry->getEditUrl(), 104 | $cellEntry->getRow(), 105 | $cellEntry->getColumn(), 106 | $cellEntry->getContent() 107 | ); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "asimlqt/php-google-spreadsheet-client", 4 | "version": "2.3.0", 5 | "version_normalized": "2.3.0.0", 6 | "source": { 7 | "type": "git", 8 | "url": "https://github.com/asimlqt/php-google-spreadsheet-client.git", 9 | "reference": "7c87fb7021f1fa1c5f2dbafd999e49f2e6bf364e" 10 | }, 11 | "dist": { 12 | "type": "zip", 13 | "url": "https://api.github.com/repos/asimlqt/php-google-spreadsheet-client/zipball/7c87fb7021f1fa1c5f2dbafd999e49f2e6bf364e", 14 | "reference": "7c87fb7021f1fa1c5f2dbafd999e49f2e6bf364e", 15 | "shasum": "" 16 | }, 17 | "require": { 18 | "php": ">=5.3.0" 19 | }, 20 | "time": "2014-12-02 18:15:21", 21 | "type": "library", 22 | "installation-source": "dist", 23 | "autoload": { 24 | "psr-4": { 25 | "Google\\": "src/Google" 26 | } 27 | }, 28 | "notification-url": "https://packagist.org/downloads/", 29 | "license": [ 30 | "Apache-2.0" 31 | ], 32 | "authors": [ 33 | { 34 | "name": "Asim Liaquat", 35 | "email": "asimlqt22@gmail.com", 36 | "role": "Developer" 37 | }, 38 | { 39 | "name": "Martin Czygan", 40 | "email": "martin.czygan@gmail.com", 41 | "homepage": "http://twitter.com/cvvfj", 42 | "role": "Packager" 43 | } 44 | ], 45 | "description": "Google Spreadsheet PHP Client", 46 | "homepage": "https://github.com/asimlqt/php-google-spreadsheet-client", 47 | "keywords": [ 48 | "google", 49 | "spreadsheet" 50 | ] 51 | }, 52 | { 53 | "name": "google/apiclient", 54 | "version": "1.0.6-beta", 55 | "version_normalized": "1.0.6.0-beta", 56 | "source": { 57 | "type": "git", 58 | "url": "https://github.com/google/google-api-php-client.git", 59 | "reference": "a41a9dc0662e36420030eaab802dbb1f85459479" 60 | }, 61 | "dist": { 62 | "type": "zip", 63 | "url": "https://api.github.com/repos/google/google-api-php-client/zipball/a41a9dc0662e36420030eaab802dbb1f85459479", 64 | "reference": "a41a9dc0662e36420030eaab802dbb1f85459479", 65 | "shasum": "" 66 | }, 67 | "require": { 68 | "php": ">=5.2.1" 69 | }, 70 | "require-dev": { 71 | "phpunit/phpunit": "3.7.*" 72 | }, 73 | "time": "2014-09-30 19:33:59", 74 | "type": "library", 75 | "extra": { 76 | "branch-alias": { 77 | "dev-master": "1.0.x-dev" 78 | } 79 | }, 80 | "installation-source": "dist", 81 | "autoload": { 82 | "classmap": [ 83 | "src/" 84 | ] 85 | }, 86 | "notification-url": "https://packagist.org/downloads/", 87 | "include-path": [ 88 | "src/" 89 | ], 90 | "license": [ 91 | "Apache-2.0" 92 | ], 93 | "description": "Client library for Google APIs", 94 | "homepage": "http://developers.google.com/api-client-library/php", 95 | "keywords": [ 96 | "google" 97 | ] 98 | } 99 | ] 100 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/simple-query.php: -------------------------------------------------------------------------------- 1 | setApplicationName("Client_Library_Examples"); 40 | $apiKey = ""; // Change this line. 41 | // Warn if the API key isn't changed. 42 | if ($apiKey == '') { 43 | echo missingApiKeyWarning(); 44 | } 45 | $client->setDeveloperKey($apiKey); 46 | 47 | $service = new Google_Service_Books($client); 48 | 49 | /************************************************ 50 | We make a call to our service, which will 51 | normally map to the structure of the API. 52 | In this case $service is Books API, the 53 | resource is volumes, and the method is 54 | listVolumes. We pass it a required parameters 55 | (the query), and an array of named optional 56 | parameters. 57 | ************************************************/ 58 | $optParams = array('filter' => 'free-ebooks'); 59 | $results = $service->volumes->listVolumes('Henry David Thoreau', $optParams); 60 | 61 | /************************************************ 62 | This call returns a list of volumes, so we 63 | can iterate over them as normal with any 64 | array. 65 | Some calls will return a single item which we 66 | can immediately use. The individual responses 67 | are typed as Google_Service_Books_Volume, but 68 | can be treated as an array. 69 | ***********************************************/ 70 | echo "

Results Of Call:

"; 71 | foreach ($results as $item) { 72 | echo $item['volumeInfo']['title'], "
\n"; 73 | } 74 | 75 | /************************************************ 76 | This is an example of deferring a call. 77 | ***********************************************/ 78 | $client->setDefer(true); 79 | $optParams = array('filter' => 'free-ebooks'); 80 | $request = $service->volumes->listVolumes('Henry David Thoreau', $optParams); 81 | $results = $client->execute($request); 82 | 83 | echo "

Results Of Deferred Call:

"; 84 | foreach ($results as $item) { 85 | echo $item['volumeInfo']['title'], "
\n"; 86 | } 87 | 88 | echo pageFooter(__FILE__); 89 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Auth/AppIdentity.php: -------------------------------------------------------------------------------- 1 | client = $client; 43 | } 44 | 45 | /** 46 | * Retrieve an access token for the scopes supplied. 47 | */ 48 | public function authenticateForScope($scopes) 49 | { 50 | if ($this->token && $this->tokenScopes == $scopes) { 51 | return $this->token; 52 | } 53 | $memcache = new Memcached(); 54 | $this->token = $memcache->get(self::CACHE_PREFIX . $scopes); 55 | if (!$this->token) { 56 | $this->token = AppIdentityService::getAccessToken($scopes); 57 | if ($this->token) { 58 | $memcache_key = self::CACHE_PREFIX; 59 | if (is_string($scopes)) { 60 | $memcache_key .= $scopes; 61 | } else if (is_array($scopes)) { 62 | $memcache_key .= implode(":", $scopes); 63 | } 64 | $memcache->set($memcache_key, $this->token, self::CACHE_LIFETIME); 65 | } 66 | } 67 | $this->tokenScopes = $scopes; 68 | return $this->token; 69 | } 70 | 71 | /** 72 | * Perform an authenticated / signed apiHttpRequest. 73 | * This function takes the apiHttpRequest, calls apiAuth->sign on it 74 | * (which can modify the request in what ever way fits the auth mechanism) 75 | * and then calls apiCurlIO::makeRequest on the signed request 76 | * 77 | * @param Google_Http_Request $request 78 | * @return Google_Http_Request The resulting HTTP response including the 79 | * responseHttpCode, responseHeaders and responseBody. 80 | */ 81 | public function authenticatedRequest(Google_Http_Request $request) 82 | { 83 | $request = $this->sign($request); 84 | return $this->io->makeRequest($request); 85 | } 86 | 87 | public function sign(Google_Http_Request $request) 88 | { 89 | if (!$this->token) { 90 | // No token, so nothing to do. 91 | return $request; 92 | } 93 | // Add the OAuth2 header to the request 94 | $request->setRequestHeaders( 95 | array('Authorization' => 'Bearer ' . $this->token['access_token']) 96 | ); 97 | 98 | return $request; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/service-account.php: -------------------------------------------------------------------------------- 1 | '; //Client ID 42 | $service_account_name = ''; //Email Address 43 | $key_file_location = ''; //key.p12 44 | 45 | echo pageHeader("Service Account Access"); 46 | if ($client_id == '' 47 | || !strlen($service_account_name) 48 | || !strlen($key_file_location)) { 49 | echo missingServiceAccountDetailsWarning(); 50 | } 51 | 52 | $client = new Google_Client(); 53 | $client->setApplicationName("Client_Library_Examples"); 54 | $service = new Google_Service_Books($client); 55 | 56 | /************************************************ 57 | If we have an access token, we can carry on. 58 | Otherwise, we'll get one with the help of an 59 | assertion credential. In other examples the list 60 | of scopes was managed by the Client, but here 61 | we have to list them manually. We also supply 62 | the service account 63 | ************************************************/ 64 | if (isset($_SESSION['service_token'])) { 65 | $client->setAccessToken($_SESSION['service_token']); 66 | } 67 | $key = file_get_contents($key_file_location); 68 | $cred = new Google_Auth_AssertionCredentials( 69 | $service_account_name, 70 | array('https://www.googleapis.com/auth/books'), 71 | $key 72 | ); 73 | $client->setAssertionCredentials($cred); 74 | if($client->getAuth()->isAccessTokenExpired()) { 75 | $client->getAuth()->refreshTokenWithAssertion($cred); 76 | } 77 | $_SESSION['service_token'] = $client->getAccessToken(); 78 | 79 | /************************************************ 80 | We're just going to make the same call as in the 81 | simple query as an example. 82 | ************************************************/ 83 | $optParams = array('filter' => 'free-ebooks'); 84 | $results = $service->volumes->listVolumes('Henry David Thoreau', $optParams); 85 | echo "

Results Of Call:

"; 86 | foreach ($results as $item) { 87 | echo $item['volumeInfo']['title'], "
\n"; 88 | } 89 | 90 | echo pageFooter(__FILE__); 91 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Google Docs RSVP, WordPress Plugin 2 | * Contributors: Gifford Cheung, Brian Watanabe, Chongsun Ahn 3 | * Tags: RSVP, guestlist, wedding, Google Docs, spreadsheet 4 | * Requires at least: 2.5 5 | * Tested up to: 4.0.1 6 | * Stable tag: 2.0 7 | 8 | This plugin allows you to add RSVP and guestlist functionality. Guests can leave custom messages for the planners. Uses Google Docs spreadsheets. 9 | 10 | # Known issue 11 | Guest codes are not case sensitive. 12 | 13 | # Installation 14 | 15 | 1. Create a google docs spreadsheet with the following 7 headers: Guest Name, Code, Custom Message for Guest, Ceremony, Banquet, Message from Guest, Hotel. 16 | 2. Go to "Settings->Google Docs RSVP" to configure. 17 | 3. Add the text: gdrsvp-googledocsrsvp in the content of your RSVP page. 18 | 19 | # Description 20 | This plugin allows you to add RSVP and guestlist functionality to your Wordpress site. It tracks RSVPs for ceremony and banquet. Additionally, guests can leave custom messages for the planners. The guestlist is maintained with a Google Docs spreadsheet which is very easy to use. 21 | 22 | It was originally designed to be a wedding guestlist that I made for a friend (congratulations to Mike & Di!). 23 | 24 | Features Bulletlist: 25 | 26 | * Customizable RSVP page 27 | * Connects to Google Docs Spreadsheet for guestlist 28 | * Planners can write custom messages to guests 29 | * Guests can send custom message to planners 30 | * Email updates are sent to the planner 31 | * Wedding features: Records responses for Ceremony, Banquet, or Hotel Reservations 32 | 33 | # Instructions 34 | 1. Using a Google account, create a new Spreadsheet at docs.google.com 35 | 2. The spreadsheet must have the following 7 headers: Guest Name, Code, Custom Message for Guest, Ceremony, Banquet, Message from Guest, Hotel 36 | 3. Fill in the guestlist with names, codes, and an optional custom message. Make sure the code is not guessable, for example: short numeric codes are probably a bad idea. A nosy guest might punch in random numbers and see guest information. 37 | 4. Download, unzip, upload, and activate your plugin. 38 | 5. In your Wordpress site, go to "Settings->Google Docs RSVP" and follow the step-by-step instructions on the page, and fill in the other information (Google Docs title and sheet, etc.). 39 | 6. Create a new wordpress Page and put the text: gdrsvp-googledocsrsvp in the content box. The plugin will replace it with the RSVP code. 40 | 7. Now, guests can type in a code and fill out the reservation form, which will send an email to you and update the spreadsheet. Note: Once guests have filled out the form, their RSVP code is no longer usable. 41 | 42 | 43 | Thank you! Good luck with your planning efforts. Remember to allow guests to contact you in other ways in case of digital emergencies. 44 | 45 | We look forward to any comments. If there is a good response, we may incorporate your suggestions into the next version. 46 | 47 | This code is released under GPLv3. If you create a new version of this plugin, let us know and we may link to it. 48 | 49 | Thanks! 50 | 51 | # Frequently Asked Questions 52 | 53 | = My plugin isn't working = 54 | 55 | Check the homepage for a lot of comments and responses about how to fiddle 56 | with this plugin, we have had a bit of discussion and help from other users. 57 | 58 | Note that you are required to have PHP version 5. Sorry, the only solution right now is to use that version of PHP. 59 | 60 | # How do I change some of the text? 61 | 62 | If you cannot change the text in the options page, you can change it in the source code (by editting wp-gdrsvp-plugin.php). This is not a very safe thing to do, but you could search the code for the words you want to change and fiddle around with it. This take familiarity with HTML and a little PHP. 63 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Service/GroupsMigration.php: -------------------------------------------------------------------------------- 1 | 22 | * Groups Migration Api. 23 | *

24 | * 25 | *

26 | * For more information about this service, see the API 27 | * Documentation 28 | *

29 | * 30 | * @author Google, Inc. 31 | */ 32 | class Google_Service_GroupsMigration extends Google_Service 33 | { 34 | 35 | 36 | public $archive; 37 | 38 | 39 | /** 40 | * Constructs the internal representation of the GroupsMigration service. 41 | * 42 | * @param Google_Client $client 43 | */ 44 | public function __construct(Google_Client $client) 45 | { 46 | parent::__construct($client); 47 | $this->servicePath = 'groups/v1/groups/'; 48 | $this->version = 'v1'; 49 | $this->serviceName = 'groupsmigration'; 50 | 51 | $this->archive = new Google_Service_GroupsMigration_Archive_Resource( 52 | $this, 53 | $this->serviceName, 54 | 'archive', 55 | array( 56 | 'methods' => array( 57 | 'insert' => array( 58 | 'path' => '{groupId}/archive', 59 | 'httpMethod' => 'POST', 60 | 'parameters' => array( 61 | 'groupId' => array( 62 | 'location' => 'path', 63 | 'type' => 'string', 64 | 'required' => true, 65 | ), 66 | ), 67 | ), 68 | ) 69 | ) 70 | ); 71 | } 72 | } 73 | 74 | 75 | /** 76 | * The "archive" collection of methods. 77 | * Typical usage is: 78 | * 79 | * $groupsmigrationService = new Google_Service_GroupsMigration(...); 80 | * $archive = $groupsmigrationService->archive; 81 | * 82 | */ 83 | class Google_Service_GroupsMigration_Archive_Resource extends Google_Service_Resource 84 | { 85 | 86 | /** 87 | * Inserts a new mail into the archive of the Google group. (archive.insert) 88 | * 89 | * @param string $groupId 90 | * The group ID 91 | * @param array $optParams Optional parameters. 92 | * @return Google_Service_GroupsMigration_Groups 93 | */ 94 | public function insert($groupId, $optParams = array()) 95 | { 96 | $params = array('groupId' => $groupId); 97 | $params = array_merge($params, $optParams); 98 | return $this->call('insert', array($params), "Google_Service_GroupsMigration_Groups"); 99 | } 100 | } 101 | 102 | 103 | 104 | 105 | class Google_Service_GroupsMigration_Groups extends Google_Model 106 | { 107 | protected $internal_gapi_mappings = array( 108 | ); 109 | public $kind; 110 | public $responseCode; 111 | 112 | public function setKind($kind) 113 | { 114 | $this->kind = $kind; 115 | } 116 | 117 | public function getKind() 118 | { 119 | return $this->kind; 120 | } 121 | 122 | public function setResponseCode($responseCode) 123 | { 124 | $this->responseCode = $responseCode; 125 | } 126 | 127 | public function getResponseCode() 128 | { 129 | return $this->responseCode; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/Spreadsheet.php: -------------------------------------------------------------------------------- 1 | 28 | */ 29 | class Spreadsheet 30 | { 31 | const REL_WORKSHEETS_FEED = 'http://schemas.google.com/spreadsheets/2006#worksheetsfeed'; 32 | 33 | /** 34 | * The spreadsheet xml object 35 | * 36 | * @var \SimpleXMLElement 37 | */ 38 | protected $xml; 39 | 40 | /** 41 | * Initializes the spreadsheet object 42 | * 43 | * @param SimpleXMLElement $xml 44 | */ 45 | public function __construct(SimpleXMLElement $xml) 46 | { 47 | $this->xml = $xml; 48 | } 49 | 50 | /** 51 | * Get the spreadsheet id 52 | * 53 | * @return string 54 | */ 55 | public function getId() 56 | { 57 | return $this->xml->id->__toString(); 58 | } 59 | 60 | /** 61 | * Get the updated date 62 | * 63 | * @return DateTime 64 | */ 65 | public function getUpdated() 66 | { 67 | return new DateTime($this->xml->updated->__toString()); 68 | } 69 | 70 | /** 71 | * Returns the title (name) of the spreadsheet 72 | * 73 | * @return string 74 | */ 75 | public function getTitle() 76 | { 77 | return $this->xml->title->__toString(); 78 | } 79 | 80 | /** 81 | * Get all the worksheets which belong to this spreadsheet 82 | * 83 | * @return \Google\Spreadsheet\WorksheetFeed 84 | */ 85 | public function getWorksheets() 86 | { 87 | $res = ServiceRequestFactory::getInstance()->get($this->getWorksheetsFeedUrl()); 88 | return new WorksheetFeed($res); 89 | } 90 | 91 | /** 92 | * Add a new worksheet to this spreadsheet 93 | * 94 | * @param string $title 95 | * @param int $rowCount default is 100 96 | * @param int $colCount default is 10 97 | * 98 | * @return \Google\Spreadsheet\Worksheet 99 | */ 100 | public function addWorksheet($title, $rowCount=100, $colCount=10) 101 | { 102 | $entry = sprintf(' 103 | 104 | %s 105 | %u 106 | %u 107 | ', 108 | $title, 109 | $rowCount, 110 | $colCount 111 | ); 112 | 113 | $response = ServiceRequestFactory::getInstance()->post($this->getWorksheetsFeedUrl(), $entry); 114 | return new Worksheet(new SimpleXMLElement($response)); 115 | } 116 | 117 | /** 118 | * Returns the feed url of the spreadsheet 119 | * 120 | * @return string 121 | */ 122 | public function getWorksheetsFeedUrl() 123 | { 124 | return Util::getLinkHref($this->xml, self::REL_WORKSHEETS_FEED); 125 | } 126 | 127 | } -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/youtube/YouTubeTest.php: -------------------------------------------------------------------------------- 1 | setName('Google YouTube API tests'); 26 | $suite->addTestSuite('YouTubeTest'); 27 | return $suite; 28 | } 29 | } 30 | 31 | class YouTubeTest extends BaseTest 32 | { 33 | /** @var Google_PlusService */ 34 | public $plus; 35 | public function __construct() 36 | { 37 | parent::__construct(); 38 | $this->youtube = new Google_Service_YouTube($this->getClient()); 39 | } 40 | 41 | public function testMissingFieldsAreNull() 42 | { 43 | if (!$this->checkToken()) { 44 | return; 45 | } 46 | 47 | $parts = "id,brandingSettings"; 48 | $opts = array("mine" => true); 49 | $channels = $this->youtube->channels->listChannels($parts, $opts); 50 | 51 | $newChannel = new Google_Service_YouTube_Channel(); 52 | $newChannel->setId($channels[0]->getId()); 53 | $newChannel->setBrandingSettings($channels[0]->getBrandingSettings()); 54 | 55 | $simpleOriginal = $channels[0]->toSimpleObject(); 56 | $simpleNew = $newChannel->toSimpleObject(); 57 | 58 | $this->assertObjectHasAttribute('etag', $simpleOriginal); 59 | $this->assertObjectNotHasAttribute('etag', $simpleNew); 60 | 61 | $owner_details = new Google_Service_YouTube_ChannelContentOwnerDetails(); 62 | $owner_details->setTimeLinked("123456789"); 63 | $o_channel = new Google_Service_YouTube_Channel(); 64 | $o_channel->setContentOwnerDetails($owner_details); 65 | $simpleManual = $o_channel->toSimpleObject(); 66 | $this->assertObjectHasAttribute('timeLinked', $simpleManual->contentOwnerDetails); 67 | $this->assertObjectNotHasAttribute('contentOwner', $simpleManual->contentOwnerDetails); 68 | 69 | $owner_details = new Google_Service_YouTube_ChannelContentOwnerDetails(); 70 | $owner_details->timeLinked = "123456789"; 71 | $o_channel = new Google_Service_YouTube_Channel(); 72 | $o_channel->setContentOwnerDetails($owner_details); 73 | $simpleManual = $o_channel->toSimpleObject(); 74 | 75 | $this->assertObjectHasAttribute('timeLinked', $simpleManual->contentOwnerDetails); 76 | $this->assertObjectNotHasAttribute('contentOwner', $simpleManual->contentOwnerDetails); 77 | 78 | $owner_details = new Google_Service_YouTube_ChannelContentOwnerDetails(); 79 | $owner_details['timeLinked'] = "123456789"; 80 | $o_channel = new Google_Service_YouTube_Channel(); 81 | $o_channel->setContentOwnerDetails($owner_details); 82 | $simpleManual = $o_channel->toSimpleObject(); 83 | 84 | $this->assertObjectHasAttribute('timeLinked', $simpleManual->contentOwnerDetails); 85 | $this->assertObjectNotHasAttribute('contentOwner', $simpleManual->contentOwnerDetails); 86 | 87 | $ping = new Google_Service_YouTube_ChannelConversionPing(); 88 | $ping->setContext("hello"); 89 | $pings = new Google_Service_YouTube_ChannelConversionPings(); 90 | $pings->setPings(array($ping)); 91 | $simplePings = $pings->toSimpleObject(); 92 | $this->assertObjectHasAttribute('context', $simplePings->pings[0]); 93 | $this->assertObjectNotHasAttribute('conversionUrl', $simplePings->pings[0]); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/ApiMediaFileUploadTest.php: -------------------------------------------------------------------------------- 1 | getClient(); 29 | $request = new Google_Http_Request('http://www.example.com', 'POST'); 30 | $media = new Google_Http_MediaFileUpload( 31 | $client, 32 | $request, 33 | 'image/png', 34 | base64_decode('data:image/png;base64,a') 35 | ); 36 | 37 | $this->assertEquals(0, $media->getProgress()); 38 | $this->assertGreaterThan(0, strlen($request->getPostBody())); 39 | } 40 | 41 | public function testGetUploadType() 42 | { 43 | $client = $this->getClient(); 44 | $request = new Google_Http_Request('http://www.example.com', 'POST'); 45 | 46 | // Test resumable upload 47 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', 'a', true); 48 | $params = array('mediaUpload' => array('value' => $media)); 49 | $this->assertEquals('resumable', $media->getUploadType(null)); 50 | 51 | // Test data *only* uploads 52 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', 'a', false); 53 | $this->assertEquals('media', $media->getUploadType(null)); 54 | 55 | // Test multipart uploads 56 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', 'a', false); 57 | $this->assertEquals('multipart', $media->getUploadType(array('a' => 'b'))); 58 | } 59 | 60 | public function testResultCode() 61 | { 62 | $client = $this->getClient(); 63 | $request = new Google_Http_Request('http://www.example.com', 'POST'); 64 | 65 | // Test resumable upload 66 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', 'a', true); 67 | $this->assertEquals(null, $media->getHttpResultCode()); 68 | } 69 | 70 | public function testProcess() 71 | { 72 | $client = $this->getClient(); 73 | $data = 'foo'; 74 | 75 | // Test data *only* uploads. 76 | $request = new Google_Http_Request('http://www.example.com', 'POST'); 77 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', $data, false); 78 | $this->assertEquals($data, $request->getPostBody()); 79 | 80 | // Test resumable (meta data) - we want to send the metadata, not the app data. 81 | $request = new Google_Http_Request('http://www.example.com', 'POST'); 82 | $reqData = json_encode("hello"); 83 | $request->setPostBody($reqData); 84 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', $data, true); 85 | $this->assertEquals(json_decode($reqData), $request->getPostBody()); 86 | 87 | // Test multipart - we are sending encoded meta data and post data 88 | $request = new Google_Http_Request('http://www.example.com', 'POST'); 89 | $reqData = json_encode("hello"); 90 | $request->setPostBody($reqData); 91 | $media = new Google_Http_MediaFileUpload($client, $request, 'image/png', $data, false); 92 | $this->assertContains($reqData, $request->getPostBody()); 93 | $this->assertContains(base64_encode($data), $request->getPostBody()); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/idtoken.php: -------------------------------------------------------------------------------- 1 | '; 29 | $client_secret = ''; 30 | $redirect_uri = ''; 31 | 32 | $client = new Google_Client(); 33 | $client->setClientId($client_id); 34 | $client->setClientSecret($client_secret); 35 | $client->setRedirectUri($redirect_uri); 36 | $client->setScopes('email'); 37 | 38 | /************************************************ 39 | If we're logging out we just need to clear our 40 | local access token in this case 41 | ************************************************/ 42 | if (isset($_REQUEST['logout'])) { 43 | unset($_SESSION['access_token']); 44 | } 45 | 46 | /************************************************ 47 | If we have a code back from the OAuth 2.0 flow, 48 | we need to exchange that with the authenticate() 49 | function. We store the resultant access token 50 | bundle in the session, and redirect to ourself. 51 | ************************************************/ 52 | if (isset($_GET['code'])) { 53 | $client->authenticate($_GET['code']); 54 | $_SESSION['access_token'] = $client->getAccessToken(); 55 | $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 56 | header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); 57 | } 58 | 59 | /************************************************ 60 | If we have an access token, we can make 61 | requests, else we generate an authentication URL. 62 | ************************************************/ 63 | if (isset($_SESSION['access_token']) && $_SESSION['access_token']) { 64 | $client->setAccessToken($_SESSION['access_token']); 65 | } else { 66 | $authUrl = $client->createAuthUrl(); 67 | } 68 | 69 | /************************************************ 70 | If we're signed in we can go ahead and retrieve 71 | the ID token, which is part of the bundle of 72 | data that is exchange in the authenticate step 73 | - we only need to do a network call if we have 74 | to retrieve the Google certificate to verify it, 75 | and that can be cached. 76 | ************************************************/ 77 | if ($client->getAccessToken()) { 78 | $_SESSION['access_token'] = $client->getAccessToken(); 79 | $token_data = $client->verifyIdToken()->getAttributes(); 80 | } 81 | 82 | echo pageHeader("User Query - Retrieving An Id Token"); 83 | if ( 84 | $client_id == '' 85 | || $client_secret == '' 86 | || $redirect_uri == '') { 87 | echo missingClientSecretsWarning(); 88 | } 89 | ?> 90 |
91 |
92 | 93 | 94 | 95 | Logout 96 | 97 |
98 | 99 | 100 |
101 | 102 |
103 | 104 |
105 | 2 | 3 | https://spreadsheets.google.com/feeds/worksheets/tFEgU8ywJkkjcZjGsXV/private/full 4 | 2014-02-07T18:33:44.826Z 5 | 6 | Test Spreadsheet 7 | 8 | 9 | 10 | 11 | 12 | asimlqt22 13 | asimlqt22@gmail.com 14 | 15 | 1 16 | 1 17 | 18 | https://spreadsheets.google.com/feeds/worksheets/tFEgU8ywJkkjcZjGsXV/private/full/od6 19 | 2013-12-27T15:24:52.148Z 20 | 21 | Sheet1 22 | Sheet1 23 | 24 | 25 | 26 | 27 | 28 | 100 29 | 20 30 | 31 | 32 | https://spreadsheets.google.com/feeds/worksheets/tFEgU8ywJkkjcZjGsXV/private/full/od6 33 | 2013-12-27T15:24:52.148Z 34 | 35 | Sheet2 36 | Sheet2 37 | 38 | 39 | 40 | 41 | 42 | 100 43 | 20 44 | 45 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "f704d46a3b1e817188d477e5b1b1effb", 8 | "packages": [ 9 | { 10 | "name": "asimlqt/php-google-spreadsheet-client", 11 | "version": "2.3.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/asimlqt/php-google-spreadsheet-client.git", 15 | "reference": "7c87fb7021f1fa1c5f2dbafd999e49f2e6bf364e" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/asimlqt/php-google-spreadsheet-client/zipball/7c87fb7021f1fa1c5f2dbafd999e49f2e6bf364e", 20 | "reference": "7c87fb7021f1fa1c5f2dbafd999e49f2e6bf364e", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.3.0" 25 | }, 26 | "type": "library", 27 | "autoload": { 28 | "psr-4": { 29 | "Google\\": "src/Google" 30 | } 31 | }, 32 | "notification-url": "https://packagist.org/downloads/", 33 | "license": [ 34 | "Apache-2.0" 35 | ], 36 | "authors": [ 37 | { 38 | "name": "Asim Liaquat", 39 | "email": "asimlqt22@gmail.com", 40 | "role": "Developer" 41 | }, 42 | { 43 | "name": "Martin Czygan", 44 | "email": "martin.czygan@gmail.com", 45 | "homepage": "http://twitter.com/cvvfj", 46 | "role": "Packager" 47 | } 48 | ], 49 | "description": "Google Spreadsheet PHP Client", 50 | "homepage": "https://github.com/asimlqt/php-google-spreadsheet-client", 51 | "keywords": [ 52 | "google", 53 | "spreadsheet" 54 | ], 55 | "time": "2014-12-02 18:15:21" 56 | }, 57 | { 58 | "name": "google/apiclient", 59 | "version": "1.0.6-beta", 60 | "source": { 61 | "type": "git", 62 | "url": "https://github.com/google/google-api-php-client.git", 63 | "reference": "a41a9dc0662e36420030eaab802dbb1f85459479" 64 | }, 65 | "dist": { 66 | "type": "zip", 67 | "url": "https://api.github.com/repos/google/google-api-php-client/zipball/a41a9dc0662e36420030eaab802dbb1f85459479", 68 | "reference": "a41a9dc0662e36420030eaab802dbb1f85459479", 69 | "shasum": "" 70 | }, 71 | "require": { 72 | "php": ">=5.2.1" 73 | }, 74 | "require-dev": { 75 | "phpunit/phpunit": "3.7.*" 76 | }, 77 | "type": "library", 78 | "extra": { 79 | "branch-alias": { 80 | "dev-master": "1.0.x-dev" 81 | } 82 | }, 83 | "autoload": { 84 | "classmap": [ 85 | "src/" 86 | ] 87 | }, 88 | "notification-url": "https://packagist.org/downloads/", 89 | "include-path": [ 90 | "src/" 91 | ], 92 | "license": [ 93 | "Apache-2.0" 94 | ], 95 | "description": "Client library for Google APIs", 96 | "homepage": "http://developers.google.com/api-client-library/php", 97 | "keywords": [ 98 | "google" 99 | ], 100 | "time": "2014-09-30 19:33:59" 101 | } 102 | ], 103 | "packages-dev": [], 104 | "aliases": [], 105 | "minimum-stability": "stable", 106 | "stability-flags": { 107 | "google/apiclient": 10 108 | }, 109 | "prefer-stable": false, 110 | "platform": [], 111 | "platform-dev": [] 112 | } 113 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Cache/Memcache.php: -------------------------------------------------------------------------------- 1 | 30 | */ 31 | class Google_Cache_Memcache extends Google_Cache_Abstract 32 | { 33 | private $connection = false; 34 | private $mc = false; 35 | private $host; 36 | private $port; 37 | 38 | public function __construct(Google_Client $client) 39 | { 40 | if (!function_exists('memcache_connect') && !class_exists("Memcached")) { 41 | throw new Google_Cache_Exception("Memcache functions not available"); 42 | } 43 | if ($client->isAppEngine()) { 44 | // No credentials needed for GAE. 45 | $this->mc = new Memcached(); 46 | $this->connection = true; 47 | } else { 48 | $this->host = $client->getClassConfig($this, 'host'); 49 | $this->port = $client->getClassConfig($this, 'port'); 50 | if (empty($this->host) || (empty($this->port) && (string) $this->port != "0")) { 51 | throw new Google_Cache_Exception("You need to supply a valid memcache host and port"); 52 | } 53 | } 54 | } 55 | 56 | /** 57 | * @inheritDoc 58 | */ 59 | public function get($key, $expiration = false) 60 | { 61 | $this->connect(); 62 | $ret = false; 63 | if ($this->mc) { 64 | $ret = $this->mc->get($key); 65 | } else { 66 | $ret = memcache_get($this->connection, $key); 67 | } 68 | if ($ret === false) { 69 | return false; 70 | } 71 | if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) { 72 | $this->delete($key); 73 | return false; 74 | } 75 | return $ret['data']; 76 | } 77 | 78 | /** 79 | * @inheritDoc 80 | * @param string $key 81 | * @param string $value 82 | * @throws Google_Cache_Exception 83 | */ 84 | public function set($key, $value) 85 | { 86 | $this->connect(); 87 | // we store it with the cache_time default expiration so objects will at 88 | // least get cleaned eventually. 89 | $data = array('time' => time(), 'data' => $value); 90 | $rc = false; 91 | if ($this->mc) { 92 | $rc = $this->mc->set($key, $data); 93 | } else { 94 | $rc = memcache_set($this->connection, $key, $data, false); 95 | } 96 | if ($rc == false) { 97 | throw new Google_Cache_Exception("Couldn't store data in cache"); 98 | } 99 | } 100 | 101 | /** 102 | * @inheritDoc 103 | * @param String $key 104 | */ 105 | public function delete($key) 106 | { 107 | $this->connect(); 108 | if ($this->mc) { 109 | $this->mc->delete($key, 0); 110 | } else { 111 | memcache_delete($this->connection, $key, 0); 112 | } 113 | } 114 | 115 | /** 116 | * Lazy initialiser for memcache connection. Uses pconnect for to take 117 | * advantage of the persistence pool where possible. 118 | */ 119 | private function connect() 120 | { 121 | if ($this->connection) { 122 | return; 123 | } 124 | 125 | if (class_exists("Memcached")) { 126 | $this->mc = new Memcached(); 127 | $this->mc->addServer($this->host, $this->port); 128 | $this->connection = true; 129 | } else { 130 | $this->connection = memcache_pconnect($this->host, $this->port); 131 | } 132 | 133 | if (! $this->connection) { 134 | throw new Google_Cache_Exception("Couldn't connect to memcache server"); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Google Docs RSVP, WordPress Plugin === 2 | Contributors: Gifford Cheung, Brian Watanabe, Chongsun Ahn 3 | Tags: RSVP, guestlist, wedding, Google Docs, spreadsheet 4 | Requires at least: 2.5 5 | Tested up to: 4.0.1 6 | Stable tag: 2.0 7 | 8 | This plugin allows you to add RSVP and guestlist functionality. Guests can leave custom messages for the planners. Uses Google Docs spreadsheets. 9 | 10 | == Known issue == 11 | Guest codes are not case sensitive. 12 | 13 | == Installation == 14 | 15 | 1. Create a google docs spreadsheet with the following 7 headers: Guest Name, Code, Custom Message for Guest, Ceremony, Banquet, Message from Guest, Hotel. 16 | 2. Go to "Settings->Google Docs RSVP" to configure. 17 | 3. Add the text: gdrsvp-googledocsrsvp in the content of your RSVP page. 18 | 19 | == Description == 20 | This plugin allows you to add RSVP and guestlist functionality to your Wordpress site. It tracks RSVPs for ceremony and banquet. Additionally, guests can leave custom messages for the planners. The guestlist is maintained with a Google Docs spreadsheet which is very easy to use. 21 | 22 | It was originally designed to be a wedding guestlist that I made for a friend (congratulations to Mike & Di!). 23 | 24 | Features Bulletlist: 25 | 26 | * Customizable RSVP page 27 | * Connects to Google Docs Spreadsheet for guestlist 28 | * Planners can write custom messages to guests 29 | * Guests can send custom message to planners 30 | * Email updates are sent to the planner 31 | * Wedding features: Records responses for Ceremony, Banquet, or Hotel Reservations 32 | 33 | == Instructions == 34 | 1. Using a Google account, create a new Spreadsheet at docs.google.com 35 | 2. The spreadsheet must have the following 7 headers: Guest Name, Code, Custom Message for Guest, Ceremony, Banquet, Message from Guest, Hotel 36 | 3. Fill in the guestlist with names, codes, and an optional custom message. Make sure the code is not guessable, for example: short numeric codes are probably a bad idea. A nosy guest might punch in random numbers and see guest information. 37 | 4. Download, unzip, upload, and activate your plugin. 38 | 5. In your Wordpress site, go to "Settings->Google Docs RSVP" and follow the step-by-step instructions on the page, and fill in the other information (Google Docs title and sheet, etc.). 39 | 6. Create a new wordpress Page and put the text: gdrsvp-googledocsrsvp in the content box. The plugin will replace it with the RSVP code. 40 | 7. Now, guests can type in a code and fill out the reservation form, which will send an email to you and update the spreadsheet. Note: Once guests have filled out the form, their RSVP code is no longer usable. 41 | 42 | 43 | Thank you! Good luck with your planning efforts. Remember to allow guests to contact you in other ways in case of digital emergencies. 44 | 45 | We look forward to any comments. If there is a good response, we may incorporate your suggestions into the next version. 46 | 47 | This code is released under GPLv3. If you create a new version of this plugin, let us know and we may link to it. 48 | 49 | Thanks! 50 | 51 | == Frequently Asked Questions == 52 | 53 | = My plugin isn't working = 54 | 55 | Check the homepage for a lot of comments and responses about how to fiddle 56 | with this plugin, we have had a bit of discussion and help from other users. 57 | 58 | Note that you are required to have PHP version 5. Sorry, the only solution right now is to use that version of PHP. 59 | 60 | = How do I change some of the text? = 61 | 62 | If you cannot change the text in the options page, you can change it in the source code (by editting wp-gdrsvp-plugin.php). This is not a very safe thing to do, but you could search the code for the words you want to change and fiddle around with it. This take familiarity with HTML and a little PHP. 63 | 64 | = License = 65 | Copyright (C) 2008-2014 Gifford Cheung, Brian Watanabe, Chongsun Ahn 66 | 67 | This program is free software: you can redistribute it and/or modify 68 | it under the terms of the GNU General Public License as published by 69 | the Free Software Foundation, either version 3 of the License, or 70 | (at your option) any later version. 71 | 72 | This program is distributed in the hope that it will be useful, 73 | but WITHOUT ANY WARRANTY; without even the implied warranty of 74 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 75 | GNU General Public License for more details. 76 | 77 | You should have received a copy of the GNU General Public License 78 | along with this program. If not, see . 79 | -------------------------------------------------------------------------------- /vendor/google/apiclient/examples/simplefileupload.php: -------------------------------------------------------------------------------- 1 | '; 42 | $client_secret = ''; 43 | $redirect_uri = ''; 44 | 45 | $client = new Google_Client(); 46 | $client->setClientId($client_id); 47 | $client->setClientSecret($client_secret); 48 | $client->setRedirectUri($redirect_uri); 49 | $client->addScope("https://www.googleapis.com/auth/drive"); 50 | $service = new Google_Service_Drive($client); 51 | 52 | if (isset($_REQUEST['logout'])) { 53 | unset($_SESSION['upload_token']); 54 | } 55 | 56 | if (isset($_GET['code'])) { 57 | $client->authenticate($_GET['code']); 58 | $_SESSION['upload_token'] = $client->getAccessToken(); 59 | $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; 60 | header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); 61 | } 62 | 63 | if (isset($_SESSION['upload_token']) && $_SESSION['upload_token']) { 64 | $client->setAccessToken($_SESSION['upload_token']); 65 | if ($client->isAccessTokenExpired()) { 66 | unset($_SESSION['upload_token']); 67 | } 68 | } else { 69 | $authUrl = $client->createAuthUrl(); 70 | } 71 | 72 | /************************************************ 73 | If we're signed in then lets try to upload our 74 | file. For larger files, see fileupload.php. 75 | ************************************************/ 76 | if ($client->getAccessToken()) { 77 | // This is uploading a file directly, with no metadata associated. 78 | $file = new Google_Service_Drive_DriveFile(); 79 | $result = $service->files->insert( 80 | $file, 81 | array( 82 | 'data' => file_get_contents(TESTFILE), 83 | 'mimeType' => 'application/octet-stream', 84 | 'uploadType' => 'media' 85 | ) 86 | ); 87 | 88 | // Now lets try and send the metadata as well using multipart! 89 | $file = new Google_Service_Drive_DriveFile(); 90 | $file->setTitle("Hello World!"); 91 | $result2 = $service->files->insert( 92 | $file, 93 | array( 94 | 'data' => file_get_contents(TESTFILE), 95 | 'mimeType' => 'application/octet-stream', 96 | 'uploadType' => 'multipart' 97 | ) 98 | ); 99 | } 100 | 101 | echo pageHeader("File Upload - Uploading a small file"); 102 | if ( 103 | $client_id == '' 104 | || $client_secret == '' 105 | || $redirect_uri == '') { 106 | echo missingClientSecretsWarning(); 107 | } 108 | ?> 109 |
110 |
111 | 112 | 113 | 114 |
115 | 116 | 117 |
118 | title); ?> 119 | title); ?> 120 |
121 | 122 |
123 | 2 | 3 | https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full 4 | 2014-11-17T21:26:55.831Z 5 | 6 | Sheet1 7 | 8 | 9 | 10 | 11 | 12 | asimlqt22 13 | asimlqt22@gmail.com 14 | 15 | 4 16 | 1 17 | 18 | https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full/cokwr 19 | 2014-11-17T21:26:55.831Z 20 | 21 | asim 22 | age: 60, _cpzh4: bug 23 | 24 | 25 | asim 26 | 30 27 | bug 28 | 29 | 30 | https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full/cre1l 31 | 2014-11-17T21:26:55.831Z 32 | 33 | Cassie 34 | age: 61 35 | 36 | 37 | Cassie 38 | 31 39 | 40 | 41 | https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full/chk2m 42 | 2014-11-17T21:26:55.831Z 43 | 44 | Alex 45 | age: 20 46 | 47 | 48 | Alex 49 | 20 50 | 51 | 52 | https://spreadsheets.google.com/feeds/list/G3345eEsfsk60/od6/private/full/ciyn3 53 | 2014-11-17T21:26:55.831Z 54 | 55 | Test 56 | age: 75 57 | 58 | 59 | Test 60 | 75 61 | 62 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Auth/AssertionCredentials.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | class Google_Auth_AssertionCredentials 28 | { 29 | const MAX_TOKEN_LIFETIME_SECS = 3600; 30 | 31 | public $serviceAccountName; 32 | public $scopes; 33 | public $privateKey; 34 | public $privateKeyPassword; 35 | public $assertionType; 36 | public $sub; 37 | /** 38 | * @deprecated 39 | * @link http://tools.ietf.org/html/draft-ietf-oauth-json-web-token-06 40 | */ 41 | public $prn; 42 | private $useCache; 43 | 44 | /** 45 | * @param $serviceAccountName 46 | * @param $scopes array List of scopes 47 | * @param $privateKey 48 | * @param string $privateKeyPassword 49 | * @param string $assertionType 50 | * @param bool|string $sub The email address of the user for which the 51 | * application is requesting delegated access. 52 | * @param bool useCache Whether to generate a cache key and allow 53 | * automatic caching of the generated token. 54 | */ 55 | public function __construct( 56 | $serviceAccountName, 57 | $scopes, 58 | $privateKey, 59 | $privateKeyPassword = 'notasecret', 60 | $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer', 61 | $sub = false, 62 | $useCache = true 63 | ) { 64 | $this->serviceAccountName = $serviceAccountName; 65 | $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes); 66 | $this->privateKey = $privateKey; 67 | $this->privateKeyPassword = $privateKeyPassword; 68 | $this->assertionType = $assertionType; 69 | $this->sub = $sub; 70 | $this->prn = $sub; 71 | $this->useCache = $useCache; 72 | } 73 | 74 | /** 75 | * Generate a unique key to represent this credential. 76 | * @return string 77 | */ 78 | public function getCacheKey() 79 | { 80 | if (!$this->useCache) { 81 | return false; 82 | } 83 | $h = $this->sub; 84 | $h .= $this->assertionType; 85 | $h .= $this->privateKey; 86 | $h .= $this->scopes; 87 | $h .= $this->serviceAccountName; 88 | return md5($h); 89 | } 90 | 91 | public function generateAssertion() 92 | { 93 | $now = time(); 94 | 95 | $jwtParams = array( 96 | 'aud' => Google_Auth_OAuth2::OAUTH2_TOKEN_URI, 97 | 'scope' => $this->scopes, 98 | 'iat' => $now, 99 | 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS, 100 | 'iss' => $this->serviceAccountName, 101 | ); 102 | 103 | if ($this->sub !== false) { 104 | $jwtParams['sub'] = $this->sub; 105 | } else if ($this->prn !== false) { 106 | $jwtParams['prn'] = $this->prn; 107 | } 108 | 109 | return $this->makeSignedJwt($jwtParams); 110 | } 111 | 112 | /** 113 | * Creates a signed JWT. 114 | * @param array $payload 115 | * @return string The signed JWT. 116 | */ 117 | private function makeSignedJwt($payload) 118 | { 119 | $header = array('typ' => 'JWT', 'alg' => 'RS256'); 120 | 121 | $payload = json_encode($payload); 122 | // Handle some overzealous escaping in PHP json that seemed to cause some errors 123 | // with claimsets. 124 | $payload = str_replace('\/', '/', $payload); 125 | 126 | $segments = array( 127 | Google_Utils::urlSafeB64Encode(json_encode($header)), 128 | Google_Utils::urlSafeB64Encode($payload) 129 | ); 130 | 131 | $signingInput = implode('.', $segments); 132 | $signer = new Google_Signer_P12($this->privateKey, $this->privateKeyPassword); 133 | $signature = $signer->sign($signingInput); 134 | $segments[] = Google_Utils::urlSafeB64Encode($signature); 135 | 136 | return implode(".", $segments); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/CellFeed.php: -------------------------------------------------------------------------------- 1 | 29 | */ 30 | class CellFeed 31 | { 32 | /** 33 | * The xml representation of the feed 34 | * 35 | * @var \SimpleXMLElement 36 | */ 37 | protected $xml; 38 | 39 | /** 40 | * 41 | * @var array 42 | */ 43 | protected $entries; 44 | 45 | /** 46 | * Constructor 47 | * 48 | * @param string $xml 49 | */ 50 | public function __construct($xml) 51 | { 52 | $this->xml = new SimpleXMLElement($xml); 53 | $this->entries = array(); 54 | } 55 | 56 | /** 57 | * Get the feed entries 58 | * 59 | * @return array \Google\Spreadsheet\CellEntry 60 | */ 61 | public function getEntries() 62 | { 63 | if(count($this->entries) > 0) { 64 | return $this->entries; 65 | } 66 | 67 | $postUrl = $this->getPostUrl(); 68 | 69 | foreach ($this->xml->entry as $entry) { 70 | $cell = new CellEntry($entry, $postUrl); 71 | $this->entries[$cell->getCellIdString()] = $cell; 72 | } 73 | 74 | return $this->entries; 75 | } 76 | 77 | /** 78 | * 79 | * @param type $row 80 | * @param type $col 81 | * 82 | * @return CellEntry|null 83 | */ 84 | public function getCell($row, $col) 85 | { 86 | if(count($this->entries) === 0) { 87 | $this->getEntries(); 88 | } 89 | 90 | $id = sprintf( 91 | "R%sC%s", 92 | $row, 93 | $col 94 | ); 95 | 96 | if(isset($this->entries[$id])) { 97 | return $this->entries[$id]; 98 | } 99 | 100 | return null; 101 | } 102 | 103 | /** 104 | * Edit a single cell. the row and column indexing start at 1. 105 | * So the first column of the first row will be (1,1). 106 | * 107 | * @param int $rowNum 108 | * @param int $colNum 109 | * @param string $value 110 | * 111 | * @return null 112 | */ 113 | public function editCell($rowNum, $colNum, $value) 114 | { 115 | $entry = sprintf(' 116 | 117 | 118 | ', 119 | $rowNum, 120 | $colNum, 121 | $value 122 | ); 123 | 124 | ServiceRequestFactory::getInstance()->post($this->getPostUrl(), $entry); 125 | } 126 | 127 | /** 128 | * 129 | * @param \Google\Spreadsheet\Batch\BatchRequest $batchRequest 130 | * 131 | * @return \Google\Spreadsheet\Batch\BatchResponse 132 | */ 133 | public function updateBatch(BatchRequest $batchRequest) 134 | { 135 | $xml = $batchRequest->createRequestXml($this); 136 | $response = ServiceRequestFactory::getInstance()->post($this->getBatchUrl(), $xml); 137 | return new BatchResponse(new SimpleXMLElement($response)); 138 | } 139 | 140 | /** 141 | * Get the feed post url 142 | * 143 | * @return string 144 | */ 145 | public function getPostUrl() 146 | { 147 | return Util::getLinkHref($this->xml, 'http://schemas.google.com/g/2005#post'); 148 | } 149 | 150 | /** 151 | * 152 | * @return string 153 | */ 154 | public function getBatchUrl() 155 | { 156 | return Util::getLinkHref($this->xml, 'http://schemas.google.com/g/2005#batch'); 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Utils.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | class Google_Utils 25 | { 26 | public static function urlSafeB64Encode($data) 27 | { 28 | $b64 = base64_encode($data); 29 | $b64 = str_replace( 30 | array('+', '/', '\r', '\n', '='), 31 | array('-', '_'), 32 | $b64 33 | ); 34 | return $b64; 35 | } 36 | 37 | public static function urlSafeB64Decode($b64) 38 | { 39 | $b64 = str_replace( 40 | array('-', '_'), 41 | array('+', '/'), 42 | $b64 43 | ); 44 | return base64_decode($b64); 45 | } 46 | 47 | /** 48 | * Misc function used to count the number of bytes in a post body, in the 49 | * world of multi-byte chars and the unpredictability of 50 | * strlen/mb_strlen/sizeof, this is the only way to do that in a sane 51 | * manner at the moment. 52 | * 53 | * This algorithm was originally developed for the 54 | * Solar Framework by Paul M. Jones 55 | * 56 | * @link http://solarphp.com/ 57 | * @link http://svn.solarphp.com/core/trunk/Solar/Json.php 58 | * @link http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Json/Decoder.php 59 | * @param string $str 60 | * @return int The number of bytes in a string. 61 | */ 62 | public static function getStrLen($str) 63 | { 64 | $strlenVar = strlen($str); 65 | $d = $ret = 0; 66 | for ($count = 0; $count < $strlenVar; ++ $count) { 67 | $ordinalValue = ord($str{$ret}); 68 | switch (true) { 69 | case (($ordinalValue >= 0x20) && ($ordinalValue <= 0x7F)): 70 | // characters U-00000000 - U-0000007F (same as ASCII) 71 | $ret ++; 72 | break; 73 | case (($ordinalValue & 0xE0) == 0xC0): 74 | // characters U-00000080 - U-000007FF, mask 110XXXXX 75 | // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 76 | $ret += 2; 77 | break; 78 | case (($ordinalValue & 0xF0) == 0xE0): 79 | // characters U-00000800 - U-0000FFFF, mask 1110XXXX 80 | // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 81 | $ret += 3; 82 | break; 83 | case (($ordinalValue & 0xF8) == 0xF0): 84 | // characters U-00010000 - U-001FFFFF, mask 11110XXX 85 | // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 86 | $ret += 4; 87 | break; 88 | case (($ordinalValue & 0xFC) == 0xF8): 89 | // characters U-00200000 - U-03FFFFFF, mask 111110XX 90 | // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 91 | $ret += 5; 92 | break; 93 | case (($ordinalValue & 0xFE) == 0xFC): 94 | // characters U-04000000 - U-7FFFFFFF, mask 1111110X 95 | // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 96 | $ret += 6; 97 | break; 98 | default: 99 | $ret ++; 100 | } 101 | } 102 | return $ret; 103 | } 104 | 105 | /** 106 | * Normalize all keys in an array to lower-case. 107 | * @param array $arr 108 | * @return array Normalized array. 109 | */ 110 | public static function normalize($arr) 111 | { 112 | if (!is_array($arr)) { 113 | return array(); 114 | } 115 | 116 | $normalized = array(); 117 | foreach ($arr as $key => $val) { 118 | $normalized[strtolower($key)] = $val; 119 | } 120 | return $normalized; 121 | } 122 | 123 | /** 124 | * Convert a string to camelCase 125 | * @param string $value 126 | * @return string 127 | */ 128 | public static function camelCase($value) 129 | { 130 | $value = ucwords(str_replace(array('-', '_'), ' ', $value)); 131 | $value = str_replace(' ', '', $value); 132 | $value[0] = strtolower($value[0]); 133 | return $value; 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /vendor/google/apiclient/tests/general/CacheTest.php: -------------------------------------------------------------------------------- 1 | getClient(); 32 | $client->setClassConfig( 33 | 'Google_Cache_File', 34 | 'directory', 35 | $dir 36 | ); 37 | $cache = new Google_Cache_File($client); 38 | $cache->set('foo', 'bar'); 39 | $this->assertEquals($cache->get('foo'), 'bar'); 40 | 41 | $this->getSetDelete($cache); 42 | } 43 | 44 | public function testNull() 45 | { 46 | if (!function_exists('memcache_connect')) { 47 | $this->markTestSkipped('Test requires memcache'); 48 | } 49 | $client = $this->getClient(); 50 | $cache = new Google_Cache_Null($client); 51 | $client->setCache($cache); 52 | 53 | $cache->set('foo', 'bar'); 54 | $cache->delete('foo'); 55 | $this->assertEquals(false, $cache->get('foo')); 56 | 57 | $cache->set('foo.1', 'bar.1'); 58 | $this->assertEquals($cache->get('foo.1'), false); 59 | 60 | $cache->set('foo', 'baz'); 61 | $this->assertEquals($cache->get('foo'), false); 62 | 63 | $cache->set('foo', null); 64 | $cache->delete('foo'); 65 | $this->assertEquals($cache->get('foo'), false); 66 | } 67 | 68 | public function testMemcache() { 69 | if (!function_exists('memcache_connect')) { 70 | $this->markTestSkipped('Test requires memcache'); 71 | } 72 | $client = $this->getClient(); 73 | if (!$client->getClassConfig('Google_Cache_Memcache', 'host')) { 74 | $this->markTestSkipped('Test requires memcache host specified'); 75 | } 76 | 77 | $cache = new Google_Cache_Memcache($client); 78 | 79 | $this->getSetDelete($cache); 80 | } 81 | 82 | public function testAPC() { 83 | if (!function_exists('apc_add')) { 84 | $this->markTestSkipped('Test requires APC'); 85 | } 86 | if (!ini_get('apc.enable_cli')) { 87 | $this->markTestSkipped('Test requires APC enabled for CLI'); 88 | } 89 | $client = $this->getClient(); 90 | $cache = new Google_Cache_APC($client); 91 | 92 | $this->getSetDelete($cache); 93 | } 94 | 95 | public function getSetDelete($cache) { 96 | $cache->set('foo', 'bar'); 97 | $cache->delete('foo'); 98 | $this->assertEquals(false, $cache->get('foo')); 99 | 100 | $cache->set('foo.1', 'bar.1'); 101 | $cache->delete('foo.1'); 102 | $this->assertEquals($cache->get('foo.1'), false); 103 | 104 | $cache->set('foo', 'baz'); 105 | $cache->delete('foo'); 106 | $this->assertEquals($cache->get('foo'), false); 107 | 108 | $cache->set('foo', null); 109 | $cache->delete('foo'); 110 | $this->assertEquals($cache->get('foo'), false); 111 | 112 | $obj = new stdClass(); 113 | $obj->foo = 'bar'; 114 | $cache->set('foo', $obj); 115 | $cache->delete('foo'); 116 | $this->assertEquals($cache->get('foo'), false); 117 | 118 | $cache->set('foo.1', 'bar.1'); 119 | $this->assertEquals($cache->get('foo.1'), 'bar.1'); 120 | 121 | $cache->set('foo', 'baz'); 122 | $this->assertEquals($cache->get('foo'), 'baz'); 123 | 124 | $cache->set('foo', null); 125 | $this->assertEquals($cache->get('foo'), null); 126 | 127 | $cache->set('1/2/3', 'bar'); 128 | $this->assertEquals($cache->get('1/2/3'), 'bar'); 129 | 130 | $obj = new stdClass(); 131 | $obj->foo = 'bar'; 132 | $cache->set('foo', $obj); 133 | $this->assertEquals($cache->get('foo'), $obj); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /vendor/google/apiclient/src/Google/Cache/File.php: -------------------------------------------------------------------------------- 1 | 28 | */ 29 | class Google_Cache_File extends Google_Cache_Abstract 30 | { 31 | const MAX_LOCK_RETRIES = 10; 32 | private $path; 33 | private $fh; 34 | 35 | public function __construct(Google_Client $client) 36 | { 37 | $this->path = $client->getClassConfig($this, 'directory'); 38 | } 39 | 40 | public function get($key, $expiration = false) 41 | { 42 | $storageFile = $this->getCacheFile($key); 43 | $data = false; 44 | 45 | if (!file_exists($storageFile)) { 46 | return false; 47 | } 48 | 49 | if ($expiration) { 50 | $mtime = filemtime($storageFile); 51 | if ((time() - $mtime) >= $expiration) { 52 | $this->delete($key); 53 | return false; 54 | } 55 | } 56 | 57 | if ($this->acquireReadLock($storageFile)) { 58 | $data = fread($this->fh, filesize($storageFile)); 59 | $data = unserialize($data); 60 | $this->unlock($storageFile); 61 | } 62 | 63 | return $data; 64 | } 65 | 66 | public function set($key, $value) 67 | { 68 | $storageFile = $this->getWriteableCacheFile($key); 69 | if ($this->acquireWriteLock($storageFile)) { 70 | // We serialize the whole request object, since we don't only want the 71 | // responseContent but also the postBody used, headers, size, etc. 72 | $data = serialize($value); 73 | $result = fwrite($this->fh, $data); 74 | $this->unlock($storageFile); 75 | } 76 | } 77 | 78 | public function delete($key) 79 | { 80 | $file = $this->getCacheFile($key); 81 | if (file_exists($file) && !unlink($file)) { 82 | throw new Google_Cache_Exception("Cache file could not be deleted"); 83 | } 84 | } 85 | 86 | private function getWriteableCacheFile($file) 87 | { 88 | return $this->getCacheFile($file, true); 89 | } 90 | 91 | private function getCacheFile($file, $forWrite = false) 92 | { 93 | return $this->getCacheDir($file, $forWrite) . '/' . md5($file); 94 | } 95 | 96 | private function getCacheDir($file, $forWrite) 97 | { 98 | // use the first 2 characters of the hash as a directory prefix 99 | // this should prevent slowdowns due to huge directory listings 100 | // and thus give some basic amount of scalability 101 | $storageDir = $this->path . '/' . substr(md5($file), 0, 2); 102 | if ($forWrite && ! is_dir($storageDir)) { 103 | if (! mkdir($storageDir, 0755, true)) { 104 | throw new Google_Cache_Exception("Could not create storage directory: $storageDir"); 105 | } 106 | } 107 | return $storageDir; 108 | } 109 | 110 | private function acquireReadLock($storageFile) 111 | { 112 | return $this->acquireLock(LOCK_SH, $storageFile); 113 | } 114 | 115 | private function acquireWriteLock($storageFile) 116 | { 117 | $rc = $this->acquireLock(LOCK_EX, $storageFile); 118 | if (!$rc) { 119 | $this->delete($storageFile); 120 | } 121 | return $rc; 122 | } 123 | 124 | private function acquireLock($type, $storageFile) 125 | { 126 | $mode = $type == LOCK_EX ? "w" : "r"; 127 | $this->fh = fopen($storageFile, $mode); 128 | $count = 0; 129 | while (!flock($this->fh, $type | LOCK_NB)) { 130 | // Sleep for 10ms. 131 | usleep(10000); 132 | if (++$count < self::MAX_LOCK_RETRIES) { 133 | return false; 134 | } 135 | } 136 | return true; 137 | } 138 | 139 | public function unlock($storageFile) 140 | { 141 | if ($this->fh) { 142 | flock($this->fh, LOCK_UN); 143 | } 144 | } 145 | } 146 | --------------------------------------------------------------------------------