GithubHelp home page GithubHelp logo

Smallphp Framework

框架目录

├── Cache
│   └── Adapter
│       ├── Memcache.php
│       └── Redis.php
├── composer.json
├── Config.php
├── Database
│   ├── Adapter
│   │   ├── Mysqli
│   │   │   └── Result.php
│   │   └── Mysqli.php
│   └── Adapter.php
├── Database.php
├── Di.php
├── Dispatch.php
├── examples
│   ├── config
│   │   ├── database.php
│   │   └── router.php
│   ├── controllers
│   │   └── Index.php
│   ├── index.php
│   ├── models
│   │   ├── Test.php
│   │   └── User.php
│   └── views
│       └── index
│           └── index.php
├── Loader.php
├── Mvc
│   ├── Controller.php
│   ├── Model.php
│   ├── Router.php
│   ├── Url.php
│   └── View.php
├── Nosql
│   ├── Mongodb
│   │   └── Query.php
│   └── Mongodb.php
├── README.md
├── Request.php
├── Session
│   ├── Adapter
│   │   ├── File.php
│   │   ├── Memcache.php
│   │   └── Redis.php
│   └── Adapter.php
├── Session.php
└── Spl
    └── ArrayAccess.php

入口文件examples/index.php

<?php
define('APPPATH', dirname(__FILE__));
include '/data/Smallphp/Loader.php';
$loader = new \Smallphp\Loader();
$loader->registerNamespace(['App\Library' => APPPATH . '/library']);

$loader->registerAutoload();

\Smallphp\Di:: set('view', function () {
    return new \Smallphp\Mvc\View(APPPATH . '/views/');
});

\Smallphp\Di:: set('loader', $loader);

\Smallphp\Di:: set('mongodb', function () {
    return new \Smallphp\Nosql\Mongodb();
});

\Smallphp\Di:: set('config', function () {
    return new \Smallphp\Config(APPPATH . '/config/');
});

try {
    \Smallphp\Request:: factory()->execute();
} catch (\Exception $e) {
    echo $e->getMessage();
}

smallphp's Projects

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.