Comments (28)
The existence of this is so absolutely mind bogglingly absurd. We have a zoom call of 8 people trying to figure out how to get past this right now, it took us 3 days to figure out what was even happening. Because WHY, IN THE NAME OF ALL THE CHILDREN IN THE WORLD, would anyone do something so completely asinine as writing to /tmp/
from the web user out of a f@#$ing vendor/
package????????
If you don't understand why this is not a reasonable thing to do, I have a pamphlet for a high flying career in food service right here for you to peruse.
from shopify-api-php.
Answering my own question with a workaround I found:
- Add the following to
composer.json
"autoload": {
"psr-4": {
"Shopify\\Clients\\": "app/Overrides/"
},
"exclude-from-classmap": ["vendor/shopify/shopify-api/src/Clients/Http.php"]
},
- Copy the Shopify implementation of the
Http
class toapp/Overrides/
folder. - Remove the deprecation file writing code (below) from the
logApiDeprecation
function of the copied class (or modify in the way you prefer)
$warningFilePath = $this->getApiDeprecationTimestampFilePath();
$lastWarning = null;
if (file_exists($warningFilePath)) {
$lastWarning = (int)(file_get_contents($warningFilePath));
}
if (time() - $lastWarning < self::DEPRECATION_ALERT_SECONDS) {
return;
}
file_put_contents($warningFilePath, time());
- Fix the
$version
line in therequest()
function, since it relies on the class directory location
$version = require dirname(__FILE__) . '/../../vendor/shopify/shopify-api/src/version.php';
You may need to run composer dump-autoload
after fixing.
from shopify-api-php.
^ This
No composer library should be attempting to write to filesystem, especially a local directory. A simple deprecation warning now produces a fatal error for the entire application.
from shopify-api-php.
Same problem here. I don't understand why write a file in /vendor folder. 🤯
from shopify-api-php.
Is there any workaround for this besides forking the library?
This causes a fatal crash and means I can't fetch orders using Order::find()
- despite using the most recent API and not requesting any deprecated fields/endpoints, I still get the deprecation warning.
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
The problem still exists in the latest version of this package, and the most recent commit to the default branch.
https://github.com/Shopify/shopify-api-php/blob/v5.0.0/src/Clients/Http.php#L288
shopify-api-php/src/Clients/Http.php
Line 288 in d180c05
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
Same issue since Oct 02. All the payments stopped working, so I had to comment out code in the library (file src/Clients/Http.php
line 208-213) to get the app working
from shopify-api-php.
+1
from shopify-api-php.
From what I can tell, this was fixed in #263 (3ae0ed4) by moving the temporary file into sys_get_temp_dir()
instead of writing to a path within vendor/
. This was released as part of version 5.0.0
of this library. (My previous comment was wrong.)
@paulomarg, I think this issue can be closed now.
from shopify-api-php.
@paulomarg, I think this issue can be closed now.
It's up to the maintainers of course, but in all honesty I still don't get why a library has to write deprecations to a file. Even though it's just to the temp directory, there's still a file somewhere that can potentially grow to unknown sizes and can't be routed elsewhere.
from shopify-api-php.
there's still a file somewhere that can potentially grow to unknown sizes and can't be routed elsewhere.
The file contains only a unix timestamp.
from shopify-api-php.
… which then makes me wonder why we need it at all, or at least from a userland perspective.
It's now turning into a discussion of principles and I know that I am on the annoying end of the spectrum, but the cleaner and less surprises in code (especially code provided by a company such as Shopify), the better :)
from shopify-api-php.
It seems like an option to disable this is required, perhaps when doing Context::initialize.
The file .last_api_deprecation_warning
makes it impossible to run 2 instances on the same server under different users (something we often do for prod and staging for small apps) because if one of the users creates the file, the other one will be unable to edit it due to lacking ownership.
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
+1
from shopify-api-php.
Related Issues (20)
- A new release of the Shopify API occurred HOT 2
- Could not find the current session id in the cookies - Error still happening HOT 2
- Add missing @throws tag to DocBlocks HOT 2
- Unable to Access My shopify app UI in admin side using Docker. HOT 2
- cannot get response as the documentations HOT 2
- The Registry::process always fails for webhooks sent by Shopify
- Token Exchange support HOT 2
- Exception stacktrace goes missing when the processing of a webhook catches it HOT 3
- Utils::sanitizeShopDomain is not utilizing the custom $myShopifyDomain parameter HOT 3
- Complete example in documentation? HOT 2
- A new release of the Shopify API is due soon
- Add a method to retrieve the last raw response HOT 1
- 5.5.1 is a breaking change: CookieNotFoundException HOT 3
- A new release of the Shopify API occurred
- Default cookie setter in OAuth is not setting samesite = None
- Add missing CUSTOMERS_REDACT, CUSTOMERS_REQUEST & SHOP_REDACT topics. HOT 1
- Missing combines_with in PriceRule HOT 4
- Cant add fields, metafieldNamespaces, filter to webhooks! ruby has it why dont we??? Shopify\Webhooks\Registry::register HOT 1
- You may have taken more than 60 seconds to complete the OAuth process and need to start over HOT 2
- A new release of the Shopify API is due soon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify-api-php.