Commit 6b41d41f by Qiang Xue

Fixes #711.

parent 62dee149
...@@ -180,6 +180,16 @@ abstract class Application extends Module ...@@ -180,6 +180,16 @@ abstract class Application extends Module
} }
/** /**
* Returns an ID that uniquely identifies this module among all modules within the current application.
* Since this is an application instance, it will always return an empty string.
* @return string the unique ID of the module.
*/
public function getUniqueId()
{
return '';
}
/**
* Runs the application. * Runs the application.
* This is the main entrance of an application. * This is the main entrance of an application.
* @return integer the exit status (0 means normal, non-zero values mean abnormal) * @return integer the exit status (0 means normal, non-zero values mean abnormal)
......
...@@ -192,13 +192,7 @@ abstract class Module extends Component ...@@ -192,13 +192,7 @@ abstract class Module extends Component
*/ */
public function getUniqueId() public function getUniqueId()
{ {
if ($this instanceof Application) { return $this->module ? ltrim($this->module->getUniqueId() . '/' . $this->id, '/') : $this->id;
return '';
} elseif ($this->module) {
return ltrim($this->module->getUniqueId() . '/' . $this->id, '/');
} else {
return $this->id;
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment