Search

I came across this line in on Github. It uses:

Administration::instance()->throwCustomError(...

I can't find that documented in the API pages at getsymphony.com, and I can't get throwCustomError() to work in my extension. However, I found customError() in the API pages. Which one of these is "right" for a current stable version of Symphony?

Also, is there a good way to search the API pages? I usually end up with putting "site:getsymphony.com codeidontunderstand" into Google, but that didn't pull up this particular method.

is there a good way to search the API pages?

I'm using the Find functionality in my editor :) coupled with smart code interpretation it does the job.

The throwCustomError function is new in Symphony 2.3.2, so it's documentation doesn't exist yet as it is usually generated when it reaches Release Candidate status.

Like @vladG said, all the code is documented at the source level, so here is the relevant documentation for throwCustomError. The method will replace customError() as it includes better support for correctly setting response headers.

vladG, I use find in my editor as well, but it only seems to work in a single file. I guess you have a project set up with all of the source code from Symphony and any extensions you work on, and your editor will search all of the files? What editor do you use? I'm working with pretty basic stuff, geany and Ubuntu.

brendo, I don't know how I missed that. I was sure I searched that file. Anyway, it looks like customError() will still be available, but if an extension uses throwCustomError() it won't be compatible with pre-2.3.2 versions?

I guess you have a project set up with all of the source code from Symphony and any extensions you work on, and your editor will search all of the files?

Yes.

What editor do you use?

PhpStorm. Brilliant.

PhpStorm. Brilliant.

Changed my life.

brendo, I don't know how I missed that. I was sure I searched that file. Anyway, it looks like customError() will still be available, but if an extension uses throwCustomError() it won't be compatible with pre-2.3.2 versions?

Correct :)

@jgm: See Geany: Find in files

Or:

cd /path/to/symphony
grep -rnB 30 "function throwCustomError" .

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details