PHP code example of xianglin / first-composer

1. Go to this page and download the library: Download xianglin/first-composer 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/ */

    

xianglin / first-composer example snippets



/**
 * Created by xianglinl
 * User:liubo
 * Date:2020/5/26
 * Time:20:14
 */

namespace firstComposer;

class TestComposer
{
    public function showTime()
    {
        echo '当时北京时间: ' . date('Y-m-d H:i:s');
    }
}



irstComposer\TestComposer;

(new TestComposer())->showTime();


firstComposer\TestComposer;

(new TestComposer())->showTime();

.
├── README.md
├── composer.json
└── src
    └── TestComposer.php

.
├── README.md
├── composer.json
├── src
│   └── TestComposer.php
└── vendor
    ├── autoload.php
    └── composer
        ├── ClassLoader.php
        ├── LICENSE
        ├── autoload_classmap.php
        ├── autoload_namespaces.php
        ├── autoload_psr4.php
        ├── autoload_real.php
        ├── autoload_static.php
        └── installed.json
bash
php vendor/index.php 
当时北京时间: 2020-05-26 12:47:24%