├── PHP_INSTALLATION.md
├── README.md
├── create_currency_table.php
├── create_currency_table_db.php
├── create_iso_country_codes_csv.php
├── db.config.php
├── google_api_key.php
├── info.php
├── php7cookbook.sql
├── phpunit.phar
├── prospects.csv
├── source
├── .buildpath
├── .project
├── .settings
│ └── org.eclipse.php.core.prefs
├── Application
│ ├── Acl
│ │ ├── Acl.php
│ │ ├── Authenticate.php
│ │ ├── AuthenticateInterface.php
│ │ └── DbTable.php
│ ├── Autoload
│ │ └── Loader.php
│ ├── Cache
│ │ ├── CacheAdapterInterface.php
│ │ ├── Constants.php
│ │ ├── Core.php
│ │ ├── Database.php
│ │ └── File.php
│ ├── Captcha
│ │ ├── CaptchaInterface.php
│ │ ├── Image.php
│ │ ├── Phrase.php
│ │ └── Reverse.php
│ ├── Database
│ │ ├── BasicOps.php
│ │ ├── Connection.php
│ │ ├── ConnectionAwareInterface.php
│ │ ├── ConnectionTrait.php
│ │ ├── CustomerOrmService_1.php
│ │ ├── CustomerOrmService_2.php
│ │ ├── CustomerService.php
│ │ ├── Finder.php
│ │ ├── Mapper
│ │ │ ├── FieldConfig.php
│ │ │ └── Mapping.php
│ │ ├── Paginate.php
│ │ ├── Search
│ │ │ ├── Criteria.php
│ │ │ └── Engine.php
│ │ └── Service.php
│ ├── Entity
│ │ ├── Address.php
│ │ ├── Base.php
│ │ ├── Customer.php
│ │ ├── Name.php
│ │ ├── Person.php
│ │ ├── Product.php
│ │ ├── Profile.php
│ │ ├── ProtectedPerson.php
│ │ ├── PublicPerson.php
│ │ └── Purchase.php
│ ├── Error
│ │ ├── GeneratesError.php
│ │ ├── Handler.php
│ │ ├── ThrowsError.php
│ │ └── ThrowsException.php
│ ├── Event
│ │ ├── Listener.php
│ │ └── Manager.php
│ ├── Filter
│ │ ├── AbstractFilter.php
│ │ ├── CallbackInterface.php
│ │ ├── Filter.php
│ │ ├── Messages.php
│ │ ├── Result.php
│ │ └── Validator.php
│ ├── Form
│ │ ├── Element
│ │ │ ├── CheckBox.php
│ │ │ ├── Form.php
│ │ │ ├── Radio.php
│ │ │ └── Select.php
│ │ ├── Factory.php
│ │ └── Generic.php
│ ├── Generic
│ │ ├── CountryList.php
│ │ ├── CountryListUsingTrait.php
│ │ ├── CustomerList.php
│ │ ├── CustomerListUsingTrait.php
│ │ ├── Hydrator
│ │ │ ├── Any.php
│ │ │ ├── GetSet.php
│ │ │ └── Strategy
│ │ │ │ ├── Extending.php
│ │ │ │ ├── GetSet.php
│ │ │ │ ├── HydratorInterface.php
│ │ │ │ └── PublicProps.php
│ │ ├── ListFactory.php
│ │ ├── ListTrait.php
│ │ ├── Name.php
│ │ ├── Node.php
│ │ ├── Registry.php
│ │ ├── Search.php
│ │ ├── Stack.php
│ │ ├── Temp.php
│ │ ├── Test.php
│ │ └── Tree.php
│ ├── I18n
│ │ ├── Calendar.php
│ │ ├── Day.php
│ │ ├── Event.php
│ │ ├── IsoCodes.php
│ │ ├── IsoCodesCsv.php
│ │ ├── IsoCodesDb.php
│ │ ├── IsoCodesInterface.php
│ │ ├── Locale.php
│ │ ├── SingleEvent.php
│ │ └── Translate
│ │ │ ├── Adapter
│ │ │ ├── Csv.php
│ │ │ ├── Database.php
│ │ │ ├── Ini.php
│ │ │ ├── TranslateAdapterInterface.php
│ │ │ └── TranslateAdapterTrait.php
│ │ │ └── Translation.php
│ ├── Iterator
│ │ ├── Directory.php
│ │ └── LargeFile.php
│ ├── MiddleWare
│ │ ├── Constants.php
│ │ ├── Message.php
│ │ ├── Request.php
│ │ ├── Response.php
│ │ ├── ServerRequest.php
│ │ ├── Session
│ │ │ └── Validator.php
│ │ ├── Stream.php
│ │ ├── TextStream.php
│ │ ├── UploadedFile.php
│ │ └── Uri.php
│ ├── Mvc
│ │ ├── City.php
│ │ └── Dispatch.php
│ ├── Parse
│ │ ├── Convert.php
│ │ ├── ConvertXml.php
│ │ ├── Tree.php
│ │ ├── WebTree.php
│ │ └── XmlPath.php
│ ├── PubSub
│ │ ├── Publisher.php
│ │ └── Subscriber.php
│ ├── Routing
│ │ └── Router.php
│ ├── Security
│ │ ├── PassGen.php
│ │ └── SessOptions.php
│ ├── Test
│ │ ├── FakeData.php
│ │ └── TestClass.php
│ └── Web
│ │ ├── AbstractHttp.php
│ │ ├── Access.php
│ │ ├── Client
│ │ ├── Curl.php
│ │ └── Streams.php
│ │ ├── Deep.php
│ │ ├── Hoover.php
│ │ ├── Menu
│ │ ├── Factory.php
│ │ ├── Item.php
│ │ └── Menu.php
│ │ ├── Received.php
│ │ ├── Request.php
│ │ ├── Response.php
│ │ ├── Rest
│ │ ├── AbstractApi.php
│ │ ├── ApiInterface.php
│ │ ├── CustomerApi.php
│ │ └── Server.php
│ │ ├── Security.php
│ │ └── Soap
│ │ └── ProspectsApi.php
├── Psr
│ ├── Http
│ │ └── Message
│ │ │ ├── MessageInterface.php
│ │ │ ├── RequestInterface.php
│ │ │ ├── ResponseInterface.php
│ │ │ ├── ServerRequestInterface.php
│ │ │ ├── StreamInterface.php
│ │ │ ├── UploadedFileInterface.php
│ │ │ └── UriInterface.php
│ ├── LICENSE
│ ├── README.md
│ └── composer.json
├── chapter01
│ ├── chap_01_autoload_test.php
│ ├── chap_01_deep_scan_website.php
│ ├── chap_01_php5_to_php7_code_converter.php
│ ├── chap_01_php5_to_php7_code_converter_test_file.php
│ ├── chap_01_php7_to_php5_code_converter.php
│ ├── chap_01_php7_to_php5_code_converter_test_file.php
│ ├── chap_01_vacuuming_website.php
│ └── test.php
├── chapter02
│ ├── chap_02_config.php
│ ├── chap_02_foreach.php
│ ├── chap_02_iterating_through_a_massive_file.php
│ ├── chap_02_performance_using_php7_enhancement_call.php
│ ├── chap_02_recursive_directory_iterator.php
│ ├── chap_02_simple_ast_example.php
│ ├── chap_02_taking_advantage_of_ast.php
│ ├── chap_02_taking_advantage_of_ast_left_to_right_parsing.php
│ ├── chap_02_understanding_ast_simple_example.php
│ ├── chap_02_understanding_diffs_in_parsing.php
│ ├── chap_02_understanding_diffs_in_parsing_2.php
│ ├── chap_02_understanding_diffs_in_parsing_php5.php
│ ├── chap_02_understanding_variable_variables.php
│ ├── chap_02_uploading_csv_to_database.php
│ ├── chap_02_web_filtering_ast_example.php
│ ├── css
│ │ ├── bootstrap.css
│ │ ├── owl.carousel.css
│ │ ├── popuo-box.css
│ │ └── style.css
│ ├── home.php
│ ├── images
│ │ ├── arrow-2.png
│ │ ├── arrow1.png
│ │ ├── brand-logo1.png
│ │ ├── brand-logo2.png
│ │ ├── brand-logo3.png
│ │ ├── brand-logo4.png
│ │ ├── btn-icons.png
│ │ ├── divice-half.png
│ │ ├── divice-in-hand.png
│ │ ├── divice.png
│ │ ├── fav.png
│ │ ├── feature-icons-l.png
│ │ ├── feature-icons-r.png
│ │ ├── heart-icon.png
│ │ ├── icon1.png
│ │ ├── logo.png
│ │ ├── msg-icon.png
│ │ ├── nav-icon.png
│ │ ├── play-btn.png
│ │ ├── quit-people.jpg
│ │ ├── screen-coursuals.png
│ │ ├── screen.png
│ │ ├── slide.jpg
│ │ ├── social-icons.png
│ │ ├── team-member.jpg
│ │ ├── team-member1.jpg
│ │ ├── team-member2.jpg
│ │ ├── team-member3.jpg
│ │ ├── team-member4.jpg
│ │ ├── team-social.png
│ │ ├── testmonials.png
│ │ ├── to-top1.png
│ │ └── top-slider-pagenate.png
│ ├── index.html
│ ├── js
│ │ ├── easing.js
│ │ ├── jquery.magnific-popup.js
│ │ ├── jquery.min.js
│ │ ├── move-top.js
│ │ ├── owl.carousel.js
│ │ └── responsiveslides.min.js
│ ├── templates
│ │ └── home.html
│ └── w3layouts-license.txt
├── chapter03
│ ├── chap_03_developing_functions.php
│ ├── chap_03_developing_functions_array_iterator.php
│ ├── chap_03_developing_functions_filtered_and_paginated.php
│ ├── chap_03_developing_functions_filtered_iterator.php
│ ├── chap_03_developing_functions_iterators.php
│ ├── chap_03_developing_functions_iterators_library.php
│ ├── chap_03_developing_functions_library.php
│ ├── chap_03_developing_functions_namespace.php
│ ├── chap_03_developing_functions_namespace_alpha.php
│ ├── chap_03_developing_functions_namespace_beta.php
│ ├── chap_03_developing_functions_paginated.php
│ ├── chap_03_developing_functions_recursive.php
│ ├── chap_03_developing_functions_return_types.php
│ ├── chap_03_developing_functions_return_types_library.php
│ ├── chap_03_developing_functions_stacked_iterators.php
│ ├── chap_03_developing_functions_type_hints_library.php
│ ├── chap_03_developing_functions_using_generator.php
│ ├── chap_03_developing_functions_with_hints.php
│ └── test.php
├── chapter04
│ ├── NameAddress.php
│ ├── Test.php
│ ├── TwoClass.php
│ ├── chap_04_oop_abstract.php
│ ├── chap_04_oop_anonymous_class.php
│ ├── chap_04_oop_anonymous_class_basic.php
│ ├── chap_04_oop_anonymous_class_extends.php
│ ├── chap_04_oop_anonymous_class_interfaces.php
│ ├── chap_04_oop_basic_visibility.php
│ ├── chap_04_oop_classes_case_insensitive.php
│ ├── chap_04_oop_defining_class_test.php
│ ├── chap_04_oop_extends.php
│ ├── chap_04_oop_factory_pattern_example.php
│ ├── chap_04_oop_interfaces_collisions.php
│ ├── chap_04_oop_late_static_binding_illustration.php
│ ├── chap_04_oop_namespace_and_autoloading.php
│ ├── chap_04_oop_namespace_example.php
│ ├── chap_04_oop_namespace_example_1.php
│ ├── chap_04_oop_namespace_example_2.php
│ ├── chap_04_oop_namespace_example_3.php
│ ├── chap_04_oop_private.php
│ ├── chap_04_oop_simple_interfaces_example.php
│ ├── chap_04_oop_simple_static.php
│ ├── chap_04_oop_single_inheritance.php
│ ├── chap_04_oop_trait_anonymous_class.php
│ ├── chap_04_oop_trait_methods_do_not_override_class_methods.php
│ ├── chap_04_oop_trait_multiple.php
│ ├── chap_04_oop_traits_override_inherited.php
│ ├── chap_04_oop_two_classes_in_one_file.php
│ ├── chap_04_oop_type_hint.php
│ ├── chap_04_oop_using_stdclass.php
│ └── chap_04_oop_visibility_class_constants.php
├── chapter05
│ ├── chap_05_entity_to_query_fetch_by_id.php
│ ├── chap_05_entity_to_query_remove.php
│ ├── chap_05_entity_to_query_save.php
│ ├── chap_05_jquery_datatables_php_lookups.php
│ ├── chap_05_jquery_datatables_php_lookups_ajax.php
│ ├── chap_05_match_entity_to_table.php
│ ├── chap_05_oop_query_builder.php
│ ├── chap_05_pagination.php
│ ├── chap_05_pdo_connect_mysql.php
│ ├── chap_05_pdo_connect_mysql_extended_dsn.php
│ ├── chap_05_pdo_connect_pgsql.php
│ ├── chap_05_pdo_connect_sqlite.php
│ ├── chap_05_pdo_error_mode.php
│ ├── chap_05_pdo_mysql_fetch_class.php
│ ├── chap_05_pdo_mysql_fetch_class_fetch_object.php
│ ├── chap_05_pdo_mysql_fetch_into.php
│ ├── chap_05_pdo_mysql_fetch_obj.php
│ ├── chap_05_pdo_prepared_bind_params.php
│ ├── chap_05_pdo_prepared_named_placeholders.php
│ ├── chap_05_pdo_prepared_positional_placeholders.php
│ ├── chap_05_pdo_scrollable_cursor.php
│ ├── chap_05_pdo_transactions.php
│ ├── chap_05_secondary_lookups.php
│ └── test.php
├── chapter06
│ ├── chap_06_form_element_checkbox.php
│ ├── chap_06_form_element_generator.php
│ ├── chap_06_form_element_radio.php
│ ├── chap_06_form_element_select.php
│ ├── chap_06_form_factory.php
│ ├── chap_06_menu_builder.php
│ ├── chap_06_menu_builder_1.php
│ ├── chap_06_menu_builder_2.php
│ ├── chap_06_menu_builder_3.php
│ ├── chap_06_post_data_config_callbacks.php
│ ├── chap_06_post_data_config_messages.php
│ ├── chap_06_post_data_filtering.php
│ ├── chap_06_post_data_validation.php
│ ├── chap_06_tying_filters_to_form.php
│ ├── chap_06_tying_filters_to_form_definitions.php
│ ├── php7cookbook.css
│ ├── php7cookbook_html_table.css
│ └── test.php
├── chapter07
│ ├── api_key.php
│ ├── chap_07_converting_php_array_to_xml.php
│ ├── chap_07_converting_xml_php_iteration_1.php
│ ├── chap_07_converting_xml_php_iteration_2.php
│ ├── chap_07_converting_xml_php_to_array.php
│ ├── chap_07_converting_xml_php_xpath.php
│ ├── chap_07_payment_provider_request.php
│ ├── chap_07_simple_rest_client_google_maps_curl.php
│ ├── chap_07_simple_rest_client_google_maps_streams.php
│ ├── chap_07_simple_rest_client_google_maps_template.php
│ ├── chap_07_simple_rest_server.php
│ ├── chap_07_simple_rest_server_test.php
│ ├── chap_07_simple_soap_client_test.php
│ ├── chap_07_simple_soap_client_weather_service.php
│ ├── chap_07_simple_soap_server.php
│ ├── chap_07_wsdl.xml
│ ├── composer.json
│ ├── composer.lock
│ ├── composer.phar
│ ├── google_api_key.php
│ ├── php7cookbook.css
│ ├── php7cookbook_html_table.css
│ └── test.php
├── chapter08
│ ├── chap_08_control_and_combining_unicode.php
│ ├── chap_08_emoji_using_html.php
│ ├── chap_08_formatting_currency.php
│ ├── chap_08_formatting_date.php
│ ├── chap_08_formatting_numbers.php
│ ├── chap_08_getting_locale_from_browser.php
│ ├── chap_08_html_calendar.php
│ ├── chap_08_html_calendar_full_year.php
│ ├── chap_08_phpinfo.php
│ ├── chap_08_recurring_events.php
│ ├── chap_08_translation_array.php
│ ├── chap_08_translation_csv.php
│ ├── chap_08_translation_database.php
│ ├── chap_08_translation_ini.php
│ ├── jcartier-city.png
│ ├── php7cookbook_html_table.css
│ └── test.php
├── chapter09
│ ├── .gitignore
│ ├── Application_MiddleWare_ServerRequest.php
│ ├── chap_09_middleware_acl_config.php
│ ├── chap_09_middleware_authenticate.php
│ ├── chap_09_middleware_cache_db.php
│ ├── chap_09_middleware_request.php
│ ├── chap_09_middleware_request_to_response.php
│ ├── chap_09_middleware_request_using_with.php
│ ├── chap_09_middleware_server.php
│ ├── chap_09_middleware_server_with_response.php
│ ├── chap_09_middleware_value_objects_file_upload.php
│ ├── chap_09_middleware_value_objects_uri.php
│ ├── churchill.txt
│ ├── composer.phar
│ ├── customer_09_passwords.txt
│ ├── customer_passwords.txt
│ ├── expressive
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── CHANGELOG.md
│ │ ├── CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── LICENSE.md
│ │ ├── README.md
│ │ ├── composer.json
│ │ ├── composer.lock
│ │ ├── config
│ │ │ ├── autoload
│ │ │ │ ├── .gitignore
│ │ │ │ ├── dependencies.global.php
│ │ │ │ ├── local.php.dist
│ │ │ │ ├── middleware-pipeline.global.php
│ │ │ │ ├── routes.global.php
│ │ │ │ ├── templates.global.php
│ │ │ │ └── zend-expressive.global.php
│ │ │ ├── config.php
│ │ │ └── container.php
│ │ ├── data
│ │ │ └── .gitignore
│ │ ├── phpcs.xml
│ │ ├── phpunit.xml.dist
│ │ ├── public
│ │ │ ├── .htaccess
│ │ │ ├── favicon.ico
│ │ │ ├── index.php
│ │ │ └── zf-logo.png
│ │ ├── src
│ │ │ └── App
│ │ │ │ └── Action
│ │ │ │ ├── HomePageAction.php
│ │ │ │ ├── HomePageFactory.php
│ │ │ │ ├── PingAction.php
│ │ │ │ └── SessionValidateAction.php
│ │ ├── templates
│ │ │ ├── .gitkeep
│ │ │ ├── app
│ │ │ │ └── home-page.phtml
│ │ │ ├── error
│ │ │ │ ├── 404.phtml
│ │ │ │ └── error.phtml
│ │ │ └── layout
│ │ │ │ └── default.phtml
│ │ └── test
│ │ │ └── AppTest
│ │ │ └── Action
│ │ │ ├── HomePageActionTest.php
│ │ │ ├── HomePageFactoryTest.php
│ │ │ └── PingActionTest.php
│ ├── gettysburg.txt
│ ├── info.php
│ ├── pages
│ │ ├── auth.php
│ │ ├── logout.php
│ │ ├── menu.php
│ │ ├── page0.php
│ │ ├── page1.php
│ │ ├── page2.php
│ │ ├── page3.php
│ │ ├── page4.php
│ │ ├── page5.php
│ │ ├── page6.php
│ │ ├── page7.php
│ │ ├── page8.php
│ │ ├── page9.php
│ │ ├── route_menu.php
│ │ └── sorry.php
│ ├── public
│ │ ├── index.php
│ │ └── info.php
│ ├── routing
│ │ ├── .htaccess
│ │ ├── index.php
│ │ ├── info.php
│ │ ├── main.php
│ │ ├── planet.png
│ │ └── test
│ │ │ └── index.php
│ └── star_trek.txt
├── chapter10
│ ├── chap_10_binary_search.php
│ ├── chap_10_bubble_sort.php
│ ├── chap_10_html_table_multi_array_hidden.php
│ ├── chap_10_html_table_multi_array_raw.php
│ ├── chap_10_linked_double.php
│ ├── chap_10_linked_list_filtered.php
│ ├── chap_10_linked_list_in_order.php
│ ├── chap_10_linked_list_include.php
│ ├── chap_10_oop_using_getters_and_setters.php
│ ├── chap_10_oop_using_getters_and_setters_defaults.php
│ ├── chap_10_oop_using_getters_and_setters_magic_call.php
│ ├── chap_10_search_engine.php
│ ├── chap_10_stack.php
│ ├── php7cookbook.css
│ └── php7cookbook_html_table.css
├── chapter11
│ ├── chap_11_array_to_object.php
│ ├── chap_11_mapper.php
│ ├── chap_11_object_to_array.php
│ ├── chap_11_orm_embedded.php
│ ├── chap_11_orm_secondary_lookups.php
│ ├── chap_11_parse_tree_structure.php
│ ├── chap_11_pub_sub.php
│ ├── chap_11_pub_sub_complex_example.php
│ ├── chap_11_pub_sub_include.php
│ ├── chap_11_pub_sub_simple_example.php
│ ├── chap_11_pub_sub_view_logic.php
│ ├── chap_11_simple_object_tree_example.php
│ ├── chap_11_strategy_pattern.php
│ └── php7cookbook.css
├── chapter12
│ ├── .gitignore
│ ├── FreeSansBold.ttf
│ ├── chap_12_captcha_image.php
│ ├── chap_12_captcha_text.php
│ ├── chap_12_captcha_view_include.php
│ ├── chap_12_form_csrf_test_protected.html
│ ├── chap_12_form_csrf_test_unprotected.html
│ ├── chap_12_form_protected.php
│ ├── chap_12_form_protected_index.php
│ ├── chap_12_form_protected_with_token.php
│ ├── chap_12_form_protected_with_token.phtml
│ ├── chap_12_form_unprotected.php
│ ├── chap_12_form_unprotected_include.php
│ ├── chap_12_form_view_results.php
│ ├── chap_12_openssl_encryption.php
│ ├── chap_12_password_generate.php
│ ├── chap_12_post_data_filtering.php
│ ├── chap_12_post_data_filtering_basic.php
│ ├── chap_12_post_data_validation_basic.php
│ ├── chap_12_session_hijack.php
│ ├── chap_12_session_protected.php
│ ├── chap_12_session_protection_simple_login.php
│ ├── csrf-test.html
│ └── php7cookbook.css
├── chapter13
│ ├── .gitignore
│ ├── Demo.php
│ ├── SimpleClassTest.php
│ ├── SimpleDbTest.php
│ ├── SimpleTest.php
│ ├── VisitorOps.php
│ ├── VisitorOpsMock.php
│ ├── VisitorService.php
│ ├── VisitorServiceTest.php
│ ├── VisitorServiceTestAnonClass.php
│ ├── VisitorServiceTestMockBuilder.php
│ ├── chap_13_error_handler.php
│ ├── chap_13_error_throwable.php
│ ├── chap_13_exception_handler.php
│ ├── chap_13_fake_data.php
│ ├── chap_13_session_options.php
│ ├── chap_13_trait_and_interface.php
│ ├── chap_13_unit_test_simple.php
│ ├── chap_13_unit_test_vistor_ops.php
│ ├── composer.json
│ ├── composer.lock
│ ├── composer.phar
│ ├── phpunit.phar
│ ├── tests
│ │ ├── SimpleClassTest.php
│ │ ├── SimpleDbTest.php
│ │ ├── SimpleTest.php
│ │ ├── VisitorOpsMock.php
│ │ ├── VisitorServiceTest.php
│ │ └── phpunit.xml
│ └── tests_with_autoload
│ │ ├── Demo
│ │ └── Demo.php
│ │ ├── Simple
│ │ └── ClassTest.php
│ │ ├── bootstrap.php
│ │ └── phpunit.xml
├── config
│ └── db.config.php
└── data
│ ├── 6b3628918b77f77ae86001beed72f0ee
│ ├── access.log
│ ├── db
│ └── php7cookbook.db.sqlite
│ ├── error.log
│ ├── files
│ ├── country_code_name.csv
│ ├── currencies.csv
│ ├── currencyTable.txt
│ ├── customer.csv
│ ├── customer.sql
│ ├── customer_passwords.txt
│ ├── first_names.txt
│ ├── iso_country_codes.csv
│ ├── mongo.db.global.php
│ ├── php7cookbook.sql
│ ├── prospects.csv
│ ├── surnames.txt
│ └── war_and_peace.txt
│ └── languages
│ ├── de_DE
│ ├── amsterdam.txt
│ ├── bangkok.txt
│ ├── main_page.txt
│ ├── san_francisco.txt
│ ├── translation.csv
│ ├── translation.ini
│ └── translation.ini~
│ ├── en_GB
│ ├── amsterdam.txt
│ ├── bangkok.txt
│ ├── main_page.txt
│ ├── san_francisco.txt
│ ├── translation.csv
│ ├── translation.ini
│ └── translation.ini~
│ ├── es_ES
│ ├── amsterdam.txt
│ ├── bangkok.txt
│ ├── main_page.txt
│ ├── san_francisco.txt
│ ├── translation.csv
│ ├── translation.ini
│ └── translation.ini~
│ └── fr_FR
│ ├── amsterdam.txt
│ ├── bangkok.txt
│ ├── main_page.txt
│ ├── san_francisco.txt
│ ├── translation.csv
│ ├── translation.ini
│ └── translation.ini~
├── war_and_peace.txt
└── world_city_data.sql.zip
/README.md:
--------------------------------------------------------------------------------
1 | # PHP 7 Cookbook
2 |
3 | This repository is designed to supplement the examples discussed in the
4 | [PHP 7 Programming Cookbook](https://www.packtpub.com/application-development/php-7-programming-cookbook)
5 |
6 | ## Database Setup
7 | * Read through Chapter 1, "Defining a test MySQL database"
8 | * See "db.config.php" for example MySQL params; adjust to match your environment
9 | * Use this SQL statement to match the examples in the book:
10 | ```
11 | CREATE DATABASE IF NOT EXISTS dbname DEFAULT CHARACTER SET utf8
12 | COLLATE utf8_general_ci;
13 | CREATE USER 'cook'@'%' IDENTIFIED WITH mysql_native_password;
14 | SET PASSWORD FOR 'cook'@'%' = PASSWORD('book');
15 | GRANT ALL PRIVILEGES ON dbname.* to 'cook'@'%';
16 | GRANT ALL PRIVILEGES ON dbname.* to 'cook'@'localhost';
17 | FLUSH PRIVILEGES;
18 | ```
19 | * `php7cookbook.sql` contains all the sample data used in the book
20 | * In order to use the sample data in the `world_city_codes` database table, you'll need to download it separately from this URL:
21 | * opensource.unlikelysource.org/world_city_data.sql.zip
22 | * you can then import `world_city_codes.sql` into the `php7cookbook` database separately
23 |
--------------------------------------------------------------------------------
/create_currency_table_db.php:
--------------------------------------------------------------------------------
1 | pdo;
16 |
17 | $fileObj = new SplFileObject(CURRENCY_CSV, 'r');
18 | $stmt = $pdo->prepare('SELECT * FROM iso_country_codes WHERE name LIKE ?');
19 | $stmt2 = $pdo->prepare('UPDATE iso_country_codes SET currency_name = ?, currency_code = ?, currency_number = ? WHERE iso2 = ?');
20 | while ($csvRow = $fileObj->fgetcsv()) {
21 | $search = ucwords(strtolower(substr($csvRow[0], 0, 12))) . '%';
22 | echo $search . PHP_EOL;
23 | $stmt->execute([$search]);
24 | $dbRow = $stmt->fetch(PDO::FETCH_ASSOC);
25 | if ($dbRow) {
26 | $stmt2->execute([$csvRow[1], $csvRow[2], $csvRow[3], $dbRow['iso2']]);
27 | }
28 | }
29 | echo serialize($currencyTable);
30 |
--------------------------------------------------------------------------------
/create_iso_country_codes_csv.php:
--------------------------------------------------------------------------------
1 | pdo;
16 |
17 | // erase current file
18 | file_put_contents(CURRENCY_CSV, '');
19 |
20 | $fileObj = new SplFileObject(CURRENCY_CSV, 'w');
21 | $stmt = $pdo->query('SELECT * FROM iso_country_codes');
22 | while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
23 | $fileObj->fputcsv($row);
24 | }
25 | unset($fileObj);
26 | readfile(CURRENCY_CSV);
27 |
--------------------------------------------------------------------------------
/db.config.php:
--------------------------------------------------------------------------------
1 | 'mysql',
5 | 'host' => 'localhost',
6 | 'dbname' => 'php7cookbook',
7 | 'user' => 'cook',
8 | 'password' => 'book',
9 | 'errmode' => PDO::ERRMODE_EXCEPTION,
10 | ];
11 |
--------------------------------------------------------------------------------
/google_api_key.php:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/phpunit.phar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dbierer/php7cookbook/eda1bf62e38f14502328ac76bb21841c64197ad7/phpunit.phar
--------------------------------------------------------------------------------
/source/.buildpath:
--------------------------------------------------------------------------------
1 |
2 |