37 lines
669 B
Plaintext
37 lines
669 B
Plaintext
``++include_once++`` and ``++include++`` only generate a warning if an error occurs during the operation. Because of this they should only be used after possible error conditions have been checked.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,php]
|
|
----
|
|
include_once $user.'_history.php'; // Noncompliant
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,php]
|
|
----
|
|
if (is_member($user)) {
|
|
include_once $user.'_history.php';
|
|
}
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|