File: commands/help.php

Recommend this page to a friend!
  Classes of Andoitz Jordan Marmolejo   JavaScript Query Terminal   commands/help.php   Download  
File: commands/help.php
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: JavaScript Query Terminal
Online console to run server commands using AJAX
Author: By
Last change: Update of commands/help.php
Date: 2 years ago
Size: 1,205 bytes
 

Contents

Class file image Download
<?php class help extends Command{ public function __construct(){ parent::__construct(); } public function init($params){ $result = "\n[[;#F00;<BACKGROUND>]Estas órdenes del shell están definidas internamente. Teclee 'help nombre' para saber más sobre la función 'nombre']\n"; if(isset($params[1])){ //AYUDA EXTENDIDA DE UN COMANDO $pError = $this->syntaxError($params,1); if(!$pError) $result .= $this->moreHelp($params[1]); else $result = $pError; } else{ $dir = opendir("commands"); $result .= "\n [[ib;#FFF;<BACKGROUND>]help ->] ".$this::$info; while($file = readdir($dir)){ if(!is_dir($file) && $file != 'help.php'){ include($file); $file = rtrim($file,'.php'); $result .= "\n [[ib;#FFF;<BACKGROUND>]".$file." ->] ".$file::$info; } } } $this->data = $result."\n"; } public function moreHelp($command){ $result = ""; if(file_exists($this->folder.$command.".php")){ include($this->folder.$command.".php"); $result .= "\n [[ib;#FFF;<BACKGROUND>]".$command." ->] ".command::help(); } else{ $result .= "\n [[ib;#FFF;<BACKGROUND>]".$command." ->] El comando introducido no existe"; } return $result; } } ?>