├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── COPYING.TXT ├── Doxyfile ├── MIT.TXT ├── README.md ├── THIRD_PARTY_SOFTWARE.TXT ├── bin ├── cppcms_run └── cppcms_tmpl_cc ├── booster ├── CMakeLists.txt ├── LICENSE_1_0.txt ├── booster │ ├── aio │ │ ├── acceptor.h │ │ ├── aio_category.h │ │ ├── aio_config.h │ │ ├── basic_io_device.h │ │ ├── basic_socket.h │ │ ├── buffer.h │ │ ├── deadline_timer.h │ │ ├── endpoint.h │ │ ├── io_service.h │ │ ├── reactor.h │ │ ├── socket.h │ │ ├── stream_socket.h │ │ └── types.h │ ├── assert.h │ ├── atomic_counter.h │ ├── backtrace.h │ ├── bad_weak_ptr.h │ ├── callback.h │ ├── checked_delete.h │ ├── clone_ptr.h │ ├── config.h │ ├── copy_ptr.h │ ├── cstdint.h │ ├── ctime.h │ ├── enable_shared_from_this.h │ ├── function.h │ ├── hold_ptr.h │ ├── intrusive_ptr.h │ ├── iterator │ │ ├── iterator_facade.h │ │ └── range.h │ ├── locale.h │ ├── locale │ │ ├── boundary.h │ │ ├── boundary │ │ │ ├── boundary_point.h │ │ │ ├── facets.h │ │ │ ├── index.h │ │ │ ├── segment.h │ │ │ └── types.h │ │ ├── collator.h │ │ ├── config.h │ │ ├── conversion.h │ │ ├── date_time.h │ │ ├── date_time_facet.h │ │ ├── encoding.h │ │ ├── encoding_errors.h │ │ ├── encoding_utf.h │ │ ├── format.h │ │ ├── formatting.h │ │ ├── generator.h │ │ ├── generic_codecvt.h │ │ ├── gnu_gettext.h │ │ ├── hold_ptr.h │ │ ├── info.h │ │ ├── localization_backend.h │ │ ├── message.h │ │ ├── time_zone.h │ │ ├── utf.h │ │ ├── utf8_codecvt.h │ │ └── util.h │ ├── log.h │ ├── memory_inc.h │ ├── noncopyable.h │ ├── nowide │ │ ├── convert.h │ │ ├── cstdio.h │ │ └── fstream.h │ ├── perl_regex.h │ ├── posix_time.h │ ├── refcounted.h │ ├── regex.h │ ├── regex_match.h │ ├── shared_object.h │ ├── shared_ptr.h │ ├── streambuf.h │ ├── system_error.h │ ├── thread.h │ ├── traits │ │ ├── enable_if.h │ │ ├── is_base_of.h │ │ └── type_traits.h │ └── weak_ptr.h └── lib │ ├── aio │ ├── src │ │ ├── acceptor.cpp │ │ ├── aio_category.cpp │ │ ├── basic_io_device.cpp │ │ ├── basic_socket.cpp │ │ ├── category.h │ │ ├── deadline_timer.cpp │ │ ├── endpoint.cpp │ │ ├── io_service.cpp │ │ ├── reactor.cpp │ │ ├── reactor_config.h │ │ ├── select_iterrupter.cpp │ │ ├── select_iterrupter.h │ │ ├── socket_details.h │ │ └── stream_socket.cpp │ └── test │ │ ├── aio_test.h │ │ ├── test_endpoint.cpp │ │ ├── test_event_loop.cpp │ │ ├── test_prefork.cpp │ │ ├── test_reactor.cpp │ │ ├── test_socket.cpp │ │ └── test_timer.cpp │ ├── backtrace │ ├── src │ │ └── backtrace.cpp │ └── test │ │ └── test_backtrace.cpp │ ├── booster_build_config.cmake.h │ ├── function │ └── test │ │ ├── test_callback.cpp │ │ └── test_function.cpp │ ├── iostreams │ ├── src │ │ └── streambuf.cpp │ └── test │ │ └── test_streambuf.cpp │ ├── locale │ ├── examples │ │ ├── boundary.cpp │ │ ├── calendar.cpp │ │ ├── collate.cpp │ │ ├── conversions.cpp │ │ ├── hello.cpp │ │ ├── wboundary.cpp │ │ ├── wconversions.cpp │ │ └── whello.cpp │ ├── src │ │ ├── encoding │ │ │ ├── codepage.cpp │ │ │ ├── conv.h │ │ │ ├── iconv_codepage.ipp │ │ │ ├── uconv_codepage.ipp │ │ │ └── wconv_codepage.ipp │ │ ├── icu │ │ │ ├── all_generator.h │ │ │ ├── boundary.cpp │ │ │ ├── cdata.h │ │ │ ├── codecvt.cpp │ │ │ ├── codecvt.h │ │ │ ├── collator.cpp │ │ │ ├── conversion.cpp │ │ │ ├── date_time.cpp │ │ │ ├── formatter.cpp │ │ │ ├── formatter.h │ │ │ ├── icu_backend.cpp │ │ │ ├── icu_backend.h │ │ │ ├── icu_util.h │ │ │ ├── numeric.cpp │ │ │ ├── predefined_formatters.h │ │ │ ├── time_zone.cpp │ │ │ ├── time_zone.h │ │ │ └── uconv.h │ │ ├── posix │ │ │ ├── all_generator.h │ │ │ ├── codecvt.cpp │ │ │ ├── codecvt.h │ │ │ ├── collate.cpp │ │ │ ├── converter.cpp │ │ │ ├── numeric.cpp │ │ │ ├── posix_backend.cpp │ │ │ └── posix_backend.h │ │ ├── shared │ │ │ ├── date_time.cpp │ │ │ ├── format.cpp │ │ │ ├── formatting.cpp │ │ │ ├── generator.cpp │ │ │ ├── ids.cpp │ │ │ ├── ios_prop.h │ │ │ ├── localization_backend.cpp │ │ │ ├── message.cpp │ │ │ ├── mo_hash.h │ │ │ ├── mo_lambda.cpp │ │ │ └── mo_lambda.h │ │ ├── std │ │ │ ├── all_generator.h │ │ │ ├── codecvt.cpp │ │ │ ├── collate.cpp │ │ │ ├── converter.cpp │ │ │ ├── numeric.cpp │ │ │ ├── std_backend.cpp │ │ │ └── std_backend.h │ │ ├── util │ │ │ ├── codecvt_converter.cpp │ │ │ ├── default_locale.cpp │ │ │ ├── gregorian.cpp │ │ │ ├── gregorian.h │ │ │ ├── iconv.h │ │ │ ├── info.cpp │ │ │ ├── locale_data.cpp │ │ │ ├── locale_data.h │ │ │ ├── numeric.h │ │ │ └── timezone.h │ │ └── win32 │ │ │ ├── all_generator.h │ │ │ ├── api.h │ │ │ ├── collate.cpp │ │ │ ├── converter.cpp │ │ │ ├── lcid.cpp │ │ │ ├── lcid.h │ │ │ ├── numeric.cpp │ │ │ ├── win_backend.cpp │ │ │ └── win_backend.h │ └── test │ │ ├── generate_catalogs.sh │ │ ├── he │ │ └── LC_MESSAGES │ │ │ ├── default.mo │ │ │ ├── default.po │ │ │ ├── fall.mo │ │ │ ├── fall.po │ │ │ ├── simple.mo │ │ │ └── simple.po │ │ ├── he_IL │ │ └── LC_MESSAGES │ │ │ ├── full.mo │ │ │ └── full.po │ │ ├── test_boundary.cpp │ │ ├── test_codecvt.cpp │ │ ├── test_codepage.cpp │ │ ├── test_codepage_converter.cpp │ │ ├── test_collate.cpp │ │ ├── test_config.cpp │ │ ├── test_convert.cpp │ │ ├── test_date_time.cpp │ │ ├── test_formatting.cpp │ │ ├── test_generator.cpp │ │ ├── test_icu_vs_os_timezone.cpp │ │ ├── test_ios_prop.cpp │ │ ├── test_locale.h │ │ ├── test_locale_tools.h │ │ ├── test_message.cpp │ │ ├── test_posix_collate.cpp │ │ ├── test_posix_convert.cpp │ │ ├── test_posix_formatting.cpp │ │ ├── test_posix_tools.h │ │ ├── test_std_collate.cpp │ │ ├── test_std_convert.cpp │ │ ├── test_std_formatting.cpp │ │ ├── test_utf.cpp │ │ ├── test_winapi_collate.cpp │ │ ├── test_winapi_convert.cpp │ │ └── test_winapi_formatting.cpp │ ├── log │ ├── src │ │ └── log.cpp │ └── test │ │ └── test_log.cpp │ ├── nowide │ ├── src │ │ └── convert.cpp │ └── test │ │ └── test_nowide.cpp │ ├── ptime │ ├── src │ │ ├── ctime.cpp │ │ └── posix_time.cpp │ └── test │ │ └── test_posix_time.cpp │ ├── regex │ ├── src │ │ ├── pcre_regex.cpp │ │ └── std_regex.cpp │ └── test │ │ └── test_regex.cpp │ ├── shared_object │ └── src │ │ └── shared_object.cpp │ ├── smart_ptr │ ├── src │ │ └── atomic_counter.cpp │ └── test │ │ ├── test_atomic_counter.cpp │ │ └── test_shared_ptr.cpp │ ├── test │ └── test.h │ └── thread │ ├── src │ ├── pthread.cpp │ ├── thread_win5.cpp │ ├── thread_win6.cpp │ └── thread_winapi.cpp │ └── test │ ├── test_fork.cpp │ └── test_thread.cpp ├── config.cmake.h ├── contrib ├── client_side │ └── jsonrpc │ │ ├── json2.js │ │ └── jsonrpc.js ├── integration │ └── session │ │ ├── asp.net │ │ ├── API.cs │ │ ├── Cookie.cs │ │ ├── Session.cs │ │ ├── SessionBase.cs │ │ ├── SessionPool.cs │ │ ├── build.sh │ │ └── test │ │ │ ├── bin │ │ │ └── .gitignore │ │ │ ├── html │ │ │ ├── run.sh │ │ │ ├── test.aspx │ │ │ └── test.aspx.cs │ │ ├── example │ │ ├── Sample.java │ │ ├── cppcms-config.js │ │ ├── example.aspx │ │ ├── example.aspx.cs │ │ ├── sample.php │ │ └── views.py │ │ ├── java │ │ ├── build.sh │ │ ├── com │ │ │ └── cppcms │ │ │ │ └── session │ │ │ │ ├── API.java │ │ │ │ ├── CppCMSCookie.java │ │ │ │ ├── Session.java │ │ │ │ ├── SessionBase.java │ │ │ │ └── SessionPool.java │ │ ├── config.sh │ │ └── test │ │ │ ├── UnitTest.java │ │ │ ├── build_test.sh │ │ │ └── web.xml │ │ ├── php │ │ ├── php5 │ │ │ ├── build_ext.sh │ │ │ ├── cppcms.php │ │ │ ├── cppcms_api.c │ │ │ ├── cppcms_api.php │ │ │ └── php_cppcms_api.h │ │ ├── php7 │ │ │ ├── build_ext.sh │ │ │ ├── cppcms.php │ │ │ ├── cppcms_api.c │ │ │ ├── cppcms_api.php │ │ │ └── php_cppcms_api.h │ │ └── test │ │ │ ├── html │ │ │ ├── index.html │ │ │ ├── run.sh │ │ │ ├── run7.sh │ │ │ └── unit_test.php │ │ ├── python │ │ ├── cppcms.py │ │ └── cppcmstest │ │ │ ├── config.js │ │ │ ├── cppcmstest │ │ │ ├── .urls.py.swp │ │ │ ├── __init__.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ │ ├── html │ │ │ ├── manage.py │ │ │ ├── run.sh │ │ │ └── tester │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── reference │ │ ├── config.js │ │ └── test.cpp │ │ ├── swig │ │ ├── cppcms.i │ │ ├── gen-php.sh │ │ └── gen-php7.sh │ │ ├── tools │ │ ├── parse-csharp.sh │ │ ├── parse-java.sh │ │ └── parse.sh │ │ └── wwwtest │ │ ├── index.html │ │ └── tester.js └── server_side │ ├── recaptcha │ ├── recaptcha.cpp │ └── recaptcha.h │ ├── sessions │ ├── CMakeLists.txt │ ├── berkeley_db │ │ ├── CMakeLists.txt │ │ └── bdb.cpp │ ├── cleanup.sh │ ├── cppdb │ │ ├── CMakeLists.txt │ │ └── cppdb_storage.cpp │ ├── sqlite3 │ │ ├── CMakeLists.txt │ │ └── session_sqlite_storage.cpp │ ├── storage_test.cpp │ └── tests.js │ └── sse │ ├── examples │ ├── Makefile │ ├── chat.cpp │ ├── config-chat.js │ ├── config-ticker.js │ ├── the_chat.html │ ├── the_ticker.html │ └── ticker.cpp │ ├── server_sent_events.cpp │ └── server_sent_events.h ├── cppcms ├── application.h ├── applications_pool.h ├── archive_traits.h ├── base64.h ├── base_cache_fwd.h ├── base_content.h ├── base_view.h ├── cache_interface.h ├── cache_pool.h ├── capi │ └── session.h ├── copy_filter.h ├── cppcms_error.h ├── crypto.h ├── cstdint.h ├── defs.h ├── encoding.h ├── filters.h ├── form.h ├── forwarder.h ├── http_content_filter.h ├── http_content_type.h ├── http_context.h ├── http_cookie.h ├── http_file.h ├── http_request.h ├── http_response.h ├── json.h ├── locale_fwd.h ├── localization.h ├── mem_bind.h ├── mount_point.h ├── plugin.h ├── rpc_json.h ├── serialization.h ├── serialization_classes.h ├── service.h ├── session_api.h ├── session_cookies.h ├── session_dual.h ├── session_interface.h ├── session_pool.h ├── session_sid.h ├── session_storage.h ├── steal_buf.h ├── string_key.h ├── thread_pool.h ├── urandom.h ├── url_dispatcher.h ├── url_mapper.h ├── util.h ├── view.h ├── views_pool.h └── xss.h ├── doc ├── architecture.txt ├── logo │ └── logo.svg └── mainpage.doxy ├── examples ├── aio │ ├── Makefile │ └── echo_server.cpp ├── autogenerated.doxy ├── basic_cache │ ├── Makefile │ ├── config.js │ ├── content.h │ ├── hello.cpp │ └── view.tmpl ├── chat │ ├── Makefile │ ├── chat.cpp │ ├── config.js │ └── the_chat.html ├── examples.doxy ├── examples.txt ├── format.sh ├── forms │ ├── Makefile │ ├── config.js │ ├── content.h │ ├── hello.cpp │ └── view.tmpl ├── hello_world │ ├── Makefile │ ├── config.js │ └── hello.cpp ├── hierarchy │ ├── Makefile │ ├── config.js │ └── myapp.cpp ├── json │ ├── Makefile │ └── json.cpp ├── json_rpc │ ├── Makefile │ ├── config.js │ ├── index.html │ ├── rpc.cpp │ └── usingrpc.html ├── json_rpc_chat │ ├── Makefile │ ├── chat.cpp │ ├── config.js │ └── index.html ├── localization │ ├── Makefile │ ├── config.js │ ├── content.h │ ├── hello.cpp │ ├── locale │ │ └── he │ │ │ └── LC_MESSAGES │ │ │ └── hello.po │ └── view.tmpl ├── message_board │ ├── CMakeLists.txt │ ├── apps │ │ ├── forums.cpp │ │ ├── forums.h │ │ ├── main.cpp │ │ ├── master.cpp │ │ ├── master.h │ │ ├── mb.cpp │ │ ├── mb.h │ │ ├── thread.cpp │ │ └── thread.h │ ├── config.js │ ├── data │ │ ├── data.h │ │ ├── forums.h │ │ ├── master.h │ │ └── thread.h │ ├── locale │ │ └── he │ │ │ └── LC_MESSAGES │ │ │ └── mb.po │ ├── media │ │ ├── style-ltr.css │ │ ├── style-rtl.css │ │ └── style.css │ ├── model │ │ ├── mysql.sql │ │ └── sqlite3.sql │ └── view │ │ ├── forums.tmpl │ │ ├── master.tmpl │ │ └── thread.tmpl ├── serialization │ ├── Makefile │ ├── external_serialization.cpp │ └── serialization.cpp ├── sessions │ ├── Makefile │ ├── config.js │ ├── content.h │ ├── hello.cpp │ └── view.tmpl ├── templates │ ├── Makefile │ ├── Makefile.dyn │ ├── config-dyn.js │ ├── config.js │ ├── content.h │ ├── first.tmpl │ └── hello-tmpl.cpp ├── templates_inheritance │ ├── Makefile │ ├── config.js │ ├── content.h │ ├── intro.tmpl │ ├── master.tmpl │ ├── myapp.cpp │ ├── news.tmpl │ └── page.tmpl ├── uploads │ ├── Makefile │ ├── config.js │ ├── content.h │ ├── index.html │ ├── uploader.cpp │ ├── uploads │ │ └── .placeholder │ └── view.tmpl ├── url_mapping │ ├── Makefile │ ├── config.js │ └── hello.cpp └── xss │ ├── Makefile │ ├── comment_profile.js │ ├── config.js │ ├── tinymce_profile.js │ └── xss.cpp ├── header_file_template.h ├── private ├── aes_encryptor.h ├── base_cache.h ├── basic_allocator.h ├── binder.h ├── buddy_allocator.h ├── c_string.h ├── cache_over_ip.h ├── cache_storage.h ├── cached_settings.h ├── cgi_acceptor.h ├── cgi_api.h ├── cgi_headers_parser.h ├── cppcms_error_category.h ├── crc32.h ├── daemonize.h ├── dir.h ├── encoding_validators.h ├── fastcgi_api.h ├── format_number.h ├── hash_map.h ├── hmac_encryptor.h ├── http_api.h ├── http_file_buffer.h ├── http_parser.h ├── http_protocol.h ├── internal_file_server.h ├── logging.h ├── md5.h ├── multipart_parser.h ├── posix_util.h ├── prefork_acceptor.h ├── response_headers.h ├── rewrite.h ├── scgi_api.h ├── scgi_header.h ├── send_timeout.h ├── service_impl.h ├── session_memory_storage.h ├── session_posix_file_storage.h ├── session_sqlite_storage.h ├── session_tcp_storage.h ├── session_win32_file_storage.h ├── sha1.h ├── shmem_allocator.h ├── string_map.h ├── tcp_cache_client.h ├── tcp_cache_protocol.h ├── tcp_cache_server.h ├── tcp_connector.h ├── tcp_messenger.h ├── todec.h ├── tohex.h ├── utf_iterator.h └── winservice.h ├── src ├── aes.cpp ├── aes_encryptor.cpp ├── application.cpp ├── applications_pool.cpp ├── archive.cpp ├── base64.cpp ├── base_content.cpp ├── base_view.cpp ├── cache_interface.cpp ├── cache_over_ip.cpp ├── cache_pool.cpp ├── cache_server_main.cpp ├── cache_storage.cpp ├── capi │ └── session.cpp ├── cgi_api.cpp ├── config.js ├── copy_filter.cpp ├── cppcms_config_find_param.cpp ├── cppcms_error.cpp ├── cppcms_error_category.cpp ├── crypto.cpp ├── daemonize.cpp ├── encoding.cpp ├── fastcgi_api.cpp ├── filters.cpp ├── form.cpp ├── forwarder.cpp ├── hello_world.cpp ├── hello_world_skin1.tmpl ├── hello_world_skin2.tmpl ├── hello_world_view.h ├── hello_world_view1.tmpl ├── hmac_encryptor.cpp ├── http_api.cpp ├── http_content_filter.cpp ├── http_content_type.cpp ├── http_context.cpp ├── http_cookie.cpp ├── http_file.cpp ├── http_request.cpp ├── http_response.cpp ├── internal_file_server.cpp ├── json.cpp ├── make_key.cpp ├── md5.cpp ├── mount_point.cpp ├── plugin.cpp ├── rpc_json.cpp ├── scgi_api.cpp ├── send_timeout.cpp ├── service.cpp ├── session_cookies.cpp ├── session_dual.cpp ├── session_interface.cpp ├── session_memory_storage.cpp ├── session_pool.cpp ├── session_posix_file_storage.cpp ├── session_sid.cpp ├── session_tcp_storage.cpp ├── session_win32_file_storage.cpp ├── tcp_cache_client.cpp ├── tcp_cache_server.cpp ├── tcp_connector.cpp ├── tcp_messenger.cpp ├── the_chat.html ├── thread_pool.cpp ├── urandom.cpp ├── url_dispatcher.cpp ├── url_mapper.cpp ├── util.cpp ├── views_pool.cpp ├── winservice.cpp └── xss.cpp ├── tests ├── .gitignore ├── allocator_test.cpp ├── base64_test.cpp ├── cache_backend_test.cpp ├── cache_frontend_test.cpp ├── cache_performance_test.cpp ├── client.h ├── content_type_parser_test.cpp ├── cookie_test.cpp ├── cookie_test.js ├── cookie_test.py ├── copy_filter_test.cpp ├── cppcms_service_test.cpp ├── disco_test.cpp ├── disco_test.py ├── disco_test_async_cgi_multiple.in ├── disco_test_async_cgi_nonblocking.in ├── disco_test_async_cgi_single.in ├── disco_test_async_multiple.in ├── disco_test_async_nonblocking.in ├── disco_test_async_single.in ├── disco_test_gzip.in ├── disco_test_gzip_cgi.in ├── disco_test_norm.in ├── disco_test_norm_cgi.in ├── dummy_api.h ├── en │ └── LC_MESSAGES │ │ ├── main.mo │ │ ├── main.po │ │ ├── plugin2.mo │ │ └── plugin2.po ├── encryptor_test.cpp ├── external_session_test.c ├── external_session_test.js ├── file_buffer_test.cpp ├── file_server │ ├── al │ │ ├── foo │ │ │ └── test.txt │ │ ├── index.html │ │ └── test.txt │ ├── alfile.txt │ ├── never.txt │ ├── www │ │ ├── bar │ │ │ ├── index.html │ │ │ └── test.txt │ │ ├── file with space.txt │ │ ├── foo │ │ │ ├── looooooooooooooooooooooooooooooooooooong_fiiiiiiiiiiiiiiiiiile_name.txt │ │ │ └── test.txt │ │ ├── no.txt │ │ ├── test.txt │ │ ├── y.txt │ │ └── yes.txt │ └── wwwfile.txt ├── file_server_test.cpp ├── file_server_test.js ├── file_server_test.py ├── filter_test.cpp ├── filter_test.js ├── filter_test.py ├── form_test.cpp ├── form_test.js ├── form_test.py ├── forwarder_test.cpp ├── forwarder_test.js ├── forwarder_test.py ├── gzip_test.cpp ├── gzip_test.py ├── hash_map_test.cpp ├── he │ └── LC_MESSAGES │ │ ├── default.mo │ │ ├── default.po │ │ ├── fall.mo │ │ ├── fall.po │ │ ├── simple.mo │ │ └── simple.po ├── he_IL │ └── LC_MESSAGES │ │ ├── full.mo │ │ └── full.po ├── http_timeouts_test.cpp ├── http_timeouts_test.py ├── httpclient.py ├── json_test.cpp ├── jsonrpc_test.cpp ├── jsonrpc_test.js ├── jsonrpc_test.py ├── loadable_storage.cpp ├── loadable_storage_test.cpp ├── mount_point_test.cpp ├── multipart │ ├── chrome.txt │ ├── firefox.txt │ ├── ie.txt │ └── opera.txt ├── multipart_parser_test.cpp ├── plugin_base.h ├── plugin_test.cpp ├── pool_test.cpp ├── pool_test.js ├── pool_test.py ├── proto_test.cpp ├── proto_test.js ├── proto_test.py ├── proto_test_http_1.in ├── proto_test_http_1.out ├── proto_test_http_2.in ├── proto_test_http_2.out ├── proto_test_http_3.in ├── proto_test_http_3.out ├── proto_test_http_4.in ├── proto_test_http_4.out ├── proto_test_http_5.in ├── proto_test_http_5.out ├── proto_test_http_6.in ├── proto_test_http_6.out ├── proto_test_http_7.in ├── proto_test_http_7.out ├── proto_test_http_8.in ├── proto_test_http_8.out ├── proto_test_scgi_1.in ├── proto_test_scgi_1.out ├── proto_test_scgi_2.in ├── proto_test_scgi_2.out ├── proto_test_scgi_3.in ├── proto_test_scgi_3.out ├── proto_test_scgi_4.in ├── proto_test_scgi_4.out ├── proto_test_scgi_5.in ├── proto_test_scgi_5.out ├── proto_test_scgi_6.in ├── proto_test_scgi_6.out ├── response_test.cpp ├── rewrite_test.cpp ├── sample_key.txt ├── secure_post_test.cpp ├── secure_post_test.js ├── secure_post_test.py ├── serialization_test.cpp ├── service_test ├── service_test.py ├── session.py ├── session_interface_test.cpp ├── session_interface_test.js ├── session_interface_test.py ├── status_test.cpp ├── status_test.js ├── status_test.py ├── storage_test.cpp ├── tc_plugin.tmpl ├── tc_plugin2.tmpl ├── tc_skin.tmpl ├── tc_skin_a.tmpl ├── tc_skin_b.tmpl ├── tc_test.cpp ├── tc_test_content.h ├── test.h ├── test_plan.txt ├── test_plugin_so.cpp ├── todec_test.cpp ├── tofcgi.py ├── toscgi.py ├── unit_test.sh ├── url_mapper_test.cpp ├── validator_test.cpp └── xss_test.cpp └── tools ├── ArmelToolChain.cmake ├── arm.sh ├── benchmarks.cpp ├── boost_to_booster ├── bsd-build.sh ├── conv.py ├── convert_locale ├── mingw-build.sh ├── nightly └── vm │ ├── copy_file.sh │ ├── copy_files_windows.sh │ ├── export_version.sh │ ├── freebsd │ └── clang4.0-x64.sh │ ├── localhost │ ├── clang3.8-x64.sh │ ├── clang4.0-x64.sh │ └── gcc5.4-x64.sh │ ├── nightly_build.sh │ ├── report_to_html.py │ ├── run-vm-test.sh │ ├── run_test_unix.sh │ ├── run_test_windows.sh │ ├── solaris │ └── gcc4.8-x86.sh │ ├── upload_build.sh │ ├── upload_report.sh │ ├── upload_version_unix.sh │ ├── upload_version_windows.sh │ ├── url.sh │ ├── vm-freebsd.sh │ ├── vm-localhost.sh │ ├── vm-solaris.sh │ ├── vm-win7.sh │ └── win7 │ ├── mingw_gcc7.1-x64.bat │ ├── mingw_gcc7.1-x86.bat │ ├── msvc2017-x64.bat │ └── msvc2017-x86.bat ├── nightly_build.sh ├── release.sh ├── rename.py ├── rename_locale.py ├── report_to_html.py ├── solaris-build.sh └── url.sh /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - osx 5 | - linux 6 | 7 | compiler: 8 | - gcc 9 | - clang 10 | 11 | script: 12 | - mkdir build && cd build && cmake -DBOOSTER_AIO_HAVE_PF_INET6=OFF -DDISABLE_STATIC=ON .. && make && CTEST_OUTPUT_ON_FAILURE=1 ctest 13 | -------------------------------------------------------------------------------- /MIT.TXT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 Artyom Beilis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CppCMS - High Performance C++ Web Framework 2 | 3 | What is [CppCMS](http://cppcms.com/)? CppCMS is a [Free](http://en.wikipedia.org/wiki/Free_and_open_source_software) High Performance Web Development Framework (_not a CMS_) aimed at [Rapid](http://en.wikipedia.org/wiki/Rapid_application_development) Web Application Development. It differs from most other web development frameworks like: Python Django, Java Servlets in the following ways: 4 | 5 | 1. It is designed and tuned to handle extremely high loads. 6 | 2. It uses modern C++ as the primary development language in order to achieve the first goal. 7 | 3. It is designed for developing both Web Sites and Web Services. 8 | 9 | Starting from version 1.2 it is available under MIT license. 10 | 11 | ## Useful Links 12 | 13 | - 14 | - [Documentation](http://cppcms.com/wikipp/en/page/cppcms_1x) 15 | 16 | ## Status 17 | 18 | [![Build Status](https://travis-ci.org/artyom-beilis/cppcms.svg?branch=master)](https://travis-ci.org/artyom-beilis/cppcms) 19 | 20 | -------------------------------------------------------------------------------- /booster/booster/aio/aio_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_AIO_CONFIG_H 9 | #define BOOSTER_AIO_CONFIG_H 10 | 11 | #include 12 | #include 13 | 14 | #if defined(BOOSTER_WIN32) 15 | # define BOOSTER_AIO_NO_PF_UNIX 16 | #endif 17 | 18 | #ifndef BOOSTER_AIO_HAVE_PF_INET6 19 | # define BOOSTER_AIO_NO_PF_INET6 20 | #endif 21 | 22 | 23 | #endif // AIO_CONFIG_H 24 | -------------------------------------------------------------------------------- /booster/booster/aio/socket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_AIO_SOCKET_H 9 | #define BOOSTER_AIO_SOCKET_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /booster/booster/assert.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_ASSERT_H 9 | #define BOOSTER_ASSERT_H 10 | 11 | #include 12 | 13 | #define BOOSTER_ASSERT(x) assert(x) 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /booster/booster/bad_weak_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOSTER_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED 2 | #define BOOSTER_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED 3 | #include 4 | #endif // #ifndef BOOST_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED 5 | -------------------------------------------------------------------------------- /booster/booster/checked_delete.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOSTER_CHECKED_DELETE_H 2 | #define BOOSTER_CHECKED_DELETE_H 3 | #include 4 | #endif // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED 5 | -------------------------------------------------------------------------------- /booster/booster/cstdint.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_CSTDINT_H 9 | #define BOOSTER_CSTDINT_H 10 | 11 | #include 12 | 13 | #if defined(BOOSTER_HAVE_STDINT_H) || defined(BOOSTER_HAVE_INTTYPES_H) 14 | 15 | # if defined BOOSTER_HAVE_STDINT_H 16 | # include 17 | # elif defined BOOSTER_HAVE_INTTYPES_H 18 | # include 19 | # endif 20 | namespace booster { 21 | using ::int8_t; 22 | using ::uint8_t; 23 | using ::uint16_t; 24 | using ::int16_t; 25 | using ::uint32_t; 26 | using ::int32_t; 27 | using ::uint64_t; 28 | using ::int64_t; 29 | } 30 | 31 | 32 | #else 33 | namespace booster { 34 | // 35 | // Generally only for broken MSVC 36 | // And guess 37 | typedef unsigned char uint8_t; 38 | typedef signed char int8_t; 39 | typedef unsigned short uint16_t; 40 | typedef short int16_t; 41 | typedef unsigned int uint32_t; 42 | typedef int int32_t; 43 | typedef unsigned long long uint64_t; 44 | typedef long long int64_t; 45 | } 46 | #endif 47 | 48 | #endif // BOOSTER_CSTDINT_H 49 | 50 | -------------------------------------------------------------------------------- /booster/booster/enable_shared_from_this.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOSTER_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED 2 | #define BOOSTER_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED 3 | #include 4 | #endif // #ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED 5 | -------------------------------------------------------------------------------- /booster/booster/function.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_FUNCTION_H 9 | #define BOOSTER_FUNCTION_H 10 | 11 | #include 12 | 13 | namespace booster { 14 | using std::function; 15 | using std::bad_function_call; 16 | } // booster 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /booster/booster/iterator/range.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_ITERATOR_RANGE_H 9 | #define BOOSTER_ITERATOR_RANGE_H 10 | 11 | #include 12 | 13 | namespace booster { 14 | using std::begin; 15 | using std::end; 16 | 17 | // rbegin, rend only in c++14 :-( 18 | template 19 | auto rbegin(C &cnt) -> decltype(cnt.rbegin()) 20 | { 21 | return cnt.rbegin(); 22 | } 23 | template 24 | auto rend(C &cnt) -> decltype(cnt.rend()) 25 | { 26 | return cnt.rend(); 27 | } 28 | template 29 | auto rbegin(C const &cnt) -> decltype(cnt.rbegin()) 30 | { 31 | return cnt.rbegin(); 32 | } 33 | template 34 | auto rend(C const &cnt) -> decltype(cnt.rend()) 35 | { 36 | return cnt.rend(); 37 | } 38 | template 39 | std::reverse_iterator rbegin(T (&a)[N]) 40 | { 41 | return std::reverse_iterator(a+N); 42 | } 43 | template 44 | std::reverse_iterator rend(T (&a)[N]) 45 | { 46 | return std::reverse_iterator(a); 47 | } 48 | 49 | } // booster 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /booster/booster/locale.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_H_INCLUDED 9 | #define BOOSTER_LOCALE_H_INCLUDED 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #endif 27 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 28 | -------------------------------------------------------------------------------- /booster/booster/locale/boundary.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_BOUNDARY_H_INCLUDED 9 | #define BOOSTER_LOCALE_BOUNDARY_H_INCLUDED 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #endif 18 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 19 | -------------------------------------------------------------------------------- /booster/booster/locale/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2010 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_CONFIG_H_INCLUDED 9 | #define BOOSTER_LOCALE_CONFIG_H_INCLUDED 10 | 11 | #include 12 | 13 | #ifdef BOOSTER_HAS_DECLSPEC 14 | # if defined(BOOSTER_ALL_DYN_LINK) || defined(BOOSTER_LOCALE_DYN_LINK) 15 | # ifdef BOOSTER_SOURCE 16 | # define BOOSTER_API __declspec(dllexport) 17 | # else 18 | # define BOOSTER_API __declspec(dllimport) 19 | # endif // BOOST_LOCALE_SOURCE 20 | # endif // DYN_LINK 21 | #endif // BOOST_HAS_DECLSPEC 22 | 23 | #ifndef BOOSTER_API 24 | # define BOOSTER_API 25 | #endif 26 | 27 | 28 | #endif // boost/locale/config.hpp 29 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 30 | 31 | -------------------------------------------------------------------------------- /booster/booster/memory_inc.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2020 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_MEMORY_INC_H 9 | #define BOOSTER_MEMORY_INC_H 10 | #include 11 | namespace booster { 12 | using std::enable_shared_from_this; 13 | using std::weak_ptr; 14 | using std::shared_ptr; 15 | using std::bad_weak_ptr; 16 | using std::static_pointer_cast; 17 | using std::dynamic_pointer_cast; 18 | using std::const_pointer_cast; 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /booster/booster/noncopyable.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_NONCOPYABLE_H 9 | #define BOOSTER_NONCOPYABLE_H 10 | 11 | namespace booster { 12 | /// 13 | /// \brief This class makes impossible to copy any class derived from this one. 14 | /// 15 | class noncopyable { 16 | private: 17 | noncopyable(noncopyable const &) = delete; 18 | noncopyable const &operator=(noncopyable const &) = delete; 19 | protected: 20 | noncopyable(){} 21 | ~noncopyable(){} 22 | }; 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /booster/booster/nowide/convert.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOSTER_NOWIDE_CONVERT_H 2 | #define BOOSTER_NOWIDE_CONVERT_H 3 | 4 | #include 5 | #include 6 | 7 | #if defined(BOOSTER_WIN_NATIVE) || defined(BOOSTER_DOXYGEN_DOCS) 8 | namespace booster { 9 | namespace nowide { 10 | 11 | /// 12 | /// \brief This exception is thrown if invalid UTF-8 or UTF-16 is given as input 13 | /// 14 | class BOOSTER_API bad_utf : public booster::runtime_error { 15 | public: 16 | bad_utf(); 17 | }; 18 | 19 | /// 20 | /// Convert between UTF-16 and UTF-8 string, implemented only on Windows platform 21 | /// 22 | BOOSTER_API std::string convert(wchar_t const *s); 23 | /// 24 | /// Convert between UTF-8 and UTF-16 string, implemented only on Windows platform 25 | /// 26 | BOOSTER_API std::wstring convert(char const *s); 27 | /// 28 | /// Convert between UTF-16 and UTF-8 string, implemented only on Windows platform 29 | /// 30 | inline std::string convert(std::wstring const &s) 31 | { 32 | return convert(s.c_str()); 33 | } 34 | /// 35 | /// Convert between UTF-8 and UTF-16 string, implemented only on Windows platform 36 | /// 37 | inline std::wstring convert(std::string const &s) 38 | { 39 | return convert(s.c_str()); 40 | } 41 | 42 | } // nowide 43 | } // booster 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /booster/booster/regex.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_REGEX_H 9 | #define BOOSTER_REGEX_H 10 | 11 | #include "perl_regex.h" 12 | #include "regex_match.h" 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /booster/booster/shared_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOSTER_SMART_PTR_SHARED_PTR_HPP_INCLUDED 2 | #define BOOSTER_SMART_PTR_SHARED_PTR_HPP_INCLUDED 3 | #include 4 | #endif // #ifndef BOOST_SMART_PTR_SHARED_PTR_HPP_INCLUDED 5 | -------------------------------------------------------------------------------- /booster/booster/system_error.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_SYSTEM_ERROR_H 9 | #define BOOSTER_SYSTEM_ERROR_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | namespace booster { 18 | 19 | /// 20 | /// \brief this namespace includes partial implementation of std::tr1's/boost's system_error, error_code 21 | /// classes 22 | /// 23 | namespace system { 24 | using std::error_category; 25 | using std::system_category; 26 | using std::error_code; 27 | 28 | class system_error : public std::system_error, public backtrace { 29 | public: 30 | using std::system_error::system_error; 31 | }; 32 | 33 | } // system 34 | } // booster 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /booster/booster/traits/is_base_of.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | #ifndef BOOSTER_IS_BASE_OF_H 10 | #define BOOSTER_IS_BASE_OF_H 11 | 12 | namespace booster{ 13 | template 14 | struct is_same { 15 | static bool const value = false; 16 | }; 17 | 18 | template 19 | struct is_same { 20 | static bool const value = true; 21 | }; 22 | 23 | 24 | template 25 | struct is_base_of { 26 | static D * create_d(); 27 | static char check(B *); 28 | static int check(...); 29 | static bool const value = 30 | sizeof check(create_d()) == 1 31 | && !is_same::value; 32 | }; 33 | 34 | 35 | } // booster 36 | 37 | #endif 38 | 39 | 40 | -------------------------------------------------------------------------------- /booster/booster/traits/type_traits.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | #ifndef BOOSTER_TYPE_TRAITS_H 10 | #define BOOSTER_TYPE_TRAITS_H 11 | 12 | #include 13 | #include 14 | 15 | 16 | namespace booster{ 17 | template 18 | struct remove_const 19 | { 20 | typedef T type; 21 | }; 22 | 23 | template 24 | struct remove_const 25 | { 26 | typedef T type; 27 | }; 28 | 29 | 30 | template 31 | struct remove_reference 32 | { 33 | typedef T type; 34 | }; 35 | 36 | template 37 | struct remove_reference 38 | { 39 | typedef T type; 40 | }; 41 | 42 | template 43 | struct remove_const_reference { 44 | typedef typename remove_const::type>::type type; 45 | }; 46 | 47 | 48 | 49 | } // booster 50 | 51 | #endif 52 | 53 | 54 | -------------------------------------------------------------------------------- /booster/booster/weak_ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef BOOSTER_SMART_PTR_WEAK_PTR_HPP_INCLUDED 2 | #define BOOSTER_SMART_PTR_WEAK_PTR_HPP_INCLUDED 3 | #include 4 | #endif // #ifndef BOOST_SMART_PTR_WEAK_PTR_HPP_INCLUDED 5 | -------------------------------------------------------------------------------- /booster/lib/aio/src/aio_category.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #define BOOSTER_SOURCE 9 | #include 10 | 11 | namespace booster { 12 | namespace aio{ 13 | namespace aio_error { 14 | char const *category::name() const noexcept 15 | { 16 | return "aio::"; 17 | } 18 | std::string category::message(int cat) const 19 | { 20 | switch(cat) { 21 | case ok: return "ok"; 22 | case canceled: return "canceled"; 23 | case select_failed: return "connection hang-up or invalid discriptor tested"; 24 | case eof: return "eof"; 25 | case invalid_endpoint: return "invalid endpoint"; 26 | case no_service_provided: return "no io_service provided"; 27 | case prefork_not_enabled: return "prefork acceptor is not enabled"; 28 | default: 29 | return "unknown"; 30 | } 31 | } 32 | 33 | category const &get_category() 34 | { 35 | static const category cat = category(); 36 | return cat; 37 | } 38 | 39 | } // aio_error 40 | 41 | } // aio 42 | } // booster 43 | -------------------------------------------------------------------------------- /booster/lib/aio/src/category.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_AIO_SRC_CATEGORY_H 9 | #define BOOSTER_AIO_SRC_CATEGORY_H 10 | 11 | #include 12 | #include 13 | 14 | static booster::system::error_category const &syscat = std::system_category(); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /booster/lib/aio/src/reactor_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_AIO_REACTOR_CONFIG_H 9 | #define BOOSTER_AIO_REACTOR_CONFIG_H 10 | 11 | #if defined __linux 12 | 13 | # define AIO_HAVE_EPOLL 14 | # define AIO_HAVE_POLL 15 | # define AIO_HAVE_POSIX_SELECT 16 | 17 | #elif defined(__sun) || defined(__hpux) 18 | 19 | # define AIO_HAVE_DEVPOLL 20 | # define AIO_HAVE_POLL 21 | # define AIO_HAVE_POSIX_SELECT 22 | 23 | #elif defined(__FreeBSD__) || defined(__NetBSD__) 24 | 25 | # define AIO_HAVE_KQUEUE 26 | # define AIO_HAVE_POLL 27 | # define AIO_HAVE_POSIX_SELECT 28 | 29 | #elif defined(__APPLE__) 30 | 31 | // poll(2) is buggy and Mac OS X, removed 32 | 33 | # define AIO_HAVE_KQUEUE 34 | # define AIO_HAVE_POSIX_SELECT 35 | 36 | #elif defined(__CYGWIN__) || defined(__WIN32) || defined(_WIN32) || defined(WIN32) 37 | 38 | # define AIO_HAVE_WIN32_SELECT 39 | 40 | #else // generic POSIX 41 | 42 | # include 43 | # if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100) 44 | # define AIO_HAVE_POLL 45 | # endif 46 | # define AIO_HAVE_POSIX_SELECT 47 | 48 | #endif 49 | 50 | 51 | #endif // AIO_CONFIG_H 52 | -------------------------------------------------------------------------------- /booster/lib/backtrace/test/test_backtrace.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int foo() 5 | { 6 | throw booster::runtime_error("My Error"); 7 | return 10; 8 | } 9 | 10 | int bar() 11 | { 12 | return foo()+20; 13 | } 14 | 15 | 16 | int main() 17 | { 18 | try { 19 | std::cout << bar() << std::endl; 20 | } 21 | catch(std::exception const &e) 22 | { 23 | std::cerr << e.what() << std::endl; 24 | std::cerr << booster::trace(e); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /booster/lib/booster_build_config.cmake.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_BUILD_CONFIG_H 9 | #define BOOSTER_BUILD_CONFIG_H 10 | 11 | // 12 | // Have 13 | // 14 | 15 | #cmakedefine BOOSTER_HAVE_STDINT_H 16 | 17 | // 18 | // Have 19 | // 20 | 21 | #cmakedefine BOOSTER_HAVE_INTTYPES_H 22 | 23 | // 24 | // Have IPv6 support 25 | // 26 | 27 | #cmakedefine BOOSTER_AIO_HAVE_PF_INET6 28 | 29 | #cmakedefine BOOSTER_HAVE_EXECINFO 30 | 31 | #cmakedefine BOOSTER_HAVE_UNWIND_BACKTRACE 32 | 33 | #cmakedefine BOOSTER_HAVE_UNWIND_BACKTRACE_BUILTIN 34 | /* Define to module suffix. */ 35 | #cmakedefine BOOSTER_LIBRARY_SUFFIX "${BOOSTER_LIBRARY_SUFFIX}" 36 | 37 | /* Define to module suffix. */ 38 | #cmakedefine BOOSTER_LIBRARY_PREFIX "${BOOSTER_LIBRARY_PREFIX}" 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /booster/lib/locale/examples/collate.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | using namespace std; 15 | using namespace booster::locale; 16 | 17 | int main() 18 | { 19 | generator gen; 20 | std::locale::global(gen("")); 21 | /// Set global locale to requested 22 | 23 | /// Create a set that includes all strings sorted according to ABC order 24 | /// std::locale can be used as object for comparison 25 | typedef std::set set_type; 26 | set_type all_strings; 27 | 28 | /// Read all strings into the set 29 | while(!cin.eof()) { 30 | std::string tmp; 31 | getline(cin,tmp); 32 | all_strings.insert(tmp); 33 | } 34 | /// Print them out 35 | for(set_type::iterator p=all_strings.begin();p!=all_strings.end();++p) { 36 | cout<<*p< 12 | 13 | namespace booster { 14 | namespace locale { 15 | namespace impl_icu { 16 | struct cdata; 17 | std::locale create_convert(std::locale const &,cdata const &,character_facet_type); // ok 18 | std::locale create_collate(std::locale const &,cdata const &,character_facet_type); // ok 19 | std::locale create_formatting(std::locale const &,cdata const &,character_facet_type); // ok 20 | std::locale create_parsing(std::locale const &,cdata const &,character_facet_type); // ok 21 | std::locale create_codecvt(std::locale const &,std::string const &encoding,character_facet_type); // ok 22 | std::locale create_boundary(std::locale const &,cdata const &,character_facet_type); // ok 23 | std::locale create_calendar(std::locale const &,cdata const &); // ok 24 | 25 | } 26 | } 27 | } 28 | 29 | #endif 30 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 31 | -------------------------------------------------------------------------------- /booster/lib/locale/src/icu/cdata.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_ICU_CDATA_HPP 9 | #define BOOSTER_LOCALE_ICU_CDATA_HPP 10 | 11 | #include 12 | #include 13 | 14 | namespace booster { 15 | namespace locale { 16 | namespace impl_icu { 17 | struct cdata { 18 | icu::Locale locale; 19 | std::string encoding; 20 | bool utf8; 21 | }; 22 | } 23 | } 24 | } 25 | 26 | 27 | #endif 28 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 29 | -------------------------------------------------------------------------------- /booster/lib/locale/src/icu/codecvt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_ICU_CODECVT_HPP 9 | #define BOOSTER_LOCALE_IMPL_ICU_CODECVT_HPP 10 | #include 11 | #include 12 | #include 13 | namespace booster { 14 | namespace locale { 15 | namespace impl_icu { 16 | BOOSTER_API 17 | std::unique_ptr create_uconv_converter(std::string const &encoding); 18 | 19 | } // impl_icu 20 | } // locale 21 | } // boost 22 | 23 | #endif 24 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 25 | -------------------------------------------------------------------------------- /booster/lib/locale/src/icu/icu_backend.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_ICU_LOCALIZATION_BACKEND_HPP 9 | #define BOOSTER_LOCALE_IMPL_ICU_LOCALIZATION_BACKEND_HPP 10 | namespace booster { 11 | namespace locale { 12 | class localization_backend; 13 | namespace impl_icu { 14 | localization_backend *create_localization_backend(); 15 | } // impl_icu 16 | } // locale 17 | } // boost 18 | #endif 19 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 20 | 21 | -------------------------------------------------------------------------------- /booster/lib/locale/src/icu/icu_util.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_SRC_ICU_UTIL_HPP 9 | #define BOOSTER_SRC_ICU_UTIL_HPP 10 | #include 11 | #include 12 | 13 | namespace booster { 14 | namespace locale { 15 | namespace impl_icu { 16 | 17 | inline void throw_icu_error(UErrorCode err) 18 | { 19 | throw booster::runtime_error(u_errorName(err)); 20 | } 21 | 22 | inline void check_and_throw_icu_error(UErrorCode err) 23 | { 24 | if(U_FAILURE(err)) 25 | throw_icu_error(err); 26 | } 27 | } // impl 28 | } // locale 29 | } // boost 30 | 31 | #endif 32 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 33 | -------------------------------------------------------------------------------- /booster/lib/locale/src/icu/time_zone.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_ICU_GET_TIME_ZONE_HPP 9 | #define BOOSTER_LOCALE_IMPL_ICU_GET_TIME_ZONE_HPP 10 | 11 | #include 12 | #include 13 | 14 | namespace booster { 15 | namespace locale { 16 | namespace impl_icu { 17 | 18 | // Provides a workaround for an ICU default timezone bug and also 19 | // handles time_zone string correctly - if empty returns default 20 | // otherwise returns the instance created with time_zone 21 | icu::TimeZone *get_time_zone(std::string const &time_zone); 22 | } 23 | } 24 | } 25 | #endif 26 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 27 | -------------------------------------------------------------------------------- /booster/lib/locale/src/posix/codecvt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_POSIX_CODECVT_HPP 9 | #define BOOSTER_LOCALE_IMPL_POSIX_CODECVT_HPP 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace booster { 17 | namespace locale { 18 | namespace impl_posix { 19 | BOOSTER_API 20 | std::unique_ptr create_iconv_converter(std::string const &encoding); 21 | 22 | } // impl_posix 23 | } // locale 24 | } // boost 25 | 26 | #endif 27 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 28 | 29 | -------------------------------------------------------------------------------- /booster/lib/locale/src/posix/posix_backend.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_POSIX_LOCALIZATION_BACKEND_HPP 9 | #define BOOSTER_LOCALE_IMPL_POSIX_LOCALIZATION_BACKEND_HPP 10 | namespace booster { 11 | namespace locale { 12 | class localization_backend; 13 | namespace impl_posix { 14 | localization_backend *create_localization_backend(); 15 | } // impl_std 16 | } // locale 17 | } // boost 18 | #endif 19 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 20 | 21 | -------------------------------------------------------------------------------- /booster/lib/locale/src/shared/mo_lambda.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_SRC_LOCALE_MO_LAMBDA_H_INCLUDED 9 | #define BOOSTER_SRC_LOCALE_MO_LAMBDA_H_INCLUDED 10 | 11 | #include 12 | 13 | namespace booster { 14 | namespace locale { 15 | namespace gnu_gettext { 16 | namespace lambda { 17 | 18 | struct plural { 19 | 20 | virtual int operator()(int n) const = 0; 21 | virtual plural *clone() const = 0; 22 | virtual ~plural() 23 | { 24 | } 25 | }; 26 | 27 | typedef std::unique_ptr plural_ptr; 28 | 29 | plural_ptr compile(char const *c_expression); 30 | 31 | } // lambda 32 | } // gnu_gettext 33 | } // locale 34 | } // boost 35 | 36 | #endif 37 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 38 | 39 | -------------------------------------------------------------------------------- /booster/lib/locale/src/std/std_backend.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_STD_LOCALIZATION_BACKEND_HPP 9 | #define BOOSTER_LOCALE_IMPL_STD_LOCALIZATION_BACKEND_HPP 10 | namespace booster { 11 | namespace locale { 12 | class localization_backend; 13 | namespace impl_std { 14 | localization_backend *create_localization_backend(); 15 | } // impl_std 16 | } // locale 17 | } // boost 18 | #endif 19 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 20 | 21 | -------------------------------------------------------------------------------- /booster/lib/locale/src/util/gregorian.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_SRC_UTIL_GREGORIAN_HPP 9 | #define BOOSTER_LOCALE_SRC_UTIL_GREGORIAN_HPP 10 | 11 | #include 12 | 13 | namespace booster { 14 | namespace locale { 15 | namespace util { 16 | 17 | std::locale install_gregorian_calendar(std::locale const &in,std::string const &terr); 18 | 19 | } // util 20 | } // locale 21 | } //boost 22 | 23 | 24 | #endif 25 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 26 | -------------------------------------------------------------------------------- /booster/lib/locale/src/win32/lcid.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_WIN32_LCID_HPP 9 | #define BOOSTER_LOCALE_IMPL_WIN32_LCID_HPP 10 | 11 | #include 12 | #include 13 | 14 | namespace booster { 15 | namespace locale { 16 | namespace impl_win { 17 | 18 | BOOSTER_API unsigned locale_to_lcid(std::string const &locale_name); 19 | 20 | } // impl_win 21 | } // locale 22 | } // boost 23 | 24 | #endif 25 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 26 | -------------------------------------------------------------------------------- /booster/lib/locale/src/win32/win_backend.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_LOCALE_IMPL_WIN32_LOCALIZATION_BACKEND_HPP 9 | #define BOOSTER_LOCALE_IMPL_WIN32_LOCALIZATION_BACKEND_HPP 10 | namespace booster { 11 | namespace locale { 12 | class localization_backend; 13 | namespace impl_win { 14 | localization_backend *create_localization_backend(); 15 | } // impl_win 16 | } // locale 17 | } // boost 18 | #endif 19 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 20 | 21 | -------------------------------------------------------------------------------- /booster/lib/locale/test/generate_catalogs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See 6 | # accompanying file LICENSE_1_0.txt or copy at 7 | # http://www.boost.org/LICENSE_1_0.txt) 8 | # 9 | 10 | msgfmt --endianness=big he/LC_MESSAGES/simple.po -o he/LC_MESSAGES/simple.mo 11 | msgfmt he/LC_MESSAGES/default.po -o he/LC_MESSAGES/default.mo 12 | msgfmt he/LC_MESSAGES/fall.po -o he/LC_MESSAGES/fall.mo 13 | msgfmt he_IL/LC_MESSAGES/full.po -o he_IL/LC_MESSAGES/full.mo 14 | 15 | -------------------------------------------------------------------------------- /booster/lib/locale/test/he/LC_MESSAGES/default.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/booster/lib/locale/test/he/LC_MESSAGES/default.mo -------------------------------------------------------------------------------- /booster/lib/locale/test/he/LC_MESSAGES/default.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | "Plural-Forms: nplurals=4; plural= (n==1 ? 0 : (n==2 ? 1 : (n>10 ? 3 : 2))) ;\n" 7 | 8 | msgid "בדיקה" 9 | msgstr "test" 10 | 11 | msgid "hello" 12 | msgstr "שלום" 13 | 14 | msgid "#hello" 15 | msgstr "#שלום" 16 | 17 | msgctxt "context" 18 | msgid "hello" 19 | msgstr "שלום בהקשר אחר" 20 | 21 | msgid "x day" 22 | msgid_plural "x days" 23 | msgstr[0] "יום x" 24 | msgstr[1] "יומיים" 25 | msgstr[2] "x ימים" 26 | msgstr[3] "x יום" 27 | 28 | msgctxt "context" 29 | msgid "x day" 30 | msgid_plural "בהקשר x days" 31 | msgstr[0] "בהקשר יום x" 32 | msgstr[1] "בהקשר יומיים" 33 | msgstr[2] "בהקשר x ימים" 34 | msgstr[3] "בהקשר x יום" 35 | 36 | -------------------------------------------------------------------------------- /booster/lib/locale/test/he/LC_MESSAGES/fall.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/booster/lib/locale/test/he/LC_MESSAGES/fall.mo -------------------------------------------------------------------------------- /booster/lib/locale/test/he/LC_MESSAGES/fall.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | 7 | msgid "test" 8 | msgstr "he" 9 | 10 | 11 | -------------------------------------------------------------------------------- /booster/lib/locale/test/he/LC_MESSAGES/simple.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/booster/lib/locale/test/he/LC_MESSAGES/simple.mo -------------------------------------------------------------------------------- /booster/lib/locale/test/he/LC_MESSAGES/simple.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | "Plural-Forms: nplurals=2; plural=n!=1;\n" 7 | 8 | msgid "hello" 9 | msgstr "היי" 10 | 11 | msgid "#hello" 12 | msgstr "#היי" 13 | 14 | msgctxt "context" 15 | msgid "hello" 16 | msgstr "היי בהקשר אחר" 17 | 18 | 19 | #: test_message.cpp:47 20 | msgid "test" 21 | msgid_plural "tests" 22 | msgstr[0] "" 23 | msgstr[1] "" 24 | -------------------------------------------------------------------------------- /booster/lib/locale/test/he_IL/LC_MESSAGES/full.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/booster/lib/locale/test/he_IL/LC_MESSAGES/full.mo -------------------------------------------------------------------------------- /booster/lib/locale/test/he_IL/LC_MESSAGES/full.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | 7 | msgid "test" 8 | msgstr "he_IL" 9 | 10 | 11 | -------------------------------------------------------------------------------- /booster/lib/locale/test/test_posix_tools.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | #ifndef BOOSTER_LOCLAE_TEST_LOCALE_POSIX_TOOLS_HPP 10 | #define BOOSTER_LOCLAE_TEST_LOCALE_POSIX_TOOLS_HPP 11 | 12 | #include 13 | #include 14 | 15 | #if defined(__APPLE__) || defined(__FreeBSD__) 16 | #include 17 | #endif 18 | 19 | inline bool have_locale(std::string const &name) 20 | { 21 | locale_t l=newlocale(LC_ALL_MASK,name.c_str(),0); 22 | if(l) { 23 | freelocale(l); 24 | return true; 25 | } 26 | return false; 27 | } 28 | 29 | #endif 30 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 31 | 32 | -------------------------------------------------------------------------------- /booster/lib/nowide/src/convert.cpp: -------------------------------------------------------------------------------- 1 | #define BOOSTER_SOURCE 2 | #include 3 | 4 | #ifdef BOOSTER_WIN_NATIVE 5 | 6 | #ifndef NOMINMAX 7 | #define NOMINMAX 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace booster { 14 | namespace nowide { 15 | 16 | bad_utf::bad_utf() : booster::runtime_error("Bad utf-8 or utf-16 sequence") 17 | { 18 | } 19 | 20 | 21 | std::string convert(wchar_t const *s) 22 | { 23 | std::string res; 24 | std::vector buf(wcslen(s)*4+1); 25 | int n=WideCharToMultiByte(CP_UTF8,0,s,-1,&buf.front(),buf.size(),0,0); 26 | if(n==0) { 27 | throw bad_utf(); 28 | } 29 | res.assign(&buf.front(),n-1); 30 | return res; 31 | } 32 | 33 | std::wstring convert(char const *s) 34 | { 35 | std::wstring res; 36 | std::vector buf(strlen(s)+1); 37 | int n=MultiByteToWideChar(CP_UTF8,0,s,-1,&buf.front(),buf.size()); 38 | if(n==0) { 39 | throw bad_utf(); 40 | } 41 | res.assign(&buf.front(),n-1); 42 | return res; 43 | } 44 | 45 | } // nowide 46 | } // booster 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /booster/lib/smart_ptr/src/atomic_counter.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #define BOOSTER_SOURCE 9 | #include 10 | 11 | namespace booster { 12 | 13 | atomic_counter::atomic_counter(long value) : value_(value) 14 | { 15 | } 16 | 17 | atomic_counter::~atomic_counter() 18 | { 19 | } 20 | 21 | long atomic_counter::inc() 22 | { 23 | return ++value_; 24 | } 25 | 26 | long atomic_counter::dec() 27 | { 28 | return --value_; 29 | } 30 | 31 | long atomic_counter::get() const 32 | { 33 | return value_; 34 | } 35 | 36 | 37 | } // booster 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /booster/lib/smart_ptr/test/test_atomic_counter.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #include 9 | #include 10 | #include 11 | #include "test.h" 12 | #include 13 | 14 | booster::atomic_counter *c; 15 | 16 | void inc() 17 | { 18 | for(int i=0;i<1000000;i++) 19 | ++*c; 20 | } 21 | 22 | void dec() 23 | { 24 | for(int i=0;i<1000000;i++) 25 | --*c; 26 | } 27 | 28 | 29 | 30 | int main() 31 | { 32 | try { 33 | booster::atomic_counter counter(0); 34 | TEST(long(counter) == 0); 35 | TEST(++counter == 1); 36 | TEST(--counter == 0); 37 | TEST(++counter == 1); 38 | TEST(long(counter) == 1); 39 | TEST(++counter == 2); 40 | TEST(--counter == 1); 41 | TEST(long(counter) == 1); 42 | TEST(--counter == 0); 43 | TEST(long(counter) == 0); 44 | c=&counter; 45 | booster::thread a(inc); 46 | booster::thread b(dec); 47 | a.join(); 48 | b.join(); 49 | TEST(long(counter) == 0); 50 | } 51 | catch(std::exception const &e) { 52 | std::cerr << "Failed " << e.what() << std::endl; 53 | return 1; 54 | } 55 | std::cout << "Ok" << std::endl; 56 | return 0; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /booster/lib/test/test.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2009-2012 Artyom Beilis (Tonkikh) 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. (See 5 | // accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | #ifndef BOOSTER_TEST_H 9 | #define BOOSTER_TEST_H 10 | 11 | 12 | #include 13 | #include 14 | 15 | 16 | #define TEST(X) \ 17 | do { \ 18 | if(X) break; \ 19 | std::ostringstream oss; \ 20 | oss << "Error " << __FILE__ << ":"<<__LINE__ << " "#X; \ 21 | throw std::runtime_error(oss.str()); \ 22 | }while(0) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/Cookie.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace CppCMS.Session { 5 | public class Cookie { 6 | 7 | public readonly string Header; 8 | public readonly string Name; 9 | public readonly string Value; 10 | public readonly string Domain; 11 | public readonly string Path; 12 | public readonly string HeaderContent; 13 | public readonly bool MaxAgeDefined; 14 | public readonly bool ExpiresDefined; 15 | public readonly bool Secure; 16 | public readonly uint MaxAge; 17 | public readonly long Expires; 18 | 19 | private static String ts(IntPtr p) 20 | { 21 | return SessionBase.ts(p); 22 | } 23 | internal Cookie(IntPtr d) 24 | { 25 | Header = ts(API.cookie_header(d)); 26 | Name = ts(API.cookie_name(d)); 27 | Value = ts(API.cookie_value(d)); 28 | Domain = ts(API.cookie_domain(d)); 29 | Path = ts(API.cookie_path(d)); 30 | HeaderContent = ts(API.cookie_header_content(d)); 31 | MaxAgeDefined = API.cookie_max_age_defined(d)!=0; 32 | ExpiresDefined = API.cookie_expires_defined(d)!=0; 33 | Secure = API.cookie_is_secure(d)!=0; 34 | MaxAge = API.cookie_max_age(d); 35 | Expires = API.cookie_expires(d); 36 | } 37 | public override string ToString() 38 | { 39 | return this.Header; 40 | } 41 | } // class 42 | } // namespcae 43 | 44 | -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/SessionBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace CppCMS.Session { 6 | 7 | abstract public class SessionBase : IDisposable { 8 | 9 | internal IntPtr d = IntPtr.Zero; 10 | 11 | abstract public void Close(); 12 | 13 | public void Dispose() 14 | { 15 | Close(); 16 | } 17 | ~SessionBase() 18 | { 19 | Close(); 20 | } 21 | 22 | internal static byte[] tb(string s) 23 | { 24 | if(s==null) 25 | return null; 26 | return Encoding.UTF8.GetBytes(s + "\0"); 27 | } 28 | internal static string ts(IntPtr p) 29 | { 30 | if(p==IntPtr.Zero) 31 | return null; 32 | int len = 0; 33 | while(Marshal.ReadByte(p,len)!=0) 34 | len++; 35 | byte[] tmp = new byte[len]; 36 | Marshal.Copy(p,tmp,0,len); 37 | return Encoding.UTF8.GetString(tmp); 38 | } 39 | protected void check() 40 | { 41 | int code = API.error(d); 42 | if(code == 0) 43 | return; 44 | string msg = ts(API.error_clear(d)); 45 | switch(code) { 46 | case API.ERROR_ALLOC: 47 | throw new OutOfMemoryException(msg); 48 | case API.ERROR_INVALID_ARGUMENT: 49 | throw new ArgumentException(msg); 50 | case API.ERROR_LOGIC: 51 | throw new InvalidOperationException(msg); 52 | default: 53 | throw new SystemException(msg); 54 | } 55 | } 56 | } // class 57 | } // namespace 58 | -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/SessionPool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | namespace CppCMS.Session { 3 | public class SessionPool : SessionBase { 4 | private SessionPool() 5 | { 6 | d=API.session_pool_new(); 7 | } 8 | override public void Close() 9 | { 10 | if(d!=IntPtr.Zero) { 11 | API.session_pool_delete(d); 12 | d=IntPtr.Zero; 13 | } 14 | } 15 | public static SessionPool FromConfig(string path) 16 | { 17 | SessionPool p = new SessionPool(); 18 | API.session_pool_init(p.d,tb(path)); 19 | p.check(); 20 | return p; 21 | } 22 | public static SessionPool FromJSON(string json) 23 | { 24 | SessionPool p = new SessionPool(); 25 | API.session_pool_init_from_json(p.d,tb(json)); 26 | p.check(); 27 | return p; 28 | } 29 | public Session Session() 30 | { 31 | return new Session(this); 32 | } 33 | } 34 | } // namespace 35 | 36 | -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f cppcms.dll 3 | mcs -r:System.Web.dll *.cs -out:cppcms.dll || exit 1 4 | 5 | -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/test/bin/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/contrib/integration/session/asp.net/test/bin/.gitignore -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/test/html: -------------------------------------------------------------------------------- 1 | ../../wwwtest/ -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f bin/cppcms.dll 3 | cp ../cppcms.dll bin/ 4 | xsp --port 8000 --root ./ 5 | -------------------------------------------------------------------------------- /contrib/integration/session/asp.net/test/test.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" Inherits="UnitTest" CodeFile="test.aspx.cs" %> 2 | <%=message %> -------------------------------------------------------------------------------- /contrib/integration/session/example/Sample.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | import javax.servlet.*; 3 | import javax.servlet.http.*; 4 | import com.cppcms.session.*; 5 | 6 | public class Sample extends HttpServlet { 7 | static SessionPool pool; 8 | 9 | public void init() throws ServletException 10 | { 11 | ServletContext context = getServletContext(); 12 | String configPath = context.getRealPath("/WEB-INF/cppcms-config.js"); 13 | pool = SessionPool.openFromConfig(configPath); 14 | } 15 | 16 | public void doGet(HttpServletRequest request, 17 | HttpServletResponse response) throws ServletException, IOException 18 | { 19 | Session session = pool.getSession(); 20 | session.load(request); 21 | String x=session.get("x"); 22 | if(x==null) { 23 | x="0"; 24 | } 25 | x=Integer.toString(Integer.parseInt(x)+1); 26 | session.set("x",x); 27 | session.save(response); 28 | session.close(); 29 | 30 | PrintWriter out = response.getWriter(); 31 | out.println("X is now " + x); 32 | // Use "out" to send content to browser 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /contrib/integration/session/example/cppcms-config.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "session" : { 4 | "timeout" : 300, 5 | "location" : "client", 6 | "expire" : "renew", 7 | "client" : { 8 | "hmac" : "sha1", 9 | "hmac_key" : "dc07e0ff8e44be872e86fe848841584cd38983e5" 10 | }, 11 | }, 12 | } 13 | -------------------------------------------------------------------------------- /contrib/integration/session/example/example.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" Inherits="Example" CodeFile="example.aspx.cs" %> 2 | 3 | 4 | 5 |

Session Counter = <%=counter%>

6 | 7 | 8 | -------------------------------------------------------------------------------- /contrib/integration/session/example/example.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Web.UI; 3 | using CppCMS.Session; 4 | public partial class Example : Page { 5 | static SessionPool pool; 6 | static Example() { 7 | pool = SessionPool.FromConfig("cppcms-config.js"); 8 | } 9 | protected string counter = null; 10 | protected void Page_Load(object sender,EventArgs e) 11 | { 12 | using(Session s = pool.Session()) { 13 | s.Load(Request); 14 | string v="0"; 15 | if(s.IsSet("x")) 16 | v=s["x"]; 17 | v = (int.Parse(v) + 1).ToString(); 18 | s["x"]=v; 19 | s.Save(Response); 20 | counter = v; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contrib/integration/session/example/sample.php: -------------------------------------------------------------------------------- 1 | session(); 6 | $session->load(); 7 | $x=0; 8 | if($session->is_set('x')) { 9 | $x=$session['x']; 10 | } 11 | 12 | $x=intval($x)+1; 13 | $session['x']=$x; 14 | $session->save(); 15 | 16 | echo "x=$x\n"; 17 | -------------------------------------------------------------------------------- /contrib/integration/session/example/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | from django.conf import settings 3 | import cppcms 4 | # 5 | # Create the session pool - note it is thread safe and should be one per projects 6 | # Provide a path to configuration file 7 | # 8 | pool=cppcms.SessionPool(settings.BASE_DIR + '/mysite/cppcms-config.js') 9 | 10 | def home(request): 11 | # Get session object 12 | s=pool.session() 13 | # Load the data from request 14 | s.load(django_request=request) 15 | 16 | # Access session key-values as dictionary 17 | v='0' 18 | if 'x' in s: 19 | v= s['x'] 20 | s['x']=str(int(v)+1) 21 | 22 | response = HttpResponse() 23 | 24 | # Save the session 25 | s.save(django_response=response) 26 | response.write('x is %s' % v); 27 | return response 28 | -------------------------------------------------------------------------------- /contrib/integration/session/java/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source config.sh 4 | 5 | rm -f com/cppcms/session/*.class cppcms.jar 6 | 7 | if ! javac -cp $SERVLET:$JNA com/cppcms/session/*.java 8 | then 9 | exit 1 10 | fi 11 | jar cvf cppcms.jar com/cppcms/session/*.class 12 | 13 | -------------------------------------------------------------------------------- /contrib/integration/session/java/com/cppcms/session/SessionBase.java: -------------------------------------------------------------------------------- 1 | package com.cppcms.session; 2 | import com.sun.jna.Pointer; 3 | 4 | abstract class SessionBase { 5 | 6 | protected Pointer d; 7 | protected void finalize() 8 | { 9 | close(); 10 | } 11 | protected void check() 12 | { 13 | if(d==null) 14 | throw new NullPointerException("Invalid class use"); 15 | int code=API.api.cppcms_capi_error(d); 16 | if(code == 0) 17 | return; 18 | String msg = API.api.cppcms_capi_error_clear(d); 19 | switch(code) { 20 | case API.ERROR_ALLOC: 21 | throw new OutOfMemoryError(msg); 22 | case API.ERROR_INVALID_ARGUMENT: 23 | throw new IllegalArgumentException(msg); 24 | case API.ERROR_LOGIC: 25 | throw new IllegalStateException(msg); 26 | default: 27 | throw new RuntimeException(msg); 28 | } 29 | } 30 | 31 | abstract void doClose(); 32 | 33 | public void close() 34 | { 35 | if(d!=null && API.api != null) { 36 | doClose(); 37 | d=null; 38 | } 39 | } 40 | 41 | 42 | }; 43 | -------------------------------------------------------------------------------- /contrib/integration/session/java/com/cppcms/session/SessionPool.java: -------------------------------------------------------------------------------- 1 | package com.cppcms.session; 2 | 3 | import com.sun.jna.Pointer; 4 | 5 | 6 | public class SessionPool extends SessionBase { 7 | 8 | private SessionPool() 9 | { 10 | API.init(); 11 | d=API.api.cppcms_capi_session_pool_new(); 12 | } 13 | public static SessionPool openFromConfig(String file) 14 | { 15 | SessionPool p=new SessionPool(); 16 | API.api.cppcms_capi_session_pool_init(p.d,file); 17 | p.check(); 18 | return p; 19 | } 20 | public static SessionPool openFromJson(String json) 21 | { 22 | SessionPool p=new SessionPool(); 23 | API.api.cppcms_capi_session_pool_init_from_json(p.d,json); 24 | p.check(); 25 | return p; 26 | } 27 | public Session getSession() 28 | { 29 | return new Session(d); 30 | } 31 | void doClose() 32 | { 33 | API.api.cppcms_capi_session_pool_delete(d); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /contrib/integration/session/java/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export SERVLET=/home/artik/Packages/jetty/jetty-distribution-9.4.6.v20170531/lib/servlet-api-3.1.jar 4 | export JNA=/usr/share/java/jna.jar 5 | 6 | -------------------------------------------------------------------------------- /contrib/integration/session/java/test/build_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm *.class 3 | source ../config.sh 4 | 5 | if ! javac -cp $SERVLET:$JNA:../cppcms.jar UnitTest.java 6 | then 7 | exit 1 8 | fi 9 | 10 | 11 | rm -fr jct 12 | 13 | mkdir jct 14 | mkdir jct/WEB-INF 15 | mkdir jct/WEB-INF/classes 16 | mkdir jct/WEB-INF/lib 17 | 18 | cp web.xml jct/WEB-INF/ 19 | cp *.class jct/WEB-INF/classes/ 20 | cp ../cppcms.jar jct/WEB-INF/lib/ 21 | cp $JNA jct/WEB-INF/lib/ 22 | cp ../../wwwtest/*.html jct/ 23 | cp ../../wwwtest/*.js jct/ 24 | cp ../../reference/config.js jct/WEB-INF/ 25 | -------------------------------------------------------------------------------- /contrib/integration/session/java/test/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | UnitTest 4 | UnitTest 5 | 6 | 7 | 8 | UnitTest 9 | /test 10 | 11 | 12 | -------------------------------------------------------------------------------- /contrib/integration/session/php/php5/build_ext.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -f cppcms_api.so 4 | 5 | if [ "$CPPCMS_PATH" != "" ] 6 | then 7 | CPPCMS_INC=-I$CPPCMS_PATH/include 8 | CPPCMS_LIB=-L$CPPCMS_PATH/lib 9 | CPPCMS_LINK_FLAGS=-Wl,-rpath=$CPPCMS_PATH/lib 10 | fi 11 | 12 | PHP_FLAGS=`php-config5 --includes` 13 | 14 | gcc -fPIC -shared -O2 -g $CPPCMS_INC $PHP_FLAGS $CPPCMS_LIB cppcms_api.c -o cppcms_api.so $CPPCMS_LINK_FLAGS -lcppcms -lbooster 15 | -------------------------------------------------------------------------------- /contrib/integration/session/php/php7/build_ext.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -f cppcms_api.so 4 | 5 | if [ "$CPPCMS_PATH" != "" ] 6 | then 7 | CPPCMS_INC=-I$CPPCMS_PATH/include 8 | CPPCMS_LIB=-L$CPPCMS_PATH/lib 9 | CPPCMS_LINK_FLAGS=-Wl,-rpath=$CPPCMS_PATH/lib 10 | fi 11 | 12 | PHP_FLAGS=`php-config --includes` 13 | 14 | gcc -fPIC -shared -O2 -g $CPPCMS_INC $PHP_FLAGS $CPPCMS_LIB cppcms_api.c -o cppcms_api.so $CPPCMS_LINK_FLAGS -lcppcms -lbooster 15 | -------------------------------------------------------------------------------- /contrib/integration/session/php/test/html: -------------------------------------------------------------------------------- 1 | ../../wwwtest/ -------------------------------------------------------------------------------- /contrib/integration/session/php/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /contrib/integration/session/php/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | php5 -S 0.0.0.0:8000 -d enable_dl=On -d extension=../php5/cppcms_api.so -t ./ 3 | -------------------------------------------------------------------------------- /contrib/integration/session/php/test/run7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | php7.0 -S 0.0.0.0:8000 -d enable_dl=On -d extension=../php7/cppcms_api.so -t ./ 3 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/config.js: -------------------------------------------------------------------------------- 1 | ../../reference/config.js -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/cppcmstest/.urls.py.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/contrib/integration/session/python/cppcmstest/cppcmstest/.urls.py.swp -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/cppcmstest/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/contrib/integration/session/python/cppcmstest/cppcmstest/__init__.py -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/cppcmstest/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | 3 | from django.contrib import admin 4 | admin.autodiscover() 5 | 6 | urlpatterns = patterns('', 7 | # Examples: 8 | # url(r'^$', 'cppcmstest.views.home', name='home'), 9 | url(r'^tester/', include('tester.urls')), 10 | 11 | url(r'^admin/', include(admin.site.urls)), 12 | ) 13 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/cppcmstest/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for cppcmstest project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cppcmstest.settings") 12 | 13 | from django.core.wsgi import get_wsgi_application 14 | application = get_wsgi_application() 15 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/html: -------------------------------------------------------------------------------- 1 | ../../wwwtest/ -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cppcmstest.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LD_LIBRARY_PATH=/opt/cppcms/lib/ 4 | export PYTHONPATH=.. 5 | python manage.py runserver 8000 6 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/tester/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/contrib/integration/session/python/cppcmstest/tester/__init__.py -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/tester/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/tester/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/tester/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /contrib/integration/session/python/cppcmstest/tester/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | url(r'^$', views.home, name='home'), 7 | ] 8 | -------------------------------------------------------------------------------- /contrib/integration/session/reference/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8000, 5 | "ip" : "0.0.0.0" 6 | }, 7 | "http" : { 8 | "script" : "/test" 9 | }, 10 | "session" : { 11 | "expire" : "renew", 12 | "timeout" : 604800, 13 | "location" : "both", 14 | "client" : { 15 | "hmac" : "sha1", 16 | "hmac_key" : "3891bbf7f845fd4277008a63d72640fc13bb9a31" 17 | }, 18 | "server" : { 19 | "storage" : "files", 20 | "shared" : true, 21 | } 22 | 23 | }, 24 | "security" : { "csrf" : {"enable" : true}}, 25 | "file_server" : { 26 | "enable" : true, 27 | "document_root" : "../wwwtest" 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /contrib/integration/session/swig/gen-php.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$SWIG" == "" ] 4 | then 5 | SWIG=swig 6 | fi 7 | 8 | $SWIG -php -module cppcms_api -outdir ../php/php5 -o ../php/php5/cppcms_api.c cppcms.i 9 | -------------------------------------------------------------------------------- /contrib/integration/session/swig/gen-php7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$SWIG" == "" ] 4 | then 5 | SWIG=swig 6 | fi 7 | 8 | $SWIG -php7 -module cppcms_api -outdir ../php/php7 -o ../php/php7/cppcms_api.c cppcms.i 9 | -------------------------------------------------------------------------------- /contrib/integration/session/tools/parse-csharp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | parsed() 4 | { 5 | grep -E '(CPPCMS_API|define.*[0-9])' "$1" | \ 6 | sed 's/char const \*\([a-z_]*\)\([,\)]\)/string \1\2/g' | \ 7 | sed 's/char const \*cppcms/IntPtr cppcms/g' | \ 8 | sed 's/const//' | \ 9 | sed 's/void *\*\([a-z_]*\)\([,\)]\)/byte[] \1\2/g' | \ 10 | sed 's/int *\([a-z_]*\)\([,)]\)/int \1\2/g' | \ 11 | sed 's/cppcms_capi[a-z_]* *\*\([a-z_]*\)\([,\)]\)/pointer \1\2/g' | \ 12 | sed 's/cppcms_capi[a-z_]* *\*cppcms_capi/pointer cppcms_capi/g' | \ 13 | sed 's/cppcms_capi_object *\([a-zA-Z_]*\)/pointer \1/g' | \ 14 | sed 's/CPPCMS_API //' | \ 15 | sed 's/long long/llong/g' | \ 16 | sed 's/\t/ /g' | \ 17 | sed 's/ / /g' 18 | } 19 | 20 | FILE=$1 21 | if [ "$FILE" == "" ] 22 | then 23 | FILE=../../../../cppcms/capi/session.h 24 | fi 25 | 26 | parsed $FILE \ 27 | | sed 's/pointer/IntPtr/g' \ 28 | | sed 's/string/byte[] /g' \ 29 | | sed 's/llong/long/g' \ 30 | | sed 's/int/int/g' \ 31 | | sed 's/\([^_]\)value/\1val/g' \ 32 | | sed 's/unsigned/uint/g' \ 33 | | sed 's/#define *CPPCMS_CAPI_\([a-zA-Z0-9_]*\) *\([0-9\-]*\)/\ public const int \1=\2;/' \ 34 | | sed 's/\([a-zA-Z_][a-zA-Z_]*\) *cppcms_capi_\([a-z_][a-z_]*\)(\(.*\));/ [DllImport(library,EntryPoint="cppcms_capi_\2")]\n public static extern \1 \2(\3);\n/' >API.cs 35 | -------------------------------------------------------------------------------- /contrib/integration/session/tools/parse-java.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | parsed() 4 | { 5 | grep -E '(CPPCMS_API|define.*[0-9])' "$1" | \ 6 | sed 's/char const \*\([a-z_]*\)\([,\)]\)/string \1\2/g' | \ 7 | sed 's/char const \*cppcms/string cppcms/g' | \ 8 | sed 's/const//' | \ 9 | sed 's/void *\*\([a-z_]*\)\([,\)]\)/byte[] \1\2/g' | \ 10 | sed 's/int *\([a-z_]*\)\([,)]\)/int \1\2/g' | \ 11 | sed 's/cppcms_capi[a-z_]* *\*\([a-z_]*\)\([,\)]\)/pointer \1\2/g' | \ 12 | sed 's/cppcms_capi[a-z_]* *\*cppcms_capi/pointer cppcms_capi/g' | \ 13 | sed 's/cppcms_capi_object *\([a-zA-Z_]*\)/pointer \1/g' | \ 14 | sed 's/CPPCMS_API //' | \ 15 | sed 's/long long/llong/g' | \ 16 | sed 's/\t/ /g' | \ 17 | sed 's/ / /g' 18 | } 19 | 20 | FILE=$1 21 | if [ "$FILE" == "" ] 22 | then 23 | FILE=../../../../cppcms/capi/session.h 24 | fi 25 | 26 | parsed $FILE \ 27 | | sed 's/pointer/Pointer/g' \ 28 | | sed 's/string/String/g' \ 29 | | sed 's/llong/long/g' \ 30 | | sed 's/int/int/g' \ 31 | | sed 's/unsigned/int/g' \ 32 | | sed 's/#define *CPPCMS_CAPI_\([a-zA-Z0-9_]*\) *\([0-9\-]*\)/\ public final static int \1=\2;/' \ 33 | | sed 's/\([a-zA-Z_][a-z_]*\) *\([a-z_][a-z_]*\)(\(.*\));/ \1 \2(\3);/' >Api.java 34 | -------------------------------------------------------------------------------- /contrib/integration/session/tools/parse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | parsed() 4 | { 5 | grep -E '(CPPCMS_API|define.*[0-9])' "$1" | \ 6 | sed 's/char const \*[a-z_]*\([,\)]\)/string\1/g' | \ 7 | sed 's/char const \*cppcms/string cppcms/g' | \ 8 | sed 's/const//' | \ 9 | sed 's/void *\*[a-z_]*\([,\)]\)/pointer\1/g' | \ 10 | sed 's/int *[a-z_]*\([,)]\)/int\1/g' | \ 11 | sed 's/cppcms_capi[a-z_]* *\*[a-z_]*\([,\)]\)/pointer\1/g' | \ 12 | sed 's/cppcms_capi[a-z_]* *\*cppcms_capi/pointer cppcms_capi/g' | \ 13 | sed 's/cppcms_capi_object *[a-zA-Z_]*/pointer/g' | \ 14 | sed 's/CPPCMS_API //' | \ 15 | sed 's/long long/llong/g' | \ 16 | sed 's/\t/ /g' | \ 17 | sed 's/ / /g' 18 | } 19 | 20 | FILE=$1 21 | if [ "$FILE" == "" ] 22 | then 23 | FILE=../../../../cppcms/capi/session.h 24 | fi 25 | 26 | parsed $FILE \ 27 | | sed 's/void/None/g' \ 28 | | sed 's/pointer/c_void_p/g' \ 29 | | sed 's/string/c_char_p/g' \ 30 | | sed 's/llong/c_longlong/g' \ 31 | | sed 's/int/c_int/g' \ 32 | | sed 's/unsigned/c_uint/g' \ 33 | | sed 's/#define *CPPCMS_CAPI_\([a-zA-Z0-9_]*\) *\([0-9\-]*\)/\ cls.\1=\2/' \ 34 | | sed 's/\([a-zA-Z_][a-z_]*\) *\([a-z_][a-z_]*\)(\(.*\));/ cls.capi.\2.restype=\1\n cls.capi.\2.argtypes=[ \3 ]/' >python.py 35 | -------------------------------------------------------------------------------- /contrib/integration/session/wwwtest/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Unit test 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
TestStatusComment
27 | 28 | -------------------------------------------------------------------------------- /contrib/server_side/sessions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | add_subdirectory(sqlite3) 4 | add_subdirectory(cppdb) 5 | add_subdirectory(berkeley_db) 6 | 7 | if(WIN32 OR CYGWIN) 8 | add_definitions(-DDLL_EXPORT) 9 | endif() 10 | 11 | add_executable(tester storage_test.cpp) 12 | target_link_libraries(tester cppcms booster pthread) 13 | -------------------------------------------------------------------------------- /contrib/server_side/sessions/berkeley_db/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | 3 | if(WIN32 OR CYGWIN) 4 | add_definitions(-DDLL_EXPORT) 5 | endif() 6 | 7 | add_library(cppcms_session_bdb SHARED bdb.cpp) 8 | target_link_libraries(cppcms_session_bdb cppcms booster db) 9 | -------------------------------------------------------------------------------- /contrib/server_side/sessions/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cleanall() 4 | { 5 | pushd $1 6 | rm -fr CMakeCache.txt CMakeFiles cmake_install.cmake Makefile 7 | popd 8 | } 9 | 10 | cleanall . 11 | cleanall berkeley_db 12 | cleanall cppdb 13 | cleanall sqlite3 14 | 15 | rm -f *.db 16 | rm -fr db/* 17 | 18 | mysql -u root --password=root test < 3 | 4 | 5 | 6 | 7 | Chat Room 8 | 9 | 10 |

Stock Price

11 | 28 |

Price:

29 | 30 | 31 | -------------------------------------------------------------------------------- /cppcms/base_cache_fwd.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_BASE_CACHE_FWD_H 9 | #define CPPCMS_BASE_CACHE_FWD_H 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace cppcms { 18 | namespace impl { 19 | class base_cache; 20 | inline void intrusive_ptr_add_ref(base_cache *ptr); 21 | inline void intrusive_ptr_release(base_cache *ptr); 22 | } // impl 23 | } //cppcms 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /cppcms/cache_pool.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_CACHE_POOL_H 9 | #define CPPCMS_CACHE_POOL_H 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace cppcms { 18 | namespace json { class value; } 19 | namespace impl { class base_cache; } 20 | 21 | /// \cond INTERNAL 22 | class CPPCMS_API cache_pool { 23 | public: 24 | cache_pool(json::value const &settings); 25 | ~cache_pool(); 26 | booster::intrusive_ptr get(); 27 | private: 28 | struct _data; 29 | booster::hold_ptr<_data> d; 30 | }; 31 | /// \endcond 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /cppcms/cppcms_error.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_ERROR_H 9 | #define CPPCMS_ERROR_H 10 | 11 | #include 12 | #include 13 | #include 14 | namespace cppcms { 15 | 16 | /// 17 | /// \brief Exception thrown by CppCMS framework. 18 | /// 19 | /// Every exception that is thrown from CppCMS modules derived from this exception. 20 | /// 21 | 22 | class CPPCMS_API cppcms_error : public booster::runtime_error { 23 | std::string strerror(int err); 24 | public: 25 | /// 26 | /// Create an object with error code err (errno) and a message \a error 27 | /// 28 | cppcms_error(int err,std::string const &error); 29 | /// 30 | /// Create an object with message \a error 31 | /// 32 | cppcms_error(std::string const &error) : booster::runtime_error(error) {}; 33 | }; 34 | 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /cppcms/cstdint.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_CSTDINT_H 9 | #define CPPCMS_CSTDINT_H 10 | #include 11 | 12 | namespace cppcms { 13 | using booster::int8_t; 14 | using booster::uint8_t; 15 | using booster::uint16_t; 16 | using booster::int16_t; 17 | using booster::uint32_t; 18 | using booster::int32_t; 19 | using booster::uint64_t; 20 | using booster::int64_t; 21 | } 22 | 23 | #endif // CPPCMS_CSTDINT_H 24 | 25 | -------------------------------------------------------------------------------- /cppcms/locale_fwd.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_LOCALE_FWD_H 9 | #define CPPCMS_LOCALE_FWD_H 10 | 11 | #include 12 | 13 | namespace booster { 14 | namespace locale { 15 | class generator; 16 | class info; 17 | } 18 | } 19 | namespace cppcms { 20 | namespace locale = ::booster::locale; 21 | } 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /cppcms/localization.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_LOCALIZATION_H 9 | #define CPPCMS_LOCALIZATION_H 10 | 11 | #include 12 | #include 13 | namespace cppcms { 14 | namespace locale = ::booster::locale; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /cppcms/mem_bind.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_UTIL_MEM_BIND_H 9 | #define CPPCMS_UTIL_MEM_BIND_H 10 | 11 | namespace cppcms { namespace util { 12 | 13 | /// \cond INTERNAL 14 | namespace details { 15 | 16 | template 17 | struct binderX { 18 | void (C::*member)(P1...); 19 | P object; 20 | void operator()(P1... args) const { ((*object).*member)(args...); } 21 | }; 22 | } 23 | 24 | /// \endcond 25 | 26 | /// 27 | /// Bind a member function \a mem of object referenced by a pointer \a obj creating a functional 28 | /// object that has an member function void operator()(P1 p) const and calls obj->mem(p) 29 | /// 30 | template 31 | details::binderX mem_bind(void (C::*mem)(P1...),P obj) 32 | { 33 | details::binderX tmp={mem,obj}; 34 | return tmp; 35 | } 36 | 37 | 38 | } } // cppcms::util 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /cppcms/serialization.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_SERIALIZATION_H 9 | #define CPPCMS_SERIALIZATION_H 10 | 11 | #include 12 | #include 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /cppcms/view.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_VIEW_H 9 | #define CPPCMS_VIEW_H 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /doc/architecture.txt: -------------------------------------------------------------------------------- 1 | # Architecture of CppCMS framework 2 | 3 | Application flow: 4 | 5 | - Several forked processes listen on the socket of cgi-like protocol: scgi, fcgi, http; 6 | - One of the processes accepts new connection and starts reading headers of the request. 7 | 8 | 9 | 10 | Classes 11 | 12 | - http::request 13 | - http::context 14 | - Owns 15 | - session 16 | - cache 17 | - locale 18 | - cgi::api (shared_from_this) 19 | - Owns 20 | - http::request 21 | - http::response 22 | - http::context 23 | - application 24 | - app::application 25 | - app::pool 26 | - thread::pool 27 | 28 | 29 | cgi::io created withing accept. 30 | once accepted: 31 | async read headers 32 | request object from pool 33 | async read post data and create request 34 | create context and response 35 | do 36 | proceed handler 37 | while incomplete handlers exist 38 | write data to output 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /doc/mainpage.doxy: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | \mainpage CppCMS - C++ Web Development Framework 4 | 5 | \section mainpage_intro Introduction 6 | 7 | What is CppCMS? CppCMS is Free C++ Web Development Framework (not CMS) aimed for 8 | Rapid Web Application Development. It differs from most of other web development 9 | frameworks like: Python Django, Java Servlets or C++ Wt in following: 10 | 11 | -# It is designed and tuned to handle extremely high loads. 12 | -# It uses modern C++ as primary development language in order to achieve first goal. 13 | -# It is aimed on development of Web Sites rather then "GUI Like" web applications. 14 | 15 | \section mainpage_docs Reference Documentation 16 | 17 | This is reference documentation for CppCMS. It includes two major parts: 18 | 19 | - Documentation of cppcms itself 20 | - Documentation of booster -- helper Boost like library. 21 | 22 | \section mainpage_tutorials Tutorials 23 | 24 | You can find multiple tutorails at the cppcms.com website. 25 | 26 | \section mainpage_examples Examples 27 | 28 | Multiple examples of using CppCMS can be found at this page \subpage examples_page 29 | 30 | \page v1_2 New in CppCMS 1.2 31 | 32 | \page new_api New API by Version 33 | 34 | - \ref v1_2 35 | */ 36 | -------------------------------------------------------------------------------- /examples/aio/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lbooster 2 | 3 | 4 | all: echo_server 5 | 6 | echo_server: echo_server.cpp 7 | $(CXX) $(CXXFLAGS) -std=c++11 -O2 -Wall -g echo_server.cpp -o echo_server ${LIBS} 8 | 9 | clean: 10 | rm -fr echo_server echo_server.exe cppcms_rundir 11 | -------------------------------------------------------------------------------- /examples/basic_cache/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean hello 4 | 5 | hello: hello.cpp view.cpp content.h 6 | $(CXX) -Wall -std=c++11 hello.cpp view.cpp -o hello $(LIBS) 7 | 8 | view.cpp: view.tmpl content.h 9 | cppcms_tmpl_cc view.tmpl -o view.cpp 10 | 11 | clean: 12 | rm -fr hello *.exe *.so view.cpp cppcms_rundir 13 | -------------------------------------------------------------------------------- /examples/basic_cache/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | }, 9 | "cache" : { 10 | "backend" : "thread_shared", 11 | "limit" : 100, 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /examples/basic_cache/content.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTENT_H 2 | #define CONTENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | 10 | namespace content { 11 | 12 | struct input_form : public cppcms::form { 13 | cppcms::widgets::numeric arg; 14 | cppcms::widgets::submit submit; 15 | 16 | input_form() 17 | { 18 | arg.message("N"); 19 | submit.value("Calc"); 20 | add(arg); 21 | add(submit); 22 | arg.non_empty(); 23 | } 24 | }; 25 | 26 | struct message : public cppcms::base_content { 27 | long long int fact; 28 | int arg; 29 | input_form info; 30 | }; 31 | 32 | } 33 | 34 | 35 | #endif 36 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 37 | -------------------------------------------------------------------------------- /examples/basic_cache/view.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "content.h" %> 2 | <% skin view %> 3 | <% view message uses content::message %> 4 | <% template render() %> 5 | 6 | 7 |

Factorial Calculator

8 |

<%= arg %>! = <%= fact %>

9 |
10 | <% form as_p info %> 11 |
12 | 13 | 14 | <% end template %> 15 | <% end view %> 16 | <% end skin %> 17 | -------------------------------------------------------------------------------- /examples/chat/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | 4 | all: chat 5 | 6 | chat: chat.cpp 7 | $(CXX) $(CXXFLAGS) -std=c++11 -O2 -Wall -g chat.cpp -o chat ${LIBS} 8 | 9 | clean: 10 | rm -fr chat chat.exe cppcms_rundir 11 | -------------------------------------------------------------------------------- /examples/chat/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/chat" 8 | }, 9 | "file_server" : { 10 | "enable" : true, 11 | "document_root" : "." 12 | }, 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples/examples.doxy: -------------------------------------------------------------------------------- 1 | /*! 2 | \page examples_page Examples 3 | 4 | Basics: 5 | 6 | - \subpage ex_hello_world 7 | - \subpage ex_templates 8 | - \subpage ex_url_mapping 9 | - \subpage ex_hierarchy 10 | - \subpage ex_templates_inheritance 11 | 12 | Forms: 13 | 14 | - \subpage ex_forms 15 | - \subpage ex_uploads 16 | 17 | Important Tasks: 18 | 19 | - \subpage ex_basic_cache 20 | - \subpage ex_localization 21 | - \subpage ex_sessions 22 | - \subpage ex_serialization 23 | 24 | Security: 25 | 26 | - \subpage ex_xss 27 | 28 | JSON: 29 | 30 | - \subpage ex_json 31 | - \subpage ex_json_rpc 32 | 33 | Comet: 34 | 35 | - \subpage ex_chat 36 | - \subpage ex_json_rpc_chat 37 | - \subpage ex_aio 38 | 39 | Applications: 40 | 41 | - \subpage ex_message_board 42 | 43 | 44 | */ 45 | -------------------------------------------------------------------------------- /examples/examples.txt: -------------------------------------------------------------------------------- 1 | basic_cache Using CppCMS Cache 2 | chat Basic Comet Example 3 | forms Using CppCMS forms 4 | hello_world Our First 'Hello World' Program 5 | json Using JSON API 6 | json_rpc Simple JsonRPC example 7 | json_rpc/index.html JsonRPC Client Using XMLHttpRequest 8 | json_rpc/usingrpc.html Using JsonRPC Object 9 | json_rpc_chat Implementing chat using asynchronous JSON RPC calls 10 | localization Localizing CppCMS Applications 11 | message_board Full Message Board Application Example using Cache, Sessions, CppDB library and more 12 | sessions Using Sessions 13 | templates Using CppCMS template system 14 | templates/Makefile Makefile for static templates linking 15 | templates/Makefile.dyn Makefile for dynamic templates loading 16 | templates/config.js Configuration File for static templates linking 17 | templates/config-dyn.js Configuration File for dynamic templates loading 18 | templates_inheritance Views Inheritance 19 | uploads Uploading files with CppCMS 20 | url_mapping Using nice URLs and a mapping between modules and URLs 21 | hierarchy Using applications hierarchy and URL mapping 22 | xss XSS filters and their use example 23 | aio Asynchonous I/O examples 24 | serialization Using Serialization Services 25 | -------------------------------------------------------------------------------- /examples/forms/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean hello 4 | 5 | hello: hello.cpp view.cpp content.h 6 | $(CXX) -std=c++11 -Wall hello.cpp view.cpp -o hello $(LIBS) 7 | 8 | view.cpp: view.tmpl content.h 9 | cppcms_tmpl_cc view.tmpl -o view.cpp 10 | 11 | clean: 12 | rm -fr *.exe *.so view.cpp cppcms_rundir hello 13 | -------------------------------------------------------------------------------- /examples/forms/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /examples/forms/hello.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "content.h" 7 | 8 | using namespace std; 9 | class hello: public cppcms::application { 10 | public: 11 | hello(cppcms::service &s) : 12 | cppcms::application(s) 13 | { 14 | } 15 | 16 | void main(std::string /*unused*/) 17 | { 18 | content::message c; 19 | if(request().request_method()=="POST") { 20 | c.info.load(context()); 21 | if(c.info.validate()) { 22 | c.name=c.info.name.value(); 23 | c.sex=c.info.sex.selected_id(); 24 | c.state=c.info.marital.selected_id(); 25 | c.age=c.info.age.value(); 26 | c.info.clear(); 27 | } 28 | } 29 | render("message",c); 30 | } 31 | }; 32 | 33 | int main(int argc,char ** argv) 34 | { 35 | try { 36 | cppcms::service app(argc,argv); 37 | app.applications_pool().mount(cppcms::applications_factory()); 38 | app.run(); 39 | } 40 | catch(std::exception const &e) { 41 | cerr< 2 | <% skin view %> 3 | <% view message uses content::message %> 4 | <% template render() %> 5 | 6 | 7 | <% if not empty name %> 8 |

Hello <%= name %>

9 |

You are <%= sex %>, <%= state %>

10 |

Your age is <%= age %>

11 | <% else %> 12 |

Input your details

13 | <% end %> 14 |
15 | <% form as_p info %> 16 |
17 | 18 | 19 | <% end template %> 20 | <% end view %> 21 | <% end skin %> 22 | -------------------------------------------------------------------------------- /examples/hello_world/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | 4 | all: hello 5 | 6 | hello: hello.cpp 7 | $(CXX) -std=c++11 -O2 -Wall -g hello.cpp -o hello ${LIBS} 8 | 9 | clean: 10 | rm -fr hello hello.exe cppcms_rundir 11 | -------------------------------------------------------------------------------- /examples/hello_world/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /examples/hello_world/hello.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | class my_hello_world : public cppcms::application { 8 | public: 9 | my_hello_world(cppcms::service &srv) : 10 | cppcms::application(srv) 11 | { 12 | } 13 | virtual void main(std::string url); 14 | }; 15 | 16 | void my_hello_world::main(std::string /*url*/) 17 | { 18 | response().out()<< 19 | "\n" 20 | "\n" 21 | "

Hello World

\n" 22 | "\n" 23 | "\n"; 24 | } 25 | 26 | int main(int argc,char ** argv) 27 | { 28 | try { 29 | cppcms::service srv(argc,argv); 30 | srv.applications_pool().mount(cppcms::create_pool()); 31 | srv.run(); 32 | } 33 | catch(std::exception const &e) { 34 | std::cerr< 5 | #include 6 | 7 | namespace content { 8 | struct message : public cppcms::base_content { 9 | std::string message; 10 | }; 11 | } 12 | 13 | 14 | #endif 15 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 16 | -------------------------------------------------------------------------------- /examples/localization/hello.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "content.h" 7 | 8 | 9 | class hello: public cppcms::application { 10 | public: 11 | hello(cppcms::service &srv) : 12 | cppcms::application(srv) 13 | { 14 | dispatcher().assign("^/(en_US|he_IL)/?$",&hello::say_hello,this,1); 15 | dispatcher().assign("^(.*)$",&hello::redirect,this); 16 | } 17 | void redirect() 18 | { 19 | response().set_redirect_header(request().script_name() + "/en_US"); 20 | } 21 | void say_hello(std::string lang) 22 | { 23 | context().locale(lang + ".UTF-8"); 24 | content::message c; 25 | c.message=translate("Hello World"); 26 | render("message",c); 27 | } 28 | }; 29 | 30 | int main(int argc,char ** argv) 31 | { 32 | try { 33 | cppcms::service app(argc,argv); 34 | app.applications_pool().mount(cppcms::applications_factory()); 35 | app.run(); 36 | } 37 | catch(std::exception const &e) { 38 | std::cerr< 2 | <% skin view %> 3 | <% view message uses content::message %> 4 | <% template render() %> 5 | 6 | 7 | 8 | 9 | <% if rtl %> 10 | 11 | <% else %> 12 | 13 | <% end %> 14 |

<% gt "We want to say" %>

15 |

<%= message %>

16 |

he/en

17 | 18 | 19 | <% end template %> 20 | <% end view %> 21 | <% end skin %> 22 | -------------------------------------------------------------------------------- /examples/message_board/apps/forums.h: -------------------------------------------------------------------------------- 1 | #ifndef APPS_FORUMS_H 2 | #define APPS_FORUMS_H 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace apps { 9 | 10 | 11 | class forums : public master{ 12 | public: 13 | 14 | forums(cppcms::service &s); 15 | void prepare(std::string page); 16 | private: 17 | void prepare_content(data::forums &c,std::string const &page); 18 | }; 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /examples/message_board/apps/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | int main(int argc,char ** argv) 8 | { 9 | try { 10 | 11 | cppcms::service app(argc,argv); 12 | app.applications_pool().mount(cppcms::applications_factory()); 13 | app.run(); 14 | } 15 | catch(std::exception const &e) { 16 | std::cerr< 4 | #include 5 | #include 6 | #include 7 | 8 | namespace apps { 9 | 10 | master::master(cppcms::service &srv) : cppcms::application(srv) 11 | { 12 | conn_str_ = settings().get("mb.connection_string"); 13 | media_=settings().get("mb.media"); 14 | } 15 | 16 | void master::init() 17 | { 18 | sql.open(conn_str_); 19 | if(!session().is_set("view") || session()["view"]=="tree") { 20 | parent()->mapper().set_value("method","tree"); 21 | } 22 | else { 23 | parent()->mapper().set_value("method","flat"); 24 | } 25 | } 26 | void master::clear() 27 | { 28 | sql.close(); 29 | } 30 | 31 | void master::prepare(data::master &c) 32 | { 33 | c.media=media_; 34 | } 35 | 36 | 37 | } // namespace apps 38 | -------------------------------------------------------------------------------- /examples/message_board/apps/master.h: -------------------------------------------------------------------------------- 1 | #ifndef APPS_MASTER_H 2 | #define APPS_MASTER_H 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace apps { 9 | 10 | class master: public cppcms::application { 11 | public: 12 | 13 | master(cppcms::service &w); 14 | virtual void init(); 15 | virtual void clear(); 16 | 17 | protected: 18 | void prepare(data::master &c); 19 | cppdb::session sql; 20 | private: 21 | std::string conn_str_; 22 | std::string media_; 23 | }; 24 | 25 | 26 | } 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /examples/message_board/apps/mb.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | 10 | namespace apps { 11 | 12 | 13 | mb::mb(cppcms::service &s) : cppcms::application(s) 14 | { 15 | 16 | attach( new forums(s), 17 | "forums", 18 | "/{1}", 19 | "(/(\\d+)?)?",2); 20 | 21 | attach( new flat_thread(s), 22 | "flat_thread", 23 | "/flat/{1}", 24 | "/flat/(\\d+)",1); 25 | 26 | 27 | attach( new tree_thread(s), 28 | "tree_thread", 29 | "/tree/{1}", 30 | "/tree/(\\d+)",1); 31 | 32 | attach( new reply(s), 33 | "comment", 34 | "/comment/{1}", 35 | "/comment/(\\d+)",1); 36 | 37 | // Generic mapping 38 | mapper().root(settings().get("mb.root")); 39 | mapper().assign("user_thread","/{method}/{1}"); 40 | } 41 | 42 | } // apps 43 | -------------------------------------------------------------------------------- /examples/message_board/apps/mb.h: -------------------------------------------------------------------------------- 1 | #ifndef MB_H 2 | #define MB_H 3 | 4 | #include 5 | 6 | namespace apps { 7 | 8 | class mb : public cppcms::application { 9 | public: 10 | 11 | mb(cppcms::service &s); 12 | 13 | }; 14 | 15 | 16 | } 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /examples/message_board/apps/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef APPS_THREAD_H 2 | #define APPS_THREAD_H 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace apps { 10 | 11 | class thread_shared : public master 12 | { 13 | public: 14 | thread_shared(cppcms::service &s); 15 | bool prepare(data::thread_shared &c,int id); 16 | 17 | }; 18 | 19 | class flat_thread : public thread_shared { 20 | public: 21 | 22 | flat_thread(cppcms::service &s); 23 | void prepare(std::string id); 24 | }; 25 | 26 | class tree_thread : public thread_shared { 27 | public: 28 | 29 | tree_thread(cppcms::service &s); 30 | void prepare(std::string id); 31 | }; 32 | 33 | typedef data::tree_t tree_t; 34 | 35 | class reply : public thread_shared { 36 | public: 37 | 38 | reply(cppcms::service &s); 39 | void prepare(std::string id); 40 | }; 41 | 42 | 43 | } // apps 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /examples/message_board/config.js: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "mb" : { 4 | "media" : "/media", 5 | "root" : "", 6 | "connection_string" : "sqlite3:db=mb.db;@pool_size=10" 7 | //"connection_string" : "mysql:database=test;user=root;password=root;@pool_size=10" 8 | }, 9 | "service" : { 10 | "api" : "http", 11 | "port" : 8080 12 | }, 13 | "http" : { 14 | "script" : "/mb", 15 | "rewrite" : [ 16 | { "regex" : "/media(/.*)?", "pattern" : "$0" }, 17 | { "regex" : "/favion\\.ico", "pattern" : "$0" }, 18 | { "regex" : ".*" , "pattern" : "/mb$0" } 19 | ] 20 | }, 21 | "views" : { 22 | "paths" : [ "./" ], 23 | "skins" : [ "simple" ], 24 | }, 25 | "file_server" : { 26 | "enable" : true, 27 | "document_root" : "../" 28 | }, 29 | "session" : { 30 | "expire" : "renew", 31 | "timeout" : 604800, 32 | "location" : "client", 33 | "client" : { 34 | "hmac" : "sha1", 35 | "hmac_key" : "232074faa0fd37de20858bf8cd0a7d04" 36 | } 37 | }, 38 | "cache" : { 39 | "backend" : "thread_shared", 40 | "limit" : 100, 41 | }, 42 | "security" : { 43 | "csrf" : { 44 | "enable" : true, 45 | "exposed" : true 46 | } 47 | }, 48 | "localization" : { 49 | "messages" : { 50 | "paths" : [ "./locale" ], 51 | "domains" : [ "mb" ] 52 | }, 53 | "locales" : [ 54 | "en_US.UTF-8", 55 | "he_IL.UTF-8" 56 | ] 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /examples/message_board/data/data.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_H 2 | #define DATA_H 3 | 4 | #include 5 | #include 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /examples/message_board/data/forums.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_FORUMS_H 2 | #define DATA_FORUMS_H 3 | 4 | #include 5 | 6 | namespace data { 7 | 8 | struct new_topic_form : public cppcms::form { 9 | cppcms::widgets::text title; 10 | cppcms::widgets::text author; 11 | cppcms::widgets::textarea comment; 12 | cppcms::widgets::submit submit; 13 | new_topic_form(); 14 | }; 15 | 16 | 17 | class forums : public master{ 18 | public: 19 | forums() : next(0),prev(0) {} 20 | struct topic { 21 | topic() : id(0) {} 22 | std::string title; 23 | int id; 24 | }; 25 | std::vector topics; 26 | int next,prev; 27 | new_topic_form form; 28 | }; 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /examples/message_board/data/master.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_MASTER_H 2 | #define DATA_MASTER_H 3 | #include 4 | 5 | namespace data { 6 | 7 | class master: public cppcms::base_content { 8 | public: 9 | std::string media; 10 | }; 11 | 12 | 13 | } 14 | 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /examples/message_board/data/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_THREAD_H 2 | #define DATA_THREAD_H 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace data { 9 | 10 | struct reply_form : public cppcms::form { 11 | cppcms::widgets::text author; 12 | cppcms::widgets::textarea comment; 13 | cppcms::widgets::submit send; 14 | reply_form(); 15 | }; 16 | 17 | 18 | struct msg { 19 | std::string author; 20 | std::string content; 21 | int msg_id; 22 | msg() : msg_id(0) {} 23 | }; 24 | 25 | 26 | class thread_shared : public master 27 | { 28 | public: 29 | thread_shared() 30 | { 31 | thread_id = 0; 32 | } 33 | int thread_id; 34 | std::string title; 35 | std::string (*text2html)(std::string const &); 36 | 37 | }; 38 | 39 | class flat_thread : public thread_shared { 40 | public: 41 | std::vector messages; 42 | 43 | }; 44 | 45 | class tree_thread : public thread_shared { 46 | public: 47 | struct tree_msg : public msg { 48 | typedef std::map tree_t; 49 | tree_t repl; 50 | }; 51 | tree_msg::tree_t messages; 52 | 53 | }; 54 | 55 | typedef tree_thread::tree_msg::tree_t tree_t; 56 | 57 | class reply : public thread_shared , public msg { 58 | public: 59 | reply_form form; 60 | 61 | }; 62 | 63 | 64 | } // data 65 | 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /examples/message_board/media/style-ltr.css: -------------------------------------------------------------------------------- 1 | #links { float:left } 2 | #body { float:right } 3 | body { direction:ltr } 4 | 5 | -------------------------------------------------------------------------------- /examples/message_board/media/style-rtl.css: -------------------------------------------------------------------------------- 1 | #links { float:right } 2 | #body { float:left } 3 | body { direction:rtl } 4 | 5 | -------------------------------------------------------------------------------- /examples/message_board/media/style.css: -------------------------------------------------------------------------------- 1 | #page { 2 | width:750px; 3 | margin:20px auto; 4 | padding-left:10px; 5 | padding-right:10px; 6 | } 7 | 8 | #links { 9 | width:180px; 10 | } 11 | 12 | #body { 13 | width:540px; 14 | } 15 | -------------------------------------------------------------------------------- /examples/message_board/model/mysql.sql: -------------------------------------------------------------------------------- 1 | drop table if exists threads; 2 | drop table if exists messages; 3 | 4 | create table threads ( 5 | id integer auto_increment primary key not null, 6 | title varchar(256) not null 7 | ) Engine = InnoDB; 8 | 9 | create table messages ( 10 | id integer auto_increment primary key not null, 11 | reply_to integer not null, 12 | thread_id integer not null, 13 | author varchar(256) not null, 14 | content text not null 15 | ) Engine = InnoDB; 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/message_board/model/sqlite3.sql: -------------------------------------------------------------------------------- 1 | begin; 2 | drop table if exists threads; 3 | drop table if exists messages; 4 | 5 | create table threads ( 6 | id integer primary key autoincrement not null, 7 | title varchar(256) not null 8 | ); 9 | 10 | create table messages ( 11 | id integer primary key autoincrement not null, 12 | reply_to integer not null, 13 | thread_id integer not null, 14 | author varchar(256) not null, 15 | content text not null 16 | ); 17 | 18 | commit; 19 | -------------------------------------------------------------------------------- /examples/message_board/view/forums.tmpl: -------------------------------------------------------------------------------- 1 | <% skin %> 2 | <% view forums uses data::forums extends master %> 3 | <% template body() %> 4 | <% foreach topic in topics %> 5 | 10 | <% empty %> 11 |

<% gt "No Topics" %>

12 | <% end %> 13 |

<% gt "Create New Disussion" %>

14 |
" method="post" ><% csrf script %> 15 | <% form as_p form %> 16 |
17 | <% end template %> 18 | 19 | <% template links() %> 20 | <% include master::links() %> 21 |

22 | <% if next %> 23 | "><% gt "Next Page" %> 24 | <% end %> 25 | <% if prev %> 26 | "><% gt "Prev Page" %> 27 | <% end %> 28 |

29 | <% end template %> 30 | 31 | 32 | <% end view %> 33 | <% end skin %> 34 | -------------------------------------------------------------------------------- /examples/message_board/view/master.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "data/data.h" %> 2 | <% xhtml %> 3 | <% skin %> 4 | <% view master uses data::master %> 5 | 6 | <% template title() %><% gt "Welcome to the Message Board" %><% end template %> 7 | 8 | <% template header() %> 9 | <% include title() %> 10 | 11 | 12 | 13 | <% end template %> 14 | 15 | <% template render() %> 16 | 18 | 19 | 20 | <% include header() %> 21 | 22 | 23 |
24 | 27 |
28 |

<% include title() %>

29 | <% include body() %> 30 |
31 |
32 | 33 | 34 | <% end template %> 35 | 36 | <% template body() %><% end %> 37 | <% template links() %> 38 |

"><% gt "Home" %>

39 | <% end %> 40 | <% end view %> 41 | <% end skin %> 42 | 43 | -------------------------------------------------------------------------------- /examples/serialization/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | 4 | all: serialization external_serialization 5 | 6 | serialization: serialization.cpp 7 | $(CXX) $(CXXFLAGS) -std=c++11 -O2 -Wall -g serialization.cpp -o serialization ${LIBS} 8 | 9 | external_serialization: external_serialization.cpp 10 | $(CXX) $(CXXFLAGS) -std=c++11 -O2 -Wall -g external_serialization.cpp -o external_serialization ${LIBS} -lboost_serialization 11 | 12 | clean: 13 | rm -f *.exe serialization external_serialization 14 | -------------------------------------------------------------------------------- /examples/sessions/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean hello 4 | 5 | hello: hello.cpp view.cpp content.h 6 | $(CXX) -std=c++11 -Wall hello.cpp view.cpp -o hello $(LIBS) 7 | 8 | view.cpp: view.tmpl content.h 9 | cppcms_tmpl_cc view.tmpl -o view.cpp 10 | 11 | clean: 12 | rm -fr hello *.exe *.so view.cpp cppcms_rundir 13 | -------------------------------------------------------------------------------- /examples/sessions/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | }, 9 | "session" : { 10 | "expire" : "renew", 11 | "timeout" : 604800, 12 | "location" : "client", 13 | "client" : { 14 | "hmac" : "sha1", 15 | "hmac_key" : "3891bbf7f845fd4277008a63d72640fc13bb9a31" 16 | } 17 | 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /examples/sessions/view.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "content.h" %> 2 | <% skin view %> 3 | <% view message uses content::message %> 4 | <% template render() %> 5 | 6 | 7 |

Hello <%= who %> <%= name %>

8 | <% if (content.age != -1.0) %> 9 |

Your age is <%= age %>

10 |

Change details

11 | <% else %> 12 |

Input your details

13 | <% end %> 14 |
15 | <% form as_p info %> 16 |
17 | 18 | 19 | <% end template %> 20 | <% end view %> 21 | <% end skin %> 22 | -------------------------------------------------------------------------------- /examples/templates/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean hello-tmpl 4 | 5 | hello-tmpl: hello-tmpl.cpp my_skin.cpp content.h 6 | $(CXX) -std=c++11 -Wall hello-tmpl.cpp my_skin.cpp -o hello-tmpl ${LIBS} 7 | 8 | my_skin.cpp: first.tmpl content.h 9 | cppcms_tmpl_cc first.tmpl -o my_skin.cpp 10 | 11 | clean: 12 | rm -fr hello-tmpl *.exe *.so my_skin.cpp cppcms_rundir 13 | 14 | -------------------------------------------------------------------------------- /examples/templates/Makefile.dyn: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean hello-tmpl libmy_skin.so 4 | 5 | my_skin.cpp: first.tmpl 6 | cppcms_tmpl_cc first.tmpl -o my_skin.cpp 7 | 8 | libmy_skin.so: content.h my_skin.cpp 9 | g++ -std=c++11 -shared -fPIC my_skin.cpp -o libmy_skin.so ${LIBS} 10 | 11 | hello-tmpl: hello-tmpl.cpp 12 | g++ -std=c++11 -Wall -rdynamic hello-tmpl.cpp -o hello-tmpl ${LIBS} 13 | 14 | clean: 15 | rm -f *.fcgi *.exe my_skin.cpp *.so hello-tmpl 16 | -------------------------------------------------------------------------------- /examples/templates/config-dyn.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | }, 9 | "views" : { 10 | "paths" : [ "." ], 11 | "skins" : [ "my_skin" ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/templates/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/templates/content.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTENT_H 2 | #define CONTENT_H 3 | 4 | #include 5 | #include 6 | 7 | namespace content { 8 | struct message : public cppcms::base_content { 9 | std::string text; 10 | }; 11 | } 12 | 13 | 14 | #endif 15 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 16 | -------------------------------------------------------------------------------- /examples/templates/first.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "content.h" %> 2 | <% skin my_skin %> 3 | <% view message uses content::message %> 4 | <% template render() %> 5 | 6 | 7 |

<%= text %> World!

8 | 9 | 10 | <% end template %> 11 | <% end view %> 12 | <% end skin %> 13 | -------------------------------------------------------------------------------- /examples/templates/hello-tmpl.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "content.h" 9 | 10 | class my_hello_world : public cppcms::application { 11 | public: 12 | my_hello_world(cppcms::service &s) : 13 | cppcms::application(s) 14 | { 15 | } 16 | virtual void main(std::string /*url*/) 17 | { 18 | content::message c; 19 | c.text=">>>Hello<<<"; 20 | render("message",c); 21 | } 22 | }; 23 | 24 | 25 | 26 | int main(int argc,char ** argv) 27 | { 28 | try { 29 | cppcms::service srv(argc,argv); 30 | srv.applications_pool().mount(cppcms::applications_factory()); 31 | srv.run(); 32 | } 33 | catch(std::exception const &e) { 34 | std::cerr< 5 | #include 6 | 7 | namespace content { 8 | struct master : public cppcms::base_content { 9 | std::string title; 10 | }; 11 | struct page : public master { 12 | std::string page_title, page_content; 13 | }; 14 | struct news : public master { 15 | std::list news_list; 16 | }; 17 | } 18 | 19 | 20 | #endif 21 | // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 22 | -------------------------------------------------------------------------------- /examples/templates_inheritance/intro.tmpl: -------------------------------------------------------------------------------- 1 | <% skin myskin %> 2 | <% view intro uses content::master extends master %> 3 | <% template page_content() %> 4 |

The Page

5 |

The News

6 | <% end template %> 7 | <% end view %> 8 | <% end skin %> 9 | -------------------------------------------------------------------------------- /examples/templates_inheritance/master.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "content.h" %> 2 | <% skin myskin %> 3 | <% view master uses content::master %> 4 | 5 | <% template title() %><%= title %><% end %> 6 | <% template page_content() %>Override Me<% end %> 7 | <% template render() %> 8 | 9 | 10 | <% include title() %> 11 | 12 | 13 |

<% include title() %>

14 |
15 | <% include page_content() %> 16 |
17 | 18 | 19 | <% end template %> 20 | <% end view %> 21 | <% end skin %> 22 | -------------------------------------------------------------------------------- /examples/templates_inheritance/news.tmpl: -------------------------------------------------------------------------------- 1 | <% skin myskin %> 2 | <% view news uses content::news extends master %> 3 | <% template title() %><% include master::title() %> :: News<% end %> 4 | <% template page_content() %> 5 | <% foreach message in news_list %> 6 |
    7 | <% item %> 8 |
  • <%= message %>
  • 9 | <% end %> 10 |
11 | <% end foreach %> 12 | <% end template %> 13 | <% end view %> 14 | <% end skin %> 15 | -------------------------------------------------------------------------------- /examples/templates_inheritance/page.tmpl: -------------------------------------------------------------------------------- 1 | <% skin myskin %> 2 | <% view page uses content::page extends master %> 3 | 4 | <% template title() %><% include master::title() %> :: <%= page_title %><% end %> 5 | <% template page_content() %> 6 | <%= page_content | raw %> 7 | <% end template %> 8 | <% end view %> 9 | <% end skin %> 10 | -------------------------------------------------------------------------------- /examples/uploads/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean uploader 4 | 5 | uploader: uploader.cpp view.cpp content.h 6 | $(CXX) -std=c++11 -Wall $(CXXFLAGS) uploader.cpp view.cpp -o uploader $(LIBS) 7 | 8 | view.cpp: view.tmpl content.h 9 | cppcms_tmpl_cc view.tmpl -o view.cpp 10 | 11 | clean: 12 | rm -fr *.exe *.so view.cpp cppcms_rundir uploader 13 | -------------------------------------------------------------------------------- /examples/uploads/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/uploader" 8 | }, 9 | "file_server" : { 10 | "enable" : true, 11 | "listing" : true, 12 | "document_root" : "." 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /examples/uploads/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Follow the link 6 | 7 | -------------------------------------------------------------------------------- /examples/uploads/uploads/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/examples/uploads/uploads/.placeholder -------------------------------------------------------------------------------- /examples/uploads/view.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "content.h" %> 2 | <% skin view %> 3 | <% view upload uses content::upload %> 4 | <% template render() %> 5 | 6 | 7 | 8 | 9 |
10 | <% form as_p info %> 11 |
12 |

Uploaded images

13 | 14 | 15 | 16 | <% end template %> 17 | <% end view %> 18 | <% end skin %> 19 | -------------------------------------------------------------------------------- /examples/url_mapping/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | all: clean hello 4 | 5 | hello: hello.cpp 6 | $(CXX) $(CXXFLAGS) -std=c++11 -Wall hello.cpp -o hello $(LIBS) 7 | 8 | clean: 9 | rm -fr hello *.exe *.so cppcms_rundir 10 | -------------------------------------------------------------------------------- /examples/url_mapping/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "service" : { 3 | "api" : "http", 4 | "port" : 8080 5 | }, 6 | "http" : { 7 | "script" : "/hello" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/xss/Makefile: -------------------------------------------------------------------------------- 1 | LIBS=-lcppcms -lbooster 2 | 3 | 4 | all: xss 5 | 6 | xss: xss.cpp 7 | $(CXX) $(CXXFLAGS) -std=c++11 -O2 -Wall -g xss.cpp -o xss ${LIBS} 8 | 9 | clean: 10 | rm -fr xss xss.exe cppcms_rundir 11 | -------------------------------------------------------------------------------- /examples/xss/comment_profile.js: -------------------------------------------------------------------------------- 1 | { 2 | "encoding" : "UTF-8", 3 | "tags" : { 4 | "opening_and_closing" : [ 5 | "b", "i", "tt", 6 | "strong", "em", 7 | "blockquote" , 8 | "a" 9 | ], 10 | "stand_alone" : [ "br", "hr" ] 11 | }, 12 | "attributes" : [ 13 | { 14 | "tags" : [ "a" ], 15 | "attributes" : [ "href" ], 16 | "type" : "uri" 17 | } 18 | ] 19 | } 20 | 21 | -------------------------------------------------------------------------------- /examples/xss/config.js: -------------------------------------------------------------------------------- 1 | { 2 | "filters" : { 3 | // 4 | // Basic profile for example for blog comments 5 | // 6 | "profile" : "comment_profile.js" 7 | // 8 | 9 | 10 | // 11 | // Profile for simple TinyMCE configuration with rich content. 12 | // 13 | // To use download TinyMCE and extract in this diectory, 14 | // 15 | // "tinymce" : true, 16 | // "profile" : "tinymce_profile.js", 17 | // 18 | 19 | }, 20 | "service" : { 21 | "api" : "http", 22 | }, 23 | "http" : { 24 | "script" : "/xss" 25 | }, 26 | "file_server" : { 27 | "enable" : true 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /examples/xss/tinymce_profile.js: -------------------------------------------------------------------------------- 1 | { 2 | // 3 | // Profile for simple tinymce 4 | // theme with autolink plugin 5 | // 6 | "encoding" : "UTF-8", 7 | "entities" : [ "nbsp" ], 8 | "tags" : { 9 | "opening_and_closing" : [ 10 | "p", 11 | "ul","ol","li", // lists 12 | "strong", "em", 13 | "span", 14 | "a" 15 | ], 16 | "stand_alone" : [ "br" , "hr" ] 17 | }, 18 | "attributes" : [ 19 | { 20 | "tags" : [ "a" ], 21 | "attributes" : [ "href" ], 22 | "type" : "absolute_uri" 23 | }, 24 | { 25 | "tags" : [ "span" ], 26 | "attributes" : [ "style" ], 27 | "type" : "regex", 28 | "expression" : "(\\s*text-decoration\\s*:\\s*(underline|line-through)\\s*;)*" 29 | } 30 | ] 31 | } 32 | 33 | -------------------------------------------------------------------------------- /header_file_template.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2017 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | 9 | -------------------------------------------------------------------------------- /private/cache_over_ip.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_CACHE_OVER_IP_H 9 | #define CPPCMS_CACHE_OVER_IP_H 10 | #include 11 | #include 12 | #include "base_cache.h" 13 | #include 14 | #include 15 | 16 | namespace cppcms { 17 | namespace impl { 18 | booster::intrusive_ptr CPPCMS_API 19 | tcp_cache_factory( std::vector const &ips, 20 | std::vector const &ports, 21 | booster::intrusive_ptr l1); 22 | 23 | } 24 | } 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /private/cache_storage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef THREAD_CHACHE_H 9 | #define THREAD_CHACHE_H 10 | #include "base_cache.h" 11 | #include 12 | #include 13 | 14 | namespace cppcms { 15 | namespace impl { 16 | booster::intrusive_ptr CPPCMS_API thread_cache_factory(unsigned items); 17 | #ifndef CPPCMS_WIN32 18 | booster::intrusive_ptr CPPCMS_API process_cache_factory(size_t memory,unsigned items); 19 | #endif 20 | } // impl 21 | } // cppcms 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /private/cppcms_error_category.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_ERROR_CATEGORY_H 9 | #define CPPCMS_ERROR_CATEGORY_H 10 | 11 | #include 12 | #include 13 | 14 | namespace cppcms { 15 | namespace impl { 16 | namespace errc { 17 | enum { 18 | ok, 19 | protocol_violation 20 | }; 21 | } 22 | class error_category : public booster::system::error_category { 23 | public: 24 | error_category() {} 25 | error_category(error_category &&) {} 26 | virtual char const *name() const noexcept; 27 | virtual std::string message(int cat) const; 28 | }; 29 | 30 | extern const error_category cppcms_category; 31 | } 32 | } 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /private/daemonize.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_DAEMONIZE_H 9 | #define CPPCMS_IMPL_DAEMONIZE_H 10 | 11 | #include 12 | #include 13 | 14 | namespace cppcms { 15 | namespace json { class value; } 16 | namespace impl { 17 | 18 | class CPPCMS_API daemonizer { 19 | public: 20 | daemonizer(json::value const &conf); 21 | ~daemonizer(); 22 | static int global_urandom_fd; 23 | private: 24 | int real_pid; 25 | std::string unlink_file; 26 | 27 | void daemonize(json::value const &conf); 28 | void cleanup(); 29 | }; 30 | 31 | } 32 | } 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /private/fastcgi_api.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_FASTCGI_API_H 9 | #define CPPCMS_IMPL_FASTCGI_API_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace cppcms { 16 | class service; 17 | namespace impl { 18 | namespace cgi { 19 | class acceptor; 20 | std::unique_ptr fastcgi_api_tcp_socket_factory(cppcms::service &srv,std::string ip,int port,int backlog); 21 | #if !defined(CPPCMS_WIN32) 22 | std::unique_ptr fastcgi_api_unix_socket_factory(cppcms::service &srv,std::string socket,int backlog); 23 | std::unique_ptr fastcgi_api_unix_socket_factory(cppcms::service &srv,int backlog); 24 | #endif 25 | 26 | } // cgi 27 | } // impl 28 | } // cppcms 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /private/http_api.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_HTTP_API_H 9 | #define CPPCMS_IMPL_HTTP_API_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace cppcms { 16 | class service; 17 | namespace impl { 18 | namespace cgi { 19 | class acceptor; 20 | std::unique_ptr http_api_factory(cppcms::service &srv,std::string ip,int port,int backlog); 21 | } // cgi 22 | } // impl 23 | } // cppcms 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /private/logging.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_LOGGING_H 9 | #define CPPCMS_IMPL_LOGGING_H 10 | #include 11 | 12 | namespace cppcms { 13 | namespace json { class value; } 14 | namespace impl { 15 | CPPCMS_API void setup_logging(json::value const &); 16 | } 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /private/scgi_api.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_SCGI_API_H 9 | #define CPPCMS_IMPL_SCGI_API_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace cppcms { 16 | class service; 17 | namespace impl { 18 | namespace cgi { 19 | class acceptor; 20 | std::unique_ptr scgi_api_tcp_socket_factory(cppcms::service &srv,std::string ip,int port,int backlog); 21 | #if !defined(CPPCMS_WIN32) 22 | std::unique_ptr scgi_api_unix_socket_factory(cppcms::service &srv,std::string socket,int backlog); 23 | std::unique_ptr scgi_api_unix_socket_factory(cppcms::service &srv,int backlog); 24 | #endif 25 | 26 | } // cgi 27 | } // impl 28 | } // cppcms 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /private/scgi_header.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_SCGI_HEADER_H 9 | #define CPPCMS_SCGI_HEADER_H 10 | 11 | #include 12 | #include 13 | 14 | namespace cppcms { 15 | namespace impl { 16 | CPPCMS_API std::string make_scgi_header(std::map const &env,size_t addon_size); 17 | } 18 | } 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /private/send_timeout.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_SEND_TIMEOUT_H 9 | #define CPPCMS_IMPL_SEND_TIMEOUT_H 10 | #include 11 | #include 12 | 13 | namespace cppcms { 14 | namespace impl { 15 | 16 | void set_send_timeout(booster::aio::stream_socket &sock,int seconds,booster::system::error_code &e); 17 | void set_send_timeout(booster::aio::stream_socket &sock,int seconds); 18 | 19 | } // impl 20 | } // cppcms 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /private/session_memory_storage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_SESSIOM_MEMORY_STORAGE_H 9 | #define CPPCMS_SESSIOM_MEMORY_STORAGE_H 10 | 11 | #include 12 | #include 13 | namespace cppcms { 14 | namespace sessions { 15 | 16 | class CPPCMS_API session_memory_storage_factory : public session_storage_factory { 17 | public: 18 | session_memory_storage_factory(); 19 | virtual booster::shared_ptr get(); 20 | virtual bool requires_gc(); 21 | virtual void gc_job(); 22 | virtual ~session_memory_storage_factory(); 23 | private: 24 | booster::shared_ptr storage_; 25 | }; 26 | 27 | } // sessions 28 | } // cppcms 29 | #endif 30 | -------------------------------------------------------------------------------- /private/session_sqlite_storage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_PRIVATE_SESSION_SQLITE_H 9 | #define CPPCMS_PRIVATE_SESSION_SQLITE_H 10 | 11 | #include 12 | #include 13 | 14 | namespace cppcms { 15 | namespace sessions { 16 | class session_storage_factory; 17 | namespace sqlite_session { 18 | 19 | CPPCMS_API session_storage_factory *factory(std::string const &database,std::string const &shared_object); 20 | CPPCMS_API session_storage_factory *factory(std::string const &database); 21 | 22 | 23 | }// sqlite_session 24 | }// sessions 25 | }// cppcms 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /private/tcp_connector.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_TCP_CONNECTOR_H 9 | #define CPPCMS_TCP_CONNECTOR_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | namespace cppcms { 16 | 17 | namespace impl { 18 | class messenger; 19 | struct tcp_operation_header; 20 | 21 | class tcp_connector : private booster::noncopyable 22 | { 23 | public: 24 | messenger &get(std::string const &key); 25 | 26 | tcp_connector(std::vector const &ip_list,std::vector const &port_list); 27 | virtual ~tcp_connector(); 28 | 29 | void broadcast(tcp_operation_header &h,std::string &data); 30 | 31 | protected: 32 | messenger *tcp; 33 | int conns; 34 | virtual unsigned hash(std::string const &key); 35 | }; 36 | 37 | } // impl 38 | } // cppcms 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /private/tcp_messenger.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_TCP_MESSENGER_H 9 | #define CPPCMS_TCP_MESSENGER_H 10 | #include 11 | #include 12 | #include "tcp_cache_protocol.h" 13 | 14 | namespace cppcms { 15 | namespace impl { 16 | class messenger : public booster::noncopyable { 17 | booster::aio::stream_socket socket_; 18 | std::string ip_; 19 | int port_; 20 | public: 21 | void connect(std::string ip,int port); 22 | messenger(std::string ip,int port); 23 | messenger(); 24 | void transmit(tcp_operation_header &h,std::string &data); 25 | }; 26 | } // impl 27 | } // cppcms 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /private/tohex.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_IMPL_TOHEX_H 9 | #define CPPCMS_IMPL_TOHEX_H 10 | namespace cppcms { 11 | namespace impl { 12 | inline void tohex(void const *vptr,size_t len,char *out) 13 | { 14 | unsigned char const *p=static_cast(vptr); 15 | while(len>0) { 16 | static char const table[17]="0123456789abcdef"; 17 | unsigned char v=*p++; 18 | *out++ = table[(v >> 4) & 0xF]; 19 | *out++ = table[(v & 0xF)]; 20 | len--; 21 | } 22 | *out++ = '\0'; 23 | } 24 | } 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /src/base_view.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #define CPPCMS_SOURCE 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | namespace cppcms { 16 | 17 | struct base_view::_data { 18 | std::ostream *out; 19 | }; 20 | 21 | base_view::base_view(std::ostream &out) : 22 | d(new _data) 23 | { 24 | d->out=&out; 25 | } 26 | 27 | std::ostream &base_view::out() 28 | { 29 | return *d->out; 30 | } 31 | 32 | base_view::~base_view() 33 | { 34 | } 35 | 36 | void base_view::render() 37 | { 38 | } 39 | 40 | 41 | }// cppcms 42 | -------------------------------------------------------------------------------- /src/cppcms_error.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #define CPPCMS_SOURCE 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | using namespace std; 17 | 18 | 19 | namespace cppcms { 20 | 21 | cppcms_error::cppcms_error(int err,std::string const &error) : 22 | booster::runtime_error(error+":" + strerror(err)) 23 | { 24 | } 25 | 26 | std::string cppcms_error::strerror(int err) 27 | { 28 | return booster::system::error_code(err,booster::system::system_category()).message(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/cppcms_error_category.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #include "cppcms_error_category.h" 9 | 10 | namespace cppcms { 11 | namespace impl { 12 | char const *error_category::name() const noexcept 13 | { 14 | return "cppcms::io"; 15 | } 16 | std::string error_category::message(int cat) const 17 | { 18 | switch(cat) { 19 | case errc::ok: return "ok"; 20 | case errc::protocol_violation: return "protocol violation"; 21 | default: 22 | return "unknown"; 23 | } 24 | } 25 | const error_category cppcms_category = error_category(); 26 | 27 | } // impl 28 | } // cppcms 29 | -------------------------------------------------------------------------------- /src/hello_world_skin1.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "hello_world_view.h" %> 2 | <% skin %> 3 | <% view master uses view::master %> 4 | <% template test(std::string &v,int p) %> 5 | <%= p %> 6 | <% foreach c as std::string::iterator in v %> 7 | <% item %><%= c %><% end %> 8 | <% end %> 9 | <% end %> 10 | <% template render() %> 11 | 12 | Skin1 :: <%= title %> 13 | 14 |

That is cool

15 | <% include body() %> 16 | 17 | 18 | <% end template %> 19 | <% template body() %> 20 | <% end template %> 21 | <% end view %> 22 | <% end skin %> 23 | 24 | -------------------------------------------------------------------------------- /src/hello_world_skin2.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "hello_world_view.h" %> 2 | <% skin %> 3 | <% view master uses view::master %> 4 | <% template render() %> 5 | 6 | Skin2:: <%= title %> 7 | 8 |

Very Cool ;) !!!

9 | <% include body() %> 10 | 11 | 12 | <% end template %> 13 | <% template body() %> 14 | <% end template %> 15 | <% end view %> 16 | <% end skin %> 17 | 18 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /tests/client.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_TEST_RUN_CLIENT_H 9 | #define CPPCMS_TEST_RUN_CLIENT_H 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | static bool run_ok=false; 18 | 19 | struct runner { 20 | runner(cppcms::service &srv) : srv_(&srv) 21 | { 22 | command_ = srv.settings().get("test.exec","none"); 23 | } 24 | void operator()() const 25 | { 26 | if(command_ != "none") { 27 | run_ok = ::system(command_.c_str()) == 0; 28 | srv_->shutdown(); 29 | } 30 | } 31 | private: 32 | cppcms::service *srv_; 33 | std::string command_; 34 | }; 35 | 36 | struct submitter { 37 | submitter(cppcms::service &srv) : srv_(&srv) {} 38 | void operator()() const 39 | { 40 | srv_->thread_pool().post(runner(*srv_)); 41 | } 42 | cppcms::service *srv_; 43 | }; 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /tests/cookie_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http", 5 | "port" : 8080, 6 | "ip" : "127.0.0.1", 7 | }, 8 | "http" : { 9 | "script" : "/test" 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /tests/cppcms_service_test.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | class unit_test : public cppcms::application { 18 | public: 19 | unit_test(cppcms::service &s) : cppcms::application(s) {} 20 | virtual void main(std::string) 21 | { 22 | response().out() << getpid(); 23 | } 24 | }; 25 | 26 | 27 | int main(int argc,char **argv) 28 | { 29 | try { 30 | cppcms::service srv(argc,argv); 31 | srv.applications_pool().mount(cppcms::create_pool()); 32 | srv.run(); 33 | } 34 | catch(std::exception const &e) { 35 | std::cerr << e.what() << std::endl; 36 | return EXIT_FAILURE; 37 | } 38 | return EXIT_SUCCESS; 39 | } 40 | -------------------------------------------------------------------------------- /tests/disco_test_async_cgi_multiple.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO:/multiple 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/async 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | SERVER_PROTOCOL:HTTP/1.0 10 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 11 | 12 | -------------------------------------------------------------------------------- /tests/disco_test_async_cgi_nonblocking.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO: 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/nonblocking 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | SERVER_PROTOCOL:HTTP/1.0 10 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 11 | 12 | -------------------------------------------------------------------------------- /tests/disco_test_async_cgi_single.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO:/single 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/async 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | SERVER_PROTOCOL:HTTP/1.0 10 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 11 | 12 | -------------------------------------------------------------------------------- /tests/disco_test_async_multiple.in: -------------------------------------------------------------------------------- 1 | GET /async/multiple HTTP/1.0 2 | 3 | -------------------------------------------------------------------------------- /tests/disco_test_async_nonblocking.in: -------------------------------------------------------------------------------- 1 | GET /nonblocking HTTP/1.0 2 | 3 | -------------------------------------------------------------------------------- /tests/disco_test_async_single.in: -------------------------------------------------------------------------------- 1 | GET /async/single HTTP/1.0 2 | 3 | -------------------------------------------------------------------------------- /tests/disco_test_gzip.in: -------------------------------------------------------------------------------- 1 | GET /sync HTTP/1.0 2 | Accept-Encoding: gzip 3 | 4 | -------------------------------------------------------------------------------- /tests/disco_test_gzip_cgi.in: -------------------------------------------------------------------------------- 1 | HTTP_ACCEPT_ENCODING:gzip 2 | GATEWAY_INTERFACE:CGI/1.0 3 | PATH_INFO: 4 | REMOTE_ADDR: 5 | REMOTE_HOST: 6 | REQUEST_METHOD:GET 7 | SCRIPT_NAME:/sync 8 | SERVER_NAME:127.0.0.1 9 | SERVER_PORT:8080 10 | SERVER_PROTOCOL:HTTP/1.0 11 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 12 | 13 | -------------------------------------------------------------------------------- /tests/disco_test_norm.in: -------------------------------------------------------------------------------- 1 | GET /sync HTTP/1.0 2 | 3 | -------------------------------------------------------------------------------- /tests/disco_test_norm_cgi.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO: 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/sync 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | SERVER_PROTOCOL:HTTP/1.0 10 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 11 | 12 | -------------------------------------------------------------------------------- /tests/en/LC_MESSAGES/main.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/en/LC_MESSAGES/main.mo -------------------------------------------------------------------------------- /tests/en/LC_MESSAGES/main.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Artyom Beilis 2 | # This file is distributed under the same license as the CppCMS package. 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Report-Msgid-Bugs-To: \n" 7 | "POT-Creation-Date: 2016-01-18 23:10+0200\n" 8 | "Language: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=utf-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=2; plural=n==1?0:1;\n" 13 | 14 | msgid "translate me" 15 | msgstr "Main Translate Me" 16 | 17 | -------------------------------------------------------------------------------- /tests/en/LC_MESSAGES/plugin2.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/en/LC_MESSAGES/plugin2.mo -------------------------------------------------------------------------------- /tests/en/LC_MESSAGES/plugin2.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Artyom Beilis 2 | # This file is distributed under the same license as the CppCMS package. 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Report-Msgid-Bugs-To: \n" 7 | "POT-Creation-Date: 2016-01-18 23:10+0200\n" 8 | "Language: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=utf-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=2; plural=n==1?0:1;\n" 13 | 14 | msgid "translate me" 15 | msgstr "Plugin Translate Me" 16 | 17 | -------------------------------------------------------------------------------- /tests/external_session_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "session" : { 4 | "timeout" : 5, 5 | "location" : "client", 6 | "cookies" : { 7 | "prefix" : "sc", 8 | "domain" : "foo.bar", 9 | "path" : "/foo", 10 | "expiration_method" : "max-age" 11 | }, 12 | "client" : { 13 | "hmac" : "sha1", 14 | "hmac_key" : "dc07e0ff8e44be872e86fe848841584cd38983e5" 15 | }, 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /tests/file_server/al/foo/test.txt: -------------------------------------------------------------------------------- 1 | /al/foo/test.txt 2 | -------------------------------------------------------------------------------- /tests/file_server/al/index.html: -------------------------------------------------------------------------------- 1 | /al/index.html 2 | -------------------------------------------------------------------------------- /tests/file_server/al/test.txt: -------------------------------------------------------------------------------- 1 | /al/test.txt 2 | -------------------------------------------------------------------------------- /tests/file_server/alfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/file_server/alfile.txt -------------------------------------------------------------------------------- /tests/file_server/never.txt: -------------------------------------------------------------------------------- 1 | never.txt 2 | -------------------------------------------------------------------------------- /tests/file_server/www/bar/index.html: -------------------------------------------------------------------------------- 1 | /bar/index.html 2 | -------------------------------------------------------------------------------- /tests/file_server/www/bar/test.txt: -------------------------------------------------------------------------------- 1 | /bar/test.txt 2 | -------------------------------------------------------------------------------- /tests/file_server/www/file with space.txt: -------------------------------------------------------------------------------- 1 | file with space 2 | -------------------------------------------------------------------------------- /tests/file_server/www/foo/looooooooooooooooooooooooooooooooooooong_fiiiiiiiiiiiiiiiiiile_name.txt: -------------------------------------------------------------------------------- 1 | long 2 | -------------------------------------------------------------------------------- /tests/file_server/www/foo/test.txt: -------------------------------------------------------------------------------- 1 | /foo/test.txt 2 | -------------------------------------------------------------------------------- /tests/file_server/www/no.txt: -------------------------------------------------------------------------------- 1 | ../never.txt -------------------------------------------------------------------------------- /tests/file_server/www/test.txt: -------------------------------------------------------------------------------- 1 | /test.txt 2 | -------------------------------------------------------------------------------- /tests/file_server/www/y.txt: -------------------------------------------------------------------------------- 1 | /yes 2 | -------------------------------------------------------------------------------- /tests/file_server/www/yes.txt: -------------------------------------------------------------------------------- 1 | y.txt -------------------------------------------------------------------------------- /tests/file_server/wwwfile.txt: -------------------------------------------------------------------------------- 1 | BAD 2 | -------------------------------------------------------------------------------- /tests/file_server_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "worker_threads" : 5, 5 | "api" : "http" 6 | 7 | }, 8 | "http": { 9 | "rewrite" : [{ "regex" : "^/rewrite_me/(.*)$", "pattern" : "/$1" }] 10 | }, 11 | "file_server" : { 12 | "enable" : true, 13 | "document_root" : "file_server/www", 14 | "alias" : [ 15 | { 16 | "url" : "/alias", 17 | "path" : "file_server/al" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/filter_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http", 5 | "port" : 8080, 6 | "ip" : "127.0.0.1", 7 | "backlog": 100, 8 | "input_buffer_size" : 8192 9 | }, 10 | "http" : { 11 | "timeout" : 3, 12 | "script_names" : [ "/upload", "/raw" ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/form_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http", 5 | "port" : 8080, 6 | "ip" : "127.0.0.1", 7 | }, 8 | "http" : { 9 | "script" : "/test" 10 | }, 11 | "localization" : { 12 | "messages" : { 13 | "paths" : [ "./tests/locale" ], 14 | "domains" : [ "test" ] 15 | }, 16 | "locales" : [ "C.UTF-8" ], 17 | }, 18 | 19 | } 20 | -------------------------------------------------------------------------------- /tests/forwarder_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "scgi", 5 | "port" : 8081, 6 | "ip" : "127.0.0.1", 7 | "disable_global_exit_handling" : true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/he/LC_MESSAGES/default.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/he/LC_MESSAGES/default.mo -------------------------------------------------------------------------------- /tests/he/LC_MESSAGES/default.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | "Plural-Forms: nplurals=4; plural= (n==1 ? 0 : (n==2 ? 1 : (n>10 ? 3 : 2))) ;\n" 7 | 8 | msgid "hello" 9 | msgstr "שלום" 10 | 11 | msgid "#hello" 12 | msgstr "#שלום" 13 | 14 | msgctxt "context" 15 | msgid "hello" 16 | msgstr "שלום בהקשר אחר" 17 | 18 | msgid "x day" 19 | msgid_plural "x days" 20 | msgstr[0] "יום x" 21 | msgstr[1] "יומיים" 22 | msgstr[2] "x ימים" 23 | msgstr[3] "x יום" 24 | 25 | msgctxt "context" 26 | msgid "x day" 27 | msgid_plural "בהקשר x days" 28 | msgstr[0] "בהקשר יום x" 29 | msgstr[1] "בהקשר יומיים" 30 | msgstr[2] "בהקשר x ימים" 31 | msgstr[3] "בהקשר x יום" 32 | 33 | -------------------------------------------------------------------------------- /tests/he/LC_MESSAGES/fall.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/he/LC_MESSAGES/fall.mo -------------------------------------------------------------------------------- /tests/he/LC_MESSAGES/fall.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | 7 | msgid "test" 8 | msgstr "he" 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/he/LC_MESSAGES/simple.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/he/LC_MESSAGES/simple.mo -------------------------------------------------------------------------------- /tests/he/LC_MESSAGES/simple.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | "Plural-Forms: nplurals=2; plural=n!=1;\n" 7 | 8 | msgid "hello" 9 | msgstr "היי" 10 | 11 | msgid "#hello" 12 | msgstr "#היי" 13 | 14 | msgctxt "context" 15 | msgid "hello" 16 | msgstr "היי בהקשר אחר" 17 | 18 | 19 | #: test_message.cpp:47 20 | msgid "test" 21 | msgid_plural "tests" 22 | msgstr[0] "" 23 | msgstr[1] "" 24 | -------------------------------------------------------------------------------- /tests/he_IL/LC_MESSAGES/full.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/he_IL/LC_MESSAGES/full.mo -------------------------------------------------------------------------------- /tests/he_IL/LC_MESSAGES/full.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=utf-8\n" 5 | "Content-Transfer-Encoding: 8bit\n" 6 | 7 | msgid "test" 8 | msgstr "he_IL" 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/jsonrpc_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http", 5 | "port" : 8080, 6 | "ip" : "127.0.0.1", 7 | }, 8 | "http" : { 9 | "script" : "/test" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/loadable_storage_test.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #include 9 | #include 10 | #include 11 | 12 | struct stopper { 13 | cppcms::service *srv; 14 | stopper(cppcms::service *s) : srv(s) {} 15 | void operator()(booster::system::error_code const &) const 16 | { 17 | srv->shutdown(); 18 | } 19 | }; 20 | 21 | int main(int argc,char **argv) 22 | { 23 | 24 | try { 25 | cppcms::service srv(argc,argv); 26 | 27 | booster::aio::deadline_timer timer(srv.get_io_service()); 28 | timer.expires_from_now(booster::ptime::seconds(1)); 29 | timer.async_wait(stopper(&srv)); 30 | srv.run(); 31 | } 32 | catch(std::exception const &e) { 33 | std::cerr<< "Failed: " << e.what() << std::endl; 34 | return 1; 35 | } 36 | std::cout << "Ok" << std::endl; 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /tests/multipart/chrome.txt: -------------------------------------------------------------------------------- 1 | ------WebKitFormBoundaryuYwgZwieYHQ3+AR8 2 | Content-Disposition: form-data; name="submit-name" 3 | 4 | שלום 5 | ------WebKitFormBoundaryuYwgZwieYHQ3+AR8 6 | Content-Disposition: form-data; name="file"; filename="שלום.txt" 7 | Content-Type: text/plain 8 | 9 | שלום עולם! 10 | 11 | ------WebKitFormBoundaryuYwgZwieYHQ3+AR8 12 | Content-Disposition: form-data; name="submit" 13 | 14 | Send 15 | ------WebKitFormBoundaryuYwgZwieYHQ3+AR8-- 16 | -------------------------------------------------------------------------------- /tests/multipart/firefox.txt: -------------------------------------------------------------------------------- 1 | -----------------------------11395741071221114234100471568 2 | Content-Disposition: form-data; name="submit-name" 3 | 4 | שלום 5 | -----------------------------11395741071221114234100471568 6 | Content-Disposition: form-data; name="file"; filename="שלום.txt" 7 | Content-Type: text/plain 8 | 9 | שלום עולם! 10 | 11 | -----------------------------11395741071221114234100471568 12 | Content-Disposition: form-data; name="submit" 13 | 14 | Send 15 | -----------------------------11395741071221114234100471568-- 16 | -------------------------------------------------------------------------------- /tests/multipart/ie.txt: -------------------------------------------------------------------------------- 1 | -----------------------------7da3a5810028 2 | Content-Disposition: form-data; name="submit-name" 3 | 4 | שלום 5 | -----------------------------7da3a5810028 6 | Content-Disposition: form-data; name="file"; filename="z:\tmp\שלום.txt" 7 | Content-Type: text/plain 8 | 9 | שלום עולם! 10 | 11 | -----------------------------7da3a5810028 12 | Content-Disposition: form-data; name="submit" 13 | 14 | Send 15 | -----------------------------7da3a5810028-- 16 | -------------------------------------------------------------------------------- /tests/multipart/opera.txt: -------------------------------------------------------------------------------- 1 | ------------jrFLC4hxayof1KyJEgmmCw 2 | Content-Disposition: form-data; name="submit-name" 3 | 4 | שלום 5 | ------------jrFLC4hxayof1KyJEgmmCw 6 | Content-Disposition: form-data; name="file"; filename="שלום.txt" 7 | Content-Type: text/plain 8 | 9 | שלום עולם! 10 | 11 | ------------jrFLC4hxayof1KyJEgmmCw 12 | Content-Disposition: form-data; name="submit" 13 | 14 | Send 15 | ------------jrFLC4hxayof1KyJEgmmCw-- 16 | -------------------------------------------------------------------------------- /tests/plugin_base.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2016 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef TESTS_PLUGIN_BASE_H 9 | #define TESTS_PLUGIN_BASE_H 10 | struct bar_base { 11 | virtual char const *msg() = 0; 12 | virtual ~bar_base() {} 13 | }; 14 | #endif 15 | -------------------------------------------------------------------------------- /tests/pool_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http", 5 | "port" : 8080, 6 | "ip" : "127.0.0.1", 7 | "worker_threads" : 2, 8 | "backlog": 100, 9 | }, 10 | "http" : { 11 | "script_names" : [ "/test" , "/async" , "/sync" ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/proto_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "worker_threads" : 5 5 | }, 6 | "http" : { 7 | "script_names" : [ "/test" , "/async" , "/sync", "/nonblocking" ], 8 | "timeout" : 5 9 | }, 10 | "localization" : { 11 | "messages" : { 12 | "paths" : [ "./tests/locale" ], 13 | "domains" : [ "test" ] 14 | }, 15 | "locales" : [ "he_IL.UTF-8" ], 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/proto_test_http_1.in: -------------------------------------------------------------------------------- 1 | GET /test HTTP/1.0 2 | 3 | -------------------------------------------------------------------------------- /tests/proto_test_http_1.out: -------------------------------------------------------------------------------- 1 | HTTP/1.0 200 Ok 2 | Content-Type: text/plain; charset=utf-8 3 | X-Powered-By: CppCMS/2.0.0.beta2 4 | Server: CppCMS-Embedded/2.0.0.beta2 5 | Connection: close 6 | 7 | GATEWAY_INTERFACE:CGI/1.0 8 | PATH_INFO: 9 | REMOTE_ADDR:127.0.0.1 10 | REMOTE_HOST:127.0.0.1 11 | REQUEST_METHOD:GET 12 | SCRIPT_NAME:/test 13 | SERVER_NAME:127.0.0.1 14 | SERVER_PORT:8080 15 | SERVER_PROTOCOL:HTTP/1.0 16 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 17 | 18 | -------------------------------------------------------------------------------- /tests/proto_test_http_2.in: -------------------------------------------------------------------------------- 1 | GET /test HTTP/1.0 2 | Accept-Encoding: gzip 3 | 4 | -------------------------------------------------------------------------------- /tests/proto_test_http_2.out: -------------------------------------------------------------------------------- 1 | HTTP/1.0 200 Ok 2 | Content-Type: text/plain; charset=utf-8 3 | X-Powered-By: CppCMS/2.0.0.beta2 4 | Server: CppCMS-Embedded/2.0.0.beta2 5 | Connection: close 6 | 7 | GATEWAY_INTERFACE:CGI/1.0 8 | HTTP_ACCEPT_ENCODING:gzip 9 | PATH_INFO: 10 | REMOTE_ADDR:127.0.0.1 11 | REMOTE_HOST:127.0.0.1 12 | REQUEST_METHOD:GET 13 | SCRIPT_NAME:/test 14 | SERVER_NAME:127.0.0.1 15 | SERVER_PORT:8080 16 | SERVER_PROTOCOL:HTTP/1.0 17 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 18 | 19 | -------------------------------------------------------------------------------- /tests/proto_test_http_3.in: -------------------------------------------------------------------------------- 1 | GET HTTP/1.0 2 | 3 | -------------------------------------------------------------------------------- /tests/proto_test_http_3.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/artyom-beilis/cppcms/c4febcc3118b42fcdf0099d61f9f4983d9d2702b/tests/proto_test_http_3.out -------------------------------------------------------------------------------- /tests/proto_test_http_4.in: -------------------------------------------------------------------------------- 1 | POST /test HTTP/1.0 2 | Content-Type: application/x-www-form-urlencoded 3 | Content-Length: 11 4 | 5 | foo=bar&1=2 -------------------------------------------------------------------------------- /tests/proto_test_http_4.out: -------------------------------------------------------------------------------- 1 | HTTP/1.0 200 Ok 2 | Content-Type: text/plain; charset=utf-8 3 | X-Powered-By: CppCMS/2.0.0.beta2 4 | Server: CppCMS-Embedded/2.0.0.beta2 5 | Connection: close 6 | 7 | CONTENT_LENGTH:11 8 | CONTENT_TYPE:application/x-www-form-urlencoded 9 | GATEWAY_INTERFACE:CGI/1.0 10 | PATH_INFO: 11 | REMOTE_ADDR:127.0.0.1 12 | REMOTE_HOST:127.0.0.1 13 | REQUEST_METHOD:POST 14 | SCRIPT_NAME:/test 15 | SERVER_NAME:127.0.0.1 16 | SERVER_PORT:8080 17 | SERVER_PROTOCOL:HTTP/1.0 18 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 19 | 20 | 1=2 21 | foo=bar 22 | -------------------------------------------------------------------------------- /tests/proto_test_http_5.in: -------------------------------------------------------------------------------- 1 | POST /test HTTP/1.0 2 | Content-Type: application/x-www-form-urlencoded; charset=utf-8 3 | Content-Length: 11 4 | 5 | foo=bar&1=2 -------------------------------------------------------------------------------- /tests/proto_test_http_5.out: -------------------------------------------------------------------------------- 1 | HTTP/1.0 200 Ok 2 | Content-Type: text/plain; charset=utf-8 3 | X-Powered-By: CppCMS/2.0.0.beta2 4 | Server: CppCMS-Embedded/2.0.0.beta2 5 | Connection: close 6 | 7 | CONTENT_LENGTH:11 8 | CONTENT_TYPE:application/x-www-form-urlencoded; charset=utf-8 9 | GATEWAY_INTERFACE:CGI/1.0 10 | PATH_INFO: 11 | REMOTE_ADDR:127.0.0.1 12 | REMOTE_HOST:127.0.0.1 13 | REQUEST_METHOD:POST 14 | SCRIPT_NAME:/test 15 | SERVER_NAME:127.0.0.1 16 | SERVER_PORT:8080 17 | SERVER_PROTOCOL:HTTP/1.0 18 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 19 | 20 | 1=2 21 | foo=bar 22 | -------------------------------------------------------------------------------- /tests/proto_test_http_6.in: -------------------------------------------------------------------------------- 1 | GET /test HTTP/1.1 2 | Connection: Keep-Alive 3 | 4 | GET /test HTTP/1.1 5 | Connection: close 6 | 7 | -------------------------------------------------------------------------------- /tests/proto_test_http_6.out: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 Ok 2 | Content-Type: text/plain; charset=utf-8 3 | X-Powered-By: CppCMS/2.0.0.beta2 4 | Server: CppCMS-Embedded/2.0.0.beta2 5 | Connection: keep-alive 6 | 7 | GATEWAY_INTERFACE:CGI/1.0 8 | HTTP_CONNECTION:Keep-Alive 9 | PATH_INFO: 10 | REMOTE_ADDR:127.0.0.1 11 | REMOTE_HOST:127.0.0.1 12 | REQUEST_METHOD:GET 13 | SCRIPT_NAME:/test 14 | SERVER_NAME:127.0.0.1 15 | SERVER_PORT:8080 16 | SERVER_PROTOCOL:HTTP/1.1 17 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 18 | 19 | HTTP/1.1 200 Ok 20 | Content-Type: text/plain; charset=utf-8 21 | X-Powered-By: CppCMS/2.0.0.beta2 22 | Server: CppCMS-Embedded/2.0.0.beta2 23 | Connection: close 24 | 25 | GATEWAY_INTERFACE:CGI/1.0 26 | HTTP_CONNECTION:close 27 | PATH_INFO: 28 | REMOTE_ADDR:127.0.0.1 29 | REMOTE_HOST:127.0.0.1 30 | REQUEST_METHOD:GET 31 | SCRIPT_NAME:/test 32 | SERVER_NAME:127.0.0.1 33 | SERVER_PORT:8080 34 | SERVER_PROTOCOL:HTTP/1.1 35 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 36 | 37 | -------------------------------------------------------------------------------- /tests/proto_test_http_7.in: -------------------------------------------------------------------------------- 1 | GET /test HTTP/1.1 2 | Connection: Keep-Alive 3 | 4 | GET /test HTTP/1.1 5 | Connection: keep-alive 6 | 7 | -------------------------------------------------------------------------------- /tests/proto_test_http_7.out: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 Ok 2 | Content-Type: text/plain; charset=utf-8 3 | X-Powered-By: CppCMS/2.0.0.beta2 4 | Server: CppCMS-Embedded/2.0.0.beta2 5 | Connection: keep-alive 6 | 7 | GATEWAY_INTERFACE:CGI/1.0 8 | HTTP_CONNECTION:Keep-Alive 9 | PATH_INFO: 10 | REMOTE_ADDR:127.0.0.1 11 | REMOTE_HOST:127.0.0.1 12 | REQUEST_METHOD:GET 13 | SCRIPT_NAME:/test 14 | SERVER_NAME:127.0.0.1 15 | SERVER_PORT:8080 16 | SERVER_PROTOCOL:HTTP/1.1 17 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 18 | 19 | HTTP/1.1 200 Ok 20 | Content-Type: text/plain; charset=utf-8 21 | X-Powered-By: CppCMS/2.0.0.beta2 22 | Server: CppCMS-Embedded/2.0.0.beta2 23 | Connection: keep-alive 24 | 25 | GATEWAY_INTERFACE:CGI/1.0 26 | HTTP_CONNECTION:keep-alive 27 | PATH_INFO: 28 | REMOTE_ADDR:127.0.0.1 29 | REMOTE_HOST:127.0.0.1 30 | REQUEST_METHOD:GET 31 | SCRIPT_NAME:/test 32 | SERVER_NAME:127.0.0.1 33 | SERVER_PORT:8080 34 | SERVER_PROTOCOL:HTTP/1.1 35 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 36 | 37 | -------------------------------------------------------------------------------- /tests/proto_test_http_8.in: -------------------------------------------------------------------------------- 1 | POST /test HTTP/1.1 2 | Content-Type: application/x-www-form-urlencoded 3 | Content-Length: 11 4 | Connection:keep-alive 5 | 6 | foo=bar&1=2GET /test HTTP/1.1 7 | Connection: Keep-Alive 8 | 9 | GET /test HTTP/1.1 10 | Connection: close 11 | 12 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_1.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO: 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/test 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | SERVER_PROTOCOL:HTTP/1.0 10 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 11 | 12 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_1.out: -------------------------------------------------------------------------------- 1 | Content-Type: text/plain; charset=utf-8 2 | X-Powered-By: CppCMS/2.0.0.beta2 3 | 4 | CONTENT_LENGTH:0 5 | GATEWAY_INTERFACE:CGI/1.0 6 | PATH_INFO: 7 | REMOTE_ADDR: 8 | REMOTE_HOST: 9 | REQUEST_METHOD:GET 10 | SCRIPT_NAME:/test 11 | SERVER_NAME:127.0.0.1 12 | SERVER_PORT:8080 13 | SERVER_PROTOCOL:HTTP/1.0 14 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 15 | 16 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_2.in: -------------------------------------------------------------------------------- 1 | HTTP_Accept-Encoding:gzip 2 | GATEWAY_INTERFACE:CGI/1.0 3 | PATH_INFO: 4 | REMOTE_ADDR: 5 | REMOTE_HOST: 6 | REQUEST_METHOD:GET 7 | SCRIPT_NAME:/test 8 | SERVER_NAME:127.0.0.1 9 | SERVER_PORT:8080 10 | SERVER_PROTOCOL:HTTP/1.0 11 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 12 | 13 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_2.out: -------------------------------------------------------------------------------- 1 | Content-Type: text/plain; charset=utf-8 2 | X-Powered-By: CppCMS/2.0.0.beta2 3 | 4 | CONTENT_LENGTH:0 5 | GATEWAY_INTERFACE:CGI/1.0 6 | HTTP_ACCEPT_ENCODING:gzip 7 | PATH_INFO: 8 | REMOTE_ADDR: 9 | REMOTE_HOST: 10 | REQUEST_METHOD:GET 11 | SCRIPT_NAME:/test 12 | SERVER_NAME:127.0.0.1 13 | SERVER_PORT:8080 14 | SERVER_PROTOCOL:HTTP/1.0 15 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 16 | 17 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_3.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | Content-Type:application/x-www-form-urlencoded; charset=utf-8 3 | PATH_INFO: 4 | REMOTE_ADDR: 5 | REMOTE_HOST: 6 | REQUEST_METHOD:POST 7 | SCRIPT_NAME:/test 8 | SERVER_NAME:127.0.0.1 9 | SERVER_PORT:8080 10 | SERVER_PROTOCOL:HTTP/1.0 11 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 12 | 13 | foo=bar&1=2 -------------------------------------------------------------------------------- /tests/proto_test_scgi_3.out: -------------------------------------------------------------------------------- 1 | Content-Type: text/plain; charset=utf-8 2 | X-Powered-By: CppCMS/2.0.0.beta2 3 | 4 | CONTENT_LENGTH:11 5 | CONTENT_TYPE:application/x-www-form-urlencoded; charset=utf-8 6 | GATEWAY_INTERFACE:CGI/1.0 7 | PATH_INFO: 8 | REMOTE_ADDR: 9 | REMOTE_HOST: 10 | REQUEST_METHOD:POST 11 | SCRIPT_NAME:/test 12 | SERVER_NAME:127.0.0.1 13 | SERVER_PORT:8080 14 | SERVER_PROTOCOL:HTTP/1.0 15 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 16 | 17 | 1=2 18 | foo=bar 19 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_4.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO: 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/test 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | TEST:12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 10 | SERVER_PROTOCOL:HTTP/1.0 11 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 12 | 13 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_4.out: -------------------------------------------------------------------------------- 1 | Content-Type: text/plain; charset=utf-8 2 | X-Powered-By: CppCMS/2.0.0.beta2 3 | 4 | CONTENT_LENGTH:0 5 | GATEWAY_INTERFACE:CGI/1.0 6 | PATH_INFO: 7 | REMOTE_ADDR: 8 | REMOTE_HOST: 9 | REQUEST_METHOD:GET 10 | SCRIPT_NAME:/test 11 | SERVER_NAME:127.0.0.1 12 | SERVER_PORT:8080 13 | SERVER_PROTOCOL:HTTP/1.0 14 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 15 | TEST:12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 16 | 17 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_5.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO: 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/test 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | TEST1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:0 10 | SERVER_PROTOCOL:HTTP/1.0 11 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 12 | 13 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_5.out: -------------------------------------------------------------------------------- 1 | Content-Type: text/plain; charset=utf-8 2 | X-Powered-By: CppCMS/2.0.0.beta2 3 | 4 | CONTENT_LENGTH:0 5 | GATEWAY_INTERFACE:CGI/1.0 6 | PATH_INFO: 7 | REMOTE_ADDR: 8 | REMOTE_HOST: 9 | REQUEST_METHOD:GET 10 | SCRIPT_NAME:/test 11 | SERVER_NAME:127.0.0.1 12 | SERVER_PORT:8080 13 | SERVER_PROTOCOL:HTTP/1.0 14 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 15 | TEST1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789:0 16 | 17 | -------------------------------------------------------------------------------- /tests/proto_test_scgi_6.in: -------------------------------------------------------------------------------- 1 | GATEWAY_INTERFACE:CGI/1.0 2 | PATH_INFO: 3 | REMOTE_ADDR: 4 | REMOTE_HOST: 5 | REQUEST_METHOD:GET 6 | SCRIPT_NAME:/test 7 | SERVER_NAME:127.0.0.1 8 | SERVER_PORT:8080 9 | LONG_MESSAGE:30000 10 | SERVER_PROTOCOL:HTTP/1.0 11 | SERVER_SOFTWARE:CppCMS/2.0.0.beta2 12 | 13 | -------------------------------------------------------------------------------- /tests/sample_key.txt: -------------------------------------------------------------------------------- 1 | ab01ccdd 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/secure_post_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http" 5 | }, 6 | "http" : { 7 | "script" : "/test" 8 | }, 9 | "session" : { 10 | "timeout" : 100, 11 | "location" : "server", 12 | "server" : { 13 | "storage" : "memory", 14 | } 15 | }, 16 | "security" : { 17 | "multipart_form_data_limit" : 2, // KB 18 | "content_length_limit" : 1, // KB 19 | "csrf" : { "enable" : true } 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /tests/service_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | 4 | try: 5 | import httplib 6 | except: 7 | import http.client as httplib 8 | import sys 9 | 10 | h=httplib.HTTPConnection('127.0.0.1:8080'); 11 | h.request('GET','/test') 12 | r=h.getresponse() 13 | sys.stdout.write(r.read().decode()) 14 | 15 | -------------------------------------------------------------------------------- /tests/session_interface_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http" 5 | }, 6 | "http" : { 7 | "script" : "/test" 8 | }, 9 | "session" : { 10 | "timeout" : 5, 11 | "client_size_limit" : 256, 12 | "cookies" : { 13 | "prefix" : "sc", 14 | "domain" : "foo.bar", 15 | "path" : "/foo", 16 | "expiration_method" : "max-age" 17 | }, 18 | "client" : { 19 | "hmac" : "sha1", 20 | "hmac_key" : "dc07e0ff8e44be872e86fe848841584cd38983e5" 21 | }, 22 | "server" : { 23 | "storage" : "memory", 24 | } 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /tests/status_test.js: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "service" : { 4 | "api" : "http", 5 | "port": 8080 6 | }, 7 | "http" : { 8 | "script" : "/test" 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /tests/status_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | from __future__ import print_function 4 | 5 | try: 6 | import httplib 7 | except: 8 | import http.client as httplib 9 | 10 | import sys 11 | 12 | def test_status(h,stat): 13 | if h.status != stat: 14 | print("Status mistmatch:",h.status,"!=",stat) 15 | sys.exit(1) 16 | 17 | def test_valid(url,status,resp = ''): 18 | h=httplib.HTTPConnection('localhost:8080'); 19 | h.request('GET','/test' + url) 20 | r=h.getresponse() 21 | body = r.read().decode(); 22 | if r.status!=status: 23 | print("Failed", url , r.status,"!=",status ) 24 | sys.exit(1) 25 | if resp != '' and body!=resp: 26 | print("Failed", url ,"[%s]" % body,"!=", "[%s]" % resp) 27 | sys.exit(1) 28 | else: 29 | print("Ok",url,status) 30 | 31 | test_valid('/normal',200) 32 | test_valid('/throws',500) 33 | test_valid('/invalid',404) 34 | 35 | if len(sys.argv) == 2 and sys.argv[1]=='async': 36 | test_valid('/delayed',200) 37 | test_valid('/delayed_with_response',200,'test message') 38 | test_valid('/delayed_twice',200,'message1message2') 39 | 40 | 41 | # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 42 | -------------------------------------------------------------------------------- /tests/tc_plugin.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "tc_sep_skin.h" %> 2 | <% skin plugin %> 3 | <% domain tc_plugin %> 4 | <% view master_plugin uses data::master extends tc_skin::master_api %> 5 | <% template m1() %>plugin::master_plugin::m1 <%= text %><% end %> 6 | <% end view %> 7 | 8 | <% view helper_plugin uses data::helper extends tc_skin::helper_api %> 9 | <% template h1() %>plugin::helper_plugin::h1 <%= x %><% end %> 10 | <% end view %> 11 | <% end skin %> 12 | -------------------------------------------------------------------------------- /tests/tc_plugin2.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "tc_sep_skin.h" %> 2 | <% domain plugin2 %> 3 | <% skin plugin2 %> 4 | <% view master_plugin uses data::master extends tc_skin::master_api2 %> 5 | <% template call() %>Plugin2: <% include f1() %><% end %> 6 | <% end view %> 7 | 8 | <% view msg uses data::master extends tc_skin::message_base %> 9 | <% template render() %><% include f1() %>; <% gt "translate me" %>; <% include f1() %><% end %> 10 | <% end view %> 11 | 12 | <% end skin %> 13 | -------------------------------------------------------------------------------- /tests/tc_skin_a.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "tests/tc_test_content.h" %> 2 | <% skin tc_skin_a %> 3 | <% view master uses data::master %> 4 | <% template render() %>a<% end template %> 5 | <% end view %> 6 | <% end skin %> 7 | -------------------------------------------------------------------------------- /tests/tc_skin_b.tmpl: -------------------------------------------------------------------------------- 1 | <% c++ #include "tests/tc_test_content.h" %> 2 | <% skin tc_skin_b %> 3 | <% view master uses data::master %> 4 | <% template render() %>b<% end template %> 5 | <% end view %> 6 | <% end skin %> 7 | -------------------------------------------------------------------------------- /tests/test.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) 4 | // 5 | // See accompanying file COPYING.TXT file for licensing details. 6 | // 7 | /////////////////////////////////////////////////////////////////////////////// 8 | #ifndef CPPCMS_TEST_H 9 | #define CPPCMS_TEST_H 10 | 11 | 12 | #include 13 | #include 14 | 15 | 16 | #define TEST(X) \ 17 | do { \ 18 | if(X) break; \ 19 | std::ostringstream oss; \ 20 | oss << "Error " << __FILE__ << ":"<<__LINE__ << " "#X; \ 21 | throw std::runtime_error(oss.str()); \ 22 | }while(0) 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tests/test_plan.txt: -------------------------------------------------------------------------------- 1 | - Protocols testing POST/GET: 2 | http 3 | fastcgi 4 | scgi 5 | 6 | - Sessions normal: 7 | - Cookies backends: hmac, aes 8 | - Files backend: 9 | - Memort backend 10 | - Session cookies - try to hajack 11 | - Session dual - test storage 12 | - Asynchronous IO: 13 | - timer 14 | - timeout 15 | - peer-close 16 | - Cache: 17 | backends: threaded 18 | - Cookies: test 19 | - File Server Test 20 | - JSON test 21 | - Views: 22 | commands 23 | filters 24 | auto-reloading 25 | 26 | Done 27 | ====== 28 | - Forms: 29 | text: encoding-validation 30 | various tests 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/test_plugin_so.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "plugin_base.h" 4 | 5 | namespace foo { 6 | 7 | std::string lower(std::string f) 8 | { 9 | for(size_t i=0;i $FILE 41 | then 42 | echo $TEST - pass >>/tmp/report.txt 43 | else 44 | echo $TEST - fail >>/tmp/report.txt 45 | fi 46 | cp $FILE /tmp/faults/ 47 | done 48 | 49 | cp /tmp/report.txt /tmp/faults 50 | 51 | 52 | -------------------------------------------------------------------------------- /tools/conv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import re 5 | 6 | 7 | class converter(): 8 | confline=re.compile(r'^\s*#include\s*"config.h"\s*$') 9 | bline=re.compile(r'^\s*#include\s*\s*$') 10 | locline=re.compile(r'^(locale/.*|locale.hpp)$') 11 | 12 | included=0 13 | assigned=0 14 | lst=[]; 15 | 16 | def print_list(self): 17 | if not self.lst: 18 | return 19 | if not self.included: 20 | print r'#include "config.h"' 21 | self.included=1 22 | print '#ifdef CPPCMS_USE_EXTERNAL_BOOST' 23 | for inc in self.lst: 24 | print '# include ' % inc 25 | print '#else // Internal Boost' 26 | for inc in self.lst: 27 | print '# include ' % inc 28 | if not self.assigned: 29 | print ' namespace boost = cppcms_boost;' 30 | self.assigned=1 31 | print '#endif' 32 | self.lst=[] 33 | def run(self): 34 | for line in sys.stdin: 35 | if self.confline.match(line): 36 | self.included=1 37 | r=self.bline.match(line) 38 | if r: 39 | inc=r.group(1) 40 | if self.locline.match(inc): 41 | self.print_list() 42 | print line, 43 | else: 44 | self.lst.append(inc) 45 | 46 | else: 47 | self.print_list() 48 | print line, 49 | 50 | self.print_list() 51 | 52 | cvt=converter() 53 | cvt.run() 54 | -------------------------------------------------------------------------------- /tools/convert_locale: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | rm -fr boost_locale_git boost_locale 4 | git clone https://github.com/boostorg/locale.git boost_locale_git 5 | mkdir -p boost_locale/libs/locale 6 | mv boost_locale_git/include/boost boost_locale/ 7 | mv boost_locale_git/src/ boost_locale/libs/locale/ 8 | mv boost_locale_git/test/ boost_locale/libs/locale/ 9 | 10 | 11 | rm -fr root 12 | mkdir root 13 | cp boost_locale/boost/locale.hpp root/localization.h 14 | cd boost_locale/boost/locale/ 15 | for x in *.hpp 16 | do 17 | 18 | cp $x ../../../root/locale_${x%.hpp}.h 19 | done 20 | 21 | cd ../../libs/locale/src 22 | 23 | for x in *.cpp *.hpp 24 | do 25 | cp $x ../../../../root/locale_src_$x 26 | done 27 | 28 | cd ../test/ 29 | 30 | for x in *.cpp *.hpp 31 | do 32 | cp $x ../../../../root/locale_src_$x 33 | done 34 | 35 | cd ../../../../root 36 | 37 | for x in *.h *.cpp *.hpp 38 | do 39 | cat $x | ../rename_locale.py | ../conv.py >tmp.txt 40 | cp tmp.txt $x; 41 | rm tmp.txt 42 | done 43 | 44 | rm locale_config.h 45 | -------------------------------------------------------------------------------- /tools/nightly/vm/copy_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$3" == "" ] || [ "$4" == "" ] 4 | then 5 | echo "Usage vm-file.sh (get|put) src tgt" 6 | exit 1 7 | fi 8 | 9 | source "$1" 10 | 11 | CMD="$2" 12 | 13 | if [ "$CMD" == "put" ] 14 | then 15 | SRC="$3" 16 | TGT="$VM_FTP_TDIR/$4" 17 | else 18 | SRC="$VM_FTP_TDIR/$3" 19 | TGT="$4" 20 | fi 21 | 22 | cat >/tmp/batch.sftp <logs/$VM_ID-${TEST}-status.txt 10 | else 11 | echo fail >logs/$VM_ID-${TEST}-status.txt 12 | fi 13 | scp -P $VM_PORT localhost:/tmp/nightly/cppcms/"$TEST"/Testing/Temporary/LastTest.log "logs/${VM_ID}-${TEST}-ctest-log.txt" 14 | -------------------------------------------------------------------------------- /tools/nightly/vm/run_test_windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | TEST="$1" 3 | 4 | sleep 5 5 | ssh -p $VM_PORT localhost "$VM_EXE\mkdir" "c:/nightly/cppcms/$TEST" || exit 1 6 | sleep 5 7 | 8 | rm -f /mnt/raid1/storage/log.txt 9 | 10 | echo "cd c:\\nightly\\cppcms\\$TEST || exit 1" >/tmp/tmp.bat 11 | cat $VM_ID/$TEST.bat >>/tmp/tmp.bat 12 | 13 | echo "put /tmp/tmp.bat /c:/nightly/$TEST.bat" | sftp -P $VM_PORT localhost 14 | [ "${PIPESTATUS[1]}" == "0" ] || exit 1 15 | sleep 5 16 | 17 | ssh -p $VM_PORT localhost 'c:\nightly\'$TEST.bat | tee logs/$VM_ID-$TEST.log 18 | if [ "${PIPESTATUS[0]}" == "0" ] ; then 19 | echo ok >logs/$VM_ID-${TEST}-status.txt 20 | else 21 | echo fail >logs/$VM_ID-${TEST}-status.txt 22 | fi 23 | 24 | sleep 5 25 | 26 | ssh -p $VM_PORT localhost "cmd /c copy c:\\nightly\\cppcms\\$TEST\\Testing\\Temporary\\LastTest.log \\\\192.168.2.100\\storage\log.txt" 27 | 28 | sleep 5 29 | 30 | cp /mnt/raid1/storage/log.txt logs/${VM_ID}-${TEST}-ctest-log.txt 31 | 32 | sleep 5 33 | -------------------------------------------------------------------------------- /tools/nightly/vm/solaris/gcc4.8-x86.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | cmake $FLAGS -DCMAKE_CXX_FLAGS=-std=c++0x -DCMAKE_INCLUDE_PATH=$HOME/gcc/include -DCMAKE_LIBRARY_PATH=$HOME/gcc/lib -DDISABLE_STATIC=ON .. || exit 1 5 | make || exit 1 6 | ctest || exit 1 7 | -------------------------------------------------------------------------------- /tools/nightly/vm/upload_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | -------------------------------------------------------------------------------- /tools/nightly/vm/upload_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source url.sh 4 | 5 | REPO_REV="GIT $GIT_BRANCH/`git ls-remote $REPO.git $GIT_BRANCH | awk '{print $1}' `" 6 | 7 | TGT=/tmp/nightly-build-report 8 | rm -fr $TGT 9 | mkdir $TGT 10 | for f in logs/*-status.txt 11 | do 12 | base=${f%-status.txt} 13 | base=$(basename $base) 14 | if [ "$(cat $f)" == "ok" ] 15 | then 16 | cp logs/$base.log $TGT/$base.txt 17 | else 18 | cat logs/$base.log logs/${base}-ctest-log.txt >$TGT/$base.txt 19 | fi 20 | done 21 | 22 | ./report_to_html.py "$REPO" "$REPO_REV" >/home/artik/nightly-build-report.html 23 | $HOME/bin/sync_build.sh 24 | 25 | -------------------------------------------------------------------------------- /tools/nightly/vm/upload_version_unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | ssh -p $VM_PORT localhost rm -fr /tmp/nightly || exit 1 4 | ssh -p $VM_PORT localhost mkdir /tmp/nightly || exit 1 5 | scp -P $VM_PORT cppcms.tar.gz localhost:/tmp/nightly || exit 1 6 | 7 | ssh -p $VM_PORT localhost $VM_TAR -xvf /tmp/nightly/cppcms.tar.gz -C /tmp/nightly || exit 1 8 | -------------------------------------------------------------------------------- /tools/nightly/vm/upload_version_windows.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | ssh -p $VM_PORT localhost "$VM_EXE\\rm" -fr "/c/nightly/*" || exit 1 4 | rm -fr /mnt/raid1/storage/cppcms.tar.gz 5 | cp cppcms.tar.gz /mnt/raid1/storage/ || exit 1 6 | sleep 5 7 | ssh -p $VM_PORT localhost 'cmd /c copy \\192.168.2.100\storage\cppcms.tar.gz c:\nightly\' || exit 1 8 | #[ "${PIPESTATUS[1]}" == "0" ] || exit 1 9 | #echo "put cppcms.tar.gz /c:/nightly/" | sftp -P $VM_PORT localhost 10 | 11 | sleep 5 12 | 13 | ssh -p $VM_PORT localhost "$VM_EXE\\tar" -I $VM_MSYS_EXE/gzip -xvf "/c/nightly/cppcms.tar.gz" -C "/c/nightly" || exit 1 14 | sleep 5 15 | -------------------------------------------------------------------------------- /tools/nightly/vm/url.sh: -------------------------------------------------------------------------------- 1 | REPO=https://github.com/artyom-beilis/cppcms 2 | BRANCH=branches/cpp11 3 | GIT_BRANCH=cpp11 4 | -------------------------------------------------------------------------------- /tools/nightly/vm/vm-freebsd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export VM="FreeBSD 11.1" 4 | export VM_ID=freebsd 5 | export VM_PORT=2242 6 | export VM_WAIT=60 7 | export VM_PING="echo" 8 | export VM_OS=unix 9 | export VM_TAR=tar 10 | -------------------------------------------------------------------------------- /tools/nightly/vm/vm-localhost.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export VM="localhost" 4 | export VM_ID=localhost 5 | export VM_PORT=22 6 | export VM_WAIT=0 7 | export VM_PING="echo" 8 | export VM_OS=unix 9 | export VM_TAR=tar 10 | -------------------------------------------------------------------------------- /tools/nightly/vm/vm-solaris.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export VM="Solaris11" 4 | export VM_ID=solaris 5 | export VM_PORT=2250 6 | export VM_WAIT=120 7 | export VM_PING="echo" 8 | export VM_OS=unix 9 | export VM_TAR=/usr/gnu/bin/tar 10 | -------------------------------------------------------------------------------- /tools/nightly/vm/vm-win7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export VM="Windows 7" 4 | export VM_ID=win7 5 | export VM_PORT=2240 6 | export VM_EXE='\msys64\usr\bin\' 7 | export VM_MSYS_EXE='/c/msys64/usr/bin/' 8 | export VM_SCP=sftp 9 | export VM_WAIT=45 10 | export VM_PING="cmd /c echo ok" 11 | export VM_OS=windows 12 | -------------------------------------------------------------------------------- /tools/nightly/vm/win7/mingw_gcc7.1-x64.bat: -------------------------------------------------------------------------------- 1 | set PATH=%PATH%;c:\msys64\mingw64\bin 2 | 3 | cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_STATIC=ON -DCMAKE_INCLUDE_PATH=c:\msys64\mingw64\include -DCMAKE_LIBRARY_PATH=c:\msys64\mingw64\lib .. || exit 1 4 | mingw32-make -j 4 || exit 1 5 | SET PATH=%PATH%;.\booster\ 6 | ctest || exit 1 7 | 8 | -------------------------------------------------------------------------------- /tools/nightly/vm/win7/mingw_gcc7.1-x86.bat: -------------------------------------------------------------------------------- 1 | set PATH=%PATH%;c:\msys64\mingw32\bin 2 | 3 | cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_STATIC=ON -DCMAKE_INCLUDE_PATH=c:\msys64\mingw32\include -DCMAKE_LIBRARY_PATH=c:\msys64\mingw32\lib .. || exit 1 4 | mingw32-make -j 4 || exit 1 5 | SET PATH=%PATH%;.\booster\ 6 | ctest || exit 1 7 | 8 | -------------------------------------------------------------------------------- /tools/nightly/vm/win7/msvc2017-x64.bat: -------------------------------------------------------------------------------- 1 | @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" 2 | 3 | cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_STATIC=ON -DCMAKE_INCLUDE_PATH=c:\Users\artik\msvc2017\x64\Release\include -DCMAKE_LIBRARY_PATH=c:\Users\artik\msvc2017\x64\Release\lib .. || exit 1 4 | ninja || exit 1 5 | SET PATH=%PATH%;c:\Users\artik\msvc2017\x64\Release\bin;.\booster\ 6 | ctest || exit 1 7 | 8 | -------------------------------------------------------------------------------- /tools/nightly/vm/win7/msvc2017-x86.bat: -------------------------------------------------------------------------------- 1 | @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" 2 | 3 | cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDISABLE_STATIC=ON -DCMAKE_INCLUDE_PATH=c:\Users\artik\msvc2017\x86\Release\include -DCMAKE_LIBRARY_PATH=c:\Users\artik\msvc2017\x86\Release\lib .. || exit 1 4 | ninja || exit 1 5 | SET PATH=%PATH%;c:\Users\artik\msvc2017\x86\Release\bin;.\booster\ 6 | ctest || exit 1 7 | 8 | -------------------------------------------------------------------------------- /tools/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$1" == "" ] ; then 4 | echo "Usage (trunk|branches/name)" 5 | exit 1; 6 | fi 7 | 8 | rm -fr current-release 9 | mkdir current-release 10 | cd .. 11 | git archive $1 | tar -x -C tools/current-release 12 | cd tools 13 | VERSION=`grep CPPCMS_PACKAGE_VERSION current-release/CMakeLists.txt | sed 's/.*"\(.*\)".*/\1/'` 14 | 15 | DIRNAME=cppcms-$VERSION 16 | mv current-release $DIRNAME 17 | cd $DIRNAME 18 | doxygen 19 | cp /usr/share/doc/lmdb-doc/html/dynsections.js doc/doxygen/html 20 | cd .. 21 | tar -cjf $DIRNAME.tar.bz2 $DIRNAME 22 | rm -fr $DIRNAME 23 | 24 | pushd . 25 | if true 26 | then 27 | tar -xjf $DIRNAME.tar.bz2 28 | cd $DIRNAME 29 | mkdir -p ../../../www/$VERSION 30 | cp -a doc/doxygen/html/* ../../../www/$VERSION/ 31 | cd ../../../www 32 | rm -f latest 33 | ln -s $VERSION latest 34 | fi 35 | popd 36 | mv $DIRNAME.tar.bz2 ../../releases/ 37 | 38 | -------------------------------------------------------------------------------- /tools/url.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #REPO_URL=svn://svn.code.sf.net/p/cppcms/code/framework/branches/v1.0_fixes 4 | REPO_URL=http://svn.code.sf.net/p/cppcms/code/framework/trunk 5 | 6 | 7 | --------------------------------------------------------------------------------