Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Commit

Permalink
composer
Browse files Browse the repository at this point in the history
  • Loading branch information
slight committed Jun 28, 2017
1 parent 52a102d commit 62d126f
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 122 deletions.
195 changes: 116 additions & 79 deletions .idea/workspace.xml

Large diffs are not rendered by default.

19 changes: 4 additions & 15 deletions Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,8 @@
* Time: 15:51
*/

defined('ROOT_PATH') or define('ROOT_PATH', dirname(__DIR__));
spl_autoload_register(function($class){
$prefix = 'CoolQCreator\\';
$baseDir = ROOT_PATH . '/src/';
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
return;
}
//$relativeClass = substr($class, $len);
$file = $baseDir . str_replace('\\', '/', $class) . '.php';
if (file_exists($file)) {
require $file;
}else{

}
spl_autoload_register(function($className){
$path = str_replace('\\', DIRECTORY_SEPARATOR, $className);
$file = __DIR__.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.$path.'.php';
if(is_file($file)) require $file;
});
27 changes: 14 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@

{
"name": "slight-sky/coolq-sdk-php",
"type": "library",
"description": "sdk",
"type": "library",
"keywords": ["coolq","library","sdk"],
"homepage": "https://slight-sky.github.io/",
"license": "MIT",
"authors": [
{
"name": "kilingzhang",
"email": "[email protected]",
"homepage" : "https://slight-sky.github.io/"
"homepage" : "https://slight-sky.github.io/"
}
],
"homepage":"https://github.com/slight-sky/coolq-sdk-php",
"license": "MIT",
"minimum-stability": "dev",
"require": {
"php" : ">=5.3.0"
},
"autoload": {
"psr-4": {

}
"require:": {
"php": ">=5.3"
},
"autoload": {
"psr-0": {
"Feehi": "src/"
}
}
}
}
14 changes: 14 additions & 0 deletions examples/docTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* Created by PhpStorm.
* User: Kilingzhang
* Date: 2017/6/28
* Time: 15:53
*/

require_once '../Autoloader.php';

use CoolQ\CoolQ;

$CoolQ = new CoolQ('127.0.0.1',5700,'token');
echo $CoolQ->getLoginInfo();
2 changes: 1 addition & 1 deletion src/CoolQCreator/CQ.php → src/CoolQ/CQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 13:52
*/

namespace CoolQCreator;
namespace CoolQ;


class CQ
Expand Down
2 changes: 1 addition & 1 deletion src/CoolQCreator/CoolQ.php → src/CoolQ/CoolQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 12:57
*/

namespace CoolQCreator;
namespace CoolQ;


class CoolQ
Expand Down
2 changes: 1 addition & 1 deletion src/CoolQCreator/MsgTool.php → src/CoolQ/MsgTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Time: 13:55
*/

namespace CoolQCreator;
namespace CoolQ;


class MsgTool
Expand Down
12 changes: 0 additions & 12 deletions tests/docTest.php

This file was deleted.

0 comments on commit 62d126f

Please sign in to comment.