独自のセッションハンドラを設定します。

@param	string	$handler_class_name	Sessionハンドラとして設定するクラス名、またはオブジェクト
@param	bool	$register_shutdown	session_register_shutdownを登録するかどうか
@return	bool	セッションハンドラの設定に成功した場合はTRUE 失敗した場合はFALSE
163685
public static function SetHandler ($handler_class = null, $register_shutdown = false) {
		$handler_class = $handler_class ?: static::class;
		if (is_string($handler_class)) {
			$handler_class = new $handler_class;
		}
		$ret = session_set_save_handler(new \SessionHandler, $register_shutdown);
		return $ret;
	}
570947
public function registerFatalAction()
    {
        // As of PHP Version 7.0.2, the register_tick_function() causes PHP to
        // crash, with a connection reset! We need to check the version to avoid
        // this, and then tell the dev what happened.
        // Not to mention that fatals got removed anyway.
        if (version_compare(phpversion(), '7.0.0', '>=')) {
            // Too high! 420 Method Failure :-(
            $this->pool->messages->addMessage($this->pool->messages->getHelp('php7yellow'));
            krexx($this->pool->messages->getHelp('php7'));

            // Just return, there is nothing more to do here.
            return $this;
        }

        // Do we need another shutdown handler?
        if (static::$krexxFatal === null) {
            static::$krexxFatal = $this->pool->createClass('Brainworxx\\Krexx\\Errorhandler\\Fatal');
            declare(ticks = 1);
            register_shutdown_function(
                array(
                    static::$krexxFatal,
                    'shutdownCallback',
                )
            );
        }

        static::$krexxFatal->setIsActive(true);
        $this->fatalShouldActive = true;
        register_tick_function(array($this::$krexxFatal, 'tickCallback'));

        return $this;
    }
1200607
public static function shutdown_handler()
	{
		$last_error = error_get_last();

		// Only show valid fatal errors
		if ($last_error AND in_array($last_error['type'], static::$fatal_levels))
		{
			$severity = static::$levels[$last_error['type']];
			logger(\Fuel::L_ERROR, $severity.' - '.$last_error['message'].' in '.$last_error['file'].' on line '.$last_error['line']);

			$error = new \ErrorException($last_error['message'], $last_error['type'], 0, $last_error['file'], $last_error['line']);
			if (\Fuel::$env != \Fuel::PRODUCTION)
			{
				static::show_php_error($error);
			}
			else
			{
				static::show_production_error($error);
			}

			exit(1);
		}
	}
135041
public function unregisterFatalAction()
    {
        $this->fatalShouldActive = false;

        if ($this::$krexxFatal === null) {
            // There is no fatal error handler to begin with.
            return $this;
        }

        // Now we need to tell the shutdown function, that is must
        // not do anything on shutdown.
        $this::$krexxFatal->setIsActive(false);
        unregister_tick_function(array($this::$krexxFatal, 'tickCallback'));
        return $this;
    }
71479
function registerShutdownFunc($func, $args = array())
    {
        // if we are called statically, there is a potential
        // that no shutdown func is registered.  Bug #6445
        if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
            register_shutdown_function("_PEAR_call_destructors");
            $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
        }
        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
    }
810836
private function initHandler(SaveHandlerInterface $handler)
    {
        return session_set_save_handler(array($handler, 'open'), 
                                        array($handler, 'close'), 
                                        array($handler, 'read'), 
                                        array($handler, 'write'), 
                                        array($handler, 'destroy'), 
                                        array($handler, 'gc'));
    }
216169
function register()
	{
		set_error_handler(array($this,'_handleError'));
		set_exception_handler(array($this,'_handleException'));
		register_shutdown_function(array($this,'_shutdown'));
		$this->_registered = true;
		return $this;
	}
172488
protected function registerErrorHandling()
    {
        mysqli_report(MYSQLI_REPORT_STRICT);
        
        set_error_handler(function ($level, $message, $file = '', $line = 0) {
            if (error_reporting() & $level) {
                throw new ErrorException($message, 0, $level, $file, $line);
            }
        });
        
        set_exception_handler(function ($e) {
            $this->handleUncaughtException($e);
        });
        
        register_shutdown_function(function () {
            if (! is_null($error = error_get_last()) && $this->isFatalError($error['type'])) {
                $this->handleUncaughtException(new FatalErrorException(
                    $error['message'], $error['type'], 0, $error['file'], $error['line']
                ));
            }
        });
    }
