PHP code example of xiaosongshu / bags

1. Go to this page and download the library: Download xiaosongshu/bags library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xiaosongshu / bags example snippets




/**
 * @purpose 业务代码
 */
class Demo
{
    /**
     * 入口函数
     * @return void
     * @note 添加一场流星雨
     */
    public function run()
    {
        $client = new \Xiaosongshu\Animation\Client(0, 0, 1);
        $config3 = ['maxStars' => 10, 'numStars' => 10, 'isWaterLine' => true, 'distanceX' => 0, 'distanceY' => 0, 'distanceXStep' => 2, 'distanceYStep' => 1, 'directionX' => 0, 'directionY' => 0,];
        $client->addStarRain($config3);
        $client->run();
    }
}

bash 
php -d phar.readonly=0 ./index.php