/** * Creates DB object. * * @param ConnectionInfoWrapperInterface $info_wrapper * * @return \Crayon\Database\ConnectionInterface */ static function create(ConnectionInfoWrapperInterface $info_wrapper) { $wrapper = new static($info_wrapper); $wrapper->connect(); $wrapper->exec("SET NAMES utf8"); static::$instance = $wrapper; return $wrapper; }
/** * Esegue il controller con la request e la logica di base del controller. * Passando un controller diverso può cambiare tutta la logica * @return \static */ public static function run() { $request = new Request(); $controllerName = \smn\pheeca\kernel\MVC\Controller::getControllerName($request); $controller = '\\smn\\pheeca\\controller\\' . strtolower($controllerName); $mvc = new static($request, new $controller($request)); $mvc->exec(); return $mvc; }
/** * Make quick POST request * * @param string $url * @param array $params [optional] * @return \Koldy\Http\Response * @example echo \Koldy\Http\Request::post('http://www.google.com') will output body HTML of google.com */ public static function post($url, array $params = array()) { $self = new static($url); $self->type(static::POST); $self->params($params); return $self->exec(); }