@@ 107-116 (lines=10) @@ | ||
104 | * @param string $context The context for the error. |
|
105 | * @param string $error The error that was encountered. |
|
106 | */ |
|
107 | public function error( $context, $error ) { |
|
108 | ||
109 | if ( empty( $context ) || empty( $error ) ) { |
|
110 | return; |
|
111 | } |
|
112 | ||
113 | // Ensure we don't store duplicate errors by md5'ing the error as the key |
|
114 | $this->errors[ $context ][ md5( implode( ':', (array) $error ) ) ] = $error; |
|
115 | ||
116 | } |
|
117 | ||
118 | /** |
|
119 | * Get the array of warnings encountered during the backup process. |
|
@@ 146-155 (lines=10) @@ | ||
143 | * @param string $context The context for the warning. |
|
144 | * @param string $error The warning that was encountered. |
|
145 | */ |
|
146 | public function warning( $context, $warning ) { |
|
147 | ||
148 | if ( empty( $context ) || empty( $warning ) ) { |
|
149 | return; |
|
150 | } |
|
151 | ||
152 | // Ensure we don't store duplicate warnings by md5'ing the error as the key |
|
153 | $this->warnings[ $context ][ md5( implode( ':', (array) $warning ) ) ] = $warning; |
|
154 | ||
155 | } |
|
156 | ||
157 | /** |
|
158 | * Hooked into `set_error_handler` to catch any PHP errors that happen during |
@@ 183-192 (lines=10) @@ | ||
180 | * @param string $context The context for the warning. |
|
181 | * @param string $error The warning that was encountered. |
|
182 | */ |
|
183 | public function warning( $context, $warning ) { |
|
184 | ||
185 | if ( empty( $context ) || empty( $warning ) ) { |
|
186 | return; |
|
187 | } |
|
188 | ||
189 | // Ensure we don't store duplicate warnings by md5'ing the error as the key |
|
190 | $this->warnings[ $context ][ md5( implode( ':', (array) $warning ) ) ] = $warning; |
|
191 | ||
192 | } |
|
193 | ||
194 | /** |
|
195 | * Back compat with old error method |