Skip to content

Commit

Permalink
update 1.1.13 to 1.1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Nov 29, 2019
1 parent 10b241d commit 9475d7b
Show file tree
Hide file tree
Showing 540 changed files with 120,508 additions and 10,441 deletions.
40 changes: 0 additions & 40 deletions update/.gitignore

This file was deleted.

19 changes: 19 additions & 0 deletions update/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.14] - 2019-11-27
- Fix of category tree does not appear after 3 level
- Ability to change url of package manager
- $.ajax.done() was not avaible
- Sub module settings handle open setting on parent module
- Change background picture does not work on old templates
- Put scroll on deep category tree
- Opening modal should close all handles submenus
- Issue with reset password
- Export orders to excel
- Email on new order is not editable
- Add page to menu is broken
- Tooltip must close on element change
- Added language choose method on install screen
- Added admin url setting on install screen
- Added module install command from CLI
- Other fixes
- [see all changes....](https://github.com/microweber/microweber/compare/1.1.13...1.1.14 "")


## [1.1.13] - 2019-10-25
- Fixes on mw.dialog
Expand Down
5 changes: 2 additions & 3 deletions update/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@
"aws/aws-sdk-php": "^3.0",
"mailerlite/mailerlite-api-v2-php-sdk": "*",
"finlet/flexmail": "*",
"phpoffice/phpspreadsheet": "*",
"nwidart/laravel-modules": "^1.27"
},
"phpoffice/phpspreadsheet": "*"
},
"require-dev": {
"fzaninotto/faker": "^1.9"
},
Expand Down
68 changes: 1 addition & 67 deletions update/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 138 additions & 0 deletions update/src/Microweber/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?php

namespace Microweber\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Microweber\Controllers\InstallController;


class InstallCommand extends Command
{
protected $name = 'microweber:install';
protected $description = 'Installs Microweber (duh)';
protected $installer;

public function __construct(InstallController $installer)
{
$this->installer = $installer;
parent::__construct();
}

public function fire()
{
/*
*
// you can now do
php artisan microweber:install
// or you can also install from env with:
export DB_HOST=localhost
export DB_USER=user
export DB_PASS=pass
export DB_ENGINE=sqlite
export DB_NAME=storage/database.sqlite
export DB_PREFIX=mw_
export DB_PORT=
php artisan microweber:install
*/


$input = array(
'db_host' => $this->argument('db_host'),
'db_name' => $this->argument('db_name'),
'db_user' => $this->argument('db_user'),
'db_pass' => $this->argument('db_pass'),
'db_driver' => $this->argument('db_driver'),
'table_prefix' => $this->option('prefix'),
'admin_email' => $this->argument('email'),
'admin_username' => $this->argument('username'),
'admin_password' => $this->argument('password'),
'with_default_content' => $this->option('default-content'),
'default_template' => $this->option('template'),
'config_only' => $this->option('config_only'),
'site_lang' => trim($this->option('language')),
);
$vals = array_filter($input);
if (!$vals) {
$this->info('No arguments provided... Performing lazy install');
$lazy_install = true;
} else {
$lazy_install = false;
}
if (!isset($input['make_install'])) {
$input['make_install'] = true;
}

if (!$input['db_host']) {
$input['db_host'] = getenv('DB_HOST');
}
if (!$input['db_user']) {
$input['db_user'] = getenv('DB_USER');
}
if (!$input['db_pass']) {
$input['db_pass'] = getenv('DB_PASS');
}
if (!$input['db_name']) {
$input['db_name'] = getenv('DB_NAME');
}

if (!$input['db_driver']) {
$input['db_driver'] = (getenv('DB_ENGINE') ?: 'sqlite');
if (!$input['db_name']) {
$input['db_name'] = (getenv('DB_NAME') ?: 'storage/database.sqlite');
}
}


if (!$input['table_prefix']) {
$input['table_prefix'] = (getenv('DB_PREFIX') ?: '');
}
if (!$input['table_prefix']) {
$input['table_prefix'] = (getenv('TABKE_PREFIX') ?: '');
}

if ($lazy_install) {
$input['default_template'] = (getenv('DEFAULT_TEMPLATE') ?: 'liteness');
$input['with_default_content'] = true;
}
$input['subscribe_for_update_notification'] = true;


$this->info('Installing Microweber...');
$this->installer->command_line_logger = $this;
$result = $this->installer->index($input);
$this->info($result);
}

protected function getArguments()
{
return [
['email', InputArgument::OPTIONAL, 'Admin account email'],
['username', InputArgument::OPTIONAL, 'Admin account username'],
['password', InputArgument::OPTIONAL, 'Admin account password'],
['db_host', InputArgument::OPTIONAL, 'Database host address'],
['db_name', InputArgument::OPTIONAL, 'Database schema name'],
['db_user', InputArgument::OPTIONAL, 'Database username'],
['db_pass', InputArgument::OPTIONAL, 'Database password'],
['db_driver', InputArgument::OPTIONAL, 'Database driver'],
['prefix', InputArgument::OPTIONAL, 'Table prefix'],
];
}

protected function getOptions()
{
return [
['prefix', 'p', InputOption::VALUE_OPTIONAL, 'Database tables prefix'],
['template', 't', InputOption::VALUE_OPTIONAL, 'Set default template name'],
['default-content', 'd', InputOption::VALUE_OPTIONAL, 'Install default content'],
['config_only', 'c', InputOption::VALUE_OPTIONAL, 'Prepare the install'],
['language', 'l', InputOption::VALUE_OPTIONAL, 'Prepare the language install'],
];
}
}
51 changes: 51 additions & 0 deletions update/src/Microweber/Commands/ModuleCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Microweber\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Microweber\Controllers\DefaultController;


// php artisan microweber:module shop 1 --env=localhost
// php artisan microweber:module shop 0 --env=localhost
class ModuleCommand extends Command
{
protected $name = 'microweber:module';
protected $description = 'Install or uninstall module';
protected $controller;

public function __construct(DefaultController $controller)
{
$this->controller = $controller;
parent::__construct();
}

public function fire()
{
$input = array(
'module' => $this->argument('module'),
'module_action' => $this->argument('module_action'),
);

$this->info('Setting module...');

if (isset($input['module_action'])) {
if (trim($input['module_action']) == 'install' or intval($input['module_action']) == 1) {
mw()->modules->set_installed(array('for_module' => $input['module']));
$this->info($input['module'] . ' is installed');
} else if (trim($input['module_action']) == 'uninstall' or intval($input['module_action']) == 0) {
mw()->modules->uninstall(array('for_module' => $input['module']));
$this->info($input['module'] . ' is uninstalled');
}
}
}

protected function getArguments()
{
return [
['module', InputArgument::REQUIRED, 'The module type'],
['module_action', InputArgument::REQUIRED, 'Should module be installed , install or uninstall'],
];
}
}
Loading

0 comments on commit 9475d7b

Please sign in to comment.