From 8e8ec29ef6585edccc67db14c1f09821fecb9133 Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Sat, 6 Feb 2016 23:53:01 +0700 Subject: [PATCH 01/40] Update dependencies Signed-off-by: Fery Wardiyanto --- composer.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 378777f..1df4402 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b6ee37170c7cc0c21d614570ad3247e9", + "hash": "91b5e85c6a90d1454b510bdd3d779f30", "content-hash": "e05258b632615e4c1305dd6f2a134356", "packages": [ { @@ -13,12 +13,12 @@ "source": { "type": "git", "url": "https://github.com/cloudinary/cloudinary_php.git", - "reference": "c9ddafd4c33d5f9980f2b21409c999009c91f17f" + "reference": "3d82f544d6fd8e4135ab9712093840d20cec5bac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/c9ddafd4c33d5f9980f2b21409c999009c91f17f", - "reference": "c9ddafd4c33d5f9980f2b21409c999009c91f17f", + "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/3d82f544d6fd8e4135ab9712093840d20cec5bac", + "reference": "3d82f544d6fd8e4135ab9712093840d20cec5bac", "shasum": "" }, "require": { @@ -57,7 +57,7 @@ "image management", "sdk" ], - "time": "2016-01-07 14:34:23" + "time": "2016-01-28 13:48:02" }, { "name": "container-interop/container-interop", @@ -423,16 +423,16 @@ }, { "name": "slim/pdo", - "version": "1.9.5", + "version": "1.9.6", "source": { "type": "git", "url": "https://github.com/FaaPz/Slim-PDO.git", - "reference": "b1b4579a83e4a8b1dd762aa0c8803f55cf4f5593" + "reference": "8dc5d55a84b3824e508f611b23b329ac1ec5d0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FaaPz/Slim-PDO/zipball/b1b4579a83e4a8b1dd762aa0c8803f55cf4f5593", - "reference": "b1b4579a83e4a8b1dd762aa0c8803f55cf4f5593", + "url": "https://api.github.com/repos/FaaPz/Slim-PDO/zipball/8dc5d55a84b3824e508f611b23b329ac1ec5d0b2", + "reference": "8dc5d55a84b3824e508f611b23b329ac1ec5d0b2", "shasum": "" }, "require": { @@ -465,7 +465,7 @@ "pdo", "slim" ], - "time": "2016-01-22 23:14:59" + "time": "2016-02-03 19:02:05" }, { "name": "slim/slim", From 087b6774a330a931f8f12c228b57798795d98911 Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Thu, 27 Apr 2017 07:59:48 +0700 Subject: [PATCH 02/40] Update dependencies Signed-off-by: Fery Wardiyanto --- composer.lock | 207 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 136 insertions(+), 71 deletions(-) diff --git a/composer.lock b/composer.lock index 1df4402..5adf708 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,6 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "91b5e85c6a90d1454b510bdd3d779f30", "content-hash": "e05258b632615e4c1305dd6f2a134356", "packages": [ { @@ -13,12 +12,12 @@ "source": { "type": "git", "url": "https://github.com/cloudinary/cloudinary_php.git", - "reference": "3d82f544d6fd8e4135ab9712093840d20cec5bac" + "reference": "330b6b3f6fcb093a4f2345d5974a849e5f12e569" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/3d82f544d6fd8e4135ab9712093840d20cec5bac", - "reference": "3d82f544d6fd8e4135ab9712093840d20cec5bac", + "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/330b6b3f6fcb093a4f2345d5974a849e5f12e569", + "reference": "330b6b3f6fcb093a4f2345d5974a849e5f12e569", "shasum": "" }, "require": { @@ -27,7 +26,7 @@ "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "4.7.*" + "phpunit/phpunit": "5.7.*" }, "type": "library", "autoload": { @@ -57,22 +56,25 @@ "image management", "sdk" ], - "time": "2016-01-28 13:48:02" + "time": "2017-04-03 08:28:38" }, { "name": "container-interop/container-interop", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/container-interop/container-interop.git", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e" + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/container-interop/container-interop/zipball/fc08354828f8fd3245f77a66b9e23a6bca48297e", - "reference": "fc08354828f8fd3245f77a66b9e23a6bca48297e", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", "shasum": "" }, + "require": { + "psr/container": "^1.0" + }, "type": "library", "autoload": { "psr-4": { @@ -84,27 +86,28 @@ "MIT" ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", - "time": "2014-12-30 15:22:37" + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+00:00" }, { "name": "google/recaptcha", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/google/recaptcha.git", - "reference": "2b7e00566afca82a38a1d3adb8e42c118006296e" + "reference": "5a56d15ca10a7b75158178752b2ad8f755eb4f78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/google/recaptcha/zipball/2b7e00566afca82a38a1d3adb8e42c118006296e", - "reference": "2b7e00566afca82a38a1d3adb8e42c118006296e", + "url": "https://api.github.com/repos/google/recaptcha/zipball/5a56d15ca10a7b75158178752b2ad8f755eb4f78", + "reference": "5a56d15ca10a7b75158178752b2ad8f755eb4f78", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "4.5.*" + "phpunit/phpunit": "^4.8" }, "type": "library", "extra": { @@ -129,24 +132,27 @@ "recaptcha", "spam" ], - "time": "2015-09-02 17:23:59" + "time": "2017-03-09T18:44:34+00:00" }, { "name": "league/plates", - "version": "3.1.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/thephpleague/plates.git", - "reference": "2d8569e9f140a70d6a05db38006926f7547cb802" + "reference": "b1684b6f127714497a0ef927ce42c0b44b45a8af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/plates/zipball/2d8569e9f140a70d6a05db38006926f7547cb802", - "reference": "2d8569e9f140a70d6a05db38006926f7547cb802", + "url": "https://api.github.com/repos/thephpleague/plates/zipball/b1684b6f127714497a0ef927ce42c0b44b45a8af", + "reference": "b1684b6f127714497a0ef927ce42c0b44b45a8af", "shasum": "" }, + "require": { + "php": "^5.3 | ^7.0" + }, "require-dev": { - "mikey179/vfsstream": "~1.4.0", + "mikey179/vfsstream": "^1.4", "phpunit/phpunit": "~4.0", "squizlabs/php_codesniffer": "~1.5" }, @@ -181,20 +187,20 @@ "templating", "views" ], - "time": "2015-07-09 02:14:40" + "time": "2016-12-28T00:14:17+00:00" }, { "name": "nikic/fast-route", - "version": "v0.6.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/nikic/FastRoute.git", - "reference": "31fa86924556b80735f98b294a7ffdfb26789f22" + "reference": "b5f95749071c82a8e0f58586987627054400cdf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/31fa86924556b80735f98b294a7ffdfb26789f22", - "reference": "31fa86924556b80735f98b294a7ffdfb26789f22", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/b5f95749071c82a8e0f58586987627054400cdf6", + "reference": "b5f95749071c82a8e0f58586987627054400cdf6", "shasum": "" }, "require": { @@ -224,7 +230,7 @@ "router", "routing" ], - "time": "2015-06-18 19:15:47" + "time": "2017-01-19T11:35:12+00:00" }, { "name": "pimple/pimple", @@ -270,29 +276,30 @@ "container", "dependency injection" ], - "time": "2015-09-11 15:10:35" + "time": "2015-09-11T15:10:35+00:00" }, { "name": "projek-xyz/slim-plates", - "version": "v0.2.1", + "version": "v0.2.2", "source": { "type": "git", "url": "https://github.com/projek-xyz/slim-plates.git", - "reference": "6b6d22ad0e35e6cd9e0d66f744f278f59acd5ac4" + "reference": "b1d51dedcdc0b0b4e67ba48c45ddc74747914ad9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/projek-xyz/slim-plates/zipball/6b6d22ad0e35e6cd9e0d66f744f278f59acd5ac4", - "reference": "6b6d22ad0e35e6cd9e0d66f744f278f59acd5ac4", + "url": "https://api.github.com/repos/projek-xyz/slim-plates/zipball/b1d51dedcdc0b0b4e67ba48c45ddc74747914ad9", + "reference": "b1d51dedcdc0b0b4e67ba48c45ddc74747914ad9", "shasum": "" }, "require": { - "league/plates": "~3.1.0", + "league/plates": "~3.1", "php": ">=5.5.0", "slim/slim": "~3.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.7" }, "type": "library", "extra": { @@ -325,20 +332,69 @@ "template", "view" ], - "time": "2016-01-25 09:25:36" + "time": "2016-10-09T23:22:07+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/http-message", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -366,6 +422,7 @@ } ], "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", @@ -374,25 +431,28 @@ "request", "response" ], - "time": "2015-05-04 20:22:00" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "slim/flash", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim-Flash.git", - "reference": "1995ed53b77b8eeb67adf032de93c319f76aa5cd" + "reference": "3c9a26b3163820acc48080336c504d0a3cac6f30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Flash/zipball/1995ed53b77b8eeb67adf032de93c319f76aa5cd", - "reference": "1995ed53b77b8eeb67adf032de93c319f76aa5cd", + "url": "https://api.github.com/repos/slimphp/Slim-Flash/zipball/3c9a26b3163820acc48080336c504d0a3cac6f30", + "reference": "3c9a26b3163820acc48080336c504d0a3cac6f30", "shasum": "" }, "require": { "php": ">=5.5.0" }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, "type": "library", "autoload": { "psr-4": { @@ -419,20 +479,20 @@ "provider", "slim" ], - "time": "2015-08-16 22:49:06" + "time": "2016-11-11T16:29:19+00:00" }, { "name": "slim/pdo", - "version": "1.9.6", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/FaaPz/Slim-PDO.git", - "reference": "8dc5d55a84b3824e508f611b23b329ac1ec5d0b2" + "reference": "9424e6d5f3737a71722ab1f868c1d3090b63287d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FaaPz/Slim-PDO/zipball/8dc5d55a84b3824e508f611b23b329ac1ec5d0b2", - "reference": "8dc5d55a84b3824e508f611b23b329ac1ec5d0b2", + "url": "https://api.github.com/repos/FaaPz/Slim-PDO/zipball/9424e6d5f3737a71722ab1f868c1d3090b63287d", + "reference": "9424e6d5f3737a71722ab1f868c1d3090b63287d", "shasum": "" }, "require": { @@ -465,29 +525,33 @@ "pdo", "slim" ], - "time": "2016-02-03 19:02:05" + "time": "2016-08-14T11:42:49+00:00" }, { "name": "slim/slim", - "version": "3.1.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "03b44a4b41896ba42c78bbd5fa172cd79e650496" + "reference": "5385302707530b2bccee1769613ad769859b826d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/03b44a4b41896ba42c78bbd5fa172cd79e650496", - "reference": "03b44a4b41896ba42c78bbd5fa172cd79e650496", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/5385302707530b2bccee1769613ad769859b826d", + "reference": "5385302707530b2bccee1769613ad769859b826d", "shasum": "" }, "require": { - "container-interop/container-interop": "^1.1", - "nikic/fast-route": "^0.6", + "container-interop/container-interop": "^1.2", + "nikic/fast-route": "^1.0", "php": ">=5.5.0", "pimple/pimple": "^3.0", + "psr/container": "^1.0", "psr/http-message": "^1.0" }, + "provide": { + "psr/http-message-implementation": "1.0" + }, "require-dev": { "phpunit/phpunit": "^4.0", "squizlabs/php_codesniffer": "^2.5" @@ -525,34 +589,35 @@ } ], "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "http://slimframework.com", + "homepage": "https://slimframework.com", "keywords": [ "api", "framework", "micro", "router" ], - "time": "2016-01-08 15:37:50" + "time": "2017-03-19T17:55:20+00:00" }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.1", + "version": "v5.4.7", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" + "reference": "56db4ed32a6d5c9824c3ecc1d2e538f663f47eb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", - "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/56db4ed32a6d5c9824c3ecc1d2e538f663f47eb4", + "reference": "56db4ed32a6d5c9824c3ecc1d2e538f663f47eb4", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1,<0.9.4" + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { @@ -585,20 +650,20 @@ "mail", "mailer" ], - "time": "2015-06-06 14:19:39" + "time": "2017-04-20T17:32:18+00:00" }, { "name": "vlucas/valitron", - "version": "v1.2.4", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/vlucas/valitron.git", - "reference": "d2b63c611980bb804d17468bf0b3c8d4e28afbf5" + "reference": "b33c79116260637337187b7125f955ae26d306cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/valitron/zipball/d2b63c611980bb804d17468bf0b3c8d4e28afbf5", - "reference": "d2b63c611980bb804d17468bf0b3c8d4e28afbf5", + "url": "https://api.github.com/repos/vlucas/valitron/zipball/b33c79116260637337187b7125f955ae26d306cc", + "reference": "b33c79116260637337187b7125f955ae26d306cc", "shasum": "" }, "require": { @@ -631,7 +696,7 @@ "validation", "validator" ], - "time": "2015-12-15 20:10:29" + "time": "2017-02-23T08:31:59+00:00" } ], "packages-dev": [], From f2ce96a4c7dec0531fe65da7f3ec59ebfee7eebf Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Thu, 27 Apr 2017 08:03:07 +0700 Subject: [PATCH 03/40] Fix container docblock Signed-off-by: Fery Wardiyanto --- app/container.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/container.php b/app/container.php index 4233830..6795485 100644 --- a/app/container.php +++ b/app/container.php @@ -20,7 +20,7 @@ /** * Slim Container * - * @var \Slim\Container $container + * @var Container $container */ $container = new Container([ 'settings' => require $settingsFile @@ -56,6 +56,7 @@ /** * Setup data model container * + * @param Container $container * @return callable */ $container['data'] = function ($container) { @@ -84,6 +85,7 @@ /** * Setup validator container * + * @param Container $container * @return \Valitron\Validator */ $container['validator'] = function ($container) { @@ -126,6 +128,7 @@ /** * Setup view container * + * @param Container $container * @return \Projek\Slim\Plates */ $container['view'] = function ($container) { @@ -148,6 +151,7 @@ /** * Setup upload handler container * + * @param Container $container * @return callable */ $container['upload'] = function ($container) { @@ -202,6 +206,9 @@ * Setup mailer container * * TODO: will replaced with PHPMailer + * + * @param Container $container + * @return Swift_Mailer */ $container['mailer'] = function ($container) { $smtp_account = $container->get('settings')['smtp']; @@ -225,6 +232,7 @@ * * TODO: need more!!! * + * @param Container $container * @return callable */ $container['errorHandler'] = function ($container) { From c82a33427a0ea17b5085ed4e68b98ba976078753 Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Thu, 27 Apr 2017 09:19:11 +0700 Subject: [PATCH 04/40] Init refactory Signed-off-by: Fery Wardiyanto --- .gitignore | 2 +- app/{src => }/ContainerAware.php | 6 ++-- app/{src => }/Controllers.php | 0 .../Controllers/AccountController.php | 2 +- app/{src => }/Controllers/HomeController.php | 2 +- .../Controllers/PasswordController.php | 0 .../Controllers/PortfoliosController.php | 0 .../Controllers/RegionalsController.php | 2 +- .../Controllers/SkillsController.php | 0 app/{src => }/Libraries/Mailer.php | 0 app/{src => }/Libraries/PDO/Database.php | 0 .../Libraries/PDO/SelectStatement.php | 0 .../Libraries/PDO/StatementCombination.php | 0 app/{src => }/Libraries/PDO/WhereClause.php | 0 app/{src => }/Libraries/ViewExtension.php | 6 ++-- app/{src => }/Middleware.php | 0 app/{src => }/Models.php | 16 +++++------ app/{src => }/Models/Careers.php | 0 app/{src => }/Models/MemberPortfolios.php | 0 app/{src => }/Models/MemberProfile.php | 0 app/{src => }/Models/MemberSkills.php | 0 app/{src => }/Models/MemberSocmeds.php | 0 app/{src => }/Models/Regionals.php | 0 app/{src => }/Models/Religions.php | 0 app/{src => }/Models/Skills.php | 0 app/{src => }/Models/Users.php | 6 ++-- app/{src => }/Models/UsersActivations.php | 0 app/{src => }/Models/UsersResetPwd.php | 0 app/bootstrap.php | 21 -------------- app/{src => }/helpers.php | 3 +- composer.json | 4 +-- {app => resources}/container.php | 4 +-- .../database}/membership-schema.sql | 0 .../database}/membership-values.sql | 14 +++++----- {app => resources}/routes.php | 0 {app => resources}/settings.php.disable | 0 {app => resources}/views/account-edit.php | 0 {app => resources}/views/account-index.php | 0 .../views/account-javascript.php | 0 .../views/account-reactivate.php | 0 .../views/emails/activation.php | 0 .../views/emails/forgot-password.php | 0 .../views/emails/reset-password.php | 0 {app => resources}/views/errors/500.php | 0 {app => resources}/views/home-index.php | 0 {app => resources}/views/home-login.php | 0 {app => resources}/views/home-register.php | 0 {app => resources}/views/layouts/account.php | 0 {app => resources}/views/layouts/system.php | 0 {app => resources}/views/password-forgot.php | 0 {app => resources}/views/password-update.php | 0 {app => resources}/views/portfolio-add.php | 0 {app => resources}/views/portfolio-edit.php | 0 {app => resources}/views/profile-index.php | 0 {app => resources}/views/sections/alert.php | 0 {app => resources}/views/sections/captcha.php | 0 {app => resources}/views/sections/footer.php | 0 {app => resources}/views/sections/header.php | 0 .../views/sections/portfolio-form.php | 0 .../views/sections/skill-add.php | 0 {app => resources}/views/skills-add.php | 0 www/index.php | 28 ++++++++++++++----- www/js/jquery.inputmask.bundle.js | 4 +-- www/js/jquery.popupoverlay.js | 12 ++++---- www/js/portfolio.js | 4 +-- www/js/skill.js | 2 +- 66 files changed, 65 insertions(+), 73 deletions(-) rename app/{src => }/ContainerAware.php (93%) rename app/{src => }/Controllers.php (100%) rename app/{src => }/Controllers/AccountController.php (99%) rename app/{src => }/Controllers/HomeController.php (98%) rename app/{src => }/Controllers/PasswordController.php (100%) rename app/{src => }/Controllers/PortfoliosController.php (100%) rename app/{src => }/Controllers/RegionalsController.php (90%) rename app/{src => }/Controllers/SkillsController.php (100%) rename app/{src => }/Libraries/Mailer.php (100%) rename app/{src => }/Libraries/PDO/Database.php (100%) rename app/{src => }/Libraries/PDO/SelectStatement.php (100%) rename app/{src => }/Libraries/PDO/StatementCombination.php (100%) rename app/{src => }/Libraries/PDO/WhereClause.php (100%) rename app/{src => }/Libraries/ViewExtension.php (98%) rename app/{src => }/Middleware.php (100%) rename app/{src => }/Models.php (96%) rename app/{src => }/Models/Careers.php (100%) rename app/{src => }/Models/MemberPortfolios.php (100%) rename app/{src => }/Models/MemberProfile.php (100%) rename app/{src => }/Models/MemberSkills.php (100%) rename app/{src => }/Models/MemberSocmeds.php (100%) rename app/{src => }/Models/Regionals.php (100%) rename app/{src => }/Models/Religions.php (100%) rename app/{src => }/Models/Skills.php (100%) rename app/{src => }/Models/Users.php (99%) rename app/{src => }/Models/UsersActivations.php (100%) rename app/{src => }/Models/UsersResetPwd.php (100%) delete mode 100644 app/bootstrap.php rename app/{src => }/helpers.php (96%) rename {app => resources}/container.php (98%) rename {app/data => resources/database}/membership-schema.sql (100%) rename {app/data => resources/database}/membership-values.sql (98%) rename {app => resources}/routes.php (100%) rename {app => resources}/settings.php.disable (100%) rename {app => resources}/views/account-edit.php (100%) rename {app => resources}/views/account-index.php (100%) rename {app => resources}/views/account-javascript.php (100%) rename {app => resources}/views/account-reactivate.php (100%) rename {app => resources}/views/emails/activation.php (100%) rename {app => resources}/views/emails/forgot-password.php (100%) rename {app => resources}/views/emails/reset-password.php (100%) rename {app => resources}/views/errors/500.php (100%) rename {app => resources}/views/home-index.php (100%) rename {app => resources}/views/home-login.php (100%) rename {app => resources}/views/home-register.php (100%) rename {app => resources}/views/layouts/account.php (100%) rename {app => resources}/views/layouts/system.php (100%) rename {app => resources}/views/password-forgot.php (100%) rename {app => resources}/views/password-update.php (100%) rename {app => resources}/views/portfolio-add.php (100%) rename {app => resources}/views/portfolio-edit.php (100%) rename {app => resources}/views/profile-index.php (100%) rename {app => resources}/views/sections/alert.php (100%) rename {app => resources}/views/sections/captcha.php (100%) rename {app => resources}/views/sections/footer.php (100%) rename {app => resources}/views/sections/header.php (100%) rename {app => resources}/views/sections/portfolio-form.php (100%) rename {app => resources}/views/sections/skill-add.php (100%) rename {app => resources}/views/skills-add.php (100%) diff --git a/.gitignore b/.gitignore index 29ecb1b..e7f7d53 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ Icon? # Development files # -------------------------- -app/settings.php +resources/settings.php .env # Dependency folders diff --git a/app/src/ContainerAware.php b/app/ContainerAware.php similarity index 93% rename from app/src/ContainerAware.php rename to app/ContainerAware.php index 3ece7bf..27e1437 100644 --- a/app/src/ContainerAware.php +++ b/app/ContainerAware.php @@ -11,10 +11,10 @@ * @property-read \Valitron\Validator validator * @property-read \Projek\Slim\Plates view * @property-read \Membership\Libraries\Mailer mailer - * @property-read callable data + * @property-read callable database * @property-read callable upload - * @method Models data(string $class) - * @method string[] upload(\Psr\Http\Message\UploadedFileInterface $file, array $data) + * @method Models database(string $class) + * @method string[] upload(\Psr\Http\Message\UploadedFileInterface $file, array $database) */ trait ContainerAware { diff --git a/app/src/Controllers.php b/app/Controllers.php similarity index 100% rename from app/src/Controllers.php rename to app/Controllers.php diff --git a/app/src/Controllers/AccountController.php b/app/Controllers/AccountController.php similarity index 99% rename from app/src/Controllers/AccountController.php rename to app/Controllers/AccountController.php index fb157df..316e6a7 100644 --- a/app/src/Controllers/AccountController.php +++ b/app/Controllers/AccountController.php @@ -183,7 +183,7 @@ public function edit(Request $request, Response $response, array $args) $memberProfile = $this->upload($photo, $memberProfile); } - // Update profile data record + // Update profile database record $profile->update($memberProfile, ['user_id' => $userId]); $users->update([ diff --git a/app/src/Controllers/HomeController.php b/app/Controllers/HomeController.php similarity index 98% rename from app/src/Controllers/HomeController.php rename to app/Controllers/HomeController.php index 86c6a48..4d505fc 100644 --- a/app/src/Controllers/HomeController.php +++ b/app/Controllers/HomeController.php @@ -160,7 +160,7 @@ public function register(Request $request, Response $response, array $args) $emailAddress = $input['email']; $activationKey = md5(uniqid(rand(), true)); $activationExpiredDate = date('Y-m-d H:i:s', time() + 172800); // 48 jam - $registerSuccessMsg = 'Haayy '.$input['fullname'].',
Submission keanggotan sudah berhasil disimpan. Akan tetapi account anda tidak langsung aktif. Demi keamanan dan validitas data, maka sistem telah mengirimkan email ke email anda, untuk melakukan aktivasi account. Segera check email anda! Terimakasih ^_^'; + $registerSuccessMsg = 'Haayy '.$input['fullname'].',
Submission keanggotan sudah berhasil disimpan. Akan tetapi account anda tidak langsung aktif. Demi keamanan dan validitas database, maka sistem telah mengirimkan email ke email anda, untuk melakukan aktivasi account. Segera check email anda! Terimakasih ^_^'; try { $input['activation_key'] = $activationKey; diff --git a/app/src/Controllers/PasswordController.php b/app/Controllers/PasswordController.php similarity index 100% rename from app/src/Controllers/PasswordController.php rename to app/Controllers/PasswordController.php diff --git a/app/src/Controllers/PortfoliosController.php b/app/Controllers/PortfoliosController.php similarity index 100% rename from app/src/Controllers/PortfoliosController.php rename to app/Controllers/PortfoliosController.php diff --git a/app/src/Controllers/RegionalsController.php b/app/Controllers/RegionalsController.php similarity index 90% rename from app/src/Controllers/RegionalsController.php rename to app/Controllers/RegionalsController.php index 4acfa71..753bb9a 100644 --- a/app/src/Controllers/RegionalsController.php +++ b/app/Controllers/RegionalsController.php @@ -25,6 +25,6 @@ public function provinces(Request $request, Response $response, array $args) { $this->assertXhrRequest($request, $response); - return $request->withJson($this->data(Regionals::class)->getProvinces()); + return $response->withJson($this->data(Regionals::class)->getProvinces()); } } diff --git a/app/src/Controllers/SkillsController.php b/app/Controllers/SkillsController.php similarity index 100% rename from app/src/Controllers/SkillsController.php rename to app/Controllers/SkillsController.php diff --git a/app/src/Libraries/Mailer.php b/app/Libraries/Mailer.php similarity index 100% rename from app/src/Libraries/Mailer.php rename to app/Libraries/Mailer.php diff --git a/app/src/Libraries/PDO/Database.php b/app/Libraries/PDO/Database.php similarity index 100% rename from app/src/Libraries/PDO/Database.php rename to app/Libraries/PDO/Database.php diff --git a/app/src/Libraries/PDO/SelectStatement.php b/app/Libraries/PDO/SelectStatement.php similarity index 100% rename from app/src/Libraries/PDO/SelectStatement.php rename to app/Libraries/PDO/SelectStatement.php diff --git a/app/src/Libraries/PDO/StatementCombination.php b/app/Libraries/PDO/StatementCombination.php similarity index 100% rename from app/src/Libraries/PDO/StatementCombination.php rename to app/Libraries/PDO/StatementCombination.php diff --git a/app/src/Libraries/PDO/WhereClause.php b/app/Libraries/PDO/WhereClause.php similarity index 100% rename from app/src/Libraries/PDO/WhereClause.php rename to app/Libraries/PDO/WhereClause.php diff --git a/app/src/Libraries/ViewExtension.php b/app/Libraries/ViewExtension.php similarity index 98% rename from app/src/Libraries/ViewExtension.php rename to app/Libraries/ViewExtension.php index 758ce21..3256f71 100644 --- a/app/src/Libraries/ViewExtension.php +++ b/app/Libraries/ViewExtension.php @@ -40,7 +40,7 @@ public function __construct(Request $request, FlashMessage $flash, $mode = 'deve */ public function register(Engine $engine) { - // Add app view data + // Add app view database $engine->addData([ 'validation_errors' => [], 'base_js' => [], @@ -138,10 +138,10 @@ public function inputMethod($method) } /** - * Generate form based on $database array * * @param string $name Name attribute - * @param array $data List of data + * @param array $data List of database * @param array $attributes Optiona html attributes * @return string */ diff --git a/app/src/Middleware.php b/app/Middleware.php similarity index 100% rename from app/src/Middleware.php rename to app/Middleware.php diff --git a/app/src/Models.php b/app/Models.php similarity index 96% rename from app/src/Models.php rename to app/Models.php index 55df087..52b77a9 100644 --- a/app/src/Models.php +++ b/app/Models.php @@ -72,9 +72,9 @@ protected function current($key = null, $default = null) } /** - * Create new data + * Create new database * - * @param array $pairs column value pairs of data + * @param array $pairs column value pairs of database * @return int|false */ public function create(array $pairs) @@ -97,10 +97,10 @@ public function create(array $pairs) } /** - * Get basic data + * Get basic database * * @param string[] $columns Array of column - * @param callable|array|int $terms column value pairs of term data you wanna find to + * @param callable|array|int $terms column value pairs of term database you wanna find to * @return \PDOStatement|false */ public function get(array $columns = [], $terms = null) @@ -119,7 +119,7 @@ public function get(array $columns = [], $terms = null) /** * Find existing item(s) from table * - * @param callable|array|int $terms column value pairs of term data you wanna find to + * @param callable|array|int $terms column value pairs of term database you wanna find to * @return \PDOStatement|false */ public function find($terms = null) @@ -130,8 +130,8 @@ public function find($terms = null) /** * Update existing item from table * - * @param array $pairs column value pairs of data - * @param callable|array|int $terms column value pairs of term data you wanna update to + * @param array $pairs column value pairs of database + * @param callable|array|int $terms column value pairs of term database you wanna update to * @return int|false */ public function update(array $pairs, $terms = null) @@ -173,7 +173,7 @@ public function delete($terms) } /** - * Count all data + * Count all database * * @param callable|array|int $terms Use it if you want more terms * @param string $column Column to count diff --git a/app/src/Models/Careers.php b/app/Models/Careers.php similarity index 100% rename from app/src/Models/Careers.php rename to app/Models/Careers.php diff --git a/app/src/Models/MemberPortfolios.php b/app/Models/MemberPortfolios.php similarity index 100% rename from app/src/Models/MemberPortfolios.php rename to app/Models/MemberPortfolios.php diff --git a/app/src/Models/MemberProfile.php b/app/Models/MemberProfile.php similarity index 100% rename from app/src/Models/MemberProfile.php rename to app/Models/MemberProfile.php diff --git a/app/src/Models/MemberSkills.php b/app/Models/MemberSkills.php similarity index 100% rename from app/src/Models/MemberSkills.php rename to app/Models/MemberSkills.php diff --git a/app/src/Models/MemberSocmeds.php b/app/Models/MemberSocmeds.php similarity index 100% rename from app/src/Models/MemberSocmeds.php rename to app/Models/MemberSocmeds.php diff --git a/app/src/Models/Regionals.php b/app/Models/Regionals.php similarity index 100% rename from app/src/Models/Regionals.php rename to app/Models/Regionals.php diff --git a/app/src/Models/Religions.php b/app/Models/Religions.php similarity index 100% rename from app/src/Models/Religions.php rename to app/Models/Religions.php diff --git a/app/src/Models/Skills.php b/app/Models/Skills.php similarity index 100% rename from app/src/Models/Skills.php rename to app/Models/Skills.php diff --git a/app/src/Models/Users.php b/app/Models/Users.php similarity index 99% rename from app/src/Models/Users.php rename to app/Models/Users.php index 246db38..7534bb5 100644 --- a/app/src/Models/Users.php +++ b/app/Models/Users.php @@ -22,9 +22,9 @@ class Users extends Models protected $authorize = true; /** - * Create new user data + * Create new user database * - * @param string[] $pairs user data + * @param string[] $pairs user database * @return int|false */ public function create(array $pairs) @@ -88,7 +88,7 @@ public function create(array $pairs) } /** - * Update user login data + * Update user login database * * @param int $userId User ID * @return int diff --git a/app/src/Models/UsersActivations.php b/app/Models/UsersActivations.php similarity index 100% rename from app/src/Models/UsersActivations.php rename to app/Models/UsersActivations.php diff --git a/app/src/Models/UsersResetPwd.php b/app/Models/UsersResetPwd.php similarity index 100% rename from app/src/Models/UsersResetPwd.php rename to app/Models/UsersResetPwd.php diff --git a/app/bootstrap.php b/app/bootstrap.php deleted file mode 100644 index 3e854ca..0000000 --- a/app/bootstrap.php +++ /dev/null @@ -1,21 +0,0 @@ -get('db'); $session = $container->get('session'); diff --git a/app/data/membership-schema.sql b/resources/database/membership-schema.sql similarity index 100% rename from app/data/membership-schema.sql rename to resources/database/membership-schema.sql diff --git a/app/data/membership-values.sql b/resources/database/membership-values.sql similarity index 98% rename from app/data/membership-values.sql rename to resources/database/membership-values.sql index d1a5980..fb32b29 100644 --- a/app/data/membership-values.sql +++ b/resources/database/membership-values.sql @@ -1,5 +1,5 @@ -- --- Dumping data for table `career_levels` +-- Dumping database for table `career_levels` -- INSERT INTO `career_levels` (`career_level_id`, `order_by`) VALUES @@ -13,7 +13,7 @@ INSERT INTO `career_levels` (`career_level_id`, `order_by`) VALUES ('VOLUNTEER', 1); -- --- Dumping data for table `industries` +-- Dumping database for table `industries` -- INSERT INTO `industries` (`industry_id`, `industry_name`) VALUES @@ -84,7 +84,7 @@ INSERT INTO `industries` (`industry_id`, `industry_name`) VALUES (65, 'General & Wholesale Trading'); -- --- Dumping data for table `jobs` +-- Dumping database for table `jobs` -- INSERT INTO `jobs` (`job_id`) VALUES @@ -95,7 +95,7 @@ INSERT INTO `jobs` (`job_id`) VALUES ('PELAJAR'); -- --- Dumping data for table `regionals` +-- Dumping database for table `regionals` -- INSERT INTO `regionals` (`id`, `regional_name`, `parent_id`, `province_code`, `city_code`) VALUES @@ -649,7 +649,7 @@ INSERT INTO `regionals` (`id`, `regional_name`, `parent_id`, `province_code`, `c (553, 'KAB. DEIYAI', 467, '94', '36'); -- --- Dumping data for table `religions` +-- Dumping database for table `religions` -- INSERT INTO `religions` (`religion_id`, `religion_name`) VALUES @@ -661,7 +661,7 @@ INSERT INTO `religions` (`religion_id`, `religion_name`) VALUES (6, 'Others'); -- --- Dumping data for table `roles` +-- Dumping database for table `roles` -- INSERT INTO `roles` (`role_id`, `title_alias`, `deleted`) VALUES @@ -671,7 +671,7 @@ INSERT INTO `roles` (`role_id`, `title_alias`, `deleted`) VALUES ('volunteer', 'Author Voluntary', 'N'); -- --- Dumping data for table `skills` +-- Dumping database for table `skills` -- INSERT INTO `skills` (`skill_id`, `parent_id`, `skill_name`, `created`, `modified`, `deleted`) VALUES diff --git a/app/routes.php b/resources/routes.php similarity index 100% rename from app/routes.php rename to resources/routes.php diff --git a/app/settings.php.disable b/resources/settings.php.disable similarity index 100% rename from app/settings.php.disable rename to resources/settings.php.disable diff --git a/app/views/account-edit.php b/resources/views/account-edit.php similarity index 100% rename from app/views/account-edit.php rename to resources/views/account-edit.php diff --git a/app/views/account-index.php b/resources/views/account-index.php similarity index 100% rename from app/views/account-index.php rename to resources/views/account-index.php diff --git a/app/views/account-javascript.php b/resources/views/account-javascript.php similarity index 100% rename from app/views/account-javascript.php rename to resources/views/account-javascript.php diff --git a/app/views/account-reactivate.php b/resources/views/account-reactivate.php similarity index 100% rename from app/views/account-reactivate.php rename to resources/views/account-reactivate.php diff --git a/app/views/emails/activation.php b/resources/views/emails/activation.php similarity index 100% rename from app/views/emails/activation.php rename to resources/views/emails/activation.php diff --git a/app/views/emails/forgot-password.php b/resources/views/emails/forgot-password.php similarity index 100% rename from app/views/emails/forgot-password.php rename to resources/views/emails/forgot-password.php diff --git a/app/views/emails/reset-password.php b/resources/views/emails/reset-password.php similarity index 100% rename from app/views/emails/reset-password.php rename to resources/views/emails/reset-password.php diff --git a/app/views/errors/500.php b/resources/views/errors/500.php similarity index 100% rename from app/views/errors/500.php rename to resources/views/errors/500.php diff --git a/app/views/home-index.php b/resources/views/home-index.php similarity index 100% rename from app/views/home-index.php rename to resources/views/home-index.php diff --git a/app/views/home-login.php b/resources/views/home-login.php similarity index 100% rename from app/views/home-login.php rename to resources/views/home-login.php diff --git a/app/views/home-register.php b/resources/views/home-register.php similarity index 100% rename from app/views/home-register.php rename to resources/views/home-register.php diff --git a/app/views/layouts/account.php b/resources/views/layouts/account.php similarity index 100% rename from app/views/layouts/account.php rename to resources/views/layouts/account.php diff --git a/app/views/layouts/system.php b/resources/views/layouts/system.php similarity index 100% rename from app/views/layouts/system.php rename to resources/views/layouts/system.php diff --git a/app/views/password-forgot.php b/resources/views/password-forgot.php similarity index 100% rename from app/views/password-forgot.php rename to resources/views/password-forgot.php diff --git a/app/views/password-update.php b/resources/views/password-update.php similarity index 100% rename from app/views/password-update.php rename to resources/views/password-update.php diff --git a/app/views/portfolio-add.php b/resources/views/portfolio-add.php similarity index 100% rename from app/views/portfolio-add.php rename to resources/views/portfolio-add.php diff --git a/app/views/portfolio-edit.php b/resources/views/portfolio-edit.php similarity index 100% rename from app/views/portfolio-edit.php rename to resources/views/portfolio-edit.php diff --git a/app/views/profile-index.php b/resources/views/profile-index.php similarity index 100% rename from app/views/profile-index.php rename to resources/views/profile-index.php diff --git a/app/views/sections/alert.php b/resources/views/sections/alert.php similarity index 100% rename from app/views/sections/alert.php rename to resources/views/sections/alert.php diff --git a/app/views/sections/captcha.php b/resources/views/sections/captcha.php similarity index 100% rename from app/views/sections/captcha.php rename to resources/views/sections/captcha.php diff --git a/app/views/sections/footer.php b/resources/views/sections/footer.php similarity index 100% rename from app/views/sections/footer.php rename to resources/views/sections/footer.php diff --git a/app/views/sections/header.php b/resources/views/sections/header.php similarity index 100% rename from app/views/sections/header.php rename to resources/views/sections/header.php diff --git a/app/views/sections/portfolio-form.php b/resources/views/sections/portfolio-form.php similarity index 100% rename from app/views/sections/portfolio-form.php rename to resources/views/sections/portfolio-form.php diff --git a/app/views/sections/skill-add.php b/resources/views/sections/skill-add.php similarity index 100% rename from app/views/sections/skill-add.php rename to resources/views/sections/skill-add.php diff --git a/app/views/skills-add.php b/resources/views/skills-add.php similarity index 100% rename from app/views/skills-add.php rename to resources/views/skills-add.php diff --git a/www/index.php b/www/index.php index f2d7771..90e5919 100644 --- a/www/index.php +++ b/www/index.php @@ -3,17 +3,31 @@ * The actual directory name for the "app". */ define('_DS_', DIRECTORY_SEPARATOR); -define('ROOT_DIR', dirname(__DIR__)._DS_); -define('APP_DIR', ROOT_DIR.'app'._DS_); -define('MOD_DIR', APP_DIR.'libraries'._DS_); -define('WWW_DIR', __DIR__._DS_); +define('ROOT_DIR', dirname(__DIR__).DIRECTORY_SEPARATOR); +define('APP_DIR', ROOT_DIR.'app'.DIRECTORY_SEPARATOR); +define('RES_DIR', ROOT_DIR.'resources'.DIRECTORY_SEPARATOR); +define('WWW_DIR', __DIR__.DIRECTORY_SEPARATOR); /** - * Load the bootstrap file + * Set default timezone + */ +date_default_timezone_set('Asia/Jakarta'); + +/** + * Load all composer dependencies + */ +require ROOT_DIR.'vendor/autoload.php'; + +/** + * Create new Slim\App instance * - * @var \Slim\App $app + * @var Slim\App $app */ -$app = require APP_DIR.'bootstrap.php'; +$app = new Slim\App( + require RES_DIR.'container.php' +); + +require RES_DIR.'routes.php'; /** * Go! diff --git a/www/js/jquery.inputmask.bundle.js b/www/js/jquery.inputmask.bundle.js index 2551629..d904288 100644 --- a/www/js/jquery.inputmask.bundle.js +++ b/www/js/jquery.inputmask.bundle.js @@ -33,13 +33,13 @@ } function importAttributeOptions(npt, opts, userOptions) { function importOption(option) { - var optionData = npt.getAttribute("data-inputmask-" + option.toLowerCase()); + var optionData = npt.getAttribute("database-inputmask-" + option.toLowerCase()); null !== optionData && (optionData = "boolean" == typeof optionData ? optionData : optionData.toString(), "string" == typeof optionData && 0 === option.indexOf("on") && (optionData = eval("(" + optionData + ")")), "mask" === option && 0 === optionData.indexOf("[") ? (userOptions[option] = optionData.replace(/[\s[\]]/g, "").split(","), userOptions[option][0] = userOptions[option][0].replace("'", ""), userOptions[option][userOptions[option].length - 1] = userOptions[option][userOptions[option].length - 1].replace("'", "")) : userOptions[option] = optionData); } - var attrOptions = npt.getAttribute("data-inputmask"); + var attrOptions = npt.getAttribute("database-inputmask"); if (attrOptions && "" !== attrOptions) try { attrOptions = attrOptions.replace(new RegExp("'", "g"), '"'); var dataoptions = $.parseJSON("{" + attrOptions + "}"); diff --git a/www/js/jquery.popupoverlay.js b/www/js/jquery.popupoverlay.js index 74af73b..d05a9a5 100644 --- a/www/js/jquery.popupoverlay.js +++ b/www/js/jquery.popupoverlay.js @@ -30,7 +30,7 @@ zindexvalues[el.id] = 0; if (!$el.data('popup-initialized')) { - $el.attr('data-popup-initialized', 'true'); + $el.attr('database-popup-initialized', 'true'); methods._initonce(el); } @@ -193,7 +193,7 @@ var openelement = (options.openelement) ? options.openelement : ('.' + el.id + opensuffix); $(openelement).each(function (i, item) { - $(item).attr('data-popup-ordinal', i); + $(item).attr('database-popup-ordinal', i); if (!item.id) { $(item).attr('id', 'open_' + parseInt((Math.random() * 100000000), 10)); @@ -258,7 +258,7 @@ if (!$el.data('popup-initialized')) { methods._init(el); } - $el.attr('data-popup-initialized', 'true'); + $el.attr('database-popup-initialized', 'true'); var $body = $('body'); var options = $el.data('popupoptions'); @@ -580,9 +580,9 @@ if (options.tooltipanchor) { $tooltipanchor = $(options.tooltipanchor); } else if (options.openelement) { - $tooltipanchor = $(options.openelement).filter('[data-popup-ordinal="' + ordinal + '"]'); + $tooltipanchor = $(options.openelement).filter('[database-popup-ordinal="' + ordinal + '"]'); } else { - $tooltipanchor = $('.' + el.id + opensuffix + '[data-popup-ordinal="' + ordinal + '"]'); + $tooltipanchor = $('.' + el.id + opensuffix + '[database-popup-ordinal="' + ordinal + '"]'); } var linkOffset = $tooltipanchor.offset(); @@ -664,7 +664,7 @@ var callback = function (el, ordinal, func) { var options = $(el).data('popupoptions'); var openelement = (options.openelement) ? options.openelement : ('.' + el.id + opensuffix); - var elementclicked = $(openelement + '[data-popup-ordinal="' + ordinal + '"]'); + var elementclicked = $(openelement + '[database-popup-ordinal="' + ordinal + '"]'); if (typeof func == 'function') { func.call($(el), el, elementclicked); } diff --git a/www/js/portfolio.js b/www/js/portfolio.js index a474193..37e7176 100644 --- a/www/js/portfolio.js +++ b/www/js/portfolio.js @@ -19,7 +19,7 @@ $(document).ready(function () { }).done(function (data) { console.log(data); }).fail(function (data) { - alert('Failed to request data'); + alert('Failed to request database'); }).always(function (data) { $('#portfolio-popup').popup('hide'); }); @@ -33,7 +33,7 @@ $(document).ready(function () { }).done(function (data) { console.log(data); }).fail(function (data) { - alert('Failed to request data'); + alert('Failed to request database'); }).always(function (data) { $('#skill-popup').popup('hide'); }); diff --git a/www/js/skill.js b/www/js/skill.js index 221fa69..b265618 100644 --- a/www/js/skill.js +++ b/www/js/skill.js @@ -26,7 +26,7 @@ $(document).ready(function () { } }).fail(function (data) { - alert('Failed to request data'); + alert('Failed to request database'); }).always(function (data) { // }); From d05b7d3e49165c11d5622ea463f7b8b7887728c7 Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Thu, 27 Apr 2017 09:54:53 +0700 Subject: [PATCH 05/40] Refactor Database namespace Signed-off-by: Fery Wardiyanto --- app/Libraries/Database.php | 22 +++++++++ .../{PDO => Database}/SelectStatement.php | 4 +- .../StatementCombination.php | 2 +- .../{PDO => Database}/WhereClause.php | 49 +++++++++---------- app/Libraries/PDO/Database.php | 20 -------- 5 files changed, 48 insertions(+), 49 deletions(-) create mode 100644 app/Libraries/Database.php rename app/Libraries/{PDO => Database}/SelectStatement.php (93%) rename app/Libraries/{PDO => Database}/StatementCombination.php (89%) rename app/Libraries/{PDO => Database}/WhereClause.php (53%) delete mode 100644 app/Libraries/PDO/Database.php diff --git a/app/Libraries/Database.php b/app/Libraries/Database.php new file mode 100644 index 0000000..edc556f --- /dev/null +++ b/app/Libraries/Database.php @@ -0,0 +1,22 @@ +container[] = ' '.$chainType.' '.$column; - } - else - { - $this->container[] = ' '.$chainType.' '.$column.' '.$operator.' ?'; - } - } -} +container[] = $column instanceof StatementCombination + ? ' '.$chainType.' '.$column + : ' '.$chainType.' '.$column.' '.$operator.' ?'; + } +} diff --git a/app/Libraries/PDO/Database.php b/app/Libraries/PDO/Database.php deleted file mode 100644 index 01c707b..0000000 --- a/app/Libraries/PDO/Database.php +++ /dev/null @@ -1,20 +0,0 @@ - Date: Thu, 27 Apr 2017 09:55:11 +0700 Subject: [PATCH 06/40] Fix docblock Signed-off-by: Fery Wardiyanto --- app/Libraries/Mailer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Libraries/Mailer.php b/app/Libraries/Mailer.php index c51723b..d906823 100644 --- a/app/Libraries/Mailer.php +++ b/app/Libraries/Mailer.php @@ -7,7 +7,7 @@ class Mailer { /** - * @var PHPMailer + * @var \PHPMailer */ protected $mail; @@ -73,6 +73,7 @@ public function __construct(array $settings = [], Engine $view) * * @param string $senderEmail * @param string $senderName + * @return $this */ public function setSender($senderEmail, $senderName) { @@ -151,7 +152,7 @@ public function withBody($body, array $data = []) /** * Add attachments. * - * @param array $attachments + * @param array $files * @return $this */ public function addAttachments(array $files) From 005ceb8efc651be36544a63662a51ae2e284902c Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Thu, 27 Apr 2017 09:56:07 +0700 Subject: [PATCH 07/40] Fix some issue due to previous commit Signed-off-by: Fery Wardiyanto --- resources/container.php | 18 ++++++++---------- resources/settings.php.disable | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/resources/container.php b/resources/container.php index a4b833f..ac3b696 100644 --- a/resources/container.php +++ b/resources/container.php @@ -8,13 +8,11 @@ use Valitron\Validator; use Membership\Models; use Membership\Libraries; -use Membership\Libraries\PDO\Database; /** * Settings file */ -$settingsFile = APP_DIR.'settings.php'; -file_exists($settingsFile) || die ('Setting file not available'); +file_exists($settingsFile = RES_DIR.'settings.php') || die ('Setting file not available'); session_start(); @@ -44,15 +42,15 @@ * Setup database container * * @param Container $container - * @return Database + * @return Libraries\Database */ -$container['db'] = function ($container) { +$container['database'] = function ($container) { $db = $container->get('settings')['db']; if (!isset($db['dsn'])) { $db['dsn'] = sprintf('%s:host=%s;dbname=%s', $db['driver'], $db['host'], $db['dbname']); } - return new Database($db['dsn'], $db['username'], $db['password']); + return new Libraries\Database($db['dsn'], $db['username'], $db['password']); }; /** @@ -61,11 +59,11 @@ * @param Container $container * @return callable */ -$container['database'] = function ($container) { - $db = $container->get('db'); +$container['data'] = function ($container) { + $database = $container->get('database'); $session = $container->get('session'); - return function ($class) use ($db, $session) { + return function ($class) use ($database, $session) { if (!class_exists($class)) { throw new LogicException("Data model class {$class} not exists "); } @@ -80,7 +78,7 @@ )); } - return $model->newInstance($db, $session); + return $model->newInstance($database, $session); }; }; diff --git a/resources/settings.php.disable b/resources/settings.php.disable index 16fe122..05d8bd7 100644 --- a/resources/settings.php.disable +++ b/resources/settings.php.disable @@ -20,7 +20,7 @@ return [ 'password' => '', ], 'view' => [ - 'directory' => APP_DIR.'views', + 'directory' => RES_DIR.'views', 'fileExtension' => 'php', ], 'gcaptcha' => [ From ca3aa53d155d649f049c52e2e220be05196b715a Mon Sep 17 00:00:00 2001 From: Fery Wardiyanto Date: Thu, 27 Apr 2017 09:56:25 +0700 Subject: [PATCH 08/40] Update homepage url to new phpindonesia.id Signed-off-by: Fery Wardiyanto --- resources/views/layouts/system.php | 32 ++++++++++++------------- resources/views/sections/footer.php | 20 ++++++++-------- resources/views/sections/header.php | 36 ++++++++++++++--------------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/resources/views/layouts/system.php b/resources/views/layouts/system.php index f4f2058..5ddc1bb 100644 --- a/resources/views/layouts/system.php +++ b/resources/views/layouts/system.php @@ -10,24 +10,24 @@ PHP Indonesia | Membership - - - + + + - - + + + + - - + @@ -43,7 +43,7 @@

e($page_title); ?>

- - - - - - + + + + + + diff --git a/resources/views/sections/footer.php b/resources/views/sections/footer.php index 95cea11..f8ee2da 100644 --- a/resources/views/sections/footer.php +++ b/resources/views/sections/footer.php @@ -13,12 +13,12 @@ @@ -38,8 +38,8 @@