Skip to content

Commit

Permalink
Merge pull request #27 from dotkernel/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
n3vrax authored May 27, 2017
2 parents 89ad935 + f267f42 commit 6ffe0db
Show file tree
Hide file tree
Showing 13 changed files with 391 additions and 167 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## 0.4.0 - 2017-05-27

### Changed
* Nothing

### Added
* console capabilities added through dot-console based on zf-console
* bin/console.php bootstrap file(e.g php bin/console.php <command_name>)
* see [zf-console documentation](https://github.com/zfcampus/zf-console) for details on how to use console

### Deprecated
* Nothing

### Removed
* Nothing

### Fixed
* Nothing


## 0.3.1 - 2017-04-07

### Changed
Expand Down
22 changes: 22 additions & 0 deletions bin/console.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Console application bootstrap file
*/
use ZF\Console\Application;

chdir(dirname(__DIR__));
require 'vendor/autoload.php';

/**
* Self-called anonymous function that creates its own scope and keep the global namespace clean.
*/
call_user_func(function () {
/** @var \Interop\Container\ContainerInterface $container */
$container = require 'config/container.php';

/** @var Application $app */
$app = $container->get(Application::class);

$exit = $app->run();
exit($exit);
});
48 changes: 25 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,18 @@
},
"require": {
"php": "^7.1",
"roave/security-advisories": "dev-master",
"zendframework/zend-expressive": "^2.0.2",
"zendframework/zend-expressive-fastroute": "^2.0",
"zendframework/zend-expressive-twigrenderer": "^1.4",
"zendframework/zend-servicemanager": "^3.3.0",
"zendframework/zend-db": "^2.8",
"zendframework/zend-i18n": "^2.7",
"zendframework/zend-i18n-resources": "^2.5",
"zendframework/zend-captcha": "^2.6",
"zendframework/zendservice-recaptcha": "^3.0",
"zendframework/zend-text": "^2.6",
"zendframework/zend-stdlib": "^3.1",
"zendframework/zend-psr7bridge": "^0.2.2",
"zendframework/zend-config": "^3.1",
"zendframework/zend-config-aggregator": "^0.2.0",
"zendframework/zend-component-installer": "^1.0 || ^0.7.0",

"dotkernel/dot-annotated-services": "^1.1",
"dotkernel/dot-authentication-service": "^0.2",
"dotkernel/dot-authentication-web": "^0.2",
"dotkernel/dot-cache": "^1.1",
"dotkernel/dot-console": "^0.1",
"dotkernel/dot-controller": "^0.2",
"dotkernel/dot-controller-plugin-flashmessenger": "^0.2",
"dotkernel/dot-controller-plugin-authentication": "^0.2",
"dotkernel/dot-controller-plugin-authorization": "^0.2",
"dotkernel/dot-controller-plugin-flashmessenger": "^0.2",
"dotkernel/dot-controller-plugin-forms": "^0.2",
"dotkernel/dot-controller-plugin-mail": "^0.1",
"dotkernel/dot-controller-plugin-session": "^0.2",
"dotkernel/dot-mapper": "^0.3",
"dotkernel/dot-event": "^0.2",
"dotkernel/dot-filter": "^1.1",
"dotkernel/dot-flashmessenger": "^0.2",
Expand All @@ -52,14 +35,32 @@
"dotkernel/dot-inputfilter": "^1.1",
"dotkernel/dot-log": "^1.1",
"dotkernel/dot-mail": "^0.1",
"dotkernel/dot-mapper": "^0.3",
"dotkernel/dot-navigation": "^0.2",
"dotkernel/dot-paginator": "^1.1",
"dotkernel/dot-rbac": "^0.2",
"dotkernel/dot-rbac-guard": "^0.2",
"dotkernel/dot-session": "^2.0",
"dotkernel/dot-twigrenderer": "^0.2",
"dotkernel/dot-user": "^0.2",
"dotkernel/dot-validator": "^1.1"
"dotkernel/dot-validator": "^1.1",

"roave/security-advisories": "dev-master",
"zendframework/zend-captcha": "^2.6",
"zendframework/zend-component-installer": "^1.0 || ^0.7.0",
"zendframework/zend-config": "^3.1",
"zendframework/zend-config-aggregator": "^0.2.0",
"zendframework/zend-db": "^2.8",
"zendframework/zend-expressive": "^2.0.2",
"zendframework/zend-expressive-fastroute": "^2.0",
"zendframework/zend-expressive-twigrenderer": "^1.4",
"zendframework/zend-i18n": "^2.7",
"zendframework/zend-i18n-resources": "^2.5",
"zendframework/zend-psr7bridge": "^0.2.2",
"zendframework/zend-servicemanager": "^3.3.0",
"zendframework/zend-stdlib": "^3.1",
"zendframework/zend-text": "^2.6",
"zendframework/zendservice-recaptcha": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0.8 || ^5.7.15",
Expand All @@ -72,7 +73,8 @@
"psr-4": {
"Admin\\App\\": "src/App/src",
"Admin\\Admin\\": "src/Admin/src",
"Admin\\User\\": "src/User/src"
"Admin\\User\\": "src/User/src",
"Admin\\Console\\": "src/Console/src"
}
},
"autoload-dev": {
Expand Down Expand Up @@ -101,8 +103,8 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.3-dev",
"dev-develop": "0.4-dev"
"dev-master": "0.4-dev",
"dev-develop": "0.5-dev"
}
}
}
18 changes: 18 additions & 0 deletions config/autoload/console.global.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Admin\Console\Command\HelloCommand;

