GithubHelp home page GithubHelp logo

anandanvil / spe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markc/spe

0.0 0.0 0.0 318 KB

Simple PHP7 Examples based around a simple and lightweight framework

License: GNU Affero General Public License v3.0

PHP 97.39% Shell 2.61%

spe's Introduction

SPE - Simple PHP7 Examples

Copyright (C) 2015-2017 Mark Constable [email protected] (AGPL-3.0)

A very simple PHP7 "framework" that will be expanded to include more small project examples building on the first very lean foundation and incorporating additional functionality in each successive example. This is not a repository of all the attributes of PHP7, there are already many other great projects and pages that provide excellent PHP7 guides, but rather a series of examples that are fully developed under PHP7 (sury/php7.0 PPA on Ubuntu 15.10 2015-09) and taking advantage of any new PHP7-only constructs where it makes sense. Each folder will contain a more comprehensive example of a working, and hopefully useful, sub-project with a README.md explaining each example. This README will provide an overview and index of all examples and some hints that apply to all the sub-project examples.

  • 01-Simple

    At 90 LOC this is about the simplest 3 page example of this particular framework style I could come up with. It is a self-contained single script withall code encapsulated within classes.

  • 02-Styled

    Funcionally similar to the above barebones example but with a small amount of inline CSS to provide a minimum of style along with the Roboto font from Google CDN.

  • 03-Plugins

    A simple example of providing "plugins" which are basically the model of the traditional MVC coding style. It also includes a simple AJAX link on the About page that dumps the main global output array using the ultra simple remote XHR API. There is also an example of passing a success/error message back into the same page but it will be replaced with session vars in one of the next examples.

  • 04-Themes

    Extend the above example to include basic themeing classes and methods.

  • 05-Autoload

    Add a simple spl_autoload_register() function to autoload the split out plugin and theme classes.

  • [06-Session]

    TODO:

  • [07-PDO]

    TODO:

  • [08-Users]

    TODO:

  • [05-Auth]

    TODO:

  • [10-Files]

    TODO:

The associated example README files will act as both code comments and general documentation for each project and an easy way to follow along is to open up two browsers side by side with the README documentation on the left side and drag the reference page line links to the right hand side browser which will highlight the code being discussed.

This function below has proven to be quite useful for examining the code, assuming you have access to the servers error_log file...

function dbg($var = null)
{
    if (is_object($var))
        error_log(ReflectionObject::export($var, true));
    ob_start();
    print_r($var);
    $ob = ob_get_contents();
    ob_end_clean();
    error_log($ob);
}

spe's People

Contributors

markc 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.