https://github.com/smallphp/smallphp
smallphp framework
https://github.com/smallphp/smallphp
php php-framework smallphp-framework
Last synced: 6 months ago
JSON representation
smallphp framework
- Host: GitHub
- URL: https://github.com/smallphp/smallphp
- Owner: smallphp
- Created: 2017-01-12T10:20:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-28T09:09:58.000Z (almost 8 years ago)
- Last Synced: 2025-08-03T14:52:11.803Z (11 months ago)
- Topics: php, php-framework, smallphp-framework
- Language: PHP
- Homepage:
- Size: 47.9 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```
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();
}
```