| @@ 162-163 (lines=2) @@ | ||
| 159 | function singleton($className) { |
|
| 160 | if($className == "Config") user_error("Don't pass Config to singleton()", E_USER_ERROR); |
|
| 161 | if(!isset($className)) user_error("singleton() Called without a class", E_USER_ERROR); |
|
| 162 | if(!is_string($className)) user_error("singleton() passed bad class_name: " . var_export($className,true), |
|
| 163 | E_USER_ERROR); |
|
| 164 | return Injector::inst()->get($className); |
|
| 165 | } |
|
| 166 | ||
| @@ 189-191 (lines=3) @@ | ||
| 186 | Debug::message("Action not set; using default action method name 'index'"); |
|
| 187 | } |
|
| 188 | $action = "index"; |
|
| 189 | } else if(!is_string($action)) { |
|
| 190 | user_error("Non-string method name: " . var_export($action, true), E_USER_ERROR); |
|
| 191 | } |
|
| 192 | ||
| 193 | $classMessage = Director::isLive() ? 'on this handler' : 'on class '.get_class($this); |
|
| 194 | ||