1270820
static public function stop()
    {
        if ( !self::$hasStarted )
        {
             return false;
        }
        session_write_close();
        self::$hasStarted = false;
        self::$handlerInstance = null;
        return true;
    }
571502
public function register($name, $handler)
    {
        if (is_callable($handler)) {
            $params = array_merge(array($this), $this->params);
            $this->container[$name] = call_user_func_array($handler, $params);

        } else {
            $this->container[$name] = $handler;
        }

        return $this;
    }
232611
public function register($name, $handler)
    {
        Assert::string($name, 'The handler name must be a string. Got: %s');
        Assert::notEmpty($name, 'The handler name must not be empty.');

        if (!is_object($handler)) {
            Assert::isCallable($handler, 'The handler must be a callable or an object. Got: %s');
        }

        $this->handlers[$name] = $handler;

        if (!$this->selectedHandler) {
            $this->selectedHandler = $name;
        }
    }
1283089
protected function registerFatalHandler()
    {
        $error = $this;

        // When shutdown, the current working directory will be set to the web
        // server directory, store it for later use
        $cwd = getcwd();

        register_shutdown_function(function () use ($error, $cwd) {
            $e = error_get_last();
            if (!$e || !in_array($e['type'], array(E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE))) {
                // No error or not fatal error
                return;
            }

            ob_get_length() && ob_end_clean();

            // Reset the current working directory to make sure everything work as usual
            chdir($cwd);

            $exception = new \ErrorException($e['message'], $e['type'], 0, $e['file'], $e['line']);

            if ($error->triggerHandler('fatal', $exception)) {
                // Handled!
                return;
            }

            // Fallback to error handlers
            if ($error->triggerHandler('error', $exception)) {
                // Handled!
                return;
            }

            // Fallback to internal error Handlers
            $error->internalHandleException($exception);
        });
    }
24985
public function get_handler_classname() {
        global $CFG;

        if (!empty($CFG->sitepolicyhandler)) {
            $sitepolicyhandlers = $this->get_all_handlers();

            if (!isset($sitepolicyhandlers[$CFG->sitepolicyhandler])) {
                return default_handler::class;

            } else {
                return $sitepolicyhandlers[$CFG->sitepolicyhandler];
            }

        } else {
            return default_handler::class;
        }
    }
26860
public function shutdown()
    {

        // create a local copy of the request/response
        $servletRequest = $this->servletRequest;
        $servletResponse = $this->servletResponse;

        // check if we had a fatal error that caused the shutdown
        if ($lastError = error_get_last()) {
            // add the fatal error
            $this->addError(ErrorUtil::singleton()->fromArray($lastError));
            // in case of fatal errors, we need to override request with perpared
            // instances because error handling needs application access
            $servletRequest = RequestHandler::$requestContext;
        }

        // handle the errors if necessary
        ErrorUtil::singleton()->handleErrors($this, $servletRequest, $servletResponse);

        // copy request/response back to the thread context
        $this->servletRequest = $servletRequest;
        $this->servletResponse = $servletResponse;
    }
265208
public function PHPShutdownHandler()
    {
        session_write_close();
        if ($lasterror = error_get_last()) {
            $message = $lasterror['message'] . ' | File: {file} | Ln: {line}';
            $context = array(
                'file' => $lasterror['file'],
                'line' => $lasterror['line']
            );
            $this->logger->log($this->shutdownLogLevel, $message, $context);
        }
    }
691815
public static function ShutdownHandler () {
		$error = error_get_last();
		if (isset($error['type'])) static::Exception($error);
		if (!self::isHtmlResponse() || count(self::$dumps) === 0) return;
		list($dumps, $lastDump) = self::formatDebugDumps();
		echo str_replace(
			['%mvccoreDumps%', '"%mvccoreInitArgs%"'],
			[$dumps, ($lastDump ? '!0' : '!1') . ',' . count(self::$dumps)],
			file_get_contents(__DIR__.'/debug.html')
		);
	}
895252
public function shutdownHandler()
    {
        $lastError = error_get_last();

        if (is_array($lastError)) {
            $this->errorHandler(
                $lastError[ 'type' ],
                $lastError[ 'message' ],
                $lastError[ 'file' ],
                $lastError[ 'line' ]
            );
        }

        // Execute shutdown service
        if(services()->has('shutdown')) {
            shutdown()->execute();
        }
    }