The leader gave me a task, let me work with iOS and Android for the platform mobile version of a app4.0 version, before this did not write interface and so on, so that the hands are a bit misty.
Later asked the elder, slowly wrote a little, basically in a day to master the handover rules, the most difficult is the debugging part, because it is also part of the two development, coupled with some of the features are not very familiar with, so stumbled on the way, simply is to go after finally walked through, also on-line. This time the main use of the Redis,memcache. Although I have seen Redis but actually use it for another event, let me give you a few examples:
1, is the problem of the value of Redis,
$redis = new Redis ();
$redis->set ("test". $user [' id '], $packet _token);
But when you take it,
$redid = $redis->get ("test". $user [' id ']);
It's not going to get a value.
The reason is that Redis is not set to expire, add the line $redis->set2 ("user") when assigning a value. $user [' id '], $packet _token,1000);
2. Redis Queue blocking situation
When testing the app Redis various blocks, various error logs, for simple blocking just ask for the queue (execute script):
#!/bin/bash
#
Redis_pass=aaaaaaaaaaaaaaaaaaaaaaaaaaa
Redis-cli-a $REDIS _pass Lpop Fund:queue:sandbox
Redis-cli-a $REDIS _pass Set fund:queue:locked "
Supervisorctl Restart all
For the error log, one of the errors made me spend half a day:
The reason is that there is a field uniqueness constraint in the table, and the value that exists as Redis should have been a list type because the error has passed the string type, as long as you clear the table data and then restart Redis.
3, finally online, but finally redeemed the amount of money cannot redeem
Because each account is added to the account lock, the user can not continuously click, because it is multiple redemption, but the account lock is added to a single redemption, so long as the account lock into multiple redemption.
The above describes the first time to write the experience of the interface, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.