Пример #1
0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @author    Naohisa Minagawa <*****@*****.**>
 * @copyright Copyright (c) 2010, Vizualizer
 * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
 * @since PHP 5.3
 * @version   1.0.0
 */
// Vizualizerの初期化
Vizualizer::initialize();
// エラー時に例外をスローするようにコールバック関数を登録
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
    switch ($errno) {
        case E_ERROR:
            Vizualizer_Logger::error($errstr . " in " . $errfile . "(" . $errline . ")");
            throw new Vizualizer_Exception_System($errstr);
            break;
        case E_WARNING:
            Vizualizer_Logger::alert($errstr . " in " . $errfile . "(" . $errline . ")");
            break;
        case E_NOTICE:
            Vizualizer_Logger::info("【NOTICE】" . $errstr . " in " . $errfile . "(" . $errline . ")");
            break;
        case E_STRICT:
            Vizualizer_Logger::info("【STRICT】" . $errstr . " in " . $errfile . "(" . $errline . ")");