return [
'dot_console' => [
//'name' => 'DotKernel Console',
//'version' => '1.0.0',

'commands' => [
[
'name' => 'hello',
'description' => 'Hello, World! command example',
'handler' => HelloCommand::class,
],
]
]
];
2 changes: 2 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
\Dot\Twig\ConfigProvider::class,
\Dot\User\ConfigProvider::class,
\Dot\Validator\ConfigProvider::class,
\Dot\Console\ConfigProvider::class,

//application
\Admin\Admin\ConfigProvider::class,
\Admin\User\ConfigProvider::class,
\Admin\App\ConfigProvider::class,
\Admin\Console\ConfigProvider::class,

// Load application config in a pre-defined order in such a way that local settings
// overwrite global settings. (Loaded as first to last):
Expand Down
159 changes: 54 additions & 105 deletions data/admin+frontend.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,159 +4,108 @@
-- Table structure for table `user`
--

CREATE TABLE `user` (
`id` int(11) NOT NULL,
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(150) DEFAULT NULL,
`email` varchar(150) NOT NULL,
`password` varchar(150) NOT NULL,
`status` enum('pending','active','inactive','deleted') NOT NULL DEFAULT 'pending',
`dateCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`dateCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `user_details`
--

CREATE TABLE `user_details` (
CREATE TABLE IF NOT EXISTS `user_details` (
`userId` int(11) NOT NULL,
`firstName` varchar(150) DEFAULT NULL,
`lastName` varchar(150) DEFAULT NULL,
`phone` varchar(150) DEFAULT NULL,
`address` text
`address` text,
PRIMARY KEY (`userId`),
CONSTRAINT `user_details_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `user_message`
--

CREATE TABLE IF NOT EXISTS `user_message` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(150) NOT NULL,
`name` text NOT NULL,
`subject` text NOT NULL,
`message` text NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;


--
-- Table structure for table `user_role`
--

CREATE TABLE `user_role` (
`id` int(11) NOT NULL,
`name` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `user_role`
--

INSERT INTO `user_role` (`id`, `name`) VALUES
(1, 'user'),
(2, 'subscriber');
LOCK TABLES `user_role` WRITE;
/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
INSERT INTO `user_role` VALUES (2,'subscriber'),(1,'user');
/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
UNLOCK TABLES;

-- --------------------------------------------------------

--
-- Table structure for table `user_roles`
--

CREATE TABLE `user_roles` (
CREATE TABLE IF NOT EXISTS `user_roles` (
`userId` int(11) NOT NULL,
`roleId` int(11) NOT NULL
`roleId` int(11) NOT NULL,
PRIMARY KEY (`userId`,`roleId`),
KEY `userId` (`userId`),
KEY `roleId` (`roleId`),
CONSTRAINT `user_roles_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `user_roles_ibfk_2` FOREIGN KEY (`roleId`) REFERENCES `user_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- --------------------------------------------------------

--
-- Table structure for table `user_token`
--

CREATE TABLE `user_token` (
`id` int(11) NOT NULL,
CREATE TABLE IF NOT EXISTS `user_token` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`selector` varchar(150) DEFAULT NULL,
`token` varchar(150) NOT NULL,
`expire` int(11) DEFAULT NULL,
`type` enum('confirm','reset','remember') NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `username` (`username`);
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `userId` (`userId`),
KEY `selector` (`selector`),
KEY `token` (`token`),
CONSTRAINT `user_token_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

--
-- Indexes for table `user_details`
--
ALTER TABLE `user_details`
ADD PRIMARY KEY (`userId`);

--
-- Indexes for table `user_role`
--
ALTER TABLE `user_role`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`);

--
-- Indexes for table `user_roles`
--
ALTER TABLE `user_roles`
ADD PRIMARY KEY (`userId`,`roleId`),
ADD KEY `userId` (`userId`),
ADD KEY `roleId` (`roleId`);

--
-- Indexes for table `user_token`
--
ALTER TABLE `user_token`
ADD PRIMARY KEY (`id`),
ADD KEY `userId` (`userId`),
ADD KEY `selector` (`selector`),
ADD KEY `token` (`token`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `user_role`
--
ALTER TABLE `user_role`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `user_token`
--
ALTER TABLE `user_token`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `user_details`
--
ALTER TABLE `user_details`
ADD CONSTRAINT `user_details_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `user_roles`
--
ALTER TABLE `user_roles`
ADD CONSTRAINT `user_roles_ibfk_2` FOREIGN KEY (`roleId`) REFERENCES `user_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `user_roles_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `user_token`
--
ALTER TABLE `user_token`
ADD CONSTRAINT `user_token_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--*********************************************************
-- DOT_ADMIN EXPORT

--
Expand Down
Loading

0 comments on commit 6ffe0db

Please sign in to comment.