Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
681f980
commit 362f7ab
Showing
16 changed files
with
499 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
coverage_clover: workbench/code_coverage_report/clover/clover.xml | ||
json_path: workbench/code_coverage_report/clover/coveralls.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root=true | ||
|
||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
indent_style=space | ||
indent_size=4 | ||
insert_final_newline=false | ||
trim_trailing_whitespace=false | ||
|
||
[*.php] | ||
insert_final_newline=true | ||
trim_trailing_whitespace=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# IDE | ||
/.idea/ | ||
|
||
# Composer | ||
/vendor/ | ||
/composer.lock | ||
|
||
# Workbench | ||
/workbench |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
language: php | ||
matrix: | ||
include: | ||
- php: 5.3 | ||
dist: precise | ||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- 7.2 | ||
before_script: | ||
- composer install | ||
script: | ||
- vendor/bin/phpunit -v | ||
after_script: | ||
- travis_retry vendor/bin/php-coveralls -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# KanDisheng DemoPHP | ||
|
||
[![License](https://poser.pugx.org/KanDisheng/DemoPHP/license)](LICENSE) | ||
[![Download](https://poser.pugx.org/KanDisheng/DemoPHP/downloads)](https://packagist.org/packages/KanDisheng/DemoPHP) | ||
[![Stable](https://poser.pugx.org/KanDisheng/DemoPHP/version)](https://packagist.org/packages/KanDisheng/DemoPHP) | ||
[![Unstable](https://poser.pugx.org/KanDisheng/DemoPHP/v/unstable)](https://packagist.org/packages/KanDisheng/DemoPHP) | ||
[![composer.lock Available](https://poser.pugx.org/KanDisheng/DemoPHP/composerlock)](https://packagist.org/packages/KanDisheng/DemoPHP) | ||
[![Build Status](https://travis-ci.org/KanDisheng/DemoPHP.svg?branch=master)](https://travis-ci.org/KanDisheng/DemoPHP) | ||
[![Coverage Status](https://coveralls.io/repos/github/KanDisheng/DemoPHP/badge.svg?branch=master)](https://coveralls.io/github/KanDisheng/DemoPHP?branch=master) | ||
|
||
> KanDisheng DemoPHP | ||
## Manual | ||
|
||
- [Version 1.0 简体中文](manual/1.0_SimplifiedChinese.md) | ||
|
||
## Contributor | ||
|
||
- [Candison November](http://www.kandisheng.com) - Founder | ||
|
||
## Information | ||
|
||
- [Homepage](http://www.kandisheng.com) | ||
- [GitHub](https://github.com/KanDisheng/DemoPHP) | ||
- [Packagist](https://packagist.org/packages/KanDisheng/DemoPHP) | ||
- [Feedback](https://github.com/KanDisheng/DemoPHP/issues) | ||
- [About KanDisheng](http://www.kandisheng.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* KanDisheng DemoPHP | ||
* @author Candison November <www.kandisheng.com> | ||
*/ | ||
|
||
$autoloaDirectory = array( | ||
'class' => 'KanDisheng\\DemoPHP', | ||
'interface' => 'KanDisheng\\DemoPHP' | ||
); | ||
|
||
foreach ($autoloaDirectory as $directory => $namespaceRoot) { | ||
$directory = sprintf('%s%s%s', __DIR__, DIRECTORY_SEPARATOR, $directory); | ||
spl_autoload_register(function ($className) use ($directory, $namespaceRoot) { | ||
$directory = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $directory); | ||
$directory = rtrim($directory, '/\\'); | ||
$namespaceRoot = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $namespaceRoot); | ||
$namespaceRoot = trim($namespaceRoot, '/\\'); | ||
$className = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $className); | ||
$className = trim($className, '/\\'); | ||
if (substr($className, 0, strlen($namespaceRoot)) == $namespaceRoot) { | ||
$className = substr($className, strlen($namespaceRoot)); | ||
$className = ltrim($className, '/\\'); | ||
} | ||
$extensionList = array('php', 'class.php'); | ||
foreach ($extensionList as $extension) { | ||
$file = $directory . DIRECTORY_SEPARATOR . $className . '.' . $extension; | ||
if (is_file($file) && is_readable($file)) { | ||
require_once($file); | ||
} | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* KanDisheng DemoPHP | ||
* @author Candison November <www.kandisheng.com> | ||
*/ | ||
|
||
namespace KanDisheng\DemoPHP; | ||
|
||
/** | ||
* Class Demo | ||
* @package KanDisheng\DemoPHP | ||
*/ | ||
class Demo implements DemoInterface | ||
{ | ||
/** | ||
* Demo constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
} | ||
|
||
/** | ||
* Demo | ||
* @param string $string | ||
* @return string | ||
*/ | ||
public function demo($string = '') | ||
{ | ||
return $string; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"name": "kandisheng/demophp", | ||
"type": "library", | ||
"license": "Apache-2.0", | ||
"homepage": "http://www.kandisheng.com", | ||
"description": "KanDisheng DemoPHP", | ||
"keywords": [ | ||
"KanDisheng", | ||
"DemoPHP", | ||
"PHP" | ||
], | ||
"support": { | ||
"issues": "https://github.com/KanDisheng/DemoPHP/issues", | ||
"source": "https://github.com/KanDisheng/DemoPHP" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Candison November", | ||
"role": "Founder", | ||
"email": "kandisheng@163.com", | ||
"homepage": "http://www.kandisheng.com" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"KanDisheng\\DemoPHP\\": [ | ||
"interface", | ||
"class" | ||
] | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"KanDisheng\\DemoPHP\\Test\\": "test", | ||
"KanDisheng\\DemoPHP\\Script\\": "script" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=5.3.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "*", | ||
"phpmd/phpmd": "*", | ||
"squizlabs/php_codesniffer": "*", | ||
"satooshi/php-coveralls": "*", | ||
"CodeMommy/TaskPHP": "*" | ||
}, | ||
"scripts": { | ||
"environment": [ | ||
"composer -V", | ||
"php -v", | ||
"php -m" | ||
], | ||
"update-project": [ | ||
"git pull", | ||
"composer self-update", | ||
"composer update" | ||
], | ||
"test": [ | ||
"composer phpunit", | ||
"composer phpcbf", | ||
"composer phpcs", | ||
"composer phpmd" | ||
], | ||
"phpmd": "\"vendor/bin/phpmd\" autoload.php,interface,class,script,test,test_case text cleancode,codesize,controversial,design,naming,unusedcode", | ||
"phpcs": "\"vendor/bin/phpcs\" autoload.php interface class script test test_case --standard=PSR2", | ||
"phpcbf": "\"vendor/bin/phpcbf\" autoload.php interface class script test test_case --standard=PSR2", | ||
"phpunit": "KanDisheng\\DemoPHP\\Script\\PHPUnit::start", | ||
"clean": "KanDisheng\\DemoPHP\\Script\\Clean::start" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* KanDisheng DemoPHP | ||
* @author Candison November <www.kandisheng.com> | ||
*/ | ||
|
||
namespace KanDisheng\DemoPHP; | ||
|
||
/** | ||
* Interface DemoInterface | ||
* @package KanDisheng\DemoPHP | ||
*/ | ||
interface DemoInterface | ||
{ | ||
/** | ||
* DemoInterface constructor. | ||
*/ | ||
public function __construct(); | ||
|
||
/** | ||
* Demo | ||
* @param string $string | ||
* @return string | ||
*/ | ||
public function demo($string = ''); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# KanDisheng DemoPHP 1.0 开发手册 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="./vendor/autoload.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="KanDisheng DemoPHP"> | ||
<directory suffix="Test.php">./test</directory> | ||
<exclude>./test_case</exclude> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./interface</directory> | ||
<directory suffix=".php">./class</directory> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="coverage-clover" target="./workbench/code_coverage_report/clover/clover.xml"/> | ||
<log type="coverage-html" target="./workbench/code_coverage_report/html"/> | ||
</logging> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* KanDisheng DemoPHP | ||
* @author Candison November <www.kandisheng.com> | ||
*/ | ||
|
||
namespace KanDisheng\DemoPHP\Script; | ||
|
||
use CodeMommy\TaskPHP\Console; | ||
use CodeMommy\TaskPHP\FileSystem; | ||
|
||
/** | ||
* Class Clean | ||
* @package KanDisheng\DemoPHP\Script; | ||
*/ | ||
class Clean | ||
{ | ||
/** | ||
* Clean constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
} | ||
|
||
/** | ||
* Start | ||
*/ | ||
public static function start() | ||
{ | ||
PHPUnit::clean(); | ||
$removeList = array( | ||
'workbench' | ||
); | ||
$result = FileSystem::remove($removeList); | ||
if ($result) { | ||
Console::printLine('Clean Finished.', 'success'); | ||
} else { | ||
Console::printLine('Clean Error.', 'error'); | ||
} | ||
} | ||
} |
Oops, something went wrong.