@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | ], |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | - return array_map(function ($row) { |
|
| 29 | + return array_map(function($row) { |
|
| 30 | 30 | return (object) $row; |
| 31 | 31 | }, $paths); |
| 32 | 32 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ], |
| 49 | 49 | ]; |
| 50 | 50 | |
| 51 | - return array_map(function ($row) { |
|
| 51 | + return array_map(function($row) { |
|
| 52 | 52 | return (object) $row; |
| 53 | 53 | }, $paths); |
| 54 | 54 | } |
@@ -5,56 +5,56 @@ |
||
| 5 | 5 | class PortfolioRouter extends Router |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - protected function get_redirect_array() |
|
| 9 | - { |
|
| 10 | - $paths = [ |
|
| 11 | - [ |
|
| 12 | - 'pattern' => '@/index.(html|htm|php)$@', |
|
| 13 | - 'replace' => '/', |
|
| 14 | - ], |
|
| 15 | - [ |
|
| 16 | - 'pattern' => '@^/print(/?)$@', |
|
| 17 | - 'replace' => '/projects/', |
|
| 18 | - ], |
|
| 19 | - [ |
|
| 20 | - 'pattern' => '@^/web(/?)$@', |
|
| 21 | - 'replace' => '/projects/', |
|
| 22 | - ], |
|
| 23 | - [ |
|
| 24 | - 'pattern' => '@^/(web|print)/([a-z0-9-]+)(/?)$@', |
|
| 25 | - 'replace' => '/projects/', |
|
| 26 | - ], |
|
| 27 | - ]; |
|
| 8 | + protected function get_redirect_array() |
|
| 9 | + { |
|
| 10 | + $paths = [ |
|
| 11 | + [ |
|
| 12 | + 'pattern' => '@/index.(html|htm|php)$@', |
|
| 13 | + 'replace' => '/', |
|
| 14 | + ], |
|
| 15 | + [ |
|
| 16 | + 'pattern' => '@^/print(/?)$@', |
|
| 17 | + 'replace' => '/projects/', |
|
| 18 | + ], |
|
| 19 | + [ |
|
| 20 | + 'pattern' => '@^/web(/?)$@', |
|
| 21 | + 'replace' => '/projects/', |
|
| 22 | + ], |
|
| 23 | + [ |
|
| 24 | + 'pattern' => '@^/(web|print)/([a-z0-9-]+)(/?)$@', |
|
| 25 | + 'replace' => '/projects/', |
|
| 26 | + ], |
|
| 27 | + ]; |
|
| 28 | 28 | |
| 29 | - return array_map(function ($row) { |
|
| 30 | - return (object) $row; |
|
| 31 | - }, $paths); |
|
| 32 | - } |
|
| 29 | + return array_map(function ($row) { |
|
| 30 | + return (object) $row; |
|
| 31 | + }, $paths); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - protected function get_direct_array() |
|
| 35 | - { |
|
| 36 | - $paths = [ |
|
| 37 | - [ |
|
| 38 | - 'match' => '/', |
|
| 39 | - 'controller' => 'AboutController', |
|
| 40 | - ], |
|
| 41 | - [ |
|
| 42 | - 'match' => '/contact/', |
|
| 43 | - 'controller' => 'ContactController', |
|
| 44 | - ], |
|
| 45 | - [ |
|
| 46 | - 'match' => '/projects/', |
|
| 47 | - 'controller' => 'ProjectsController', |
|
| 48 | - ], |
|
| 49 | - [ |
|
| 50 | - 'match' => '/resume/', |
|
| 51 | - 'controller' => 'ResumeController', |
|
| 52 | - ], |
|
| 53 | - ]; |
|
| 34 | + protected function get_direct_array() |
|
| 35 | + { |
|
| 36 | + $paths = [ |
|
| 37 | + [ |
|
| 38 | + 'match' => '/', |
|
| 39 | + 'controller' => 'AboutController', |
|
| 40 | + ], |
|
| 41 | + [ |
|
| 42 | + 'match' => '/contact/', |
|
| 43 | + 'controller' => 'ContactController', |
|
| 44 | + ], |
|
| 45 | + [ |
|
| 46 | + 'match' => '/projects/', |
|
| 47 | + 'controller' => 'ProjectsController', |
|
| 48 | + ], |
|
| 49 | + [ |
|
| 50 | + 'match' => '/resume/', |
|
| 51 | + 'controller' => 'ResumeController', |
|
| 52 | + ], |
|
| 53 | + ]; |
|
| 54 | 54 | |
| 55 | - return array_map(function ($row) { |
|
| 56 | - return (object) $row; |
|
| 57 | - }, $paths); |
|
| 58 | - } |
|
| 55 | + return array_map(function ($row) { |
|
| 56 | + return (object) $row; |
|
| 57 | + }, $paths); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | 60 | } |
@@ -5,92 +5,92 @@ |
||
| 5 | 5 | class ContactController extends DefaultPageController |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - protected function set_head_data() |
|
| 9 | - { |
|
| 10 | - $this->set_title("Contact Page | Jacob Emerick's Portfolio"); |
|
| 11 | - $this->set_description("Contact page for Jacob Emerick's Portfolio"); |
|
| 12 | - $this->set_keywords([ |
|
| 13 | - 'portfolio', |
|
| 14 | - 'programming portfolio', |
|
| 15 | - 'contact', |
|
| 16 | - 'Jacob Emerick', |
|
| 17 | - 'information', |
|
| 18 | - 'freelance', |
|
| 19 | - ]); |
|
| 20 | - } |
|
| 8 | + protected function set_head_data() |
|
| 9 | + { |
|
| 10 | + $this->set_title("Contact Page | Jacob Emerick's Portfolio"); |
|
| 11 | + $this->set_description("Contact page for Jacob Emerick's Portfolio"); |
|
| 12 | + $this->set_keywords([ |
|
| 13 | + 'portfolio', |
|
| 14 | + 'programming portfolio', |
|
| 15 | + 'contact', |
|
| 16 | + 'Jacob Emerick', |
|
| 17 | + 'information', |
|
| 18 | + 'freelance', |
|
| 19 | + ]); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - protected function set_body_data() |
|
| 23 | - { |
|
| 24 | - $this->set_body('body_view', 'Contact'); |
|
| 22 | + protected function set_body_data() |
|
| 23 | + { |
|
| 24 | + $this->set_body('body_view', 'Contact'); |
|
| 25 | 25 | |
| 26 | - $body_data = []; |
|
| 27 | - if (!empty($_POST)) { |
|
| 28 | - $body_data = $this->process_form_data(); |
|
| 29 | - } |
|
| 30 | - $body_data['domain_container'] = $this->get_domain_container(); |
|
| 31 | - $this->set_body('body_data', $body_data); |
|
| 26 | + $body_data = []; |
|
| 27 | + if (!empty($_POST)) { |
|
| 28 | + $body_data = $this->process_form_data(); |
|
| 29 | + } |
|
| 30 | + $body_data['domain_container'] = $this->get_domain_container(); |
|
| 31 | + $this->set_body('body_data', $body_data); |
|
| 32 | 32 | |
| 33 | - parent::set_body_data(); |
|
| 34 | - } |
|
| 33 | + parent::set_body_data(); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - private function process_form_data() |
|
| 37 | - { |
|
| 38 | - $errors = []; |
|
| 36 | + private function process_form_data() |
|
| 37 | + { |
|
| 38 | + $errors = []; |
|
| 39 | 39 | |
| 40 | - if ( |
|
| 41 | - empty($_POST['name']) || |
|
| 42 | - !is_string($_POST['name']) || |
|
| 43 | - strlen($_POST['name']) > 100 |
|
| 44 | - ) { |
|
| 45 | - $errors['name'] = 'Please enter a valid name.'; |
|
| 46 | - } |
|
| 40 | + if ( |
|
| 41 | + empty($_POST['name']) || |
|
| 42 | + !is_string($_POST['name']) || |
|
| 43 | + strlen($_POST['name']) > 100 |
|
| 44 | + ) { |
|
| 45 | + $errors['name'] = 'Please enter a valid name.'; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { |
|
| 49 | - $errors['email'] = 'Please enter a valid email.'; |
|
| 50 | - } |
|
| 48 | + if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { |
|
| 49 | + $errors['email'] = 'Please enter a valid email.'; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - if ( |
|
| 53 | - empty($_POST['message']) || |
|
| 54 | - !is_string($_POST['message']) || |
|
| 55 | - strlen($_POST['message']) > 10000 |
|
| 56 | - ) { |
|
| 57 | - $errors['message'] = 'Please enter a valid message.'; |
|
| 58 | - } |
|
| 52 | + if ( |
|
| 53 | + empty($_POST['message']) || |
|
| 54 | + !is_string($_POST['message']) || |
|
| 55 | + strlen($_POST['message']) > 10000 |
|
| 56 | + ) { |
|
| 57 | + $errors['message'] = 'Please enter a valid message.'; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - if (!empty($errors)) { |
|
| 61 | - $values = $_POST; |
|
| 62 | - $values = array_intersect_key($values, array_flip([ |
|
| 63 | - 'name', |
|
| 64 | - 'email', |
|
| 65 | - 'message', |
|
| 66 | - ])); |
|
| 60 | + if (!empty($errors)) { |
|
| 61 | + $values = $_POST; |
|
| 62 | + $values = array_intersect_key($values, array_flip([ |
|
| 63 | + 'name', |
|
| 64 | + 'email', |
|
| 65 | + 'message', |
|
| 66 | + ])); |
|
| 67 | 67 | |
| 68 | - return [ |
|
| 69 | - 'errors' => $errors, |
|
| 70 | - 'values' => $values, |
|
| 71 | - ]; |
|
| 72 | - } |
|
| 68 | + return [ |
|
| 69 | + 'errors' => $errors, |
|
| 70 | + 'values' => $values, |
|
| 71 | + ]; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - $message = [ |
|
| 75 | - "Name: {$_POST['name']}", |
|
| 76 | - "Email: {$_POST['email']}", |
|
| 77 | - '', |
|
| 78 | - 'Message:', |
|
| 79 | - $_POST['message'], |
|
| 80 | - ]; |
|
| 81 | - $message = implode("\n", $message); |
|
| 74 | + $message = [ |
|
| 75 | + "Name: {$_POST['name']}", |
|
| 76 | + "Email: {$_POST['email']}", |
|
| 77 | + '', |
|
| 78 | + 'Message:', |
|
| 79 | + $_POST['message'], |
|
| 80 | + ]; |
|
| 81 | + $message = implode("\n", $message); |
|
| 82 | 82 | |
| 83 | - global $container; |
|
| 84 | - $container['mail'] |
|
| 85 | - ->addTo($container['config']->admin_email) |
|
| 86 | - ->setSubject('Portfolio Contact') |
|
| 87 | - ->setPlainMessage($message) |
|
| 88 | - ->send(); |
|
| 83 | + global $container; |
|
| 84 | + $container['mail'] |
|
| 85 | + ->addTo($container['config']->admin_email) |
|
| 86 | + ->setSubject('Portfolio Contact') |
|
| 87 | + ->setPlainMessage($message) |
|
| 88 | + ->send(); |
|
| 89 | 89 | |
| 90 | - return [ |
|
| 91 | - 'success' => |
|
| 92 | - "Thank you for your message, {$_POST['name']}! " . |
|
| 93 | - "I'll get back to you as soon as possible." |
|
| 94 | - ]; |
|
| 95 | - } |
|
| 90 | + return [ |
|
| 91 | + 'success' => |
|
| 92 | + "Thank you for your message, {$_POST['name']}! " . |
|
| 93 | + "I'll get back to you as soon as possible." |
|
| 94 | + ]; |
|
| 95 | + } |
|
| 96 | 96 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | return [ |
| 91 | 91 | 'success' => |
| 92 | - "Thank you for your message, {$_POST['name']}! " . |
|
| 92 | + "Thank you for your message, {$_POST['name']}! ". |
|
| 93 | 93 | "I'll get back to you as soon as possible." |
| 94 | 94 | ]; |
| 95 | 95 | } |
@@ -5,26 +5,26 @@ |
||
| 5 | 5 | class AboutController extends DefaultPageController |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - protected function set_head_data() |
|
| 9 | - { |
|
| 10 | - $this->set_title("Jacob Emerick's Portfolio"); |
|
| 11 | - $this->set_description("Jacob Emerick's Portfolio - collection of programming projects and resume"); |
|
| 12 | - $this->set_keywords([ |
|
| 13 | - 'portfolio', |
|
| 14 | - 'Jacob Emerick', |
|
| 15 | - 'web development', |
|
| 16 | - 'web programming', |
|
| 17 | - 'software development', |
|
| 18 | - 'agile', |
|
| 19 | - 'freelance', |
|
| 20 | - ]); |
|
| 21 | - } |
|
| 8 | + protected function set_head_data() |
|
| 9 | + { |
|
| 10 | + $this->set_title("Jacob Emerick's Portfolio"); |
|
| 11 | + $this->set_description("Jacob Emerick's Portfolio - collection of programming projects and resume"); |
|
| 12 | + $this->set_keywords([ |
|
| 13 | + 'portfolio', |
|
| 14 | + 'Jacob Emerick', |
|
| 15 | + 'web development', |
|
| 16 | + 'web programming', |
|
| 17 | + 'software development', |
|
| 18 | + 'agile', |
|
| 19 | + 'freelance', |
|
| 20 | + ]); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - protected function set_body_data() |
|
| 24 | - { |
|
| 25 | - $this->set_body('body_view', 'About'); |
|
| 26 | - $this->set_body('body_data', []); |
|
| 23 | + protected function set_body_data() |
|
| 24 | + { |
|
| 25 | + $this->set_body('body_view', 'About'); |
|
| 26 | + $this->set_body('body_data', []); |
|
| 27 | 27 | |
| 28 | - parent::set_body_data(); |
|
| 29 | - } |
|
| 28 | + parent::set_body_data(); |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -5,31 +5,31 @@ |
||
| 5 | 5 | class ResumeController extends DefaultPageController |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - protected $resume = 'resume-20160318.json'; |
|
| 8 | + protected $resume = 'resume-20160318.json'; |
|
| 9 | 9 | |
| 10 | - protected function set_head_data() |
|
| 11 | - { |
|
| 12 | - $this->set_title("Resume | Jacob Emerick's Portfolio"); |
|
| 13 | - $this->set_description("Resume for Jacob Emerick, a software engineer extraordinaire"); |
|
| 14 | - $this->set_keywords([ |
|
| 15 | - 'resume', |
|
| 16 | - 'programming resume', |
|
| 17 | - 'Jacob Emerick', |
|
| 18 | - 'software engineer', |
|
| 19 | - 'portfolio', |
|
| 20 | - 'shutterstock', |
|
| 21 | - ]); |
|
| 22 | - } |
|
| 10 | + protected function set_head_data() |
|
| 11 | + { |
|
| 12 | + $this->set_title("Resume | Jacob Emerick's Portfolio"); |
|
| 13 | + $this->set_description("Resume for Jacob Emerick, a software engineer extraordinaire"); |
|
| 14 | + $this->set_keywords([ |
|
| 15 | + 'resume', |
|
| 16 | + 'programming resume', |
|
| 17 | + 'Jacob Emerick', |
|
| 18 | + 'software engineer', |
|
| 19 | + 'portfolio', |
|
| 20 | + 'shutterstock', |
|
| 21 | + ]); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - protected function set_body_data() |
|
| 25 | - { |
|
| 26 | - $this->set_body('body_view', 'Resume'); |
|
| 24 | + protected function set_body_data() |
|
| 25 | + { |
|
| 26 | + $this->set_body('body_view', 'Resume'); |
|
| 27 | 27 | |
| 28 | - $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}"; |
|
| 29 | - $resume = file_get_contents($resumePath); |
|
| 30 | - $resume = json_decode($resume, true); |
|
| 31 | - $this->set_body('body_data', $resume); |
|
| 28 | + $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}"; |
|
| 29 | + $resume = file_get_contents($resumePath); |
|
| 30 | + $resume = json_decode($resume, true); |
|
| 31 | + $this->set_body('body_data', $resume); |
|
| 32 | 32 | |
| 33 | - parent::set_body_data(); |
|
| 34 | - } |
|
| 33 | + parent::set_body_data(); |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $this->set_body('body_view', 'Resume'); |
| 27 | 27 | |
| 28 | - $resumePath = Loader::getRootURL('portfolio') . "/jsonresume/{$this->resume}"; |
|
| 28 | + $resumePath = Loader::getRootURL('portfolio')."/jsonresume/{$this->resume}"; |
|
| 29 | 29 | $resume = file_get_contents($resumePath); |
| 30 | 30 | $resume = json_decode($resume, true); |
| 31 | 31 | $this->set_body('body_data', $resume); |
@@ -5,25 +5,25 @@ |
||
| 5 | 5 | class ProjectsController extends DefaultPageController |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - protected function set_head_data() |
|
| 9 | - { |
|
| 10 | - $this->set_title("Projects Page | Jacob Emerick's Portfolio"); |
|
| 11 | - $this->set_description("Collection of key open-source projects that Jacob has developed and maintained over the years."); |
|
| 12 | - $this->set_keywords([ |
|
| 13 | - 'projects', |
|
| 14 | - 'open source', |
|
| 15 | - 'example work', |
|
| 16 | - 'portfolio', |
|
| 17 | - 'Jacob Emerick', |
|
| 18 | - 'software development', |
|
| 19 | - ]); |
|
| 20 | - } |
|
| 8 | + protected function set_head_data() |
|
| 9 | + { |
|
| 10 | + $this->set_title("Projects Page | Jacob Emerick's Portfolio"); |
|
| 11 | + $this->set_description("Collection of key open-source projects that Jacob has developed and maintained over the years."); |
|
| 12 | + $this->set_keywords([ |
|
| 13 | + 'projects', |
|
| 14 | + 'open source', |
|
| 15 | + 'example work', |
|
| 16 | + 'portfolio', |
|
| 17 | + 'Jacob Emerick', |
|
| 18 | + 'software development', |
|
| 19 | + ]); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - protected function set_body_data() |
|
| 23 | - { |
|
| 24 | - $this->set_body('body_view', 'Projects'); |
|
| 25 | - $this->set_body('body_data', []); |
|
| 22 | + protected function set_body_data() |
|
| 23 | + { |
|
| 24 | + $this->set_body('body_view', 'Projects'); |
|
| 25 | + $this->set_body('body_data', []); |
|
| 26 | 26 | |
| 27 | - parent::set_body_data(); |
|
| 28 | - } |
|
| 27 | + parent::set_body_data(); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $namespace = 'portfolio'; |
| 4 | -require_once __DIR__ . '/../../bootstrap.php'; |
|
| 4 | +require_once __DIR__.'/../../bootstrap.php'; |
|
| 5 | 5 | |
| 6 | 6 | // route |
| 7 | 7 | Loader::loadInstance('router', 'Router'); |
@@ -3,4 +3,4 @@ |
||
| 3 | 3 | error_reporting(E_ALL); |
| 4 | 4 | date_default_timezone_set('America/Chicago'); |
| 5 | 5 | |
| 6 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 6 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $meta_array = array(); |
| 34 | 34 | |
| 35 | - $meta_array['title'] = self::$PRIMARY_TITLE . ' | ' . self::$WEBSITE_TITLE; |
|
| 35 | + $meta_array['title'] = self::$PRIMARY_TITLE.' | '.self::$WEBSITE_TITLE; |
|
| 36 | 36 | $meta_array['description'] = self::$PRIMARY_DESCRIPTION; |
| 37 | 37 | $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
| 38 | 38 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $meta_array = array(); |
| 45 | 45 | |
| 46 | - $meta_array['title'] = sprintf(self::$SECONDARY_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->page, $this->page_count); |
|
| 46 | + $meta_array['title'] = sprintf(self::$SECONDARY_TITLE.' | '.self::$WEBSITE_TITLE, $this->page, $this->page_count); |
|
| 47 | 47 | $meta_array['description'] = sprintf(self::$SECONDARY_DESCRIPTION, $this->page, $this->page_count); |
| 48 | 48 | $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
| 49 | 49 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $meta_array = array(); |
| 34 | 34 | |
| 35 | - $meta_array['title'] = self::$PRIMARY_TITLE . ' | ' . self::$WEBSITE_TITLE; |
|
| 35 | + $meta_array['title'] = self::$PRIMARY_TITLE.' | '.self::$WEBSITE_TITLE; |
|
| 36 | 36 | $meta_array['description'] = self::$PRIMARY_DESCRIPTION; |
| 37 | 37 | $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
| 38 | 38 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $meta_array = array(); |
| 45 | 45 | |
| 46 | - $meta_array['title'] = sprintf(self::$SECONDARY_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->page); |
|
| 46 | + $meta_array['title'] = sprintf(self::$SECONDARY_TITLE.' | '.self::$WEBSITE_TITLE, $this->page); |
|
| 47 | 47 | $meta_array['description'] = sprintf(self::$SECONDARY_DESCRIPTION, $this->page, $this->page_count); |
| 48 | 48 | $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
| 49 | 49 | |