承接 gnkw/creator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

gnkw/creator

Composer 安装命令:

composer create-project gnkw/creator

包简介

README 文档

README

Introduction

This creator is used to generate some PHP Classes in an organized structure. It use an autoloader, so you can easily call the classes you want between them and from a php main script by calling the autoloader. It also let you create PHPUnit test classes to test your php classes.

To use this Creator you need to have read and write rights to create files by PHP.

Install it with composer

To install composer :

$ curl -sS https://getcomposer.org/installer | php

To install the latest version of the creator :

Stable :

$ php composer.phar create-project gnkw/creator gnkw-creator

Dev :

$ php composer.phar create-project gnkw/creator gnkw-creator master

Go to your creator

$ cd gnkw-creator

Update from 1.x to 2.x

This is the version 2.x of the creator, so now, you can't transform your classes and you can't use the old notation class like this : MyClass.class.php.

Please transform your classes with the standard notation : MyClass.php before updating the creator.

Create a class

You can create a class by using this command (replace Name/Space and MyClass by your datas) :

$ php app/console.php create class Name/Space MyClass

Create a test class

To create a test class for a class using PHPUnit, it's a similar syntax :

$ php app/console.php create test Name/Space MyClass

Note : If the original class don't exist, the test class can't be created.

Use a class

Copy the index.php example file to your web directory

$ mkdir web && cp examples/index.php web/.

After that, you want use your classes, so go to the web/index.php file and use or precise the namespace in the Your Main Code section :

$ vim web/index.php
	/**
	* Your Main Code
	*/
	use \Name\Space\MyClass;
	$myClass = new MyClass();

Then, when executing web/index.php, it returns :

$ php web/index.php
Hello MyClass !

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0
  • 更新时间: 2013-09-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固