CV-Portfolio 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/_config.yml +111 -0
- data/_includes/backtotop.html +1 -0
- data/_includes/clients.html +37 -0
- data/_includes/header.html +2 -0
- data/_includes/javascripts.html +4 -0
- data/_includes/mapbox-init.html +2 -0
- data/_includes/mapbox.html +3 -0
- data/_includes/meta.html +28 -0
- data/_includes/photoswipe.html +40 -0
- data/_includes/preloader.html +4 -0
- data/_includes/review.html +79 -0
- data/_includes/scroll.html +2 -0
- data/_includes/sidebar.html +68 -0
- data/_includes/skills.html +31 -0
- data/_includes/testimonials.html +54 -0
- data/_layouts/contact.html +20 -0
- data/_layouts/default.html +18 -0
- data/_layouts/post.html +21 -0
- data/_layouts/project.html +23 -0
- data/_layouts/resume.html +18 -0
- data/_sass/style.scss +3353 -0
- data/assets/css/app/_button.scss +70 -0
- data/assets/css/app/_cases.scss +35 -0
- data/assets/css/app/_clients.scss +22 -0
- data/assets/css/app/_contact.scss +74 -0
- data/assets/css/app/_form.scss +264 -0
- data/assets/css/app/_general.scss +106 -0
- data/assets/css/app/_navbar.scss +98 -0
- data/assets/css/app/_news.scss +112 -0
- data/assets/css/app/_other.scss +58 -0
- data/assets/css/app/_popup.scss +167 -0
- data/assets/css/app/_portfolio.scss +269 -0
- data/assets/css/app/_sections.scss +265 -0
- data/assets/css/app/_sidebar.scss +181 -0
- data/assets/css/app/_single-news.scss +445 -0
- data/assets/css/app/_single-project.scss +97 -0
- data/assets/css/app/_testimonials.scss +147 -0
- data/assets/css/app/_timeline.scss +78 -0
- data/assets/css/app/_typography.scss +253 -0
- data/assets/css/main.scss +9 -0
- data/assets/css/style.css.map +30 -0
- data/assets/css/style.scss +43 -0
- data/assets/css/variables/_media.scss +8 -0
- data/assets/css/variables/_mixins.scss +59 -0
- data/assets/css/variables/_vars.scss +48 -0
- data/assets/css/vendors/bootstrap.css +10819 -0
- data/assets/css/vendors/bootstrap.css.map +1 -0
- data/assets/css/vendors/bootstrap.min.css +7 -0
- data/assets/css/vendors/bootstrap.min.css.map +1 -0
- data/assets/css/vendors/default-skin.css +482 -0
- data/assets/css/vendors/magnific-popup.css +351 -0
- data/assets/css/vendors/photoswipe.css +179 -0
- data/assets/css/vendors/simplebar.css +211 -0
- data/assets/css/vendors/simplebar.min.css +1 -0
- data/assets/css/vendors/swiper.min.css +12 -0
- data/assets/icons/dark/icon-app.svg +4 -0
- data/assets/icons/dark/icon-design.svg +5 -0
- data/assets/icons/dark/icon-dev.svg +12 -0
- data/assets/icons/dark/icon-education.svg +10 -0
- data/assets/icons/dark/icon-experience.svg +4 -0
- data/assets/icons/dark/icon-photo.svg +7 -0
- data/assets/icons/dark/icon-quote.svg +3 -0
- data/assets/icons/emoji/emoji-angry.svg +15 -0
- data/assets/icons/emoji/emoji-bad.svg +15 -0
- data/assets/icons/emoji/emoji-crazy.svg +15 -0
- data/assets/icons/emoji/emoji-happy-2.svg +12 -0
- data/assets/icons/emoji/emoji-happy-3.svg +16 -0
- data/assets/icons/emoji/emoji-happy.svg +15 -0
- data/assets/icons/emoji/emoji-in-love.svg +15 -0
- data/assets/icons/emoji/emoji-laughing.svg +15 -0
- data/assets/icons/emoji/emoji-nerd.svg +16 -0
- data/assets/icons/emoji/emoji-pressure.svg +17 -0
- data/assets/icons/emoji/emoji-sad-2.svg +15 -0
- data/assets/icons/emoji/emoji-sad.svg +13 -0
- data/assets/icons/emoji/emoji-shocked-2.svg +15 -0
- data/assets/icons/emoji/emoji-shocked-3.svg +11 -0
- data/assets/icons/emoji/emoji-shocked.svg +14 -0
- data/assets/icons/emoji/emoji-sweating.svg +10 -0
- data/assets/icons/emoji/emoji-thinking.svg +13 -0
- data/assets/icons/emoji/emoji-wink.svg +12 -0
- data/assets/icons/feather.css +871 -0
- data/assets/icons/feather.woff +0 -0
- data/assets/icons/feather.woff2 +0 -0
- data/assets/icons/icomoon.svg +45 -0
- data/assets/icons/icomoon.ttf +0 -0
- data/assets/icons/icomoon.woff +0 -0
- data/assets/icons/icon-app.svg +14 -0
- data/assets/icons/icon-at.svg +3 -0
- data/assets/icons/icon-calendar.svg +3 -0
- data/assets/icons/icon-design.svg +27 -0
- data/assets/icons/icon-dev.svg +54 -0
- data/assets/icons/icon-download.svg +3 -0
- data/assets/icons/icon-education.svg +10 -0
- data/assets/icons/icon-envelope.svg +3 -0
- data/assets/icons/icon-experience.svg +4 -0
- data/assets/icons/icon-like-fill.svg +3 -0
- data/assets/icons/icon-like.svg +3 -0
- data/assets/icons/icon-location.svg +3 -0
- data/assets/icons/icon-news.svg +3 -0
- data/assets/icons/icon-phone.svg +3 -0
- data/assets/icons/icon-photo.svg +45 -0
- data/assets/icons/icon-quote.svg +9 -0
- data/assets/icons/icon-reply.svg +3 -0
- data/assets/icons/icon-send.svg +3 -0
- data/assets/icons/icon-skype.svg +3 -0
- data/assets/icons/icon-user.svg +6 -0
- data/assets/icons/style-custome-icons.css +132 -0
- data/assets/images/280x204.jpg +0 -0
- data/assets/images/400x550.jpg +0 -0
- data/assets/images/433x240.jpg +0 -0
- data/assets/images/560x340.jpg +0 -0
- data/assets/images/958x400.jpg +0 -0
- data/assets/images/_icon-map-pic.svg +15 -0
- data/assets/images/apple-store.png +0 -0
- data/assets/images/avatar-1.png +0 -0
- data/assets/images/avatar-2.png +0 -0
- data/assets/images/avatar-3.png +0 -0
- data/assets/images/avatar-4.png +0 -0
- data/assets/images/clients/logo-1-color.png +0 -0
- data/assets/images/clients/logo-1-white.png +0 -0
- data/assets/images/clients/logo-2-color.png +0 -0
- data/assets/images/clients/logo-2-white.png +0 -0
- data/assets/images/clients/logo-3-color.png +0 -0
- data/assets/images/clients/logo-3-white.png +0 -0
- data/assets/images/clients/logo-4-color.png +0 -0
- data/assets/images/clients/logo-4-white.png +0 -0
- data/assets/images/clients/logo-5-color.png +0 -0
- data/assets/images/clients/logo-5-white.png +0 -0
- data/assets/images/clients/logo-6-color.png +0 -0
- data/assets/images/clients/logo-6-white.png +0 -0
- data/assets/images/clients/logo-7-color.png +0 -0
- data/assets/images/clients/logo-7-white.png +0 -0
- data/assets/images/clients/logo-8-color.png +0 -0
- data/assets/images/clients/logo-8-white.png +0 -0
- data/assets/images/clients/logo-9-color.png +0 -0
- data/assets/images/clients/logo-9-white.png +0 -0
- data/assets/images/cover.png +0 -0
- data/assets/images/cv-portfolio.jpg +0 -0
- data/assets/images/favicons/apple-touch-icon-114x114.png +0 -0
- data/assets/images/favicons/apple-touch-icon-144x144.png +0 -0
- data/assets/images/favicons/apple-touch-icon-57x57.png +0 -0
- data/assets/images/favicons/apple-touch-icon-72x72.png +0 -0
- data/assets/images/favicons/favicon.png +0 -0
- data/assets/images/icon-map-pic.svg +30 -0
- data/assets/images/icon-quote.svg +3 -0
- data/assets/images/logotype.svg +9 -0
- data/assets/images/my-avatar.png +0 -0
- data/assets/images/photoswiper/default-skin.png +0 -0
- data/assets/images/photoswiper/default-skin.svg +1 -0
- data/assets/images/photoswiper/preloader.gif +0 -0
- data/assets/images/play-store.png +0 -0
- data/assets/images/splash.gif +0 -0
- data/assets/img/posts/400x550.jpg +0 -0
- data/assets/img/posts/958x400.jpg +0 -0
- data/assets/js/common.js +737 -0
- data/assets/js/jquery-3.4.1.min.js +2 -0
- data/assets/js/mapbox.init.js +32 -0
- data/assets/js/plugins.js +33367 -0
- data/assets/js/plugins.min.js +106 -0
- data/assets/php/form-contact.php +95 -0
- data/assets/php/phpmailer/COMMITMENT +46 -0
- data/assets/php/phpmailer/LICENSE +502 -0
- data/assets/php/phpmailer/README.md +218 -0
- data/assets/php/phpmailer/SECURITY.md +28 -0
- data/assets/php/phpmailer/VERSION +1 -0
- data/assets/php/phpmailer/composer.json +55 -0
- data/assets/php/phpmailer/get_oauth_token.php +144 -0
- data/assets/php/phpmailer/language/phpmailer.lang-am.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ar.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-az.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ba.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-be.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-bg.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ca.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ch.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-cs.php +25 -0
- data/assets/php/phpmailer/language/phpmailer.lang-da.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-de.php +25 -0
- data/assets/php/phpmailer/language/phpmailer.lang-el.php +25 -0
- data/assets/php/phpmailer/language/phpmailer.lang-eo.php +25 -0
- data/assets/php/phpmailer/language/phpmailer.lang-es.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-et.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-fa.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-fi.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-fo.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-fr.php +29 -0
- data/assets/php/phpmailer/language/phpmailer.lang-gl.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-he.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-hi.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-hr.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-hu.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-id.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-it.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ja.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ka.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ko.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-lt.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-lv.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-mg.php +25 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ms.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-nb.php +25 -0
- data/assets/php/phpmailer/language/phpmailer.lang-nl.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-pl.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-pt.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-pt_br.php +29 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ro.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-ru.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-sk.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-sl.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-sr.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-sv.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-tl.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-tr.php +30 -0
- data/assets/php/phpmailer/language/phpmailer.lang-uk.php +27 -0
- data/assets/php/phpmailer/language/phpmailer.lang-vi.php +26 -0
- data/assets/php/phpmailer/language/phpmailer.lang-zh.php +28 -0
- data/assets/php/phpmailer/language/phpmailer.lang-zh_cn.php +28 -0
- data/assets/php/phpmailer/src/Exception.php +39 -0
- data/assets/php/phpmailer/src/OAuth.php +138 -0
- data/assets/php/phpmailer/src/PHPMailer.php +4502 -0
- data/assets/php/phpmailer/src/POP3.php +419 -0
- data/assets/php/phpmailer/src/SMTP.php +1326 -0
- data/assets/videos/video-1.mp4 +0 -0
- data/assets/videos/video-2.mp4 +0 -0
- metadata +283 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Traditional Chinese PHPMailer language file: refer to English translation for definitive list
|
|
4
|
+
* @package PHPMailer
|
|
5
|
+
* @author liqwei <liqwei@liqwei.com>
|
|
6
|
+
* @author Peter Dave Hello <@PeterDaveHello/>
|
|
7
|
+
* @author Jason Chiang <xcojad@gmail.com>
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。';
|
|
11
|
+
$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。';
|
|
12
|
+
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。';
|
|
13
|
+
$PHPMAILER_LANG['empty_message'] = '郵件內容為空';
|
|
14
|
+
$PHPMAILER_LANG['encoding'] = '未知編碼: ';
|
|
15
|
+
$PHPMAILER_LANG['execute'] = '無法執行:';
|
|
16
|
+
$PHPMAILER_LANG['file_access'] = '無法存取檔案:';
|
|
17
|
+
$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:';
|
|
18
|
+
$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:';
|
|
19
|
+
$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。';
|
|
20
|
+
$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: ';
|
|
21
|
+
$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。';
|
|
22
|
+
$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。';
|
|
23
|
+
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:';
|
|
24
|
+
$PHPMAILER_LANG['signing'] = '電子簽章錯誤: ';
|
|
25
|
+
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗';
|
|
26
|
+
$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: ';
|
|
27
|
+
$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: ';
|
|
28
|
+
$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: ';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Simplified Chinese PHPMailer language file: refer to English translation for definitive list
|
|
4
|
+
* @package PHPMailer
|
|
5
|
+
* @author liqwei <liqwei@liqwei.com>
|
|
6
|
+
* @author young <masxy@foxmail.com>
|
|
7
|
+
* @author Teddysun <i@teddysun.com>
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
|
|
11
|
+
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
|
|
12
|
+
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
|
|
13
|
+
$PHPMAILER_LANG['empty_message'] = '邮件正文为空。';
|
|
14
|
+
$PHPMAILER_LANG['encoding'] = '未知编码:';
|
|
15
|
+
$PHPMAILER_LANG['execute'] = '无法执行:';
|
|
16
|
+
$PHPMAILER_LANG['file_access'] = '无法访问文件:';
|
|
17
|
+
$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
|
|
18
|
+
$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
|
|
19
|
+
$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
|
|
20
|
+
$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:';
|
|
21
|
+
$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
|
|
22
|
+
$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
|
|
23
|
+
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
|
|
24
|
+
$PHPMAILER_LANG['signing'] = '登录失败:';
|
|
25
|
+
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。';
|
|
26
|
+
$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:';
|
|
27
|
+
$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';
|
|
28
|
+
$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* PHPMailer Exception class.
|
|
4
|
+
* PHP Version 5.5.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
|
7
|
+
*
|
|
8
|
+
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
|
9
|
+
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
|
10
|
+
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
|
11
|
+
* @author Brent R. Matzelle (original founder)
|
|
12
|
+
* @copyright 2012 - 2017 Marcus Bointon
|
|
13
|
+
* @copyright 2010 - 2012 Jim Jagielski
|
|
14
|
+
* @copyright 2004 - 2009 Andy Prevost
|
|
15
|
+
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
|
16
|
+
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
|
17
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
namespace PHPMailer\PHPMailer;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* PHPMailer exception handler.
|
|
25
|
+
*
|
|
26
|
+
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
|
27
|
+
*/
|
|
28
|
+
class Exception extends \Exception
|
|
29
|
+
{
|
|
30
|
+
/**
|
|
31
|
+
* Prettify error message output.
|
|
32
|
+
*
|
|
33
|
+
* @return string
|
|
34
|
+
*/
|
|
35
|
+
public function errorMessage()
|
|
36
|
+
{
|
|
37
|
+
return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* PHPMailer - PHP email creation and transport class.
|
|
4
|
+
* PHP Version 5.5.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
|
7
|
+
*
|
|
8
|
+
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
|
9
|
+
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
|
10
|
+
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
|
11
|
+
* @author Brent R. Matzelle (original founder)
|
|
12
|
+
* @copyright 2012 - 2015 Marcus Bointon
|
|
13
|
+
* @copyright 2010 - 2012 Jim Jagielski
|
|
14
|
+
* @copyright 2004 - 2009 Andy Prevost
|
|
15
|
+
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
|
16
|
+
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
|
17
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
namespace PHPMailer\PHPMailer;
|
|
22
|
+
|
|
23
|
+
use League\OAuth2\Client\Grant\RefreshToken;
|
|
24
|
+
use League\OAuth2\Client\Provider\AbstractProvider;
|
|
25
|
+
use League\OAuth2\Client\Token\AccessToken;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* OAuth - OAuth2 authentication wrapper class.
|
|
29
|
+
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
|
30
|
+
*
|
|
31
|
+
* @see http://oauth2-client.thephpleague.com
|
|
32
|
+
*
|
|
33
|
+
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
|
34
|
+
*/
|
|
35
|
+
class OAuth
|
|
36
|
+
{
|
|
37
|
+
/**
|
|
38
|
+
* An instance of the League OAuth Client Provider.
|
|
39
|
+
*
|
|
40
|
+
* @var AbstractProvider
|
|
41
|
+
*/
|
|
42
|
+
protected $provider;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The current OAuth access token.
|
|
46
|
+
*
|
|
47
|
+
* @var AccessToken
|
|
48
|
+
*/
|
|
49
|
+
protected $oauthToken;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The user's email address, usually used as the login ID
|
|
53
|
+
* and also the from address when sending email.
|
|
54
|
+
*
|
|
55
|
+
* @var string
|
|
56
|
+
*/
|
|
57
|
+
protected $oauthUserEmail = '';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The client secret, generated in the app definition of the service you're connecting to.
|
|
61
|
+
*
|
|
62
|
+
* @var string
|
|
63
|
+
*/
|
|
64
|
+
protected $oauthClientSecret = '';
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The client ID, generated in the app definition of the service you're connecting to.
|
|
68
|
+
*
|
|
69
|
+
* @var string
|
|
70
|
+
*/
|
|
71
|
+
protected $oauthClientId = '';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The refresh token, used to obtain new AccessTokens.
|
|
75
|
+
*
|
|
76
|
+
* @var string
|
|
77
|
+
*/
|
|
78
|
+
protected $oauthRefreshToken = '';
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* OAuth constructor.
|
|
82
|
+
*
|
|
83
|
+
* @param array $options Associative array containing
|
|
84
|
+
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
|
|
85
|
+
*/
|
|
86
|
+
public function __construct($options)
|
|
87
|
+
{
|
|
88
|
+
$this->provider = $options['provider'];
|
|
89
|
+
$this->oauthUserEmail = $options['userName'];
|
|
90
|
+
$this->oauthClientSecret = $options['clientSecret'];
|
|
91
|
+
$this->oauthClientId = $options['clientId'];
|
|
92
|
+
$this->oauthRefreshToken = $options['refreshToken'];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get a new RefreshToken.
|
|
97
|
+
*
|
|
98
|
+
* @return RefreshToken
|
|
99
|
+
*/
|
|
100
|
+
protected function getGrant()
|
|
101
|
+
{
|
|
102
|
+
return new RefreshToken();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get a new AccessToken.
|
|
107
|
+
*
|
|
108
|
+
* @return AccessToken
|
|
109
|
+
*/
|
|
110
|
+
protected function getToken()
|
|
111
|
+
{
|
|
112
|
+
return $this->provider->getAccessToken(
|
|
113
|
+
$this->getGrant(),
|
|
114
|
+
['refresh_token' => $this->oauthRefreshToken]
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generate a base64-encoded OAuth token.
|
|
120
|
+
*
|
|
121
|
+
* @return string
|
|
122
|
+
*/
|
|
123
|
+
public function getOauth64()
|
|
124
|
+
{
|
|
125
|
+
// Get a new token if it's not available or has expired
|
|
126
|
+
if (null === $this->oauthToken or $this->oauthToken->hasExpired()) {
|
|
127
|
+
$this->oauthToken = $this->getToken();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return base64_encode(
|
|
131
|
+
'user=' .
|
|
132
|
+
$this->oauthUserEmail .
|
|
133
|
+
"\001auth=Bearer " .
|
|
134
|
+
$this->oauthToken .
|
|
135
|
+
"\001\001"
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
}
|