File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class Database {
3232 *
3333 * @var string
3434 */
35- const VERSION = '1.1.1 ' ;
35+ const VERSION = '1.1.2 ' ;
3636
3737 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3838 // Error field constants ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -221,6 +221,13 @@ class Database {
221221 */
222222 const EXCEPTION_NO_PATH = 10009 ;
223223
224+ /**
225+ * BCMath extension not installed
226+ *
227+ * @var int
228+ */
229+ const EXCEPTION_BCMATH_NOT_INSTALLED = 10010 ;
230+
224231 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
225232 // Caching method constants ////////////////////////////////////////////////////////////////////////////////////////////////////////////
226233 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -471,6 +478,10 @@ public function __destruct() {
471478 * @throws \Exception
472479 */
473480 public function open ($ file = null , $ mode = self ::FILE_IO , $ defaultFields = self ::ALL ) {
481+ if (!function_exists ('bcadd ' )) {
482+ throw new \Exception (__CLASS__ . ": BCMath extension is not installed. " , self ::EXCEPTION_BCMATH_NOT_INSTALLED );
483+ }
484+
474485 // find the referred file and its size
475486 $ rfile = self ::findFile ($ file );
476487 $ size = filesize ($ rfile );
You can’t perform that action at this time.
0 commit comments