Skip to content

Commit c4cc695

Browse files
authored
Merge pull request #22 from duncan3dc/composer-support
Add basic composer support
2 parents cda63b7 + 6d38ac9 commit c4cc695

File tree

7 files changed

+37
-56
lines changed

7 files changed

+37
-56
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
# Created by .ignore support plugin (hsz.mobi)
1+
/composer.lock
2+
/vendor

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22
This is a PHP library to detect and decode QR-codes.<br />This is first and only QR code reader that works without extensions.<br />
33
Ported from [ZXing library](https://github.com/zxing/zxing)
44

5+
6+
## Installation
7+
The recommended method of installing this library is via [Composer](https://getcomposer.org/).
8+
9+
Run the following command from your project root:
10+
11+
```bash
12+
$ composer require khanamiryan/qrcode-detector-decoder
13+
```
14+
15+
516
## Usage
617
```php
7-
include_once('./lib/QrReader.php');
18+
require __DIR__ . "/vendor/autoload.php";
819
$qrcode = new QrReader('path/to_image');
920
$text = $qrcode->text(); //return decoded text from QR Code
1021
```
1122

1223
## Requirements
13-
* PHP >= 5.3
24+
* PHP >= 5.6
1425
* GD Library
1526

1627

composer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "khanamiryan/qrcode-detector-decoder",
3+
"type": "library",
4+
"description": "QR code decoder / reader",
5+
"keywords": ["qr", "zxing", "barcode"],
6+
"homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder",
7+
"license": "MIT",
8+
"authors": [{
9+
"name": "Ashot Khanamiryan",
10+
"email": "[email protected]",
11+
"homepage": "https://github.com/khanamiryan",
12+
"role": "Developer"
13+
}],
14+
"require": {
15+
"php": "^5.6|^7.0"
16+
},
17+
"autoload": {
18+
"classmap": ["lib/"],
19+
"files": ["lib/common/customFunctions.php"]
20+
}
21+
}

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
include_once('./lib/QrReader.php');
3+
require __DIR__ . "/vendor/autoload.php";
44

55

66

lib/QrReader.php

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,5 @@
11
<?php
22

3-
include_once ('Reader.php');
4-
require_once ('BinaryBitmap.php');
5-
require_once ('common/detector/MathUtils.php');
6-
require_once ('common/BitMatrix.php');
7-
require_once ('common/BitSource.php');
8-
require_once ('common/BitArray.php');
9-
require_once ('common/CharacterSetEci.php');//
10-
require_once ('common/AbstractEnum.php');//
11-
require_once ('BinaryBitmap.php');
12-
include_once ('LuminanceSource.php');
13-
include_once ('GDLuminanceSource.php');
14-
include_once ('IMagickLuminanceSource.php');
15-
include_once ('common/customFunctions.php');
16-
include_once ('common/PerspectiveTransform.php');
17-
include_once ('common/GridSampler.php');
18-
include_once ('common/DefaultGridSampler.php');
19-
include_once ('common/DetectorResult.php');
20-
require_once ('common/reedsolomon/GenericGFPoly.php');
21-
require_once ('common/reedsolomon/GenericGF.php');
22-
include_once ('common/reedsolomon/ReedSolomonDecoder.php');
23-
include_once ('common/reedsolomon/ReedSolomonException.php');
24-
25-
include_once ('qrcode/decoder/Decoder.php');
26-
include_once ('ReaderException.php');
27-
include_once ('NotFoundException.php');
28-
include_once ('FormatException.php');
29-
include_once ('ChecksumException.php');
30-
include_once ('qrcode/detector/FinderPatternInfo.php');
31-
include_once ('qrcode/detector/FinderPatternFinder.php');
32-
include_once ('ResultPoint.php');
33-
include_once ('qrcode/detector/FinderPattern.php');
34-
include_once ('qrcode/detector/AlignmentPatternFinder.php');
35-
include_once ('qrcode/detector/AlignmentPattern.php');
36-
include_once ('qrcode/decoder/Version.php');
37-
include_once ('qrcode/decoder/BitMatrixParser.php');
38-
include_once ('qrcode/decoder/FormatInformation.php');
39-
include_once ('qrcode/decoder/ErrorCorrectionLevel.php');
40-
include_once ('qrcode/decoder/DataMask.php');
41-
include_once ('qrcode/decoder/DataBlock.php');
42-
include_once ('qrcode/decoder/DecodedBitStreamParser.php');
43-
include_once ('qrcode/decoder/Mode.php');
44-
include_once ('common/DecoderResult.php');
45-
include_once ('Result.php');
46-
include_once ('Binarizer.php');
47-
include_once ('common/GlobalHistogramBinarizer.php');
48-
include_once ('common/HybridBinarizer.php');
49-
50-
513
final class QrReader
524
{
535
const SOURCE_TYPE_FILE = 'file';

lib/Reader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Zxing;
44

5-
require_once('qrcode/QRCodeReader.php');
6-
75
interface Reader {
86

97
public function decode($image);

lib/qrcode/QRCodeReader.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
namespace Zxing\Qrcode;
1919

20-
require_once('detector/Detector.php');
21-
2220
use Zxing\BarcodeFormat;
2321
use Zxing\BinaryBitmap;
2422
use Zxing\ChecksumException;

0 commit comments

Comments
 (0)