Permalink
Browse files

Convert __toString() to use (string) cast instead.

  • Loading branch information...
1 parent 212633d commit cfbbf9ef606094868ccbd25ccf65e1a6f610528b @bharat bharat committed Jan 28, 2010
@@ -82,7 +82,7 @@ static function update_index($task) {
$task->done = true;
$task->state = "error";
$task->status = $e->getMessage();
- $task->log($e->__toString());
+ $task->log((string)$e);
}
}
}
@@ -239,7 +239,7 @@ static function import_group(&$queue) {
$g2_group = g2(GalleryCoreApi::loadEntitiesById($g2_group_id));
} catch (Exception $e) {
return t("Failed to import Gallery 2 group with id: %id\n%exception",
- array("id" => $g2_group_id, "exception" => $e->__toString()));
+ array("id" => $g2_group_id, "exception" => (string)$e));
}
switch ($g2_group->getGroupType()) {
@@ -295,7 +295,7 @@ static function import_user(&$queue) {
$g2_user = g2(GalleryCoreApi::loadEntitiesById($g2_user_id));
} catch (Exception $e) {
return t("Failed to import Gallery 2 user with id: %id\n%exception",
- array("id" => $g2_user_id, "exception" => $e->__toString()));
+ array("id" => $g2_user_id, "exception" => (string)$e));
}
$g2_groups = g2(GalleryCoreApi::fetchGroupsForUser($g2_user->getId()));
@@ -449,7 +449,7 @@ static function import_item(&$queue) {
$g2_path = g2($g2_item->fetchPath());
} catch (Exception $e) {
return t("Failed to import Gallery 2 item with id: %id\n%exception",
- array("id" => $g2_item_id, "exception" => $e->__toString()));
+ array("id" => $g2_item_id, "exception" => (string)$e));
}
$parent = ORM::factory("item")->where("id", "=", self::map($g2_item->getParentId()))->find();
@@ -596,7 +596,7 @@ static function import_comment(&$queue) {
$g2_comment = g2(GalleryCoreApi::loadEntitiesById($g2_comment_id));
} catch (Exception $e) {
return t("Failed to import Gallery 2 comment with id: %id\%exception",
- array("id" => $g2_comment_id, "exception" => $e->__toString()));
+ array("id" => $g2_comment_id, "exception" => (string)$e));
}
$text = $g2_comment->getSubject();
@@ -642,7 +642,7 @@ static function import_tags_for_item(&$queue) {
$tag_names = array_values(g2(TagsHelper::getTagsByItemId($g2_item_id)));
} catch (Exception $e) {
return t("Failed to import Gallery 2 tags for item with id: %id\n%exception",
- array("id" => $g2_item_id, "exception" => $e->__toString()));
+ array("id" => $g2_item_id, "exception" => (string)$e));
}
foreach ($tag_names as $tag_name) {
@@ -81,7 +81,7 @@ static function rebuild_dirty_images($task) {
} catch (Exception $e) {
$errors[] = t("Unable to rebuild images for '%title'",
array("title" => html::purify($item->title)));
- $errors[] = $e->__toString();
+ $errors[] = (string)$e;
$ignored[$item->id] = 1;
}
}
@@ -114,7 +114,7 @@ static function rebuild_dirty_images($task) {
$task->done = true;
$task->state = "error";
$task->status = $e->getMessage();
- $errors[] = $e->__toString();
+ $errors[] = (string)$e;
}
if ($errors) {
$task->log($errors);
@@ -217,7 +217,7 @@ static function update_l10n($task) {
$task->done = true;
$task->state = "error";
$task->status = $e->getMessage();
- $errors[] = $e->__toString();
+ $errors[] = (string)$e;
}
if ($errors) {
$task->log($errors);
@@ -284,7 +284,7 @@ static function file_cleanup($task) {
$task->done = true;
$task->state = "error";
$task->status = $e->getMessage();
- $errors[] = $e->__toString();
+ $errors[] = (string)$e;
}
if ($errors) {
$task->log($errors);
@@ -84,15 +84,15 @@ static function run($task_id) {
}
$task->save();
} catch (Exception $e) {
- Kohana_Log::add("error", $e->__toString());
+ Kohana_Log::add("error", (string)$e);
// Ugh. I hate to use instanceof, But this beats catching the exception separately since
// we mostly want to treat it the same way as all other exceptions
if ($e instanceof ORM_Validation_Exception) {
Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
}
- $task->log($e->__toString());
+ $task->log((string)$e);
$task->state = "error";
$task->done = true;
$task->status = substr($e->getMessage(), 0, 255);
@@ -36,7 +36,7 @@ function album($album_id, $offset) {
access::required("edit", $album);
print json_encode(
- array("grid" => self::_get_micro_thumb_grid($album, $offset)->__toString(),
+ array("grid" => (string)self::_get_micro_thumb_grid($album, $offset),
"sort_column" => $album->sort_column,
"sort_order" => $album->sort_order));
}
@@ -57,8 +57,8 @@ function move_to($target_album_id) {
}
print json_encode(
- array("tree" => self::_expanded_tree(ORM::factory("item", 1), $target_album)->__toString(),
- "grid" => self::_get_micro_thumb_grid($target_album, 0)->__toString()));
+ array("tree" => (string)self::_expanded_tree(ORM::factory("item", 1), $target_album),
+ "grid" => (string)self::_get_micro_thumb_grid($target_album, 0)));
}
function rearrange($target_id, $before_or_after) {
@@ -114,7 +114,7 @@ function rearrange($target_id, $before_or_after) {
module::event("album_rearrange", $album);
print json_encode(
- array("grid" => self::_get_micro_thumb_grid($album, 0)->__toString(),
+ array("grid" => (string)self::_get_micro_thumb_grid($album, 0),
"sort_column" => $album->sort_column,
"sort_order" => $album->sort_order));
}
@@ -136,7 +136,7 @@ function sort_order($album_id, $col, $dir) {
$album->save();
print json_encode(
- array("grid" => self::_get_micro_thumb_grid($album, 0)->__toString(),
+ array("grid" => (string)self::_get_micro_thumb_grid($album, 0),
"sort_column" => $album->sort_column,
"sort_order" => $album->sort_order));
}
@@ -69,7 +69,7 @@ public function create($item_id) {
print json_encode(
array("result" => "success",
- "cloud" => tag::cloud(30)->__toString()));
+ "cloud" => (string)tag::cloud(30)));
} else {
print json_encode(array("result" => "error", "form" => (string) $form));
}

0 comments on commit cfbbf9e

Please sign in to comment.