Skip to content

Commit

Permalink
add DB connection init cmd for tz
Browse files Browse the repository at this point in the history
  • Loading branch information
shayanderson committed Jan 22, 2020
1 parent 043764a commit 0ddd908
Show file tree
Hide file tree
Showing 46 changed files with 80 additions and 48 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2019 Shay Anderson <https://www.shayanderson.com>
Copyright (c) 2015-2020 Shay Anderson <https://www.shayanderson.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Eco Framework
Eco is a PHP Framework for PHP 5.5+

Latest release [v1.7.5](https://github.com/shayanderson/eco/releases/latest)
Latest release [v1.7.6](https://github.com/shayanderson/eco/releases/latest)

Install example:
```
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Socket/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Socket/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Socket/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Database/Bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Database/Bulk/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Database/Bulk/Type/Insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
27 changes: 25 additions & 2 deletions app/vendor/Eco/System/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down Expand Up @@ -86,6 +86,13 @@ class Connection
*/
private $__pdo;

/**
* Timezone
*
* @var string
*/
private static $__tz;

/**
* User
*
Expand Down Expand Up @@ -182,8 +189,13 @@ public function getPdo()
{
try
{
$opts = [\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION];
if(self::$__tz)
{
$opts[\PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET time_zone=\'' . self::$__tz . '\';';
}
$this->__pdo = new \PDO("mysql:host={$this->__host};dbname={$this->__database}",
$this->__user, $this->__password, [\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION]);
$this->__user, $this->__password, $opts);
}
catch(\PDOException $ex)
{
Expand Down Expand Up @@ -291,4 +303,15 @@ public function query($query, $params = null, $return_type = null, $is_reconnect

return false;
}

/**
* Timezone setter for connection init command
*
* @param string $timezone
* @return void
*/
public static function setTimezone($timezone)
{
self::$__tz = $timezone;
}
}
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Database/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Database/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Keep.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Registry/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Registry/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Session/Flash.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/System/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/helper/alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
2 changes: 1 addition & 1 deletion app/vendor/Eco/helper/eco.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Eco is a PHP Framework for PHP 5.5+
*
* @package Eco
* @copyright 2015-2019 Shay Anderson <https://www.shayanderson.com>
* @copyright 2015-2020 Shay Anderson <https://www.shayanderson.com>
* @license MIT License <https://github.com/shayanderson/eco/blob/master/LICENSE>
* @link <https://github.com/shayanderson/eco>
*/
Expand Down
Loading

0 comments on commit 0ddd908

Please sign in to comment.