Skip to content

Commit

Permalink
fix install issue
Browse files Browse the repository at this point in the history
add requirements
  • Loading branch information
JBinggi committed Feb 13, 2020
1 parent cb4cced commit fd41de8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"php-coveralls/php-coveralls": "^2.2",
"oneplace/oneplace-basket": "^1.0.1",
"oneplace/oneplace-contact": "^1.0.8"
"oneplace/oneplace-contact-address": "^1.0.3"
},
"require": {
"php": "^7.1",
"oneplace/oneplace-basket": "^1.0.1",
"oneplace/oneplace-contact": "^1.0.8"
"oneplace/oneplace-contact": "^1.0.8",
"oneplace/oneplace-contact-address": "^1.0.3"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class ContactController extends CoreEntityController {
* ContactController constructor.
*
* @param AdapterInterface $oDbAdapter
* @param ContactTable $oTableGateway
* @param BasketTable $oTableGateway
* @since 1.0.0
*/
public function __construct(AdapterInterface $oDbAdapter, BasketTable $oTableGateway, $oServiceManager)
public function __construct(AdapterInterface $oDbAdapter, ContactTable $oTableGateway, $oServiceManager)
{
$this->oTableGateway = $oTableGateway;
$this->sSingleForm = 'basketcontact-single';
Expand Down
14 changes: 3 additions & 11 deletions src/Controller/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use Application\Controller\CoreUpdateController;
use Application\Model\CoreEntityModel;
use OnePlace\Basket\Contact\Model\ContactTable;
use OnePlace\Basket\Model\BasketTable;
use Laminas\View\Model\ViewModel;
use Laminas\Db\Adapter\AdapterInterface;
use Laminas\Db\TableGateway\TableGateway;
Expand All @@ -30,10 +30,10 @@ class InstallController extends CoreUpdateController {
* InstallController constructor.
*
* @param AdapterInterface $oDbAdapter
* @param ContactTable $oTableGateway
* @param BasketTable $oTableGateway
* @since 1.0.0
*/
public function __construct(AdapterInterface $oDbAdapter, ContactTable $oTableGateway, $oServiceManager)
public function __construct(AdapterInterface $oDbAdapter, BasketTable $oTableGateway, $oServiceManager)
{
$this->oTableGateway = $oTableGateway;
$this->sSingleForm = 'basketcontact-single';
Expand All @@ -58,21 +58,13 @@ public function checkdbAction()

$bTableExists = false;

try {
$this->oTableGateway->fetchAll(false);
$bTableExists = true;
} catch (\RuntimeException $e) {

}

return new ViewModel([
'bTableExists' => $bTableExists,
'sVendor' => 'oneplace',
'sModule' => 'oneplace-basket-contact',
]);
} else {
$sSetupConfig = $oRequest->getPost('plc_module_setup_config');

$sSetupFile = 'vendor/oneplace/oneplace-basket-contact/data/install.sql';
if(file_exists($sSetupFile)) {
echo 'got install file..';
Expand Down
3 changes: 2 additions & 1 deletion src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Laminas\ModuleManager\ModuleManager;
use OnePlace\Basket\Model\BasketTable;
use OnePlace\Basket\Contact\Controller\ContactController;
use OnePlace\Contact\Model\ContactTable;

class Module {
/**
Expand Down Expand Up @@ -83,7 +84,7 @@ public function getControllerConfig() : array {
$oDbAdapter = $container->get(AdapterInterface::class);
return new Controller\InstallController(
$oDbAdapter,
$container->get(Model\ContactTable::class),
$container->get(BasketTable::class),
$container
);
},
Expand Down

0 comments on commit fd41de8

Please sign in to comment.