GithubHelp home page GithubHelp logo

script_template's Introduction

PHP Script template

A simple script template that has some useful tools in PHP.

How does it work?

Simple, download this project, start to code your script inside the Scripts directory, and then modify the script.php file.
The Template will help you with the configuration of your script, handle database connections and the queue schemas*

*not implemented yet.

Using configuration Helper

In the script.php you'll see a static call to a class method to get config, this will load the configuration file config.json that is located inside Config directory (this file should follow the config.json.example pattern).
The config.json will be loaded in array format inside the global var $config.

Using Database Helper

A PDO connection will be made calling the Connector class of the connection you want, like in this example:

    <?php
    use Database\Postgres;

    $pg = new Postgres\Connector("pglocal");
    $conn = $pg->connect();

The pglocal is the nabe of the connetion inside the config.json file.
Simple that way.

script_template's People

Contributors

andrelrg avatar

Stargazers

Lars Behrends avatar  avatar

Watchers

James Cloos avatar  avatar

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.