meeech / shopify.tmbundle

A bundle for interacting with Shopify Theme Assets.
http://meeech.github.com/shopify.tmbundle/
136 stars 31 forks source link

Which version of PHP is needed? #67

Closed dannguyen closed 11 years ago

dannguyen commented 12 years ago

So I'm facing the same problem as apparently fixed here, where the bundle was working and one week later is broken: https://github.com/meeech/shopify.tmbundle/issues/65

I can't get any of the operations to work anymore. As far as I can tell, my API access is working just fine.

For example, my download theme attempt gets me this error:

Getting theme asset list...
Error: Assets list not returned. Could just be a temporary error. Feel free to try again.
Req Url: http://apikeyxxxx:passwordxxx@myshop.myshopify.com/admin/assets.json

Visiting that URL by browser nets me the correct JSON.

So I'm guessing there is a problem with how the following line of PHP is executed:

$response = json_decode(`curl --connect-timeout 20 -s -g '$requestUrl'`);
...
if(!is_object($response) || !property_exists($response, 'assets') ){

The first condition passes but the second (property_exists...) does not. So the issue lies with property_exists or with json_decode...I don't know enough PHP to quickly diagnose the issue...or at least faster than anyone who may already know what's going on.

I'm on Mountain Lion and this is the result of my php -v:

PHP 5.3.13 with Suhosin-Patch (cli) (built: Jun 20 2012 17:05:20) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies


meeech commented 12 years ago

@dannguyen can you do a which php and let me know what it says?

dannguyen commented 12 years ago

Sure...I actually just updated PHP to 5.4.7 (through Homebrew).

which php yields this: /usr/local/bin/php

php -v :

PHP 5.4.7 (cli) (built: Oct  8 2012 19:44:10) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

Still getting the same error with Download Full Theme, where the asset list fails to retrieve (but the URL itself is valid when visited in the browser)

`

meeech commented 12 years ago

@dannguyen you can try a var_dump($response) and see whats in there?

can you run /usr/bin/env php -v.

I've successfully downloaded with 5.3.15