Skip to content

Commit 60bfb35

Browse files
committed
Merge branch 'develop'
2 parents ea6be0f + aab0074 commit 60bfb35

39 files changed

+1195
-845
lines changed

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/tests export-ignore
2+
/preview export-ignore
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
.travis.yml export-ignore
6+
.scrutinizer.yml export-ignore
7+
phpcs.xml export-ignore

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
22
composer.lock
3+
.idea

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
language: php
22

33
php:
4-
- 5.5
5-
- 5.4
4+
- 5.6
5+
- 7.0
66

77
before_script:
88
- composer self-update
99
- composer update
1010

1111
script:
12+
- php ./vendor/bin/phpcs
1213
- php ./vendor/bin/phpunit -c ./tests/ --coverage-clover=coverage.xml
1314

1415
after_success:

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2014 Robert Boloc
3+
Copyright (c) 2013-2017 Robert Boloc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

Module.php

+10-64
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,28 @@
11
<?php
2-
32
namespace RbComment;
43

5-
use RbComment\Model\Comment as RbComment;
6-
use RbComment\Model\CommentTable as RbCommentTable;
7-
use ZendService\Akismet\Akismet;
8-
use Zend\Db\ResultSet\ResultSet;
9-
use Zend\Mail\Transport\Sendmail;
10-
use Zend\Db\TableGateway\TableGateway;
114
use Zend\Console\Adapter\AdapterInterface as Console;
125
use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface;
136

147
class Module implements ConsoleUsageProviderInterface
158
{
9+
/**
10+
* @return array
11+
*/
1612
public function getConfig()
1713
{
1814
return include __DIR__ . '/config/module.config.php';
1915
}
2016

21-
public function getAutoloaderConfig()
22-
{
23-
return array(
24-
'Zend\Loader\ClassMapAutoloader' => array(
25-
__DIR__ . '/autoload_classmap.php',
26-
),
27-
'Zend\Loader\StandardAutoloader' => array(
28-
'namespaces' => array(
29-
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
30-
),
31-
),
32-
);
33-
}
34-
35-
public function getServiceConfig()
36-
{
37-
return array(
38-
'factories' => array(
39-
'RbComment\Model\CommentTable' => function($sm) {
40-
$tableGateway = $sm->get('RbCommentTableGateway');
41-
$table = new RbCommentTable($tableGateway);
42-
return $table;
43-
},
44-
'RbCommentTableGateway' => function ($sm) {
45-
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
46-
$resultSetPrototype = new ResultSet();
47-
$resultSetPrototype->setArrayObjectPrototype(new RbComment());
48-
return new TableGateway('rb_comments', $dbAdapter, null, $resultSetPrototype);
49-
},
50-
/**
51-
* Placeholder transport config. Do not use this in production.
52-
* Replace with smtp.
53-
*/
54-
'RbComment\Mailer' => function () {
55-
return new Sendmail();
56-
},
57-
/**
58-
* Akismet service instance factory. Uses the config down below.
59-
*/
60-
'RbComment\Akismet' => function ($serviceManager) {
61-
62-
$config = $serviceManager->get('Config');
63-
$viewHelperManager = $serviceManager->get('viewhelpermanager');
64-
65-
$akismetConfig = $config['rb_comment']['akismet'];
66-
67-
return new Akismet(
68-
$akismetConfig['api_key'],
69-
$viewHelperManager->get('serverUrl')->__invoke()
70-
);
71-
}
72-
),
73-
);
74-
}
75-
17+
/**
18+
* @param Console $console
19+
*
20+
* @return array
21+
*/
7622
public function getConsoleUsage(Console $console)
7723
{
78-
return array(
24+
return [
7925
'delete spam' => 'Delete all comments marked as spam from the database',
80-
);
26+
];
8127
}
8228
}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ email notifications, Akismet, ZfcUser and Gravatar integration.
2424
```json
2525
{
2626
"require": {
27-
"robertboloc/rbcomment": "1.4.0"
27+
"robertboloc/rbcomment": "^2.0"
2828
}
2929
}
3030
```
@@ -222,4 +222,4 @@ pick one of this tasks :
222222
* If you are using the BjyAuthorize module (or any other route restricting module)
223223
make sure the route `rbcomment` is publicly accessible.
224224

225-
* This module assumes you have a database adapter configured.
225+
* This module assumes you have a database adapter configured.

composer.json

+25-22
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,41 @@
77
"comments",
88
"zf2"
99
],
10-
"homepage": "http://github.com/robertboloc/RbComment",
10+
"homepage": "https://github.com/robertboloc/RbComment",
1111
"license": "MIT",
1212
"authors": [
1313
{
1414
"name": "Robert Boloc",
1515
"email": "robertboloc@gmail.com",
16-
"homepage": "http://robertboloc.eu",
16+
"homepage": "https://robertboloc.eu",
1717
"role": "Developer"
1818
}
1919
],
2020
"require": {
21-
"php": ">=5.3.0",
22-
"zendframework/zend-mvc": "2.*",
23-
"zendframework/zend-form": "2.*",
24-
"zendframework/zend-db": "2.*",
25-
"zendframework/zend-inputfilter": "2.*",
26-
"zendframework/zend-view": "2.*",
27-
"zendframework/zend-servicemanager": "2.*",
28-
"zendframework/zend-loader": "2.*",
29-
"zendframework/zend-stdlib": "2.*",
30-
"zendframework/zend-modulemanager": "2.*",
31-
"zendframework/zend-serializer": "2.*",
32-
"zendframework/zend-mail": "2.*",
33-
"zendframework/zend-mime": "2.*",
34-
"zendframework/zend-i18n": "2.*",
35-
"zendframework/zendservice-akismet": "2.0.2",
36-
"zendframework/zend-http": "2.*",
37-
"zendframework/zend-console": "2.*"
21+
"php": "^5.6 || ^7.0",
22+
"zendframework/zend-console": "^2.6",
23+
"zendframework/zend-db": "^2.8.1",
24+
"zendframework/zend-form": "^2.9",
25+
"zendframework/zend-http": "^2.5.4",
26+
"zendframework/zend-i18n": "^2.7.3",
27+
"zendframework/zend-inputfilter": "^2.7.2",
28+
"zendframework/zend-loader": "^2.5.1",
29+
"zendframework/zend-mail": "^2.7.1",
30+
"zendframework/zend-math": "^3.0",
31+
"zendframework/zend-mime": "^2.6",
32+
"zendframework/zend-modulemanager": "^2.7.2",
33+
"zendframework/zend-mvc": "^3.0.1",
34+
"zendframework/zend-mvc-plugin-flashmessenger": "^1.0",
35+
"zendframework/zend-serializer": "^2.8",
36+
"zendframework/zend-servicemanager": "^3.1",
37+
"zendframework/zend-stdlib": "^3.0.1",
38+
"zendframework/zend-view": "^2.8",
39+
"zendframework/zendservice-akismet": "2.0.2"
3840
},
3941
"require-dev": {
4042
"robertboloc/zf2-components-list-generator": "dev-master",
41-
"phpunit/phpunit": "3.7.*"
43+
"phpunit/phpunit": "^5.7",
44+
"squizlabs/php_codesniffer": "^2.7"
4245
},
4346
"autoload": {
4447
"psr-0": {
@@ -50,7 +53,7 @@
5053
},
5154
"extra": {
5255
"branch-alias": {
53-
"dev-master": "1.5.x-dev"
56+
"dev-master": "2.0.x-dev"
5457
}
5558
}
56-
}
59+
}

0 commit comments

Comments
 (0)