scherbak-electronics/php-app-template 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scherbak-electronics/php-app-template

最新稳定版本:v1.0.2

Composer 安装命令:

composer create-project scherbak-electronics/php-app-template

包简介

A super minimalistic PHP application template with ready-to-use Composer autoloading.

README 文档

README

This is as minimal as possible PHP application template designed to provide a basic project structure with Composer autoloading configured. It is ideal for super small minimalistic projects or scripts that require a clean, ultra-minimal setup with the capability to expand as needed.

Features

  • Minimal Setup: Only two files (composer.json and main.php) are initially present.
  • Composer Autoloading: PSR-4 autoloading is configured, ready for you to add classes under the src/ directory.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Composer installed on your system to work with this project template. You can download and install Composer by following the instructions on the official Composer website.

Installing

To start a new project based on this template, run the following command:

composer create-project scherbak-electronics/php-app-template path/to/your-new-project

Structure

  • src/: Directory where your PHP classes should be placed (following the App\ namespace).
  • main.php: A simple PHP script to demonstrate the setup. Modify or expand it as needed. To facilitate direct execution of the script from the command line, please include the shebang line #!/usr/bin/env php at the beginning of this file.

Usage

After installation, you can start adding your PHP classes in the src/ directory. For example, to add a new class Example, create a file src/Example.php with the following content:

<?php
namespace App;

class Example {
    public function sayHello() {
        return "Hello from Example class!";
    }
}

You can then use this class in your main.php file:

<?php
require __DIR__ . '/vendor/autoload.php';

use App\Example;

$example = new Example();
echo $example->sayHello();

To run your script, use:

php main.php

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

License

This project is open-sourced under the MIT License, but there is no LICENSE file for details, sorry.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-27