Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: rikh42/band-snb
base: 7c2f919993
...
head fork: rikh42/band-snb
compare: bfd82d4796
  • 3 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
12 core/Kernel.php
View
@@ -121,6 +121,18 @@ public function boot()
$this->booted = true;
}
+
+ /**
+ * Can be called on shutdown to cleanly close various services
+ */
+ public function shutdown()
+ {
+
+ }
+
+
+
+
/**
* Calls the AppKernel to find the list of packages being used
*/
1  core/KernelInterface.php
View
@@ -13,6 +13,7 @@
interface KernelInterface
{
public function boot();
+ public function shutdown();
public function getPackagePath($name);
public function findPath($name);
public function findResource($name, $type);
14 errors/ErrorHandler.php
View
@@ -56,12 +56,11 @@ class ErrorHandler
private $level;
private $exceptionHandler;
+
/**
- * Register the error handler.
- *
- * @param integer $level The level at which the conversion to Exception is done (null to use the error_reporting() value and 0 to disable)
- *
- * @return The registered error handler
+ * @param ExceptionHandler $exceptionHandler
+ * @param null $level - The level at which the conversion to Exception is done (null to use the error_reporting() value and 0 to disable)
+ * @return ErrorHandler
*/
public static function register(ExceptionHandler $exceptionHandler, $level = null)
{
@@ -75,6 +74,11 @@ public static function register(ExceptionHandler $exceptionHandler, $level = nul
return $handler;
}
+
+ /**
+ * Sets the level at which errors become exceptions
+ * @param $level
+ */
public function setLevel($level)
{
$this->level = null === $level ? error_reporting() : $level;
12 http/SessionStorage.php
View
@@ -67,6 +67,18 @@ public function start()
$_SESSION[self::FLASH_KEY] = array();
}
+
+ /**
+ * Close the session before the end of the script.
+ */
+ public function end()
+ {
+ $this->started = false;
+ session_write_close();
+ }
+
+
+
//==============================
// get
// Gets a value stored in the session
1  http/SessionStorageInterface.php
View
@@ -11,6 +11,7 @@
interface SessionStorageInterface
{
public function start();
+ public function end();
public function get($key, $default=null);
public function set($key, $value);
public function remove($key);
12 logger/Logger.php
View
@@ -11,9 +11,9 @@
class Logger implements LoggerInterface
{
- const DEBUG = 100; // useful to know if you were debugging the app
+ const DEBUG_LOGGER = 100; // useful to know if you were debugging the app (changed to DEBUG_LOGGER to prevent clash with other constants)
const INFO = 200; // Stuff it would be good to know about (eg a login)
- const WARNING = 300; // something stange is going on
+ const WARNING = 300; // something strange is going on
const ERROR = 400; // there was some kind of error
protected $handler;
@@ -79,7 +79,7 @@ public function getHtmlLog()
*/
public function debug($message, $extraData = null)
{
- $this->addRecord(self::DEBUG, $message, $extraData);
+ $this->addRecord(self::DEBUG_LOGGER, $message, $extraData);
}
/**
@@ -129,7 +129,7 @@ public function logMemory($message)
'current' => memory_get_usage(true)
);
- $this->addRecord(self::DEBUG, $message, $data);
+ $this->addRecord(self::DEBUG_LOGGER, $message, $data);
}
/**
@@ -149,7 +149,7 @@ public function logQuery($message, $sql, $args, $queryTime)
'time' => $queryTime
);
- $this->addRecord(self::DEBUG, $message, $data);
+ $this->addRecord(self::DEBUG_LOGGER, $message, $data);
}
/**
@@ -164,6 +164,6 @@ public function logTime($message)
'time' => microtime(true)
);
- $this->addRecord(self::DEBUG, $message, $data);
+ $this->addRecord(self::DEBUG_LOGGER, $message, $data);
}
}

No commit comments for this range

Something went wrong with that request. Please try again.