Skip to content

Commit 9b14c7f

Browse files
author
yanqizhou
committed
Merge branch 'master' of https://github.com/y500/YYDebugDatabase
2 parents b914f65 + d332410 commit 9b14c7f

9 files changed

Lines changed: 368 additions & 4 deletions

File tree

Cartfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
github "swisspol/GCDWebServer"
3+
github "ccgus/fmdb"

DebugDatabase/DatabaseUtil.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88

99
#import "DatabaseUtil.h"
1010
#import <sqlite3.h>
11+
12+
#ifdef COCOAPODS
1113
#import "FMDB.h"
14+
#else
15+
#import <FMDB/FMDB.h>
16+
#endif
17+
18+
1219

1320
@interface DatabaseUtil ()
1421

DebugDatabase/DebugDatabaseManager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#ifdef COCOAPODS
1012
#import <GCDWebServer/GCDWebServer.h>
13+
#else
14+
#import <GCDWebServers/GCDWebServers.h>
15+
#endif
1116

1217
@interface DebugDatabaseManager : GCDWebServer
1318

DebugDatabase/DebugDatabaseManager.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
#import "NSURL+scheme.h"
1111
#import "DatabaseUtil.h"
1212
#import "NSString+json.h"
13-
#import "GCDWebServerRequest.h"
14-
#import "GCDWebServerDataResponse.h"
13+
#ifdef COCOAPODS
14+
#import <GCDWebServer/GCDWebServerRequest.h>
15+
#import <GCDWebServer/GCDWebServerDataResponse.h>
16+
#else
17+
#import <GCDWebServers/GCDWebServerRequest.h>
18+
#import <GCDWebServers/GCDWebServerDataResponse.h>
19+
#endif
20+
1521

1622
@interface DebugDatabaseManager ()<GCDWebServerDelegate>
1723

DebugDatabase/Info.plist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
<key>NSPrincipalClass</key>
22+
<string></string>
23+
</dict>
24+
</plist>

DebugDatabase/iOSDebugDatabase.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// iOSDebugDatabase.h
3+
// iOSDebugDatabase
4+
//
5+
// Created by Jan Chaloupecky on 16.12.17.
6+
// Copyright © 2017 wentian. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
//! Project version number for iOSDebugDatabase.
12+
FOUNDATION_EXPORT double iOSDebugDatabaseVersionNumber;
13+
14+
//! Project version string for iOSDebugDatabase.
15+
FOUNDATION_EXPORT const unsigned char iOSDebugDatabaseVersionString[];
16+
17+
// In this header, you should import all the public headers of your framework using statements like
18+
#import <iOSDebugDatabase/DebugDatabaseManager.h>
19+
20+

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
- [x] Download database.
1616

1717

18+
# <span style="color:red">Release 2.0.0:</span>
19+
* **Replace CocoaAsyncSocket with GCDWebServer, which is higher level server that more convenient.**
20+
* **Satisfy with Firefox, Safari, Chrome.**
21+
* **Use bonjourname as the server address, for example: http://y500.local, http://macbook.local:9002...**
22+
* **print link address and bonjour name of the server in the console**
23+
24+
1825
# Installation
1926

2027
#### Podfile
@@ -32,6 +39,22 @@ use_frameworks!
3239
pod 'YYDebugDatabase'
3340
```
3441

42+
#### Carthage
43+
44+
- Cartfile
45+
46+
```
47+
github "y500/iOSDebugDatabase"
48+
```
49+
50+
- run `carthage update`
51+
52+
- Add all three `.frameworks` to your target "Embedd Frameworks" Build Phase:
53+
- `iOSDebugDatabase.framework`
54+
- `FMDB.framework`
55+
- `GCDWebServers.framework`
56+
57+
3558
#### Not build in Release
3659

3760
First, add configurations in Podfile.
@@ -52,7 +75,7 @@ $ pod install
5275
import at AppDelegate.m:
5376

5477
```objc
55-
#import YYDebugDatabaseManager.h
78+
#import DebugDatabaseManager.h
5679
```
5780

5881
making one line code at `application:didFinishLaunchingWithOptions`:
@@ -93,7 +116,7 @@ for example:
93116
```objc
94117
NSString *resourceDirectory = [[NSBundle mainBundle] resourcePath];
95118
NSString *databaseDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/database"];
96-
NSString *documentDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documnets"];
119+
NSString *documentDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
97120
NSString *cacheDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Cache"];
98121
[[DebugDatabaseManager shared] startServerOnPort:9002 directories:@[resourceDirectory, databaseDirectory, documentDirectory, cacheDirectory]];
99122
```
@@ -131,6 +154,15 @@ Important:
131154
- If you use Simulator you can use address: http://127.0.0.1:9002.
132155
- the port must be same as you write in Appdelegate.m
133156

157+
###other more:
158+
159+
you can find the address and bojourname address in the console like below:
160+
```
161+
[INFO] DebugDatabaseManager started on port 9002 and reachable at http://192.168.0.67:9002/
162+
[INFO] DebugDatabaseManager now locally reachable at http://y500.local:9002/
163+
```
164+
165+
134166
### License
135167
```
136168
Copyright (C) 2016 y500

0 commit comments

Comments
 (0)