2017 © Pedro Peláez
 

project blog

test composer

image

lwzphper/blog

test composer

  • Thursday, January 25, 2018
  • by lwzphper
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

# composer项目说明

前言:命名空间的名称为目录名,如:core一级目录下的文件命名空间为:namespace core; web/controller目录下的命名空间为:namespace web\controller;

步骤一:配置composer.json文件的autoload自动加载模块,将需要自动加载的文件(files) 和 命名空间(psr-4)配置好, (*1)

"autoload": {
    "files" : [
        "core/functions.php"
    ],
    "psr-4": {
        "core\\": "core/",
        "web\\": "web/"
    }
},

步骤二:需要在入口文件index.php引入composer的自动加载类, (*2)

include "vendor/autoload.php";

The Versions

25/01 2018

dev-master

9999999-dev

test composer

  Sources   Download

MIT

The Requires

 

by lwz