Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2751032
README.md
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
README.md
View Options
[![
Latest
Stable
Version
]](
https
:
//packagist.org/packages/wikimedia/at-ease) [![License]](https://packagist.org/packages/wikimedia/at-ease)
at
-
ease
=======
at
-
ease
is
a
PHP
library
that
provides
a
safe
alternative
to
PHP
'
s
[@
error
control
operator
][].
`
@` is broken when `
E_STRICT
`
is
enabled
and
it
causes
an
unlogged
,
unexplained
error
if
there
is
a
fatal
,
which
is
hard
to
support
.
The
proper
method
of
handling
errors
is
to
actually
handle
the
errors
.
For
example
,
if
you
are
thinking
of
using
an
error
suppression
operator
to
suppress
an
invalid
array
index
warning
,
you
should
instead
perform
an
`
isset
()
`
check
on
the
array
index
before
trying
to
access
it
.
When
possible
,
always
prevent
PHP
errors
rather
than
catching
and
handling
them
afterward
.
It
makes
the
code
more
understandable
and
avoids
dealing
with
slow
error
suppression
methods
.
However
,
there
are
some
cases
where
warnings
are
inevitable
,
even
if
you
check
beforehand
,
like
when
accessing
files
.
You
can
check
that
the
file
exists
by
using
`
file_exists
()
`
and
`
is_readable
()
`
,
but
the
file
could
have
been
deleted
by
the
time
you
go
to
read
it
.
In
that
case
,
you
can
use
this
library
to
suppress
the
warnings
and
prevent
PHP
from
being
noisy
.
Usage
-----
```
php
use
Wikimedia
\
AtEase
\
AtEase
;
// Suppress warnings in a block of code:
AtEase
::
suppressWarnings
();
$
content
=
file_get_contents
(
'
foobar
.
txt
'
);
AtEase
::
restoreWarnings
();
// ..or in a callback function:
AtEase
::
quietCall
(
'
file_get_contents
'
,
'
foobar
.
txt
'
);
```
Running
tests
-------------
composer
install
--
prefer
-
dist
composer
test
History
-------
This
library
was
first
introduced
in
[
MediaWiki
1.3
][]
([
r4261
][]).
It
was
split
out
of
the
MediaWiki
codebase
and
published
as
an
independent
library
during
the
[
MediaWiki
1.26
][]
development
cycle
.
---
[@
error
control
operator
]:
https
:
//php.net/manual/en/language.operators.errorcontrol.php
[
MediaWiki
1.3
]:
https
:
//www.mediawiki.org/wiki/MediaWiki_1.3
[
r4261
]:
https
:
//phabricator.wikimedia.org/rSVN4261
[
MediaWiki
1.26
]:
https
:
//www.mediawiki.org/wiki/MediaWiki_1.26
[
Latest
Stable
Version
]:
https
:
//poser.pugx.org/wikimedia/at-ease/v/stable.svg
[
License
]:
https
:
//poser.pugx.org/wikimedia/at-ease/license.svg
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 3, 17:44 (1 d, 10 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
09/06/1837bee30a103a1fc9fe75f0aafc
Default Alt Text
README.md (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment