<commit_before><?php

namespace Milax\Mconsole\Commands;

use Illuminate\Console\Command;
use Milax\Mconsole\Models\Language;
use File;
use Schema;

class ModuleGenerator extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'make:module {class : Module class name} {--namespace= : Specify module namespace} {--package : Add composer.json to the project, set namespaces and workbench directories}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new Mconsole module';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
        
        $this->blueprint = [
            'bootstrap' => [
                'destination' => 'bootstrap.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/bootstrap.php'),
            ],
            'installer' => [
                'destination' => 'Installer.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Installer.php'),
            ],
            'routes' => [
                'destination' => 'Http/routes.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Http/routes.php'),
            ],
            'controller' => [
                'destination' => 'Http/Controllers/%sController.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Http/Controllers/Controller.php'),
            ],
            'serviceprovider' => [
                'destination' => 'Provider.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Provider.php'),
            ],
        ];
        
        $this->directories = [
            'assets/migrations',
            'assets/config',
            'assets/resources/views',
            'Models',
        ];
        
        if (Schema::hasTable(Language::getQuery()->from)) {
            Language::getCached()->each(function ($lang) {
                array_push($this->directories, 'assets/resources/lang/' . $lang->key);
            });
        }
    }
    
    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()<commit_msg>Create public directory for modules<commit_after><?php

namespace Milax\Mconsole\Commands;

use Illuminate\Console\Command;
use Milax\Mconsole\Models\Language;
use File;
use Schema;

class ModuleGenerator extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'make:module {class : Module class name} {--namespace= : Specify module namespace} {--package : Add composer.json to the project, set namespaces and workbench directories}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new Mconsole module';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
        
        $this->blueprint = [
            'bootstrap' => [
                'destination' => 'bootstrap.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/bootstrap.php'),
            ],
            'installer' => [
                'destination' => 'Installer.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Installer.php'),
            ],
            'routes' => [
                'destination' => 'Http/routes.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Http/routes.php'),
            ],
            'controller' => [
                'destination' => 'Http/Controllers/%sController.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Http/Controllers/Controller.php'),
            ],
            'serviceprovider' => [
                'destination' => 'Provider.php',
                'file' => file_get_contents(__DIR__ . '/../Blueprints/Module/Provider.php'),
            ],
        ];
        
        $this->directories = [
            'assets/migrations',
            'assets/config',
            'assets/public',
            'assets/resources/views',
            'Models',
        ];
        
        if (Schema::hasTable(Language::getQuery()->from)) {
            Language::getCached()->each(function ($lang) {
                array_push($this->directories, 'assets/resources/lang/' . $lang->key);
            });
        }
    }
    
    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
{'fraction_non_alphanumeric': 0.142049025769956, 'fraction_numerical': 0.0, 'mean_word_length': 1.7421022400919013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5823522', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1283, 'n_words': 250}