Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmarsal committed Feb 5, 2017
2 parents ea6be0f + aab0074 commit 60bfb35
Show file tree
Hide file tree
Showing 39 changed files with 1,195 additions and 845 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/tests export-ignore
/preview export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
.scrutinizer.yml export-ignore
phpcs.xml export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor
composer.lock
.idea
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
language: php

php:
- 5.5
- 5.4
- 5.6
- 7.0

before_script:
- composer self-update
- composer update

script:
- php ./vendor/bin/phpcs
- php ./vendor/bin/phpunit -c ./tests/ --coverage-clover=coverage.xml

after_success:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2014 Robert Boloc
Copyright (c) 2013-2017 Robert Boloc

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
74 changes: 10 additions & 64 deletions Module.php
Original file line number Diff line number Diff line change
@@ -1,82 +1,28 @@
<?php

namespace RbComment;

use RbComment\Model\Comment as RbComment;
use RbComment\Model\CommentTable as RbCommentTable;
use ZendService\Akismet\Akismet;
use Zend\Db\ResultSet\ResultSet;
use Zend\Mail\Transport\Sendmail;
use Zend\Db\TableGateway\TableGateway;
use Zend\Console\Adapter\AdapterInterface as Console;
use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface;

class Module implements ConsoleUsageProviderInterface
{
/**
* @return array
*/
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}

public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}

public function getServiceConfig()
{
return array(
'factories' => array(
'RbComment\Model\CommentTable' => function($sm) {
$tableGateway = $sm->get('RbCommentTableGateway');
$table = new RbCommentTable($tableGateway);
return $table;
},
'RbCommentTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new RbComment());
return new TableGateway('rb_comments', $dbAdapter, null, $resultSetPrototype);
},
/**
* Placeholder transport config. Do not use this in production.
* Replace with smtp.
*/
'RbComment\Mailer' => function () {
return new Sendmail();
},
/**
* Akismet service instance factory. Uses the config down below.
*/
'RbComment\Akismet' => function ($serviceManager) {

$config = $serviceManager->get('Config');
$viewHelperManager = $serviceManager->get('viewhelpermanager');

$akismetConfig = $config['rb_comment']['akismet'];

return new Akismet(
$akismetConfig['api_key'],
$viewHelperManager->get('serverUrl')->__invoke()
);
}
),
);
}

/**
* @param Console $console
*
* @return array
*/
public function getConsoleUsage(Console $console)
{
return array(
return [
'delete spam' => 'Delete all comments marked as spam from the database',
);
];
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ email notifications, Akismet, ZfcUser and Gravatar integration.
```json
{
"require": {
"robertboloc/rbcomment": "1.4.0"
"robertboloc/rbcomment": "^2.0"
}
}
```
Expand Down Expand Up @@ -222,4 +222,4 @@ pick one of this tasks :
* If you are using the BjyAuthorize module (or any other route restricting module)
make sure the route `rbcomment` is publicly accessible.

* This module assumes you have a database adapter configured.
* This module assumes you have a database adapter configured.
47 changes: 25 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,41 @@
"comments",
"zf2"
],
"homepage": "http://github.com/robertboloc/RbComment",
"homepage": "https://github.com/robertboloc/RbComment",
"license": "MIT",
"authors": [
{
"name": "Robert Boloc",
"email": "robertboloc@gmail.com",
"homepage": "http://robertboloc.eu",
"homepage": "https://robertboloc.eu",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0",
"zendframework/zend-mvc": "2.*",
"zendframework/zend-form": "2.*",
"zendframework/zend-db": "2.*",
"zendframework/zend-inputfilter": "2.*",
"zendframework/zend-view": "2.*",
"zendframework/zend-servicemanager": "2.*",
"zendframework/zend-loader": "2.*",
"zendframework/zend-stdlib": "2.*",
"zendframework/zend-modulemanager": "2.*",
"zendframework/zend-serializer": "2.*",
"zendframework/zend-mail": "2.*",
"zendframework/zend-mime": "2.*",
"zendframework/zend-i18n": "2.*",
"zendframework/zendservice-akismet": "2.0.2",
"zendframework/zend-http": "2.*",
"zendframework/zend-console": "2.*"
"php": "^5.6 || ^7.0",
"zendframework/zend-console": "^2.6",
"zendframework/zend-db": "^2.8.1",
"zendframework/zend-form": "^2.9",
"zendframework/zend-http": "^2.5.4",
"zendframework/zend-i18n": "^2.7.3",
"zendframework/zend-inputfilter": "^2.7.2",
"zendframework/zend-loader": "^2.5.1",
"zendframework/zend-mail": "^2.7.1",
"zendframework/zend-math": "^3.0",
"zendframework/zend-mime": "^2.6",
"zendframework/zend-modulemanager": "^2.7.2",
"zendframework/zend-mvc": "^3.0.1",
"zendframework/zend-mvc-plugin-flashmessenger": "^1.0",
"zendframework/zend-serializer": "^2.8",
"zendframework/zend-servicemanager": "^3.1",
"zendframework/zend-stdlib": "^3.0.1",
"zendframework/zend-view": "^2.8",
"zendframework/zendservice-akismet": "2.0.2"
},
"require-dev": {
"robertboloc/zf2-components-list-generator": "dev-master",
"phpunit/phpunit": "3.7.*"
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^2.7"
},
"autoload": {
"psr-0": {
Expand All @@ -50,7 +53,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.5.x-dev"
"dev-master": "2.0.x-dev"
}
}
}
}
Loading

0 comments on commit 60bfb35

Please sign in to comment.