You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,13 @@ I think that everyone has their own idea of simple. In reality simple tends to
12
12
* PSR-2 compliant
13
13
* Per environment configuration.
14
14
* PHP 6.4 and PHP 7 compatible.
15
-
* No dependencies outside of core PHP.
16
15
* Easy to debug from end to end. I want to hit very little code from the request to the custom logic in the controller.
17
16
* A handful of common simple objects that you can optionally use, I'll decide as I go.
18
17
* REST verbs route.
19
18
20
19
## What this framework does not have
20
+
* Dependencies outside of core PHP.
21
+
* Configuration file parsing.
21
22
* "Magic" as that really just means "Have fun figuring out what I did". Assuming you have done some PHP I want you to easily understand what your debugger walks through, no magic. If you don't understand something feel free to send me a message.
22
23
* No internal package system though you can add composer. The idea is that if your project becomes that big you should probably use something like service oriented architecture to split it up anyway. You can however easily pull in libraries with composer.
23
24
* A bunch of other stuff that is common to frameworks, I did this as a quick side project but if you write something extremely light weight I'll consider a pull request. I may also add additional objects as I feel that I need to.
@@ -113,6 +114,11 @@ class WidgetController
113
114
## How does the configuraton system work?
114
115
It works almost exactly like the DI system but uses properties instead of methods. If you want to confgure something more complicated you can use methods as well just like the DI system.
115
116
117
+
If you want to have super secret stuff in your production file just check if the production file exists somewhere else with ConfigProd in it and load it. Once loaded the autoloader won't load the default ConfigProd.php file.
118
+
119
+
But can't this be done with a single file with switch statements in it? I couldn't find a way that would autocomplete (associative array is out), be global without saying global everywhere (again associative array is out), be overridden by different environments(defines were out), not require external file parsing (.ini files were out but then again they have the other issues too). So in the end I decided this worked the best. If you can figure this out please let me know.
120
+
121
+
116
122
## Unit Testing
117
123
In general you just put tests in the testing directory with the same structure as the classes you are testing in the classes directory. The environment is Testing and so the associated configuration and dependency injection classes will be loaded.
0 commit comments