Tag:php

  • Hide API fields dynamically in laravel

    Time:2019-12-9

    The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t I recently saw a problem in the laravel Brasil community that turned out to be more interesting than it seemed. Imagine you have aUsersResourceUse the following implementation: <?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\Resource; class UsersResource extends Resource { /** * Transform the resource […]

  • Implementation of real-time leaderboard based on redis game

    Time:2019-12-9

    [TOC] Last modified: 18:18:37, June 4, 2019 1. Preface Recently, a real-time ranking function has been implemented for the project (mobile game), with main features: Real time full service ranking Single player ranking can be queried Support two-dimensional sorting The amount of data is not large, roughly between 1W and 50W (the number of roles […]

  • Use laravel’s API resource capabilities to build your API

    Time:2019-12-9

    The article is forwarded to the professional laravel developer community. Original link: https://learnku.com/laravel/t In the past two years, I have been using fractal for API development. If there is one function that I most hope laravel can add, it is undoubtedly convenient for data conversion, so as to develop better API interface. Don’t get me […]

  • Solution to leetcode PHP — D65 892. Surface area of 3D shapes

    Time:2019-12-9

    D65 892. Surface Area of 3D Shapes Title Link 892. Surface Area of 3D Shapes Title Analysis Given a three-dimensional array, returns the surface area of the stroke cylinder. thinking In a 3D array,$arr[$i][$j]The value of represents the height of the cylinder at that point. Therefore, for each value, 6 copies (1 * 1 * […]

  • Swoole learning network communication engine Web Service (4)

    Time:2019-12-9

    I. HTTP service HTTP server Let’s look at the introduction guide to swoole official documents – > fast start – > create a web server, run the sample code of the document once, and see the following effect: http_server.php <?php $http = new Swoole\Http\Server(“0.0.0.0”, 9501); $http->on(‘request’, function ($request, $response) { var_dump($request->get, $request->post); //Cookie test // […]

  • Easyswoole redis collaboration client Publishing

    Time:2019-12-9

    Easysoole redis collaboration client Publishing Many people may ask, isn’t swoole a redis client with its own collaboration? The answer is yes, thanks to the hard work of the swoole development team for developing the redis client for us. However, in production, we found some problems. The redis client of swoole does not fully support […]

  • Online list – 20 laravel application performance optimization items

    Time:2019-12-8

    The article was forwarded from the professional laravel developer community. Original link: https://learnku.com/laravel/t Let’s start! If your laravel application is already in production. From the first user, to the tenth, the hundredth, to thousands of users! Slowly,As more users, your website will be slower and slower So what should we do?Details determine success or failure […]

  • I built the world of Warcraft server in PHP just to prove that PHP is the best language in the world

    Time:2019-12-8

    I built the world of Warcraft server in PHP –Just to prove that PHP is the best language in the world As an old Warcraft player, I recently watched Blizzard open the nostalgic suit, and my already dead heart began to be restless again. I formally entered the pit where Netease took over the nine […]

  • Protocol basis: use telnet to learn IMAP protocol

    Time:2019-12-7

    IMAP introduction IMAPThe full name is Internet Mail Access Protocol, or Interactive Mail Access ProtocolPOP3Similar to one of the mail access standard protocols. The difference is, it’s onIMAPAfter that, the e-mail you received from the e-mail client remains on the server, and the operations on the client will be fed back to the server, such […]

  • Linux server cluster management platform in China

    Time:2019-12-7

    For the stationmaster or operation and maintenance personnel who use server cluster to manage operations, everyone has opinions on manual deployment environment and one click deployment environmentFor server cluster management, here I recommend two platforms to facilitate the use of the most simple and convenient way for the station master or operation and maintenance personnel […]

  • Database filler (supplied by laravel)

    Time:2019-12-7

    //Write filler, CMD goes to project root PHP artican make: seeder userstableseeder // all frame generated fillers are in database / seeds //The stuffer class by default contains only one method: run. This method is called when the artisan command DB: seed runs. //Test add single <?php use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; class DatabaseSeeder extends Seeder […]

  • Query PHP v1-beta.6 added 400 unit test full coverage

    Time:2019-12-7

    Querypphp v1.0.0-beta.6, this version is mainly for unit test closure. We have newly written 400 unit test cases. In addition to the code that we choose to ignore actively and can’t be tested and a part of the code of swoole, the whole product achieves 100% coverage. Core library framework unit test case 3410 asserts […]