Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Yeah, their choice to not actually rotate the image data but to indicate it in EXIF data is baffling. If anything the EXIF should tell the original orientation of the device - acting as supplemental data, not required information.
  2. If you're in there looking at the EXIF data anyways you might as well do the right thing and check the orientation. [edit] Oh, and there's a more significant issue: just because the photo was taken was an iPhone (a) doesn't mean that it is rotated at all, or if it was (b) tell you which way it is rotated.
  3. Have you tried a, you know, comparison? With >?
  4. Would have to know all the FastraxNetwork code too. But don't expect someone to do this for you for free.
  5. Variables defined outside functions are not available inside functions. Pass $db as an argument to the method.
  6. If you have code that deals with superglobals (eg, a "Request" class) then use it. Otherwise it's not a crime to use them - just don't make changes.
  7. Is this another one of your abstract questions that would be better answered if it wasn't abstract? What is the relationship between the IDs and the animals? The normal answer to "how do I get a thing based on ID" is "do a query for the information from the database and construct the object appropriately", but that doesn't seem right here.
  8. Why do you think you need a class for this? And for what, exactly?
  9. Y-m-d is the normal format, but MySQL understands Ymd too. But I don't think MySQL is involved here.
  10. A helpful resource.
  11. $unique_coupon_code only exists in the create_coupon() function (and only after it gets defined). Variables in one function do not magically appear in other functions - it would create havoc. To get the value, call the function and use its return value. $coupon = create_coupon(); echo $coupon; // or simply echo create_coupon();
  12. The ID is being included in $attributes but doesn't have a valid value. Don't include it. Or if you must, set it to null.
  13. Could be caused by recursion. Install Xdebug, set a stack limit of 100 (default), and see if you can get a stack trace of it failing.
  14. Of sorts. Either it polls for changes in the main loop (if that's possible) or there's a separate PHP process running on the same machine that does blocking checks. But what kicken is describing (the "act as a client to the existing server" option) is better. If you want to lock down the ability to send messages to a client, so that client A can't force a message to client B, then you can always restrict the command to an IP range (ie, localhost and/or LAN).
  15. a) Have your code act as a client to the existing server and exchange data that way. b) Redis.
  16. You're sure it's SSH and not SSL?
  17. If you don't know the key and there's only one entry in the array then you can use current to get the value: current($my_coupon)->coupon_amount
  18. That output is for $my_coupon, right? $my_coupon Array (is an array [test]with a "test" key => WC_Coupon Objectwith a WC_Coupon object as the value [coupon_amount]which has a "coupon_amount" property => 10with the value 10. So $my_coupon["test"]->coupon_amountDoing it this way means you need to know the coupon code. Do you?
  19. Forget the class thing. It would be nice but it's probably too complicated for you to do right now. This code while($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) { $rows[] = $row; }is where you fetch all the data from the database. Inside, each course1 in $row will be a DateTime object. When you json_encode() everything, DateTime objects turn into that date/timezone_type/timezone thing. You don't want that.So instead of using course1 as is, change the value to be a simple string: you need "/Date(", the Unix timestamp which you can get with DateTime::getTimestamp(), and ")/". $row["course1"] = "/Date(" . $row["course1"]->getTimestamp() . ")/";Do that before you add $row into $rows. Try that, then post your code if you're still having problems.
  20. It doesn't look like you've tried anything I said. How about doing the from earlier and seeing if that works for you? If not, post the code you tried.
  21. What is your code?
  22. Yeah, you'd need to do it there. course1 is apparently a DateTime - discard that and replace it with a string value. Or be fancy and replace it with class JsonDateTime extends DateTime implements JsonSerializable { public function __construct(DateTime $dt) { parent::__construct($dt->format("r")); } public function jsonSerialize() { return "/Date(" . $this->getTimestamp() . ")/"; } } $row["course1"] = new JsonDateTime($row["course1"]);and let JsonSerializable do the rest of the work. Anyway, fine, whatever, but your code is still completely different from the example. So can you resolve that? What do the two samples have to do with each other?
  23. Using the hash as the actual key is an implementation detail you shouldn't need to care about. If you use SplObjectStorage then just deal with the objects. 1. "Told to do something to that client" can't work until the client gives the key. Why does the client wait so long to give that? It should be giving that at the beginning of the process, as part of a sort of handshake protocol. 2. Since this code doesn't matter without the key being exchanged, you don't need to bother storing the client thing until that happens. Wait until you have the key and then store the object, which consequently removes the need for SplObjectStorage in the first place because you'll have the unique key (a scalar value) available.
  24. SplObjectStorage is basically like an associative array that works with objects as keys. You are trying to use it as such, but you're also using these IDs as keys. Doing both doesn't make sense to me. If the IDs are unique then why not use them as the keys? And if that then why use Foo at all and not just an array?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.