Giter Site home page Giter Site logo

diego-monte / dm-framework Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 4.65 MB

The framework has the objective of easy web development, integrating the back-end to the front-end with ease.

Home Page: https://www.diegomonte.com.br

License: MIT License

PHP 100.00%

dm-framework's Introduction

logo-dois.png

DM-FRAMEWORK

The framework has the objective of easy web development, integrating the back-end to the front-end with ease.

Release Download Issues Start Forks GitHub contributors

Install

  • Deploy the dm-framework.
  • Install composer.json getcomposer
  • Give permission with the command chmod -R 777 in /dm-framework.
  • You will need to create an example database "dm_framework".
  • You will have to fill in the fields with your bank details.
  • After installation, if everything is fine, remove the install.php installation file.

ScreenShots

Fill in correctly with the connection data and the bank created. install.png If there was no error in the checklists that means everything went well, don't forget to remove the install.php installation file install-finish.png

By default, a free template will be configured as a usage example. template-default.png

I am developing a documentation with more details on the use of the framework.

Developer website www.diegomonte.com.br

dm-framework's People

Contributors

diego-monte avatar

Stargazers

Leandro Rangel avatar Daniel Henrique avatar Mateus avatar

Watchers

 avatar

dm-framework's Issues

Caching

We can now make the application faster using the cache.

use Core\Views as Views;
use Core\Caches as Caches;

class Index extends Views\ViewsClass {

    private $cache;

    public function __construct($metodos) {

        $this->cache = new Caches\Cache();

        // Checks if the requested information has already been registered.
        $cache = $this->cache->read('cache_view_index'); 

        $this->load_controller("Index_controller");
        $post = $this->POST();

        if($post != null) {
            echo $this->controller->setIndex($post);
            exit;
        }

        $render = $this->load_html("Index");
        $render = $this->setDATA_HTML("{{TITLE}}", 'DM Framework - Sua plataforma com facilidade', $render); 
        $render = $this->setDATA_HTML("{{SITE_NAME}}", 'DM Framework', $render);
        $render = $this->setDATA_HTML("{{PATH_IMAGES}}", PATH_TEMPLATE . "/" . TEMPLATE . "/" . PATH_ASSETS, $render);

        // If the requested information exists, it will be processed
        if (!$cache) {
            $cache = $render;
            // If this information is new, it will be recorded.
            $this->cache->save('cache_view_index', $cache, '30 seconds');
        }
        // finally will be rendered
        print $cache;
    }
 
}

Library Mask

How to use Mask library.

Using

src/Controller/exemple_controller.php

$this->Mask->string("##.###.###/####-##","000000000000000"); // CNPJ
$this->Mask->string("###.###.###-##","00000000000"); // CPF BR
$this->Mask->string("#####-###","00000000"); // CEP BR
$this->Mask->string("(##)####-####","0000000000"); // PHONE BR
$this->Mask->string("##/##/####",00000000); // DATE BR

OBS: the library can be used for any type of data

Library integration

We added a library system, we can call it on the controllers with ease.

Notice how to integrate it with controllers

src/Controller/exemple_controller.php
use Core\Controllers as Controllers;

class Index_controller extends Controllers\ControllersClass {

public function __construct() {
parent::__construct();
$this->load_model("Exemple_model");
}
}

public function connectFTP() {
$this->FtpClient->connect('host', 21); // connect to the FTP server
$this->FtpClient->login('user','pass'); // inform FTP username and password
$this->FtpClient->upload('path_server', 'source_file'); // inform the ftp path and inform the file to be transferred
$this->FtpClient->mkdir('path'); // inform the directory to be created
$this->FtpClient->download('source_file', 'file_server'); // inform the local directory and inform the file to be downloaded
$this->FtpClient->rename('old_file', 'new_file'); // enter the name of the current file and enter the new name.
$this->FtpClient->delete('file_or_directory'); // enter the name of the file or directory to be deleted
print $this->FtpClient->listFiles('path_server'); // enter the directory to be listed
}

