adding support for passing model name to model task, updated isMobile check in requestHandler

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5377 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-07-05 08:50:56 +00:00
parent bd673fbaf4
commit 9cd8a79ad9
2 changed files with 14 additions and 1 deletions

View file

@ -43,6 +43,15 @@ class ModelTask extends Shell {
if (empty($this->args)) {
$this->__interactive();
}
if(!empty($this->args[0])) {
$model = $this->args[0];
if ($this->__bake($model)) {
if ($this->_checkUnitTest()) {
$this->__bakeTest($model);
}
}
}
}
/**
* Handles interactive baking

View file

@ -256,7 +256,11 @@ class RequestHandlerComponent extends Object {
* @return bool True if user agent is a mobile web browser
*/
function isMobile() {
return (preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT')) > 0 || $this->accepts('wap'));
preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT'), $match);
if(!empty($match) || $this->accepts('wap')) {
return true;
}
return false;
}
/**
* Returns true if the client accepts WAP content