-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,195 additions
and
845 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
vendor | ||
composer.lock | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
); | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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": "[email protected]", | ||
"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": { | ||
|
@@ -50,7 +53,7 @@ | |
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.5.x-dev" | ||
"dev-master": "2.0.x-dev" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.