With this integration of libraries it will be easy to manipulate in the controller

Library BBcode

How to use BBcode library.

TAGS

[b]bold[/b]
[i]italic[/i]
[u]misspelled[/u]
[s]Markup[/s]
[center]center[/center]
[left]left[/left]
[right]right[/right]
[quote]quote[/quote]
[code]code[/code]
[size=16]font size[/size]
[color=#000000]font color[/color]
[url]https://exemple.com[/url]
[url=https://exemple.com]my site[/url]
[img]img url[/img]
[font=verdana]font family[/font]
[list]
[*] Item 01
[*] Item 02
[*] Item 03
[/list]
[table]
[tr]
[td]column 01[/td]
[td]column 02[/td]
[td]column 03[/td]
[/tr]
[/table]
[youtube]https://www.youtube.com/watch?v=LXb3EKWsInQ[/youtube]
[email][email protected][/email]
[[email protected]]my email[/email]

Implementation

src/Controller/exemple_controller.php

use Core\Controllers as Controllers;

class Index_controller extends Controllers\ControllersClass {

public function __construct() {
parent::__construct();
$this->load_model("Exemple_model");
}
}

public function getData() {

$ret = $this->BBcode->filter('[b]Hello Wolrd[/b]'); // Filters data by replacing tags

return $ret;

}

Library Telegram

How to use the Telegram library.

Configuring the bot in the telegram

First open the web telegram, search for BotFather and send this message /newbot
You will get this message back:

Alright, a new bot. How are we going to call it? Please choose a name for your bot.

Then enter the name of the new example bot dm_framework_bot, it is mandatory to inform at the end of the name _bot, you will soon receive this message:

Done! Congratulations on your new bot. You will find it at t.me/dm_framework_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
Use this token to access the HTTP API:
87465489789:AAGWRzAeGOUZbWzI_CKADMBlfrOKyEiA
Keep your token secure and store it safely, it can be used by anyone to control your bot.
For a description of the Bot API, see this page: https://core.telegram.org/bots/api

Integrating the library with the application.

src/Controller/exemple_controller.php

use Core\Controllers as Controllers;

class Index_controller extends Controllers\ControllersClass {

public function __construct() {
parent::__construct();
$this->load_model("Exemple_model");
}
}

public function telegram() {
$this->Telegram->token('87465489789:AAGWRzAeGOUZbWzI_CKADMBlfrOKyEiA'); // Enter the token
$chatId = $this->Telegram->lastChatId(); // Taking the last id of the last chat in which you participate.
$this->Telegram->chatId($chatId); // Enter chat id
$this->Telegram->sendMsg("Hello World"); // Then write the message to be sent
}

Fixes and improvements 1.2.0.0

This commit fixed LFI, REC and XSS security flaws, implemented a log system and implemented a RESTful architecture for Api's constructs integrated with jwt encryption.

@Matues Thanks for reporting the failures

Library QRcode

How to use QRcode library.

Using

src/Controller/exemple_controller.php

use Core\Controllers as Controllers;

class Index_controller extends Controllers\ControllersClass {

public function __construct() {
parent::__construct();
$this->load_model("Exemple_model");
}
}

public function getQRcode() {

$string = "Hello Wolrd";
$width = 250;
$height = 250;

$return = $this->QRcode->render($string, $width, $height);

// return <img src="data:image/png;base64,JDBbfpfaosfnAHFOFe983ynalfnakj==" width="250" height="250" title="QRcode" alt="QRcode" />

}

public function saveQRcode() {

$string = "Hello Wolrd";
$width = 250;
$height = 250;
$fileName = "qrcode_exemple_01";

$return = $this->QRcode->save($string, $width, $height, PATH_IMAGES . "/qrcodes", $fileName);

//return true;
//saved location: Storage/images/qrcodes/
fileName: qrcode_exemple_01.png

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.