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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b7e4bd31
Commit
b7e4bd31
authored
Apr 21, 2012
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
7c06cc03
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
31 deletions
+14
-31
Application.php
framework/base/Application.php
+1
-14
ErrorHandler.php
framework/base/ErrorHandler.php
+8
-6
View.php
framework/base/View.php
+1
-1
error.php
framework/views/error.php
+1
-4
todo.md
todo.md
+3
-6
No files found.
framework/base/Application.php
View file @
b7e4bd31
...
@@ -89,6 +89,7 @@ abstract class Application extends Module
...
@@ -89,6 +89,7 @@ abstract class Application extends Module
* @see language
* @see language
*/
*/
public
$sourceLanguage
=
'en_us'
;
public
$sourceLanguage
=
'en_us'
;
public
$preload
=
array
(
'errorHandler'
);
private
$_runtimePath
;
private
$_runtimePath
;
private
$_ended
=
false
;
private
$_ended
=
false
;
...
@@ -115,7 +116,6 @@ abstract class Application extends Module
...
@@ -115,7 +116,6 @@ abstract class Application extends Module
\Yii
::
$application
=
$this
;
\Yii
::
$application
=
$this
;
$this
->
setBasePath
(
$basePath
);
$this
->
setBasePath
(
$basePath
);
\Yii
::
setAlias
(
'application'
,
$this
->
getBasePath
());
\Yii
::
setAlias
(
'application'
,
$this
->
getBasePath
());
$this
->
initSystemHandlers
();
$this
->
registerCoreComponents
();
$this
->
registerCoreComponents
();
}
}
...
@@ -641,19 +641,6 @@ abstract class Application extends Module
...
@@ -641,19 +641,6 @@ abstract class Application extends Module
}
}
/**
/**
* Initializes the class autoloader and error handlers.
*/
protected
function
initSystemHandlers
()
{
if
(
YII_ENABLE_EXCEPTION_HANDLER
)
{
set_exception_handler
(
array
(
$this
,
'handleException'
));
}
if
(
YII_ENABLE_ERROR_HANDLER
)
{
set_error_handler
(
array
(
$this
,
'handleError'
),
error_reporting
());
}
}
/**
* Registers the core application components.
* Registers the core application components.
* @see setComponents
* @see setComponents
*/
*/
...
...
framework/base/ErrorHandler.php
View file @
b7e4bd31
...
@@ -125,7 +125,12 @@ class ErrorHandler extends ApplicationComponent
...
@@ -125,7 +125,12 @@ class ErrorHandler extends ApplicationComponent
$this
->
clearOutput
();
$this
->
clearOutput
();
}
}
$this
->
render
(
$exception
);
try
{
$this
->
render
(
$exception
);
}
catch
(
\Exception
$e
)
{
// use the most primitive way to display exception thrown in the error view
$this
->
renderAsText
(
$e
);
}
}
}
protected
function
render
(
$exception
)
protected
function
render
(
$exception
)
...
@@ -318,12 +323,9 @@ class ErrorHandler extends ApplicationComponent
...
@@ -318,12 +323,9 @@ class ErrorHandler extends ApplicationComponent
public
function
renderAsText
(
$exception
)
public
function
renderAsText
(
$exception
)
{
{
if
(
YII_DEBUG
)
{
if
(
YII_DEBUG
)
{
echo
get_class
(
$exception
)
.
"
\n
"
;
echo
$exception
;
echo
$exception
->
getMessage
()
.
' ('
.
$exception
->
getFile
()
.
':'
.
$exception
->
getLine
()
.
")
\n
"
;
echo
$exception
->
getTraceAsString
();
}
else
{
}
else
{
echo
get_class
(
$exception
)
.
"
\n
"
;
echo
get_class
(
$exception
)
.
':'
.
$exception
->
getMessage
();
echo
$exception
->
getMessage
();
}
}
}
}
...
...
framework/base/View.php
View file @
b7e4bd31
...
@@ -226,7 +226,7 @@ class View extends Component
...
@@ -226,7 +226,7 @@ class View extends Component
$view
.=
'.php'
;
$view
.=
'.php'
;
}
}
if
(
$view
[
0
]
===
'@'
)
{
if
(
$view
[
0
]
===
'@'
)
{
$file
=
\Yii
::
getAlias
(
$view
[
0
]
);
$file
=
\Yii
::
getAlias
(
$view
);
}
elseif
(
!
empty
(
$this
->
basePath
))
{
}
elseif
(
!
empty
(
$this
->
basePath
))
{
$basePaths
=
is_array
(
$this
->
basePath
)
?
$this
->
basePath
:
array
(
$this
->
basePath
);
$basePaths
=
is_array
(
$this
->
basePath
)
?
$this
->
basePath
:
array
(
$this
->
basePath
);
foreach
(
$basePaths
as
$basePath
)
{
foreach
(
$basePaths
as
$basePath
)
{
...
...
framework/views/error.php
View file @
b7e4bd31
...
@@ -58,10 +58,7 @@ $owner = $this->owner;
...
@@ -58,10 +58,7 @@ $owner = $this->owner;
The above error occurred while the Web server was processing your request.
The above error occurred while the Web server was processing your request.
</p>
</p>
<p>
<p>
If you think this is a server error, please contact us.
Please contact us if you think this is a server error. Thank you.
</p>
<p>
Thank you.
</p>
</p>
<div
class=
"version"
>
<div
class=
"version"
>
<?php
echo
date
(
'Y-m-d H:i:s'
,
time
());
?>
<?php
echo
date
(
'Y-m-d H:i:s'
,
time
());
?>
...
...
todo.md
View file @
b7e4bd31
...
@@ -2,18 +2,15 @@
...
@@ -2,18 +2,15 @@
*
WebTarget
*
WebTarget
*
ProfileTarget
*
ProfileTarget
-
base
-
base
*
error/exception handling
*
Convert all PHP errors into exceptions, remove YII_ENABLE_ERROR_HANDLER and error handler (?)
*
module
*
module
-
Module should be able to define its own configuration including routes. Application should be able to overwrite it.
-
Module should be able to define its own configuration including routes. Application should be able to overwrite it.
*
application
*
application
*
http exception
*
security
*
security
-
validators
-
validators
*
type conversion rules
*
type conversion rules
*
CompareValidator::clientValidateAttribute(): search for "CHtml::activeId"
*
CompareValidator::clientValidateAttribute(): search for "CHtml::activeId"
*
FileValidator, UniqueValidator, ExistValidator, DateValidator: TBD
*
FileValidator, UniqueValidator, ExistValidator, DateValidator: TBD
*
consider merging UniqueValidator and ExistValidator and using a NOT property: array('!exist',
…
)
*
consider merging UniqueValidator and ExistValidator and using a NOT property: array('!exist',
…)
*
when getting errors from getErrors it will be good to have which validator (at least type) failed exactly.
*
when getting errors from getErrors it will be good to have which validator (at least type) failed exactly.
-
console command support
[
DONE
]
-
console command support
[
DONE
]
-
built-in console commands
-
built-in console commands
...
@@ -25,8 +22,7 @@
...
@@ -25,8 +22,7 @@
*
a way to invalidate/clear cached data
*
a way to invalidate/clear cached data
*
a command to clear cached data
*
a command to clear cached data
-
db
-
db
*
DAO
*
sqlite, pgsql, sql server, oracle, db2 drivers
*
schema
*
write a guide on creating own schema definitions
*
write a guide on creating own schema definitions
*
AR
*
AR
*
saving related records
*
saving related records
...
@@ -51,6 +47,7 @@
...
@@ -51,6 +47,7 @@
*
get/setFlash() should be moved to session component
*
get/setFlash() should be moved to session component
*
support optional parameter in URL patterns
*
support optional parameter in URL patterns
*
Response object.
*
Response object.
*
ErrorAction
-
gii
-
gii
*
move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic.
*
move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic.
*
i18n variant of templates
*
i18n variant of templates
...
...
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