Browse Source

- Fix #25 (need to update Moxl too)

- Delete the MovimException file
pull/29/head
Jaussoin Timothée 10 years ago
parent
commit
9bbb40259f
  1. 2
      app/helpers/StringHelper.php
  2. 1
      bootstrap.php
  3. 8
      linker.php
  4. 26
      system/MovimException.php
  5. 2
      system/widget/WidgetWrapper.php

2
app/helpers/StringHelper.php

@ -309,7 +309,7 @@ function stringToColor($string) {
} }
/** /**
* Return the first letter of a string
* Return the first two letters of a string
* @param string * @param string
* @return string * @return string
*/ */

1
bootstrap.php

@ -209,7 +209,6 @@ class Bootstrap {
require_once(SYSTEM_PATH . "UtilsPicture.php"); require_once(SYSTEM_PATH . "UtilsPicture.php");
require_once(SYSTEM_PATH . "Cache.php"); require_once(SYSTEM_PATH . "Cache.php");
require_once(SYSTEM_PATH . "Event.php"); require_once(SYSTEM_PATH . "Event.php");
require_once(SYSTEM_PATH . "MovimException.php");
require_once(SYSTEM_PATH . "RPC.php"); require_once(SYSTEM_PATH . "RPC.php");
require_once(SYSTEM_PATH . "User.php"); require_once(SYSTEM_PATH . "User.php");
require_once(SYSTEM_PATH . "Picture.php"); require_once(SYSTEM_PATH . "Picture.php");

8
linker.php

@ -50,9 +50,13 @@ $stdin_behaviour = function ($data) use (&$conn, $loop, &$buffer, &$connector, &
$cd = new \Modl\ConfigDAO(); $cd = new \Modl\ConfigDAO();
$config = $cd->get(); $config = $cd->get();
$domain = \Moxl\Utils::getDomain($msg->host);
$port = 5222;
$dns = \Moxl\Utils::resolveHost($msg->host);
if(isset($dns[0]['target']) && $dns[0]['target'] != null) $msg->host = $dns[0]['target'];
if(isset($dns[0]['port']) && $dns[0]['port'] != null) $port = $dns[0]['port'];
#fwrite(STDERR, colorize('open a socket to '.$domain, 'yellow')." : ".colorize('sent to XMPP', 'green')."\n"); #fwrite(STDERR, colorize('open a socket to '.$domain, 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
$connector->create($domain, 5222)->then($xmpp_behaviour);
$connector->create($msg->resolveHost, $port)->then($xmpp_behaviour);
} }
} else { } else {
return; return;

26
system/MovimException.php

@ -1,26 +0,0 @@
<?php
/**
* \brief Movim's custom exception class.
*
* Merely adds a line break to the messages so far. Is expected to become more
* useful in the future.
*/
class MovimException extends Exception
{
/**
* Forces to add a message.
*/
public function __construct($message, $code = 0) {
parent::__construct('Error: ' . $message, $code);
}
/**
* Output proper html error reports.
*/
function __toString() {
return $this->code . ' - ' . $this->message . '<br />';
}
}
?>

2
system/widget/WidgetWrapper.php

@ -85,7 +85,7 @@ class WidgetWrapper
$path = APP_PATH . "widgets/$name/$name.php"; $path = APP_PATH . "widgets/$name/$name.php";
} }
else { else {
throw new MovimException(
throw new Exception(
__('error.widget_load_error', $name)); __('error.widget_load_error', $name));
} }

Loading…
Cancel
Save