I’ve tried it but after install, I only get a black blank page and that’s it:
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/project/yii-1.1.4/assets/6cca1998/wterm.css" />
<script type="text/javascript" src="/project/yii-1.1.4/assets/75770a22/jquery.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
var webshell = {'wtermOptions':{'WIDTH':'100%','HEIGHT':'100%','WELCOME_MESSAGE':'Welcome to Yii web shell. Type <strong>help<\/strong> for the list of available commands.','PS1':'%','TERMINAL_CLASS':'terminal','PROMPT_CLASS':'prompt','CONTENT_CLASS':'content','THEME_CLASS_PREFIX':'theme_','DEFAULT_THEME':'webshell','HIGHLIGHT_CLASS':'highlighted','KEYWORD_CLASS':'keyword'},'commands':{'test':function(){return "Hello, world!";},'yiic':'http://localhost/project/yii-1.1.4/index.php?r=webshell/default/yiic'},'helpText':'test\tJust a test.\nyiic\tAllows to run <strong>yiic<\/strong> commands.\nclear\tClear screen.\nexit\tExit console.','exitUrl':'http://localhost/project/yii-1.1.4/index.php'};
/*]]>*/
</script>
<title><?=$this->pageTitle?></title>
</head>
<body>
<script type="text/javascript" src="/project/yii-1.1.4/assets/6cca1998/wterm.jquery.js"></script>
<script type="text/javascript" src="/project/yii-1.1.4/assets/6cca1998/webshell.js"></script>
</body>
</html>
Here is the module configuration :
'modules'=>array(
'webshell'=>array(
'class'=>'application.modules.webshell.WebShellModule',
// when typing 'exit', user will be redirected to this URL
'exitUrl' => '/',
// custom wterm options
'wtermOptions' => array(
// linux-like command prompt
'PS1' => '%',
),
// additional commands (see below)
'commands' => array(
'test' => array('js:function(){return "Hello, world!";}', 'Just a test.'),
),
// uncomment to disable yiic
// 'useYiic' => false,
// adding custom yiic commands not from protected/commands dir
'yiicCommandMap' => array(
'email'=>array(
'class'=>'ext.mailer.MailerCommand',
'from'=>'sam@rmcreative.ru',
),
),
),
),
'modules'=>array(
'webshell'=>array(
'class'=>'application.modules.webshell.WebShellModule',
// when typing 'exit', user will be redirected to this URL
'exitUrl' => '/',
),
),
… I found what the problem is : you are using the shortag (<?=) to render the layout, and my environment does not use it. I’ve modified views/layouts/webShell.php and now it works fine.
Thanks for your help … and again this is a great extension !!
One note that came to my mind when looking a the sources: You define a global js var named “commands” in the global namespace here. Nothing wrong with that except that it’s a very common name and a potential source for clashes with other js libs.
Since this module is still young, maybe it’s still time to change that to something more unique like “yiiwebshellcommands”?