Cria a estrutura de um módulo.

@param string $name
@param string $module
@param string $dir
@param string $author
@param string $email

@throws \Exception
433597
public function create($name, $module, $dir, $author, $email)
    {
        $fs = new Filesystem();

        if (!$this->jsDir) {
            throw new \Exception('O diretório de código javascript "injector.directory.src" da aplicação não foi definido!');
        }

        $moduleDir = $this->getModuleDir($dir);

        if (!$fs->exists($moduleDir)) {
            throw new \Exception(sprintf('O módulo %s não existe!', $module));
        }

        $serviceFile = $this->getServiceFile($name, $moduleDir);

        if ($fs->exists($serviceFile)) {
            throw new \Exception(sprintf('O serviço %s já existe!', $name));
        }

        $this->createService($name, $serviceFile, $module, $author, $email);
    }
169649
public function create($pack, $author, $email)
    {
        $fs = new Filesystem();

        if (!$this->sourceDir) {
            throw new \Exception('O diretório de código fonte "singular.directory.src" da aplicação não foi definido!');
        }

        $packDir = $this->getPackDir($pack);

        if ($fs->exists($packDir)) {
            throw new \Exception(sprintf('O pacote %s já foi criado!', $pack));
        }

        $this->createDirectories($packDir);
        $this->createPackServiceProvider($pack, $packDir, $author, $email);
    }
1362552
public static function createAdmin(string $name, string $email, string $password)
    {
        if (static::where('email', $email)->exists()) {
            throw new Exception('User exist');
        }

        $permissions = collect();

        Dashboard::getPermission()
            ->collapse()
            ->each(function ($item) use ($permissions) {
                $permissions->put($item['slug'], true);
            });

        $user = static::create([
            'name'        => $name,
            'email'       => $email,
            'password'    => Hash::make($password),
            'permissions' => $permissions,
        ]);

        $user->notify(new DashboardNotification([
            'title'   => "Welcome {$name}",
            'message' => 'You can find the latest news of the project on the website',
            'action'  => 'https://orchid.software/',
            'type'    => DashboardNotification::INFO,
        ]));
    }
1178541
public function loadFile($file_name, $dir_name = null)
    {
        try {
            $loader = $this->getLoader();
            $file_path = $loader->findLanguageDBFile(
                !empty($file_name) ? basename($file_name) : $file_name,
                !empty($dir_name) ? $dir_name : (
                    !empty($file_name) ? dirname($file_name) : $dir_name
                )
            );
            if ($file_path && file_exists($file_path)) {
                $loader
                    ->setOption('language_strings_db_directory', dirname($file_path))
                    ->setOption('language_strings_db_filename', basename($file_path))
                ;

                $this->_loadLanguageStrings(true, true, true);
            } else {
                throw new I18nInvalidArgumentException(
                    sprintf('Language file "%s" not found!', $file_name)
                );
            }
        } catch (I18nException $e) {
            throw $e;
        }
    }
521416
protected function email($name, $value){
        //Si no se completo no se valida
        if(! $this->isComplete($value)){
            return TRUE;
        }
        if(! filter_var($value, FILTER_VALIDATE_EMAIL)){
            $this->add_message($name, 'email');
            return FALSE;
        }
        return TRUE;
    }
862133
public function publish($name)
    {
        if ($name instanceof Module) {
            $module = $name;
        } else {
            $module = $this->laravel['modules']->findOrFail($name);
        }

        with(new AssetPublisher($module))
            ->setRepository($this->laravel['modules'])
            ->setConsole($this)
            ->publish();

        $this->line("<info>Published</info>: {$module->getStudlyName()}");
    }
1196014
public function add_reply_to($email, $name = null) {
		foreach ($this->reply_to as $reply_to) {
			if ($reply_to['email'] == $email) {
				return;
			}
		}

		$this->reply_to[] = [
			'name' => $name,
			'email' => strtolower($email),
		];
	}
962735
public function addTo($email, $name = null)
    {
        Argument::i()
            ->test(1, 'string')
            ->test(2, 'string', 'null');

        $this->to[$email] = $name;
        return $this;
    }
368172
static function extractEmail( $text, &$email, &$name )
    {
        if ( preg_match( "/([^<]+)<" . eZMail::REGEXP . ">/", $text, $matches ) )
        {
            $email = $matches[2];
            $name = trim( $matches[1], '" ' );
        }
        else
        {
            $email = $text;
            $name = false;
        }
    }
688616
public function setModuleVariable($name, $value)
    {
        if (is_null($value)) {
            self::$moduleVariables = null;
        } else {
            self::$moduleVariables[$name] = $value;
        }

        $this->getFileCache()->setToCache($name, $value);
    }
999666
public function addAuthor(string $name = null, string $email = null)
    {
        is_null($name) and $name = '';
        is_null($email) and $email = '';

        if (empty($name) and empty($email)) {
            throw new AuthorNoDataException();
        }

        if (!empty($email)) {
            $author = trim(sprintf(self::FORMAT_AUTHOR, $name, $email));
        } else {
            $author = trim($name);
        }

        $this->authors[] = $author;

        return $this;
    }
284153
def set_author(self, author, email=''):
        """"""
        self.author = author
        self.email = email
545539
public function remove($module, $name)
    {
        $index = 0;

        if ($this->has($module, $name, $index)) {
            unset($this->data[$index]);
        }
    }
643878
public function add($module, $name, $value)
    {
        array_push($this->data, array(
            ConstProviderInterface::CONFIG_PARAM_MODULE => $module,
            ConstProviderInterface::CONFIG_PARAM_NAME => $name,
            ConstProviderInterface::CONFIG_PARAM_VALUE => $value
        ));
    }
248227
private function formatEmail($email, $name = null)
    {
        /**
         * Organization of the list of senders
         */
        if (!is_string($name) && preg_match('/^(.+)\s+<(.*)>\z$/', $email, $matches)) {
            array_shift($matches);
            $name = $matches[0];
            $email = $matches[1];
        }

        if (!Str::isMail($email)) {
            throw new \InvalidArgumentException("$email is not valid email.", E_USER_ERROR);
        }

        return [$name, $email];
    }
115555
private function createService($name, $serviceFile, $module, $author, $email)
    {
        $template = file_get_contents(
            __DIR__.DIRECTORY_SEPARATOR."templates".DIRECTORY_SEPARATOR."front_service.tpl"
        );

        $name = $this->getModuleFileName($module).'.'.$name;

        $template = str_replace('$name', $name, $template);
        $template = str_replace('$module',$module, $template);
        $template = str_replace('$author', $author, $template);
        $template = str_replace('$email', $email, $template);

        file_put_contents($serviceFile.'.js', $template);
    }
360327
protected function sendResetPasswordMessage($myWords, $name, $user, $email, $token)
	{
		$path = $this->_context->get("SCRIPT_NAME");
		$path = substr($path,0,strrpos($path,"/")+1);
		$url = "http://" . $this->_context->getServerName() . $path;
		$body = $myWords->ValueArgs("RESETPASSWORDMESSAGE", array($name, $this->_context->get("SERVER_NAME"), $user, $url.$this->_context->bindModuleUrl(str_replace('\\', '.', get_class()) . '?action=' . ModuleActionLogin::RESETPASSWORD . '&username=' . $user . '&resettoken=' . $token . '&returnurl=' . $this->_login->getReturnUrl())));

		$envelope = new MailEnvelope(
			Util::getFullEmail($email, $name),
			$myWords->Value("RESETSUBJECTMESSAGE", "[" . $this->_context->getServerName() . "]"),
			$body
		);
		$envelope->Send();
	}