Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
0da4be08
Commit
0da4be08
authored
Apr 15, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.yiisoft.com:yii2
parents
f2284948
9f2b44fc
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
7 deletions
+55
-7
ErrorHandler.php
framework/base/ErrorHandler.php
+14
-0
Response.php
framework/base/Response.php
+18
-0
DbDependency.php
framework/caching/DbDependency.php
+1
-0
MemCache.php
framework/caching/MemCache.php
+1
-1
ZendDataCache.php
framework/caching/ZendDataCache.php
+1
-1
AppController.php
framework/console/controllers/AppController.php
+1
-1
Html.php
framework/helpers/base/Html.php
+1
-1
VarDumper.php
framework/helpers/base/VarDumper.php
+1
-1
CaptchaValidator.php
framework/validators/CaptchaValidator.php
+1
-0
ActiveForm.php
framework/widgets/ActiveForm.php
+16
-2
No files found.
framework/base/ErrorHandler.php
View file @
0da4be08
...
@@ -51,6 +51,7 @@ class ErrorHandler extends Component
...
@@ -51,6 +51,7 @@ class ErrorHandler extends Component
/**
/**
* Handles exception
* @param \Exception $exception
* @param \Exception $exception
*/
*/
public
function
handle
(
$exception
)
public
function
handle
(
$exception
)
...
@@ -64,6 +65,10 @@ class ErrorHandler extends Component
...
@@ -64,6 +65,10 @@ class ErrorHandler extends Component
$this
->
renderException
(
$exception
);
$this
->
renderException
(
$exception
);
}
}
/**
* Renders exception
* @param \Exception $exception
*/
protected
function
renderException
(
$exception
)
protected
function
renderException
(
$exception
)
{
{
if
(
$this
->
errorAction
!==
null
)
{
if
(
$this
->
errorAction
!==
null
)
{
...
@@ -196,6 +201,10 @@ class ErrorHandler extends Component
...
@@ -196,6 +201,10 @@ class ErrorHandler extends Component
echo
'<div class="code"><pre>'
.
$output
.
'</pre></div>'
;
echo
'<div class="code"><pre>'
.
$output
.
'</pre></div>'
;
}
}
/**
* Renders calls stack trace
* @param array $trace
*/
public
function
renderTrace
(
$trace
)
public
function
renderTrace
(
$trace
)
{
{
$count
=
0
;
$count
=
0
;
...
@@ -233,6 +242,11 @@ class ErrorHandler extends Component
...
@@ -233,6 +242,11 @@ class ErrorHandler extends Component
echo
'</table>'
;
echo
'</table>'
;
}
}
/**
* Converts special characters to HTML entities
* @param string $text text to encode
* @return string
*/
public
function
htmlEncode
(
$text
)
public
function
htmlEncode
(
$text
)
{
{
return
htmlspecialchars
(
$text
,
ENT_QUOTES
,
\Yii
::
$app
->
charset
);
return
htmlspecialchars
(
$text
,
ENT_QUOTES
,
\Yii
::
$app
->
charset
);
...
...
framework/base/Response.php
View file @
0da4be08
...
@@ -13,27 +13,45 @@ namespace yii\base;
...
@@ -13,27 +13,45 @@ namespace yii\base;
*/
*/
class
Response
extends
Component
class
Response
extends
Component
{
{
/**
* Starts output buffering
*/
public
function
beginOutput
()
public
function
beginOutput
()
{
{
ob_start
();
ob_start
();
ob_implicit_flush
(
false
);
ob_implicit_flush
(
false
);
}
}
/**
* Returns contents of the output buffer and discards it
* @return string output buffer contents
*/
public
function
endOutput
()
public
function
endOutput
()
{
{
return
ob_get_clean
();
return
ob_get_clean
();
}
}
/**
* Returns contents of the output buffer
* @return string output buffer contents
*/
public
function
getOutput
()
public
function
getOutput
()
{
{
return
ob_get_contents
();
return
ob_get_contents
();
}
}
/**
* Discards the output buffer
*/
public
function
cleanOutput
()
public
function
cleanOutput
()
{
{
ob_clean
();
ob_clean
();
}
}
/**
* Discards the output buffer
* @param boolean $all if true recursively discards all output buffers used
*/
public
function
removeOutput
(
$all
=
true
)
public
function
removeOutput
(
$all
=
true
)
{
{
if
(
$all
)
{
if
(
$all
)
{
...
...
framework/caching/DbDependency.php
View file @
0da4be08
...
@@ -52,6 +52,7 @@ class DbDependency extends Dependency
...
@@ -52,6 +52,7 @@ class DbDependency extends Dependency
/**
/**
* Generates the data needed to determine if dependency has been changed.
* Generates the data needed to determine if dependency has been changed.
* This method returns the value of the global state.
* This method returns the value of the global state.
* @throws InvalidConfigException
* @return mixed the data needed to determine if dependency has been changed.
* @return mixed the data needed to determine if dependency has been changed.
*/
*/
protected
function
generateDependencyData
()
protected
function
generateDependencyData
()
...
...
framework/caching/MemCache.php
View file @
0da4be08
...
@@ -106,7 +106,7 @@ class MemCache extends Cache
...
@@ -106,7 +106,7 @@ class MemCache extends Cache
/**
/**
* Returns the underlying memcache (or memcached) object.
* Returns the underlying memcache (or memcached) object.
* @return \Memcache|\Memcached the memcache (or memcached) object used by this cache component.
* @return \Memcache|\Memcached the memcache (or memcached) object used by this cache component.
* @throws Exception if memcache or memcached extension is not loaded
* @throws
InvalidConfig
Exception if memcache or memcached extension is not loaded
*/
*/
public
function
getMemcache
()
public
function
getMemcache
()
{
{
...
...
framework/caching/ZendDataCache.php
View file @
0da4be08
...
@@ -10,7 +10,7 @@ namespace yii\caching;
...
@@ -10,7 +10,7 @@ namespace yii\caching;
/**
/**
* ZendDataCache provides Zend data caching in terms of an application component.
* ZendDataCache provides Zend data caching in terms of an application component.
*
*
* To use this application component, the [Zend Data Cache PHP extension
n
](http://www.zend.com/en/products/server/)
* To use this application component, the [Zend Data Cache PHP extension](http://www.zend.com/en/products/server/)
* must be loaded.
* must be loaded.
*
*
* See [[Cache]] for common cache operations that ZendDataCache supports.
* See [[Cache]] for common cache operations that ZendDataCache supports.
...
...
framework/console/controllers/AppController.php
View file @
0da4be08
...
@@ -159,7 +159,7 @@ class AppController extends Controller
...
@@ -159,7 +159,7 @@ class AppController extends Controller
* @param string $pathTo path to file we want to get relative path for
* @param string $pathTo path to file we want to get relative path for
* @param string $varName variable name w/o $ to replace value with relative path for
* @param string $varName variable name w/o $ to replace value with relative path for
*
*
* @return string target file conte
tn
s
* @return string target file conte
nt
s
*/
*/
public
function
replaceRelativePath
(
$source
,
$pathTo
,
$varName
)
public
function
replaceRelativePath
(
$source
,
$pathTo
,
$varName
)
{
{
...
...
framework/helpers/base/Html.php
View file @
0da4be08
...
@@ -728,7 +728,7 @@ class Html
...
@@ -728,7 +728,7 @@ class Html
if
(
!
isset
(
$options
[
'size'
]))
{
if
(
!
isset
(
$options
[
'size'
]))
{
$options
[
'size'
]
=
4
;
$options
[
'size'
]
=
4
;
}
}
if
(
isset
(
$options
[
'multiple'
])
&&
$options
[
'multiple'
]
&&
substr
(
$name
,
-
2
)
!==
'[]'
)
{
if
(
!
empty
(
$options
[
'multiple'
])
&&
substr
(
$name
,
-
2
)
!==
'[]'
)
{
$name
.=
'[]'
;
$name
.=
'[]'
;
}
}
$options
[
'name'
]
=
$name
;
$options
[
'name'
]
=
$name
;
...
...
framework/helpers/base/VarDumper.php
View file @
0da4be08
...
@@ -64,7 +64,7 @@ class VarDumper
...
@@ -64,7 +64,7 @@ class VarDumper
return
self
::
$_output
;
return
self
::
$_output
;
}
}
/*
/*
*
* @param mixed $var variable to be dumped
* @param mixed $var variable to be dumped
* @param integer $level depth level
* @param integer $level depth level
*/
*/
...
...
framework/validators/CaptchaValidator.php
View file @
0da4be08
...
@@ -68,6 +68,7 @@ class CaptchaValidator extends Validator
...
@@ -68,6 +68,7 @@ class CaptchaValidator extends Validator
/**
/**
* Returns the CAPTCHA action object.
* Returns the CAPTCHA action object.
* @throws InvalidConfigException
* @return CaptchaAction the action object
* @return CaptchaAction the action object
*/
*/
public
function
getCaptchaAction
()
public
function
getCaptchaAction
()
...
...
framework/widgets/ActiveForm.php
View file @
0da4be08
...
@@ -39,10 +39,16 @@ class ActiveForm extends Widget
...
@@ -39,10 +39,16 @@ class ActiveForm extends Widget
public
$errorMessageClass
=
'yii-error-message'
;
public
$errorMessageClass
=
'yii-error-message'
;
/**
/**
* @var string the default CSS class that indicates an input has error.
* @var string the default CSS class that indicates an input has error.
* This is
*/
*/
public
$errorClass
=
'yii-error'
;
public
$errorClass
=
'yii-error'
;
/**
* @var string the default CSS class that indicates an input validated successfully.
*/
public
$successClass
=
'yii-success'
;
public
$successClass
=
'yii-success'
;
/**
* @var string the default CSS class that indicates an input is currently being validated.
*/
public
$validatingClass
=
'yii-validating'
;
public
$validatingClass
=
'yii-validating'
;
/**
/**
* @var boolean whether to enable client-side data validation. Defaults to false.
* @var boolean whether to enable client-side data validation. Defaults to false.
...
@@ -64,7 +70,7 @@ class ActiveForm extends Widget
...
@@ -64,7 +70,7 @@ class ActiveForm extends Widget
$models
=
array
(
$models
);
$models
=
array
(
$models
);
}
}
$showAll
=
isset
(
$options
[
'showAll'
])
&&
$options
[
'showAll'
]
;
$showAll
=
!
empty
(
$options
[
'showAll'
])
;
$lines
=
array
();
$lines
=
array
();
/** @var $model Model */
/** @var $model Model */
foreach
(
$models
as
$model
)
{
foreach
(
$models
as
$model
)
{
...
@@ -127,6 +133,14 @@ class ActiveForm extends Widget
...
@@ -127,6 +133,14 @@ class ActiveForm extends Widget
return
Html
::
label
(
$label
,
$for
,
$options
);
return
Html
::
label
(
$label
,
$for
,
$options
);
}
}
/**
* @param string $type
* @param Model $model
* @param string $attribute
* @param array $options
*
* @return string
*/
public
function
input
(
$type
,
$model
,
$attribute
,
$options
=
array
())
public
function
input
(
$type
,
$model
,
$attribute
,
$options
=
array
())
{
{
$value
=
$this
->
getAttributeValue
(
$model
,
$attribute
);
$value
=
$this
->
getAttributeValue
(
$model
,
$attribute
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment