From 7076343338ae3439f3c86f01144818abe8c31978 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 12 Mar 2023 07:16:23 +0200 Subject: add container helpers; constuct public directory-tree --- Dockerfile | 135 + README.md | 267 +- auth/.gitkeep | 0 classes/Benchmark.php | 150 - classes/Cart.php | 71 - classes/Database.php | 331 - classes/Registry.php | 129 - classes/Repository.php | 43 - classes/Request.php | 94 - classes/Route.php | 97 - classes/Security.php | 923 -- classes/User.php | 111 - classes/authenticator/PasswordTrait.php | 40 - classes/authenticator/User.php | 102 - classes/authenticator/UserInterface.php | 15 - classes/authenticator/UserManager.php | 69 - classes/authenticator/UserManagerInterface.php | 21 - classes/authenticator/UserToken.php | 33 - classes/authenticator/UserTokenInterface.php | 13 - classes/authenticator/info.md | 114 - classes/cache/Cache_interface.php | 34 - classes/cache/FileCache.php | 93 - classes/cache/MemcachedCache.php | 37 - classes/cache/RedisCache.php | 69 - classes/session/DatabaseSession.php | 138 - classes/session/DefaultSession.php | 35 - classes/session/FilesSession.php | 142 - classes/session/SessionHandlerInterface.php | 169 - cli/micro/setup.php | 120 - cli/micro/term_utilities.php | 44 - composer.json | 10 + config/anom_settings.php | 169 - config/constants.php | 28 - config/credentials.php | 126 - config/init.php | 76 - core/README.md | 266 + core/auth/.gitkeep | 0 core/classes/Benchmark.php | 150 + core/classes/Cart.php | 71 + core/classes/Database.php | 331 + core/classes/Registry.php | 129 + core/classes/Repository.php | 43 + core/classes/Request.php | 94 + core/classes/Route.php | 97 + core/classes/Security.php | 923 ++ core/classes/User.php | 111 + core/classes/authenticator/PasswordTrait.php | 40 + core/classes/authenticator/User.php | 102 + core/classes/authenticator/UserInterface.php | 15 + core/classes/authenticator/UserManager.php | 69 + .../classes/authenticator/UserManagerInterface.php | 21 + core/classes/authenticator/UserToken.php | 33 + core/classes/authenticator/UserTokenInterface.php | 13 + core/classes/authenticator/info.md | 114 + core/classes/cache/Cache_interface.php | 34 + core/classes/cache/FileCache.php | 93 + core/classes/cache/MemcachedCache.php | 37 + core/classes/cache/RedisCache.php | 69 + core/classes/session/DatabaseSession.php | 138 + core/classes/session/DefaultSession.php | 35 + core/classes/session/FilesSession.php | 142 + core/classes/session/SessionHandlerInterface.php | 169 + core/cli/micro/setup.php | 120 + core/cli/micro/term_utilities.php | 44 + core/config/anom_settings.php | 169 + core/config/constants.php | 28 + core/config/credentials.php | 126 + core/config/init.php | 76 + core/helpers/autoload.php | 43 + core/helpers/design_patterns.php | 104 + core/helpers/error_handling.php | 119 + core/helpers/render.php | 338 + data/.gitkeep | 0 docker-compose.redis.yml | 166 + docker-compose.yml | 42 + docker/bin/docker-entrypoint.sh | 19 + docker/bin/optimize.sh | 17 + docker/config/composer-naked.json | 10 + docker/config/composer-redis.json | 11 + docker/config/info.md | 69 + docker/config/opcache.ini | 9 + docker/config/php-ext-xdebug.ini | 24 + docker/config/php-overrides.ini | 3 + helpers/autoload.php | 43 - helpers/design_patterns.php | 104 - helpers/error_handling.php | 119 - helpers/render.php | 338 - html/.htaccess | 99 + html/app/config/assets.php | 43 + html/app/controllers/Product.php | 52 + html/app/controllers/Resolve.php | 91 + html/app/controllers/admin/.gitkeep | 0 html/app/controllers/api/.gitkeep | 0 html/app/controllers/api/Common_api.php | 281 + html/app/controllers/api/Doc_api.php | 34 + html/app/controllers/cli/CliContoller.php | 85 + html/app/models/Jorge.php | 169 + html/app/models/_info.md | 84 + html/app/models/cms/Page_model.php | 18 + html/app/models/market/Market_repository.php | 235 + html/app/models/market/ProductCategories_model.php | 199 + html/app/models/market/Product_model.php | 49 + html/app/models/todo.md | 132 + html/app/routes/api.php | 64 + html/app/routes/backend.php | 9 + html/app/routes/frontend.php | 135 + html/app/views/basic.php | 53 + html/app/views/group.php | 18 + html/app/views/item.php | 4 + html/app/views/products_list.php | 47 + html/cache/.gitkeep | 0 html/content/Fonts/CFAstyStd-Bold.woff2 | Bin 0 -> 27476 bytes html/content/Fonts/CFAstyStd-Book.woff2 | Bin 0 -> 38112 bytes html/content/Fonts/CFAstyStd-Medium.woff2 | Bin 0 -> 27632 bytes html/content/Fonts/iconfont.svg | 495 + html/content/Fonts/iconfont.ttf | Bin 0 -> 52712 bytes html/content/Fonts/iconfont.woff | Bin 0 -> 32812 bytes html/content/Fonts/iconfont.woff2 | Bin 0 -> 28584 bytes html/content/Media/atcom.svg | 48 + html/content/Media/email/check.png | Bin 0 -> 2022 bytes html/content/Media/email/product.jpg | Bin 0 -> 4438 bytes html/content/css/email.css | 478 + html/content/css/main.css | 14508 +++++++++++++++++++ html/content/css/main.min.css | 2 + html/content/css/overides.css | 18 + html/content/fonts/CFAstyStd-Bold.woff | Bin 0 -> 36252 bytes html/content/fonts/CFAstyStd-Bold.woff2 | Bin 0 -> 27476 bytes html/content/fonts/CFAstyStd-Book.woff | Bin 0 -> 58604 bytes html/content/fonts/CFAstyStd-Book.woff2 | Bin 0 -> 38112 bytes html/content/fonts/CFAstyStd-Medium.woff | Bin 0 -> 36568 bytes html/content/fonts/CFAstyStd-Medium.woff2 | Bin 0 -> 27632 bytes html/content/fonts/iconfont.svg | 495 + html/content/fonts/iconfont.ttf | Bin 0 -> 52712 bytes html/content/fonts/iconfont.woff | Bin 0 -> 32812 bytes html/content/fonts/iconfont.woff2 | Bin 0 -> 28584 bytes .../1243x385/jpg/files/pageTitleAnakoinoseis.jpg | Bin 0 -> 394869 bytes .../1243x385/jpg/files/pageTitleDiagonismoi.jpg | Bin 0 -> 393490 bytes .../1243x385/jpg/files/pageTitleKatalogoi.jpg | Bin 0 -> 732690 bytes .../1243x385/jpg/files/pageTitleKatastimata.jpg | Bin 0 -> 425604 bytes .../images/1243x385/jpg/files/pageTitleOrario.jpg | Bin 0 -> 405802 bytes html/content/images/1243x385/png/files/emarket.png | Bin 0 -> 712842 bytes .../images/140x42/png/Content/media/appstore.webp | Bin 0 -> 1654 bytes .../140x42/png/Content/media/googlePlay.webp | Bin 0 -> 1594 bytes .../300x300/png/Content/media/sampleProduct.jp2 | Bin 0 -> 397 bytes .../300x300/png/Content/media/sampleProduct.jpg | Bin 0 -> 522 bytes .../300x300/png/Content/media/sampleProduct.png | Bin 0 -> 688 bytes .../300x300/png/Content/media/sampleProduct.webp | Bin 0 -> 226 bytes .../h20/png/Content/media/cards/dinersClub.png | Bin 0 -> 388 bytes .../h20/png/Content/media/cards/dinersClub.webp | Bin 0 -> 228 bytes .../h20/png/Content/media/cards/mastercard.png | Bin 0 -> 774 bytes .../h20/png/Content/media/cards/mastercard.webp | Bin 0 -> 388 bytes .../images/h20/png/Content/media/cards/visa.png | Bin 0 -> 726 bytes .../images/h20/png/Content/media/cards/visa.webp | Bin 0 -> 390 bytes html/content/js/Cart/miniCart.js | 96 + html/content/js/Filters/filterStatus.js | 113 + html/content/js/Filters/filters.js | 110 + html/content/js/Filters/filtersBar.js | 32 + html/content/js/Filters/range.js | 98 + html/content/js/Forms/ajaxForm.js | 188 + html/content/js/Forms/clearinput.js | 16 + html/content/js/Forms/customValidators.js | 11 + html/content/js/Forms/password.js | 15 + html/content/js/Forms/select.js | 52 + html/content/js/Forms/serialize.js | 30 + html/content/js/Forms/textarea.js | 26 + html/content/js/Forms/validateform.js | 3 + html/content/js/Images/lazyload.js | 61 + html/content/js/Modals/modal.js | 6 + html/content/js/Plugins/accordion.js | 43 + html/content/js/Plugins/breadcrumb.js | 9 + html/content/js/Plugins/copy.js | 25 + html/content/js/Plugins/expand.js | 38 + html/content/js/Plugins/expandText.js | 5 + html/content/js/Plugins/fileinput.js | 20 + html/content/js/Plugins/gallery.js | 51 + html/content/js/Plugins/infoPopup.js | 8 + html/content/js/Plugins/initialize.js | 11 + html/content/js/Plugins/intersecting.js | 18 + html/content/js/Plugins/menu.js | 97 + html/content/js/Plugins/quantity.js | 55 + html/content/js/Plugins/scrollShadowHor.js | 42 + html/content/js/Plugins/scrollShadowVert.js | 57 + html/content/js/Plugins/tabs.js | 28 + html/content/js/Plugins/tabtoggle.js | 27 + html/content/js/Plugins/tooltip.js | 45 + html/content/js/Products/productHeader.js | 21 + html/content/js/Products/productImageModal.js | 47 + html/content/js/Products/productattr.js | 11 + html/content/js/Sliders/productsSlider.js | 45 + html/content/js/Sliders/slider.js | 42 + html/content/js/Utils/Event.js | 13 + html/content/js/Utils/EventUtils.js | 75 + html/content/js/Utils/apiready.js | 15 + html/content/js/Utils/confirm.js | 27 + html/content/js/Utils/debounce.js | 16 + html/content/js/Utils/defineApi.js | 9 + html/content/js/Utils/destroyevent.js | 11 + html/content/js/Utils/dom.js | 68 + html/content/js/Utils/domHelper.js | 375 + html/content/js/Utils/enabled.js | 6 + html/content/js/Utils/getApis.js | 17 + html/content/js/Utils/throttle.js | 15 + html/content/js/Utils/whenAll.js | 13 + html/content/js/Wishlist/wishlistbutton.js | 25 + html/content/lib/current-device.min.js | 2 + html/content/lib/emitter/dist/emitter.js | 88 + .../jquery.validate.unobtrusive.js | 432 + .../jquery-validation/dist/additional-methods.js | 1158 ++ .../lib/jquery-validation/dist/jquery.validate.js | 1601 ++ html/content/lib/jquery/dist/jquery.js | 10872 ++++++++++++++ html/content/lib/nouislider.min.js | 1 + html/content/lib/plugins/plugins.js | 1130 ++ html/content/lib/plugins/plugins.min.js | 1 + html/content/lib/plugins/plugins.setup.js | 178 + html/content/lib/require/AttributePlugin.js | 138 + html/content/lib/require/Require.js | 848 ++ html/content/lib/require/plugins.attribute.js | 219 + .../content/lib/require/plugins.attribute.setup.js | 94 + html/content/lib/require/require.files.js | 75 + html/content/lib/require/require.slim.js | 492 + html/content/lib/swiper-bundle.min.js | 14 + html/content/lib/wNumb.min.js | 1 + html/content/media/badges/aplesprakseislogo.svg | 52 + html/content/media/badges/new.svg | 4 + html/content/media/content/omilos-sklaveniti.png | Bin 0 -> 89090 bytes html/content/media/delivery.svg | 24 + html/content/media/deliverySuccess.svg | 22 + html/content/media/exclusive.svg | 5 + html/content/media/icon-mylists-tennis.svg | 1 + html/content/media/icon-mylists-xmas.svg | 5 + html/content/media/logo.svg | 16 + html/content/media/logoWhite.svg | 16 + html/content/media/notsupported.svg | 347 + html/content/media/orderFail.svg | 23 + html/content/media/pickup.svg | 28 + html/content/media/powered-by-google-on-white3.png | Bin 0 -> 1616 bytes html/content/media/secure.png | Bin 0 -> 1346 bytes html/content/media/sklavenitisMask.svg | 15 + html/content/media/tags/bio.svg | 4 + html/content/media/tags/noglutten.svg | 4 + html/content/media/tags/nolaktose.svg | 5 + html/content/media/tags/pge.svg | 54 + html/content/media/tags/vegan.svg | 4 + html/content/media/tickFilled.svg | 4 + html/content/media/wood.png | Bin 0 -> 27162 bytes html/favicon.ico | Bin 0 -> 15086 bytes html/index.php | 56 + html/processed-views/base.php | 50 + html/processed-views/content/404.php | 10 + html/processed-views/content/Basket/Basket.html | 40 + .../content/Basket/Basket_Item.html | 104 + .../content/Basket/Basket_aside.html | 140 + .../content/Basket/Basket_empty.html | 36 + .../content/Checkout/Final_Error.html | 14 + .../content/Checkout/Final_Success.html | 27 + .../content/Checkout/Final_Success_Delivery.html | 60 + html/processed-views/content/Checkout/Footer.html | 39 + html/processed-views/content/Checkout/Guest.html | 785 + html/processed-views/content/Checkout/Header.html | 25 + .../content/Checkout/Order_Truck.html | 11 + .../content/Checkout/Registered.html | 788 + html/processed-views/content/Checkout/Result.html | 12 + html/processed-views/content/Checkout/Steps.html | 137 + .../content/Checkout/Yellows_Redemption.html | 21 + html/processed-views/content/Content/404.html | 10 + .../content/Content/404NotSupported.html | 14 + html/processed-views/content/Content/CCTV.html | 47 + .../content/Content/Certifications.html | 77 + html/processed-views/content/Content/Company.html | 50 + html/processed-views/content/Content/Contact.html | 173 + .../content/Content/Content_Asside.html | 28 + html/processed-views/content/Content/Faq.html | 44 + html/processed-views/content/Content/Gallery.html | 238 + html/processed-views/content/Content/History.html | 85 + .../content/Content/Politiki_Aporitou.html | 157 + .../content/Content/Politiki_Cookies.html | 50 + .../content/Content/Politiki_Epistrofwn.html | 11 + html/processed-views/content/Content/Terms.html | 86 + .../content/Content/Tropoi_Pliromis.html | 70 + .../content/Store/Store__Anakoinoseis.html | 73 + .../Store/Store__Anakoinoseis__article.html | 29 + .../content/Store/Store__Anakoinosi.html | 43 + .../Store/Store__Anakoinosi_gallerySlider.html | 27 + .../content/Store/Store__Diagonismoi.html | 71 + .../Store/Store__Diagonismoi__diagonismosTile.html | 27 + .../content/Store/Store__Diagonismos.html | 30 + .../content/Store/Store__Katalogoi.html | 37 + .../Store/Store__Katalogoi__katalogosTile.html | 22 + .../content/Store/Store__Katastima.html | 98 + .../content/Store/Store__OrarioLeitourgias.html | 25 + .../content/StoreLocator/StoreLocator.html | 70 + .../StoreLocator/StoreLocator__fitlers.html | 414 + .../StoreLocator/StoreLocator__storeMap.html | 77 + .../StoreLocator/StoreLocator__storeTile.html | 34 + .../content/User/User_Account_Details.html | 530 + .../content/User/User_Account_Header.html | 8 + .../content/User/User_Account_Lists.html | 101 + .../content/User/User_Account_Order_History.html | 366 + .../User/User_Account_Order_Repetition.html | 253 + html/processed-views/content/myList/My_List.html | 13 + .../content/myList/My_List_Aside.html | 25 + .../content/myList/My_List_Fav.html | 11 + .../content/myList/My_List_Product_List_Fav.htm | 4 + .../myList/My_List_Product_List_Fav_Tile.html | 9 + .../content/myList/My_List_Selected_Filters.html | 7 + .../content/myList/My_List_Tile.html | 11 + .../content/myList/My_List_Title.html | 5 + .../content/myList/My_List_Tools.html | 5 + html/processed-views/content/myList/My_Lists.html | 9 + .../content/product/Product_Slider.html | 29 + .../content/product/Product_Slider_Tile.html | 105 + .../content/product/product_details.php | 576 + .../content/product_list/Load_More.html | 13 + .../content/product_list/Product_List_Filters.php | 659 + .../processed-views/content/product_list/aside.php | 43 + .../content/product_list/product_list.php | 25 + .../content/product_list/product_tile.php | 151 + .../content/product_list/top_navigation.php | 47 + html/processed-views/content/static.php | 21 + html/processed-views/email/base.html | 66 + .../email/content/Forgot_Password1.html | 7 + .../email/content/Forgot_Password2.html | 8 + html/processed-views/email/content/Order.html | 275 + .../email/content/Order_Notification.html | 35 + .../email/content/Registration.html | 10 + html/processed-views/email/partials/Footer.html | 86 + html/processed-views/email/partials/Header.html | 40 + html/processed-views/error/404.php | 38 + html/processed-views/error/general.php | 38 + html/processed-views/modals/Login.html | 94 + html/processed-views/modals/My_Lists_Add.html | 680 + html/processed-views/modals/My_Lists_Delete.html | 12 + html/processed-views/modals/Register.html | 340 + html/processed-views/modals/Reset_Password.html | 29 + html/processed-views/modals/Reset_Password2.html | 15 + html/processed-views/modals/Set_New_Password.html | 51 + html/processed-views/modals/Set_New_Password2.html | 18 + .../modals/User_Account_Delete_Card.html | 11 + .../User_Account_Order_History_DeleteOrder.html | 12 + html/processed-views/partials/Loader.html | 11 + html/processed-views/partials/ProductTile__body | 0 html/processed-views/partials/ProductTile__button | 0 html/processed-views/partials/footer.php | 178 + html/processed-views/partials/header.php | 515 + html/processed-views/products.php | 113 + html/processed-views/server-client-contract.md | 59 + html/processed-views/x-404.php | 62 + sceleton.txt | 39 + tests/abstract.php | 46 + tests/code/abstract.php | 46 + tests/code/bits.php | 51 + tests/code/echo.php | 43 + tests/code/exceptions.php | 73 + tests/code/interface.php | 31 + tests/code/login.php | 25 + tests/code/proxy.php | 38 + tests/code/session.php | 50 + tests/code/str-replace.php | 5 + tests/compare/compress.php | 80 + tests/compare/hashcost.php | 54 + tests/compare/md5-v-sha1.php | 18 + tests/compare/memcached-v-filecache.php | 35 + tests/compare/redis-v-filecache.php | 35 + tests/compare/serialize-v-jsonencode.php | 35 + tests/compare/sha1-v-sha256.php | 22 + tests/php.php | 2 + tests/repository.php | 65 + tests/service/entropy.php | 61 + tests/service/memcached.php | 12 + tests/service/redis.php | 27 + 370 files changed, 54620 insertions(+), 4411 deletions(-) create mode 100644 Dockerfile delete mode 100644 auth/.gitkeep delete mode 100644 classes/Benchmark.php delete mode 100644 classes/Cart.php delete mode 100644 classes/Database.php delete mode 100644 classes/Registry.php delete mode 100644 classes/Repository.php delete mode 100644 classes/Request.php delete mode 100644 classes/Route.php delete mode 100644 classes/Security.php delete mode 100644 classes/User.php delete mode 100644 classes/authenticator/PasswordTrait.php delete mode 100644 classes/authenticator/User.php delete mode 100644 classes/authenticator/UserInterface.php delete mode 100644 classes/authenticator/UserManager.php delete mode 100644 classes/authenticator/UserManagerInterface.php delete mode 100644 classes/authenticator/UserToken.php delete mode 100644 classes/authenticator/UserTokenInterface.php delete mode 100644 classes/authenticator/info.md delete mode 100644 classes/cache/Cache_interface.php delete mode 100644 classes/cache/FileCache.php delete mode 100644 classes/cache/MemcachedCache.php delete mode 100644 classes/cache/RedisCache.php delete mode 100644 classes/session/DatabaseSession.php delete mode 100644 classes/session/DefaultSession.php delete mode 100644 classes/session/FilesSession.php delete mode 100644 classes/session/SessionHandlerInterface.php delete mode 100644 cli/micro/setup.php delete mode 100644 cli/micro/term_utilities.php create mode 100644 composer.json delete mode 100644 config/anom_settings.php delete mode 100644 config/constants.php delete mode 100644 config/credentials.php delete mode 100644 config/init.php create mode 100644 core/README.md create mode 100644 core/auth/.gitkeep create mode 100644 core/classes/Benchmark.php create mode 100644 core/classes/Cart.php create mode 100644 core/classes/Database.php create mode 100644 core/classes/Registry.php create mode 100644 core/classes/Repository.php create mode 100644 core/classes/Request.php create mode 100644 core/classes/Route.php create mode 100644 core/classes/Security.php create mode 100644 core/classes/User.php create mode 100644 core/classes/authenticator/PasswordTrait.php create mode 100644 core/classes/authenticator/User.php create mode 100644 core/classes/authenticator/UserInterface.php create mode 100644 core/classes/authenticator/UserManager.php create mode 100644 core/classes/authenticator/UserManagerInterface.php create mode 100644 core/classes/authenticator/UserToken.php create mode 100644 core/classes/authenticator/UserTokenInterface.php create mode 100644 core/classes/authenticator/info.md create mode 100644 core/classes/cache/Cache_interface.php create mode 100644 core/classes/cache/FileCache.php create mode 100644 core/classes/cache/MemcachedCache.php create mode 100644 core/classes/cache/RedisCache.php create mode 100644 core/classes/session/DatabaseSession.php create mode 100644 core/classes/session/DefaultSession.php create mode 100644 core/classes/session/FilesSession.php create mode 100644 core/classes/session/SessionHandlerInterface.php create mode 100644 core/cli/micro/setup.php create mode 100644 core/cli/micro/term_utilities.php create mode 100644 core/config/anom_settings.php create mode 100644 core/config/constants.php create mode 100644 core/config/credentials.php create mode 100644 core/config/init.php create mode 100644 core/helpers/autoload.php create mode 100644 core/helpers/design_patterns.php create mode 100644 core/helpers/error_handling.php create mode 100644 core/helpers/render.php create mode 100644 data/.gitkeep create mode 100644 docker-compose.redis.yml create mode 100644 docker-compose.yml create mode 100644 docker/bin/docker-entrypoint.sh create mode 100644 docker/bin/optimize.sh create mode 100644 docker/config/composer-naked.json create mode 100644 docker/config/composer-redis.json create mode 100644 docker/config/info.md create mode 100644 docker/config/opcache.ini create mode 100644 docker/config/php-ext-xdebug.ini create mode 100644 docker/config/php-overrides.ini delete mode 100644 helpers/autoload.php delete mode 100644 helpers/design_patterns.php delete mode 100644 helpers/error_handling.php delete mode 100644 helpers/render.php create mode 100644 html/.htaccess create mode 100644 html/app/config/assets.php create mode 100644 html/app/controllers/Product.php create mode 100644 html/app/controllers/Resolve.php create mode 100644 html/app/controllers/admin/.gitkeep create mode 100644 html/app/controllers/api/.gitkeep create mode 100644 html/app/controllers/api/Common_api.php create mode 100644 html/app/controllers/api/Doc_api.php create mode 100644 html/app/controllers/cli/CliContoller.php create mode 100644 html/app/models/Jorge.php create mode 100644 html/app/models/_info.md create mode 100644 html/app/models/cms/Page_model.php create mode 100644 html/app/models/market/Market_repository.php create mode 100644 html/app/models/market/ProductCategories_model.php create mode 100644 html/app/models/market/Product_model.php create mode 100644 html/app/models/todo.md create mode 100644 html/app/routes/api.php create mode 100644 html/app/routes/backend.php create mode 100644 html/app/routes/frontend.php create mode 100644 html/app/views/basic.php create mode 100644 html/app/views/group.php create mode 100644 html/app/views/item.php create mode 100644 html/app/views/products_list.php create mode 100755 html/cache/.gitkeep create mode 100644 html/content/Fonts/CFAstyStd-Bold.woff2 create mode 100644 html/content/Fonts/CFAstyStd-Book.woff2 create mode 100644 html/content/Fonts/CFAstyStd-Medium.woff2 create mode 100644 html/content/Fonts/iconfont.svg create mode 100644 html/content/Fonts/iconfont.ttf create mode 100644 html/content/Fonts/iconfont.woff create mode 100644 html/content/Fonts/iconfont.woff2 create mode 100644 html/content/Media/atcom.svg create mode 100644 html/content/Media/email/check.png create mode 100644 html/content/Media/email/product.jpg create mode 100644 html/content/css/email.css create mode 100644 html/content/css/main.css create mode 100644 html/content/css/main.min.css create mode 100644 html/content/css/overides.css create mode 100644 html/content/fonts/CFAstyStd-Bold.woff create mode 100644 html/content/fonts/CFAstyStd-Bold.woff2 create mode 100644 html/content/fonts/CFAstyStd-Book.woff create mode 100644 html/content/fonts/CFAstyStd-Book.woff2 create mode 100644 html/content/fonts/CFAstyStd-Medium.woff create mode 100644 html/content/fonts/CFAstyStd-Medium.woff2 create mode 100644 html/content/fonts/iconfont.svg create mode 100644 html/content/fonts/iconfont.ttf create mode 100644 html/content/fonts/iconfont.woff create mode 100644 html/content/fonts/iconfont.woff2 create mode 100644 html/content/images/1243x385/jpg/files/pageTitleAnakoinoseis.jpg create mode 100644 html/content/images/1243x385/jpg/files/pageTitleDiagonismoi.jpg create mode 100644 html/content/images/1243x385/jpg/files/pageTitleKatalogoi.jpg create mode 100644 html/content/images/1243x385/jpg/files/pageTitleKatastimata.jpg create mode 100644 html/content/images/1243x385/jpg/files/pageTitleOrario.jpg create mode 100644 html/content/images/1243x385/png/files/emarket.png create mode 100644 html/content/images/140x42/png/Content/media/appstore.webp create mode 100644 html/content/images/140x42/png/Content/media/googlePlay.webp create mode 100644 html/content/images/300x300/png/Content/media/sampleProduct.jp2 create mode 100644 html/content/images/300x300/png/Content/media/sampleProduct.jpg create mode 100644 html/content/images/300x300/png/Content/media/sampleProduct.png create mode 100644 html/content/images/300x300/png/Content/media/sampleProduct.webp create mode 100644 html/content/images/h20/png/Content/media/cards/dinersClub.png create mode 100644 html/content/images/h20/png/Content/media/cards/dinersClub.webp create mode 100644 html/content/images/h20/png/Content/media/cards/mastercard.png create mode 100644 html/content/images/h20/png/Content/media/cards/mastercard.webp create mode 100644 html/content/images/h20/png/Content/media/cards/visa.png create mode 100644 html/content/images/h20/png/Content/media/cards/visa.webp create mode 100644 html/content/js/Cart/miniCart.js create mode 100644 html/content/js/Filters/filterStatus.js create mode 100644 html/content/js/Filters/filters.js create mode 100644 html/content/js/Filters/filtersBar.js create mode 100644 html/content/js/Filters/range.js create mode 100644 html/content/js/Forms/ajaxForm.js create mode 100644 html/content/js/Forms/clearinput.js create mode 100644 html/content/js/Forms/customValidators.js create mode 100644 html/content/js/Forms/password.js create mode 100644 html/content/js/Forms/select.js create mode 100644 html/content/js/Forms/serialize.js create mode 100644 html/content/js/Forms/textarea.js create mode 100644 html/content/js/Forms/validateform.js create mode 100644 html/content/js/Images/lazyload.js create mode 100644 html/content/js/Modals/modal.js create mode 100644 html/content/js/Plugins/accordion.js create mode 100644 html/content/js/Plugins/breadcrumb.js create mode 100644 html/content/js/Plugins/copy.js create mode 100644 html/content/js/Plugins/expand.js create mode 100644 html/content/js/Plugins/expandText.js create mode 100644 html/content/js/Plugins/fileinput.js create mode 100644 html/content/js/Plugins/gallery.js create mode 100644 html/content/js/Plugins/infoPopup.js create mode 100644 html/content/js/Plugins/initialize.js create mode 100644 html/content/js/Plugins/intersecting.js create mode 100644 html/content/js/Plugins/menu.js create mode 100644 html/content/js/Plugins/quantity.js create mode 100644 html/content/js/Plugins/scrollShadowHor.js create mode 100644 html/content/js/Plugins/scrollShadowVert.js create mode 100644 html/content/js/Plugins/tabs.js create mode 100644 html/content/js/Plugins/tabtoggle.js create mode 100644 html/content/js/Plugins/tooltip.js create mode 100644 html/content/js/Products/productHeader.js create mode 100644 html/content/js/Products/productImageModal.js create mode 100644 html/content/js/Products/productattr.js create mode 100644 html/content/js/Sliders/productsSlider.js create mode 100644 html/content/js/Sliders/slider.js create mode 100644 html/content/js/Utils/Event.js create mode 100644 html/content/js/Utils/EventUtils.js create mode 100644 html/content/js/Utils/apiready.js create mode 100644 html/content/js/Utils/confirm.js create mode 100644 html/content/js/Utils/debounce.js create mode 100644 html/content/js/Utils/defineApi.js create mode 100644 html/content/js/Utils/destroyevent.js create mode 100644 html/content/js/Utils/dom.js create mode 100644 html/content/js/Utils/domHelper.js create mode 100644 html/content/js/Utils/enabled.js create mode 100644 html/content/js/Utils/getApis.js create mode 100644 html/content/js/Utils/throttle.js create mode 100644 html/content/js/Utils/whenAll.js create mode 100644 html/content/js/Wishlist/wishlistbutton.js create mode 100644 html/content/lib/current-device.min.js create mode 100644 html/content/lib/emitter/dist/emitter.js create mode 100644 html/content/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js create mode 100644 html/content/lib/jquery-validation/dist/additional-methods.js create mode 100644 html/content/lib/jquery-validation/dist/jquery.validate.js create mode 100644 html/content/lib/jquery/dist/jquery.js create mode 100644 html/content/lib/nouislider.min.js create mode 100644 html/content/lib/plugins/plugins.js create mode 100644 html/content/lib/plugins/plugins.min.js create mode 100644 html/content/lib/plugins/plugins.setup.js create mode 100644 html/content/lib/require/AttributePlugin.js create mode 100644 html/content/lib/require/Require.js create mode 100644 html/content/lib/require/plugins.attribute.js create mode 100644 html/content/lib/require/plugins.attribute.setup.js create mode 100644 html/content/lib/require/require.files.js create mode 100644 html/content/lib/require/require.slim.js create mode 100644 html/content/lib/swiper-bundle.min.js create mode 100644 html/content/lib/wNumb.min.js create mode 100644 html/content/media/badges/aplesprakseislogo.svg create mode 100644 html/content/media/badges/new.svg create mode 100644 html/content/media/content/omilos-sklaveniti.png create mode 100644 html/content/media/delivery.svg create mode 100644 html/content/media/deliverySuccess.svg create mode 100644 html/content/media/exclusive.svg create mode 100644 html/content/media/icon-mylists-tennis.svg create mode 100644 html/content/media/icon-mylists-xmas.svg create mode 100644 html/content/media/logo.svg create mode 100644 html/content/media/logoWhite.svg create mode 100644 html/content/media/notsupported.svg create mode 100644 html/content/media/orderFail.svg create mode 100644 html/content/media/pickup.svg create mode 100644 html/content/media/powered-by-google-on-white3.png create mode 100644 html/content/media/secure.png create mode 100644 html/content/media/sklavenitisMask.svg create mode 100644 html/content/media/tags/bio.svg create mode 100644 html/content/media/tags/noglutten.svg create mode 100644 html/content/media/tags/nolaktose.svg create mode 100644 html/content/media/tags/pge.svg create mode 100644 html/content/media/tags/vegan.svg create mode 100644 html/content/media/tickFilled.svg create mode 100644 html/content/media/wood.png create mode 100644 html/favicon.ico create mode 100644 html/index.php create mode 100644 html/processed-views/base.php create mode 100644 html/processed-views/content/404.php create mode 100644 html/processed-views/content/Basket/Basket.html create mode 100644 html/processed-views/content/Basket/Basket_Item.html create mode 100644 html/processed-views/content/Basket/Basket_aside.html create mode 100644 html/processed-views/content/Basket/Basket_empty.html create mode 100644 html/processed-views/content/Checkout/Final_Error.html create mode 100644 html/processed-views/content/Checkout/Final_Success.html create mode 100644 html/processed-views/content/Checkout/Final_Success_Delivery.html create mode 100644 html/processed-views/content/Checkout/Footer.html create mode 100644 html/processed-views/content/Checkout/Guest.html create mode 100644 html/processed-views/content/Checkout/Header.html create mode 100644 html/processed-views/content/Checkout/Order_Truck.html create mode 100644 html/processed-views/content/Checkout/Registered.html create mode 100644 html/processed-views/content/Checkout/Result.html create mode 100644 html/processed-views/content/Checkout/Steps.html create mode 100644 html/processed-views/content/Checkout/Yellows_Redemption.html create mode 100644 html/processed-views/content/Content/404.html create mode 100644 html/processed-views/content/Content/404NotSupported.html create mode 100644 html/processed-views/content/Content/CCTV.html create mode 100644 html/processed-views/content/Content/Certifications.html create mode 100644 html/processed-views/content/Content/Company.html create mode 100644 html/processed-views/content/Content/Contact.html create mode 100644 html/processed-views/content/Content/Content_Asside.html create mode 100644 html/processed-views/content/Content/Faq.html create mode 100644 html/processed-views/content/Content/Gallery.html create mode 100644 html/processed-views/content/Content/History.html create mode 100644 html/processed-views/content/Content/Politiki_Aporitou.html create mode 100644 html/processed-views/content/Content/Politiki_Cookies.html create mode 100644 html/processed-views/content/Content/Politiki_Epistrofwn.html create mode 100644 html/processed-views/content/Content/Terms.html create mode 100644 html/processed-views/content/Content/Tropoi_Pliromis.html create mode 100644 html/processed-views/content/Store/Store__Anakoinoseis.html create mode 100644 html/processed-views/content/Store/Store__Anakoinoseis__article.html create mode 100644 html/processed-views/content/Store/Store__Anakoinosi.html create mode 100644 html/processed-views/content/Store/Store__Anakoinosi_gallerySlider.html create mode 100644 html/processed-views/content/Store/Store__Diagonismoi.html create mode 100644 html/processed-views/content/Store/Store__Diagonismoi__diagonismosTile.html create mode 100644 html/processed-views/content/Store/Store__Diagonismos.html create mode 100644 html/processed-views/content/Store/Store__Katalogoi.html create mode 100644 html/processed-views/content/Store/Store__Katalogoi__katalogosTile.html create mode 100644 html/processed-views/content/Store/Store__Katastima.html create mode 100644 html/processed-views/content/Store/Store__OrarioLeitourgias.html create mode 100644 html/processed-views/content/StoreLocator/StoreLocator.html create mode 100644 html/processed-views/content/StoreLocator/StoreLocator__fitlers.html create mode 100644 html/processed-views/content/StoreLocator/StoreLocator__storeMap.html create mode 100644 html/processed-views/content/StoreLocator/StoreLocator__storeTile.html create mode 100644 html/processed-views/content/User/User_Account_Details.html create mode 100644 html/processed-views/content/User/User_Account_Header.html create mode 100644 html/processed-views/content/User/User_Account_Lists.html create mode 100644 html/processed-views/content/User/User_Account_Order_History.html create mode 100644 html/processed-views/content/User/User_Account_Order_Repetition.html create mode 100644 html/processed-views/content/myList/My_List.html create mode 100644 html/processed-views/content/myList/My_List_Aside.html create mode 100644 html/processed-views/content/myList/My_List_Fav.html create mode 100644 html/processed-views/content/myList/My_List_Product_List_Fav.htm create mode 100644 html/processed-views/content/myList/My_List_Product_List_Fav_Tile.html create mode 100644 html/processed-views/content/myList/My_List_Selected_Filters.html create mode 100644 html/processed-views/content/myList/My_List_Tile.html create mode 100644 html/processed-views/content/myList/My_List_Title.html create mode 100644 html/processed-views/content/myList/My_List_Tools.html create mode 100644 html/processed-views/content/myList/My_Lists.html create mode 100644 html/processed-views/content/product/Product_Slider.html create mode 100644 html/processed-views/content/product/Product_Slider_Tile.html create mode 100644 html/processed-views/content/product/product_details.php create mode 100644 html/processed-views/content/product_list/Load_More.html create mode 100644 html/processed-views/content/product_list/Product_List_Filters.php create mode 100644 html/processed-views/content/product_list/aside.php create mode 100644 html/processed-views/content/product_list/product_list.php create mode 100644 html/processed-views/content/product_list/product_tile.php create mode 100644 html/processed-views/content/product_list/top_navigation.php create mode 100644 html/processed-views/content/static.php create mode 100644 html/processed-views/email/base.html create mode 100644 html/processed-views/email/content/Forgot_Password1.html create mode 100644 html/processed-views/email/content/Forgot_Password2.html create mode 100644 html/processed-views/email/content/Order.html create mode 100644 html/processed-views/email/content/Order_Notification.html create mode 100644 html/processed-views/email/content/Registration.html create mode 100644 html/processed-views/email/partials/Footer.html create mode 100644 html/processed-views/email/partials/Header.html create mode 100644 html/processed-views/error/404.php create mode 100644 html/processed-views/error/general.php create mode 100644 html/processed-views/modals/Login.html create mode 100644 html/processed-views/modals/My_Lists_Add.html create mode 100644 html/processed-views/modals/My_Lists_Delete.html create mode 100644 html/processed-views/modals/Register.html create mode 100644 html/processed-views/modals/Reset_Password.html create mode 100644 html/processed-views/modals/Reset_Password2.html create mode 100644 html/processed-views/modals/Set_New_Password.html create mode 100644 html/processed-views/modals/Set_New_Password2.html create mode 100644 html/processed-views/modals/User_Account_Delete_Card.html create mode 100644 html/processed-views/modals/User_Account_Order_History_DeleteOrder.html create mode 100644 html/processed-views/partials/Loader.html create mode 100644 html/processed-views/partials/ProductTile__body create mode 100644 html/processed-views/partials/ProductTile__button create mode 100644 html/processed-views/partials/footer.php create mode 100644 html/processed-views/partials/header.php create mode 100644 html/processed-views/products.php create mode 100644 html/processed-views/server-client-contract.md create mode 100644 html/processed-views/x-404.php create mode 100644 sceleton.txt create mode 100644 tests/abstract.php create mode 100644 tests/code/abstract.php create mode 100644 tests/code/bits.php create mode 100644 tests/code/echo.php create mode 100644 tests/code/exceptions.php create mode 100644 tests/code/interface.php create mode 100644 tests/code/login.php create mode 100644 tests/code/proxy.php create mode 100644 tests/code/session.php create mode 100644 tests/code/str-replace.php create mode 100644 tests/compare/compress.php create mode 100644 tests/compare/hashcost.php create mode 100644 tests/compare/md5-v-sha1.php create mode 100644 tests/compare/memcached-v-filecache.php create mode 100644 tests/compare/redis-v-filecache.php create mode 100644 tests/compare/serialize-v-jsonencode.php create mode 100644 tests/compare/sha1-v-sha256.php create mode 100644 tests/php.php create mode 100644 tests/repository.php create mode 100644 tests/service/entropy.php create mode 100644 tests/service/memcached.php create mode 100644 tests/service/redis.php diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6c92eb8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,135 @@ +FROM php:8.1-apache as builder + +# ARG MODE="PRODUCTION" +ARG MODE="debug" + +# setup apache +# ------------------------------------------------------------------------------ + +# enable apache mod_rewrite and headers +RUN a2enmod rewrite +RUN a2enmod headers + +# install pdo and mysql for php +RUN docker-php-ext-install pdo pdo_mysql mysqli + +# copy application code +# ------------------------------------------------------------------------------ + +# Copy local code to the container image. +COPY html /var/www/html + +# Copy core files behind public +COPY core /var/www/core + +# Copy configuration files for the container +COPY docker /var/www/docker + +COPY tests /var/www/tests + +COPY composer.json /var/www/ + + +# Install Composer +# ------------------------------------------------------------------------------ + +# Install Composer with required libraries +RUN apt-get update --fix-missing +RUN DEBIAN_FRONTEND=noninteractive apt-get install git unzip wget -y +RUN curl -sS https://getcomposer.org/installer -o composer-setup.php +RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer +RUN rm composer-setup.php + + +# Add Greek locales to server +# ------------------------------------------------------------------------------ +WORKDIR / +RUN apt-get install -y locales +RUN sed -i 's/^# *\(el_GR\)/\1/' /etc/locale.gen +RUN locale-gen + + +# Manage permitions in specific directories +# ------------------------------------------------------------------------------ +# RUN chown -R www-data:www-data /var/www +RUN chmod -R 757 /var/www/html/cache + + +# Use the PORT environment variable in Apache configuration files. +RUN sed -i 's/80/${PORT}/g' /etc/apache2/sites-available/000-default.conf /etc/apache2/ports.conf + +# Override with custom settings +# TODO: COPY config/php-ini-overrides.ini $PHP_INI_DIR/conf.d/ + + +# Instal Memcached +# ------------------------------------------------------------------------------ +# RUN apt-get update && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-3.2.0 && docker-php-ext-enable memcached +# CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] + + +# Install and setup cron +# ------------------------------------------------------------------------------ +# RUN apt-get update && apt-get install cron -y +# RUN crontab -l | { cat; echo "10 * * * * /usr/local/bin/php /var/www/core/cli/cache-categories.php"; } | crontab - +# or? RUN crontab -l | { cat; echo "10 * * * * php /var/www/core/cli/cache-categories.php"; } | crontab - +# ... or copy cronjobs file into/as /etc/cron.d/cron ; then RUN crontab /etc/cron.d/cron +# ... do that while on entrypoint +# (+) run once after ex. 4 minutes + + + +# Install XDebug (only for develop/debud modes) +# ------------------------------------------------------------------------------ +RUN apt-get install -y apt-utils \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug + +COPY docker/config/php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini +RUN touch /usr/local/etc/php/xdebug.log +RUN chown www-data:www-data /usr/local/etc/php/xdebug.log +RUN chmod 664 /usr/local/etc/php/xdebug.log + + + +# Prepare the entrypoint as in the original image +# ------------------------------------------------------------------------------ +RUN cp /var/www/docker/bin/docker-entrypoint.sh /usr/local/bin +RUN chmod a+x /usr/local/bin/docker-entrypoint.sh + +ENTRYPOINT [] + + +# TODO: +## Enable OPcache and JIT on production +# ------------------------------------------------------------------------------ +## set environemt variable + +# RUN load OPcache and JIT from script +### if [ "${MODE}" = "PRODUCTION" ]; then +### docker-php-ext-install opcache +### docker-php-ext-install opcache +### mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" + +### chk: https://stackoverflow.com/questions/68308209/docker-compose-failed-to-solve-rpc-error-code-unknown-desc-failed-to-comp + +# TODO: +# Enable JIT + +### fi + + + +# TODO: +## Enable OPcache and JIT on production +# ------------------------------------------------------------------------------ +### optimize.sh +### #!/bin/bash -x +### +### if test ["$1" == "PRODUCTION"] ; then +### docker-php-ext-install opcache +### docker-php-ext-install opcache +### install and enable JIT +### else +### maybe install some dev-tool +### fi diff --git a/README.md b/README.md index fb92086..e463f3b 100644 --- a/README.md +++ b/README.md @@ -1,266 +1,191 @@ -## x-anom -### X is ANOther Mvc +# x-anom +(another MVC framework) -x-anom is an Object-Oriented MVC php-framework. -Main advantages of the framework: -* It is super-light and fast; -* Core has almost zero dependences and contains almost anything you need to start and optimize a server-based web-application. -* It is extensible especialy if you use Composer (which is recommended, though not required) -* Handles security; and as long as you write code using secure practices, it will be secure -* It's easy to configure, easy to code, easy to use +## pre-Check +Update ```~./container/config/composer-copy.json``` according to +```~./composer.json``` or vice-versa. You actualy need just one of them; +if pulling the project into a server (bare-metar/vps/shared etc) you only +need the first; if pulling into container you need the second/ -### Requirements +On a Linux system you can also create a link from the one file to the other +(then you need to use ralative paths on autoload.classmap section). -* PHP 8+ -* Some webserver (Apache/Nginx) -* Some SQL server (MySQL/MariaDB/Postgress) -* Basic knowledge of php and SQL +When deploying on PRODUCTION make sure that all development routes are deleted +and debuging messages are disabled. -### What is included +## Build -Core components: + docker build -t x-anom . +Force build without using cache: -#### Router + docker build --no-cache -t x-anom . -Routes request to the appropriate Controller -- matches static paths -- matches dynamic paths through regex expressions -- takes care of request-method -#### Controller and Model -(just write your Controller and Model classes) +## Run + docker-compose up -#### View (rendering engine) +Force rebuild; then run: -Usually you just need to call the render_view(template, data) function. -For templating we use the php short-tag syntax. + docker-compose up --build -main functions: -* load_template( template, data) -* render_view( view_file , data ) -* load_asset( type, assets_array ) +## Remove builded containers -* set_headers( content_type, ttl, more_array ) + docker-compose down -* render_text( data, content_type, ttl ) -* reply_json( data, ttl ) -#### Class autoloader +## While developing... -Composer is recomende; -but if is not available this one will do the job +By default autoloading is handled by Composer (this is highly recommended). +While developing your application (or the framework itself) you will need to +update the autoloading of your new classes. To do so, attach a shell, change +to ```/var/www``` directory and run ```composer dump-autoload``` + cd /var/www -#### Caching + composer dump-autoload -* File Caching mechanism +If Composer is not an option and you use the framework's autoload implementation +(enabling ```define('AUTOLOADER' , '../core/helpers/autoload.php');```), +do not forger to update the (new) paths to your new classes in the ```CLASSPATHS``` +array . Both ```AUTOLOADER``` and ```CLASSPATHS``` definitions can be found +into ```core/confing/anom_settings.php``` file. -* Redis Cache -* Memcached Caching -#### Session Management +## XDebug -* DefaultSession: psevdo-handler with passthrough methods +anom comes with most configuration of XDebug ready; all you need is -* FileSession: custom file-based session handler +1. on Doockerfile: uncoomment the commands under XDebug section -* DatabaseSession: database session handler +2. on docker-compose.yml: uncomment the services.web.extra_hosts section +3. you may need configure your ide to listen onto XDebuger host port +example: +for vscode you need to add a ~./.vscode/launch.json file like this: -#### More + { + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003, + "pathMappings": { + "/var/www/html": "${workspaceRoot}/html" + } + } + ] + } -* Proxy design pattern -* Error handling -* Repository -* Cli interface (*summarizes anom*) +## Customization +The project includes several almost-ready-to-use technologies; +You can enable / customize / disable / configure all these with a few edits. +Each time you change the configuration of your environment, do not forget to set the +related parameters on the main configuration file (```/core/config/anom_settings.php)``` +and/or define environmental variables or credentials to the ```/core/auth/.env``` file. +NOTE: #1 +We assume that you use composer; if not, then whatever composer does you have to +make it manually (copy dependency files and setup the autoloader's paths). +NOTE: #2 +There is no need to use both Redis and Memcached, thus I have not test if these +two caching technologies will work together using the proposed comfiguration. -### Other features -* Docker ready -You can run the framework as is in a Docker environment; -Also. you can edit just a bit the configuration files to customize the project -to support various technologies; Check the README file in the project's root -folder to find out more. +#### Redis +To enable Redis... +Onto docker-compose.yml: -### What is not included +1. Uncomment the lines of 'redis' section; Your Redis-server host name will be the one that is specified in the container_name field (default: redis) -* It lacks a query builder (SQL is easy and very powerful); do not forget to use prepared statements for all your SQL queries. +2. Uncomment the networks subsections; web-server and Redis-server will communicate through a bridge network -* TODO: User-Role based administration class. +3. With composer: -* TODO: Shoping-Cart class. +Include predis/redis into your project's requirements using ```/docker/config/composer-redis.json``` +as your composer.json file -or- install it via: + composer require predis/predis -## Life (and death) of a Client_Request–Server_reply session -1. THE REQUEST: client makes a request -> request arives to the server -> .htaccess sends the request to the index.php +#### Memcached -2. index loads Configuration (constants.php + config.php) and AUTOLOADER in order load classes easily +To host the Memcached service: -3. index loads init.php -> after initialization the APP is READY -> index loads the routes; Route::run() -> the APP is RUNNING +1. Onto docker-compose.yml: uncomment the lines of 'memcached' section; Memcached-server host name will be the one that is specified in the container_name field (default: anomemcached) -4. Router resolves the request pattern and calls a Controller +2. Onto Dockerfile: uncomment the lines under subsection 'Install Memcached' -5. (if needed) Controller asks data from the Model; then responds a reply to the client using **render** functions -> APP dies +* TODO: Maria database -## Direcrtory structure -NOTE: directory structure needs updata, but the main structure ramains untouched. +* TODO: Adminer +(https://stackoverflow.com/questions/33631085/how-to-use-adminer-with-composer-autoload-php) - . - |-- container * for docker/container configuration - | |-- bin * scripts - | `-- config * settings - | - |-- core * core code - | |-- auth * authentication and credentials - | | - | |-- config * application parametres - | | |-- config.php - | | |-- constants.php - | | |-- credentials.php - | | `-- init.php - | | - | |-- classes * core classes - | | |-- cacher - | | |-- Benchmark.php - | | |-- Database.php - | | |-- Route.php - | | |-- Security.php - | | `-- Session.php - | | - | `-- helpers * core helpers - | |-- autoload.php - | |-- error-handling.php - | `-- render.php - | - |-- data * folder for batch data-imports to database - | - |-- html ** PUBLIC directory - | |-- app * APP - | | |-- Controllers * Controllers - | | | |-- Art.php - | | | `-- ... - | | | - | | |-- Models * Models - | | | |-- Art_model.php - | | | `-- ... - | | | - | | |-- Views * Views - | | | |-- group.php - | | | `-- item.php - | | | - | | `-- routes.php * application routes - | | - | `-- cache * Caching folder - | - `-- vendor * Vendor classes and autoloader - |-- composer - `-- ... +* TODO: phpMyAdmin +* Apache -## Naming Conventions and good practices -1. Keep Controllers, Models, Views in their folders +* Opcache and JIT -2. Organize View elements in subfolders -3. Controller and Model names shall be camelcased; - - fist letter should be Uppercase; - - classes shall be named exactly as their filenames +TODO: -4. Model names shall be suffixed with _model +## Staging -5. Comment every-single Controller/Model/class and comment every method +#### Build -6. On Views (php templates) use php short-tags when possible - - Views are about rendering data; avoid complex-logic - - [if/else], [foreach] and some flag/temp [variables] sould be fair enough +#### Deploy -7. All of the above rules are strongly recommended (although not obligatory); +## Production +### Build -## Notes and brainstorming +### Deploy -### for template system check - https://css-tricks.com/php-is-a-ok-for-templating/ +! Run the above commands ONLY when you need to manually deploy the app to Cloud Run, otherwise everything is automated using Cloud Builds -### for rendering system you may check volt too - https://docs.phalcon.io/4.0/en/volt -## Brainstorming +## Notes -* take care of various hacks - chk: https://stackoverflow.com/questions/1996122/how-to-prevent-xss-with-html-php +* '~./' refers to the root of the project -* HTML to MarkDown! - chk: https://github.com/thephpleague/html-to-markdown - - - - - -VIEW data - --> ceo -> title - -> description - -> keywords - -> ... - --> content -> view : view_filename - -> key : some_variable_name - -> data : the_data - - - - -## Knowledge Requirements - -## Tools of work - -None of the following tools is necessary, but they will help very very-much. - -- Composer - -- Docker - -- Code editor - -- Coffee + Nicotine +* Furhter documentation about the framework can be found in ~./core/README.md diff --git a/auth/.gitkeep b/auth/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/classes/Benchmark.php b/classes/Benchmark.php deleted file mode 100644 index a7e93ea..0000000 --- a/classes/Benchmark.php +++ /dev/null @@ -1,150 +0,0 @@ -'; - $close = '
'; - $suffix = '
+ =$item['info']?> +
+ Quantity text here +
Για να δημιουργήσετε νέο κωδικό, παρακαλούμε κάντε κλικ εδώ.
Σας ευχαριστούμε!
Ημ. Παράδοσης
15/3/2022
Κωδικός παραγγελίας
F0686A8F3356
Σύνολο Παραγγελίας
25,30 €
Στοιχεία Παραλήπτη
Κατερίνα Παπαδοπούλου | 69780559445
Διεύθυνση Παράδοσης
Υψηλάντου 2, Αγία Παρασκευή
Χρόνος Παράδοσης
Τρίτη 12 Οκτωβρίου 2021, 11:00-13:00
Τρόπος Πληρωμής
Απόδειξη λιανικής | Μετρητά
Αξία Καλαθιού
28,16 €
Προϊόντα (2)
Ποσότητα
Αξία
Προσθήκη στο Ημερολόγιο
Σας ενημερώνουμε οτι η αξία της Παραγγελίας σας με κωδικό 658794512Ε είναι 3,41€.
Απο την αρχική σας Παραγγελία προκύπτει διαφορά 1,33€, ποσό που θα πιστωθεί στον λογαριασμό Τραπέζης/κάρτας, + μέσω του οποίου πραγματοποιήσατε την πληρωμή. Η εντολή επιστροφής θα δοθεί στην Τράπεζα εντος των επόμενων + δύο (2) εργάσιμων ημερών.
Είμαστε στην διάθεσή σας για οποιαδήποτε διευκρύνιση ή πληροφορία θα χρειαστείτε.
Κέντρο εξυπηρέτησης eMarket:
800 800 7777 (μόνο από σταθερό, χωρίς χρέωση)
210 540 2200 (αστική χρέωση)
emarket@sklavenitis.gr
Για να επισκεφτείτε το eMarket κάντε κλικ εδώ.
Για να μεταβείτε στον λογαριασμό σας κάντε κλικ εδώ.
Εάν εγγραφείτε θα έχετε τη δυνατότητα να:
Επιλέξτε όνομα και εικονίδιο για την Λίστα σας!
Eίστε σίγουροι ότι θέλετε να διαγράψετε την Λίστα “Χριστούγεννα”; H Λίστα περιέχει 23 προϊόντα.
Ο κωδικός πρόσβασης πρέπει να περιέχει 6 έως 25 χαρακτήρες, χωρίς κενά, οι + οποίοι μπορεί να είναι λατινικά γράμματα, αριθμοί ή και τα σύμβολα !@#$+_- +
Τα πεδία με (*) είναι υποχρεωτικά
Σας έχουμε αποστείλει email.
Ο κωδικός πρόσβασης πρέπει να περιέχει 6 έως 25 χαρακτήρες, χωρίς κενά, οι οποίοι + μπορεί να είναι λατινικά γράμματα, αριθμοί ή και τα σύμβολα !@#$+_-
+ Ο νέος σας κωδικός αποθηκεύτηκε. + Σας ευχαριστούμε +
Δεν θα μπορέσετε να αναιρέσετε αυτή την ενέργεια.
Παρακαλούμε περιμένετε...
δεν είναι πλέον διαθέσιμο για + online αγορά
Μπορείτε να γυρίσετε πίσω ή να μετακινηθείτε στην αρχική σελίδα.
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit... +There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain...
gzcompress(1) +compressed {$originalLength} to {$compressLength} or "; +echo ($originalLength-$compressLength)*100/$originalLength ."%\n"; + + + +$originalLength = $compressLength = 0; +Benchmark::add_spot('gzcompress(4)-10000-products'); +foreach($products as $product) { + $original = serialize($product); + $compress = gzcompress($original, 4); + $originalLength = strlen($original); + $compressLength = strlen($compress); +} +echo "gzcompress(4) +compressed {$originalLength} to {$compressLength} or "; +echo ($originalLength-$compressLength)*100/$originalLength ."%\n"; + + + +$originalLength = $compressLength = 0; +Benchmark::add_spot('gzcompress(6)-10000-products'); +foreach($products as $product) { + $original = serialize($product); + $compress = gzcompress($original, 6); + $originalLength = strlen($original); + $compressLength = strlen($compress); +} +echo "gzcompress(6) +compressed {$originalLength} to {$compressLength} or "; +echo ($originalLength-$compressLength)*100/$originalLength ."%\n"; + + + +$cache = Registry::use('cache'); + +Benchmark::add_spot('Cache-save-10000-products'); +foreach($products as $product) { + $cache->set('cache.sav.'.$product['ID'], serialize($product), 3600); +} + + + +Benchmark::add_spot('gz(ser(),6)+Save-10000-products'); +foreach($products as $product) { + $cache->set('zx.ser.sav.'.$product['ID'], gzcompress(serialize($product), 6), 3600); +} + +$maxLen = 0; +Benchmark::add_spot('sha1(serialize())-10000-products'); +foreach($products as $product) { + $original = sha1(serialize($product)); + $maxlen = $maxLen > strlen($original) ? $maxLen : strlen($original); +} + + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); diff --git a/tests/compare/hashcost.php b/tests/compare/hashcost.php new file mode 100644 index 0000000..7a1401f --- /dev/null +++ b/tests/compare/hashcost.php @@ -0,0 +1,54 @@ +'; +echo "\nPassword Hash Cost Calculator\n\n"; +echo "Testing BCRYPT hashing the password '$password'\n\n"; +echo "We're going to run until the time to generate the hash takes longer than {$mSec}ms\n"; + +$cost = 3; +do { + $cost++; + echo "\nTesting cost value of $cost: "; + $time = benchmark($password, $cost); + echo "... took $time"; +} while ($time < ($mSec/1000)); + +echo "\n\nIdeal cost is $cost\n"; +echo "\nRunning 100 times to check the average:\n"; + +$start = microtime(true); +$times = []; +for ($i=1;$i<=100;$i++) { + echo "\r$i/100"; + $times[] = benchmark($password, $cost); +} + +echo "\n\ndone benchmarking in ".(microtime(true)-$start)."\n"; + +echo "\nSlowest time: ".max($times); +echo "\nFastest time: ".min($times); +echo "\nAverage time: ".(array_sum($times)/count($times)); + +echo "\n\nFinished\n"; +echo ""; + +function benchmark($password, $cost=4) +{ + $start = microtime(true); + password_hash($password, PASSWORD_BCRYPT, ['cost'=>$cost]); + return microtime(true) - $start; +} diff --git a/tests/compare/md5-v-sha1.php b/tests/compare/md5-v-sha1.php new file mode 100644 index 0000000..44b5148 --- /dev/null +++ b/tests/compare/md5-v-sha1.php @@ -0,0 +1,18 @@ +runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('memcached-set-start'); +foreach($products as $product) { + MemcachedCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('memcached-get-start'); +foreach($products as $product) { + $x = MemcachedCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('filecache-set-start'); +foreach($products as $product) { + FileCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('filecache-get-start'); +foreach($products as $product) { + $x = FileCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); + + diff --git a/tests/compare/redis-v-filecache.php b/tests/compare/redis-v-filecache.php new file mode 100644 index 0000000..e59c390 --- /dev/null +++ b/tests/compare/redis-v-filecache.php @@ -0,0 +1,35 @@ +runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('redis-set-start'); +foreach($products as $product) { + RedisCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('redis-get-start'); +foreach($products as $product) { + $x = RedisCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('filecache-set-start'); +foreach($products as $product) { + FileCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('filecache-get-start'); +foreach($products as $product) { + $x = FileCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); + + diff --git a/tests/compare/serialize-v-jsonencode.php b/tests/compare/serialize-v-jsonencode.php new file mode 100644 index 0000000..ba9ccc9 --- /dev/null +++ b/tests/compare/serialize-v-jsonencode.php @@ -0,0 +1,35 @@ +runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('serialize-start'); +foreach($products as $product) { + $ser = serialize($product); +} + +Benchmark::add_spot('serialize+unserialize-start'); +foreach($products as $product) { + $ser = serialize($product); + $ori = unserialize($ser); +} + +Benchmark::add_spot('jsonencode-start'); +foreach($products as $product) { + $json = json_encode($product); +} + +Benchmark::add_spot('jsonencode+decode-start'); +foreach($products as $product) { + $json = json_encode($product); + $ori = json_decode($json); +} + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); \ No newline at end of file diff --git a/tests/compare/sha1-v-sha256.php b/tests/compare/sha1-v-sha256.php new file mode 100644 index 0000000..4d10e7f --- /dev/null +++ b/tests/compare/sha1-v-sha256.php @@ -0,0 +1,22 @@ +'; +echo "\nsha1: ". sha1('hello'); +echo "\nsha256: ". hash('sha256', 'hello'); +echo ''; +ob_flush(); + +Benchmark::add_spot('100.000 x sha1'); +for($i = 0 ; $i<100000 ; $i++) $x = sha1($i); + + +Benchmark::add_spot('100.000 x sha256'); +for($i = 0 ; $i<100000 ; $i++) $x = hash('sha256', $i); + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); + \ No newline at end of file diff --git a/tests/php.php b/tests/php.php new file mode 100644 index 0000000..58ef35c --- /dev/null +++ b/tests/php.php @@ -0,0 +1,2 @@ + Market::echo(True) +// ]); die(); + +$shorts = Market::echo(True); +?> + + + + + + + + + + + + + + $sql) : ?> + + + + =$label?> + + =$sql?> + apply: + +use Registrty; +use app\models\market\Market_repository as Market; + +// ... + +Registry::use('database')->runQuery( + Market::pull('=$label?>'), + [ + + '=$holder?>' => ..., + + ] +); + + + + + + + + diff --git a/tests/service/entropy.php b/tests/service/entropy.php new file mode 100644 index 0000000..6401ffd --- /dev/null +++ b/tests/service/entropy.php @@ -0,0 +1,61 @@ + + + Dev Tools + + + Supported Crypt/Encrypt Methods + +
gzcompress(4) +compressed {$originalLength} to {$compressLength} or "; +echo ($originalLength-$compressLength)*100/$originalLength ."%\n"; + + + +$originalLength = $compressLength = 0; +Benchmark::add_spot('gzcompress(6)-10000-products'); +foreach($products as $product) { + $original = serialize($product); + $compress = gzcompress($original, 6); + $originalLength = strlen($original); + $compressLength = strlen($compress); +} +echo "gzcompress(6) +compressed {$originalLength} to {$compressLength} or "; +echo ($originalLength-$compressLength)*100/$originalLength ."%\n"; + + + +$cache = Registry::use('cache'); + +Benchmark::add_spot('Cache-save-10000-products'); +foreach($products as $product) { + $cache->set('cache.sav.'.$product['ID'], serialize($product), 3600); +} + + + +Benchmark::add_spot('gz(ser(),6)+Save-10000-products'); +foreach($products as $product) { + $cache->set('zx.ser.sav.'.$product['ID'], gzcompress(serialize($product), 6), 3600); +} + +$maxLen = 0; +Benchmark::add_spot('sha1(serialize())-10000-products'); +foreach($products as $product) { + $original = sha1(serialize($product)); + $maxlen = $maxLen > strlen($original) ? $maxLen : strlen($original); +} + + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); diff --git a/tests/compare/hashcost.php b/tests/compare/hashcost.php new file mode 100644 index 0000000..7a1401f --- /dev/null +++ b/tests/compare/hashcost.php @@ -0,0 +1,54 @@ +'; +echo "\nPassword Hash Cost Calculator\n\n"; +echo "Testing BCRYPT hashing the password '$password'\n\n"; +echo "We're going to run until the time to generate the hash takes longer than {$mSec}ms\n"; + +$cost = 3; +do { + $cost++; + echo "\nTesting cost value of $cost: "; + $time = benchmark($password, $cost); + echo "... took $time"; +} while ($time < ($mSec/1000)); + +echo "\n\nIdeal cost is $cost\n"; +echo "\nRunning 100 times to check the average:\n"; + +$start = microtime(true); +$times = []; +for ($i=1;$i<=100;$i++) { + echo "\r$i/100"; + $times[] = benchmark($password, $cost); +} + +echo "\n\ndone benchmarking in ".(microtime(true)-$start)."\n"; + +echo "\nSlowest time: ".max($times); +echo "\nFastest time: ".min($times); +echo "\nAverage time: ".(array_sum($times)/count($times)); + +echo "\n\nFinished\n"; +echo ""; + +function benchmark($password, $cost=4) +{ + $start = microtime(true); + password_hash($password, PASSWORD_BCRYPT, ['cost'=>$cost]); + return microtime(true) - $start; +} diff --git a/tests/compare/md5-v-sha1.php b/tests/compare/md5-v-sha1.php new file mode 100644 index 0000000..44b5148 --- /dev/null +++ b/tests/compare/md5-v-sha1.php @@ -0,0 +1,18 @@ +runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('memcached-set-start'); +foreach($products as $product) { + MemcachedCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('memcached-get-start'); +foreach($products as $product) { + $x = MemcachedCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('filecache-set-start'); +foreach($products as $product) { + FileCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('filecache-get-start'); +foreach($products as $product) { + $x = FileCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); + + diff --git a/tests/compare/redis-v-filecache.php b/tests/compare/redis-v-filecache.php new file mode 100644 index 0000000..e59c390 --- /dev/null +++ b/tests/compare/redis-v-filecache.php @@ -0,0 +1,35 @@ +runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('redis-set-start'); +foreach($products as $product) { + RedisCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('redis-get-start'); +foreach($products as $product) { + $x = RedisCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('filecache-set-start'); +foreach($products as $product) { + FileCache::set('prod'.$product['ID'], $product, 600); +} + +Benchmark::add_spot('filecache-get-start'); +foreach($products as $product) { + $x = FileCache::get('prod'.$product['ID']); +} + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); + + diff --git a/tests/compare/serialize-v-jsonencode.php b/tests/compare/serialize-v-jsonencode.php new file mode 100644 index 0000000..ba9ccc9 --- /dev/null +++ b/tests/compare/serialize-v-jsonencode.php @@ -0,0 +1,35 @@ +runQuery("SELECT * FROM products LIMIT 10000",[]); + +Benchmark::add_spot('serialize-start'); +foreach($products as $product) { + $ser = serialize($product); +} + +Benchmark::add_spot('serialize+unserialize-start'); +foreach($products as $product) { + $ser = serialize($product); + $ori = unserialize($ser); +} + +Benchmark::add_spot('jsonencode-start'); +foreach($products as $product) { + $json = json_encode($product); +} + +Benchmark::add_spot('jsonencode+decode-start'); +foreach($products as $product) { + $json = json_encode($product); + $ori = json_decode($json); +} + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); \ No newline at end of file diff --git a/tests/compare/sha1-v-sha256.php b/tests/compare/sha1-v-sha256.php new file mode 100644 index 0000000..4d10e7f --- /dev/null +++ b/tests/compare/sha1-v-sha256.php @@ -0,0 +1,22 @@ +'; +echo "\nsha1: ". sha1('hello'); +echo "\nsha256: ". hash('sha256', 'hello'); +echo '
gzcompress(6) +compressed {$originalLength} to {$compressLength} or "; +echo ($originalLength-$compressLength)*100/$originalLength ."%\n"; + + + +$cache = Registry::use('cache'); + +Benchmark::add_spot('Cache-save-10000-products'); +foreach($products as $product) { + $cache->set('cache.sav.'.$product['ID'], serialize($product), 3600); +} + + + +Benchmark::add_spot('gz(ser(),6)+Save-10000-products'); +foreach($products as $product) { + $cache->set('zx.ser.sav.'.$product['ID'], gzcompress(serialize($product), 6), 3600); +} + +$maxLen = 0; +Benchmark::add_spot('sha1(serialize())-10000-products'); +foreach($products as $product) { + $original = sha1(serialize($product)); + $maxlen = $maxLen > strlen($original) ? $maxLen : strlen($original); +} + + +Benchmark::add_spot('end'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); diff --git a/tests/compare/hashcost.php b/tests/compare/hashcost.php new file mode 100644 index 0000000..7a1401f --- /dev/null +++ b/tests/compare/hashcost.php @@ -0,0 +1,54 @@ +'; +echo "\nPassword Hash Cost Calculator\n\n"; +echo "Testing BCRYPT hashing the password '$password'\n\n"; +echo "We're going to run until the time to generate the hash takes longer than {$mSec}ms\n"; + +$cost = 3; +do { + $cost++; + echo "\nTesting cost value of $cost: "; + $time = benchmark($password, $cost); + echo "... took $time"; +} while ($time < ($mSec/1000)); + +echo "\n\nIdeal cost is $cost\n"; +echo "\nRunning 100 times to check the average:\n"; + +$start = microtime(true); +$times = []; +for ($i=1;$i<=100;$i++) { + echo "\r$i/100"; + $times[] = benchmark($password, $cost); +} + +echo "\n\ndone benchmarking in ".(microtime(true)-$start)."\n"; + +echo "\nSlowest time: ".max($times); +echo "\nFastest time: ".min($times); +echo "\nAverage time: ".(array_sum($times)/count($times)); + +echo "\n\nFinished\n"; +echo "
+ =$sql?>
+use Registrty; +use app\models\market\Market_repository as Market; + +// ... + +Registry::use('database')->runQuery( + Market::pull('=$label?>'), + [ + + '=$holder?>' => ..., + + ] +); +
+ +
+ + +
+random_bytes() +32Bytes: =bin2hex(random_bytes(32))?> +