php files cleaned, added php formatting

This commit is contained in:
Dima Malishev 2011-08-06 16:12:20 +03:00
commit 4df3488c00
5 changed files with 105 additions and 109 deletions

View file

@ -5,8 +5,8 @@
* *
* Reads, manipulate configs * Reads, manipulate configs
* *
* @author Malishev Dima <dima.malishev@gmail.com>
* @author vesta, http://vestacp.com/ * @author vesta, http://vestacp.com/
* @author Dmitry Malishev <dima.malishev@gmail.com>
* @copyright vesta 2010-2011 * @copyright vesta 2010-2011
*/ */
class Config class Config

View file

@ -4,9 +4,9 @@
* Api Main class * Api Main class
* Calls / Executes native vesta methods * Calls / Executes native vesta methods
* *
* @author Malishev Dima <dima.malishev@gmail.com>
* @author Naumov-Socolov <naumov.socolov@gmail.com>
* @author vesta, http://vestacp.com/ * @author vesta, http://vestacp.com/
* @author Dmitry Malishev <dima.malishev@gmail.com>
* @author Dmitry Naumov-Socolov <naumov.socolov@gmail.com>
* @copyright vesta 2010-2011 * @copyright vesta 2010-2011
*/ */
class Vesta class Vesta
@ -117,8 +117,7 @@ class Vesta
$r = new Request(); $r = new Request();
$_DEBUG = $r->getParameter("debug", FALSE); $_DEBUG = $r->getParameter("debug", FALSE);
if (!isset($cmd_command)) if (!isset($cmd_command)) {
{
throw new ProtectionException('No function name passed into Vesta::execute'); // TODO: move msg to Messages:: throw new ProtectionException('No function name passed into Vesta::execute'); // TODO: move msg to Messages::
} }
@ -134,22 +133,21 @@ class Vesta
exec($cmd, $output, $return); exec($cmd, $output, $return);
$result = 0; $result = 0;
$result = array('status' => TRUE, $result = array(
'status' => TRUE,
'data' => '', 'data' => '',
'error_code' => '', 'error_code' => '',
'error_message' => '' 'error_message' => ''
); );
// TODO: please remove this later :) // TODO: please remove this later :)
if ($_DEBUG) if ($_DEBUG) {
{
$result['debug'] = array( $result['debug'] = array(
"cmd" => $cmd, "cmd" => $cmd,
"output" => $output, "output" => $output,
"return" => $return "return" => $return
); );
if ($debug == 2) if ($debug == 2) {
{
echo '<p>'.$cmd; echo '<p>'.$cmd;
echo '<br> output: '; print_r($output); echo '<br> output: '; print_r($output);
echo '<br> return: '.$return; echo '<br> return: '.$return;
@ -157,14 +155,12 @@ class Vesta
} }
} }
if (!!(int)$return) if (!!(int)$return) {
{
$result['status'] = FALSE; $result['status'] = FALSE;
$result['error_code'] = (int)$return; $result['error_code'] = (int)$return;
$result['error_message'] = implode('', $output); $result['error_message'] = implode('', $output);
} }
else else {
{
$result['data'] = json_decode(implode('', $output), true); $result['data'] = json_decode(implode('', $output), true);
} }

View file

@ -5,8 +5,8 @@
* *
* Thrown if unexpected action or behaviour detected * Thrown if unexpected action or behaviour detected
* *
* @author Malishev Dima <dima.malishev@gmail.com>
* @author vesta, http://vestacp.com/ * @author vesta, http://vestacp.com/
* @author Dmitry Malishev <dima.malishev@gmail.com>
* @copyright vesta 2010-2011 * @copyright vesta 2010-2011
*/ */
class ProtectionException extends Exception class ProtectionException extends Exception

View file

@ -7,8 +7,8 @@
* - system error occured * - system error occured
* - unpredictable scenarios * - unpredictable scenarios
* *
* @author Malishev Dima <dima.malishev@gmail.com>
* @author vesta, http://vestacp.com/ * @author vesta, http://vestacp.com/
* @author Dmitry Malishev <dima.malishev@gmail.com>
* @copyright vesta 2010-2011 * @copyright vesta 2010-2011
*/ */
class SystemException extends Exception { class SystemException extends Exception {

View file

@ -5,8 +5,8 @@
* *
* Contains messages, that are used in the code. * Contains messages, that are used in the code.
* *
* @author Malishev Dima <dima.malishev@gmail.com>
* @author vesta, http://vestacp.com/ * @author vesta, http://vestacp.com/
* @author Dmitry Malishev <dima.malishev@gmail.com>
* @copyright vesta 2010-2011 * @copyright vesta 2010-2011
*/ */
class Message class Message