Browse Source

Update treefrog to version 1.27.0 (#5284)

* rename treefrog-hybrid to treefrog-epoll.

* update treefrog to version 1.26.0.

* changed a caption to epoll.

* update treefrog to version 1.27.0

* Deleted epoll test

* typo.
TreeFrog Framework 5 years ago
parent
commit
90de00f7a7

+ 0 - 23
frameworks/C++/treefrog/benchmark_config.json

@@ -23,29 +23,6 @@
       "notes": "",
       "notes": "",
       "versus": ""
       "versus": ""
     },
     },
-    "hybrid": {
-      "json_url": "/json/json",
-      "db_url": "/world/random",
-      "query_url": "/world/queries/",
-      "fortune_url": "/fortune/index",
-      "update_url": "/world/updates/",
-      "plaintext_url": "/world/plain",
-      "port": 8080,
-      "approach": "Realistic",
-      "classification": "Fullstack",
-      "database": "MySQL",
-      "framework": "treefrog",
-      "language": "C++",
-      "flavor": "None",
-      "orm": "Micro",
-      "platform": "None",
-      "webserver": "None",
-      "os": "Linux",
-      "database_os": "Linux",
-      "display_name": "treefrog-hybrid",
-      "notes": "",
-      "versus": "treefrog"
-    },
     "postgres": {
     "postgres": {
       "json_url": "/json/json",
       "json_url": "/json/json",
       "db_url": "/world/random",
       "db_url": "/world/random",

+ 56 - 22
frameworks/C++/treefrog/config/application.ini

@@ -6,6 +6,10 @@
 # Listens on the specified port.
 # Listens on the specified port.
 ListenPort=8080
 ListenPort=8080
 
 
+# Listens for incoming connections on the specified IP address. If this value
+# is empty, equivalent to "0.0.0.0".
+ListenAddress=
+
 # Sets the codec used by 'QObject::tr()' and 'toLocal8Bit()' to the
 # Sets the codec used by 'QObject::tr()' and 'toLocal8Bit()' to the
 # QTextCodec for the specified encoding. See QTextCodec class reference.
 # QTextCodec for the specified encoding. See QTextCodec class reference.
 InternalEncoding=UTF-8
 InternalEncoding=UTF-8
@@ -18,8 +22,10 @@ HttpOutputEncoding=UTF-8
 # If this value is empty, the system's locale is used.
 # If this value is empty, the system's locale is used.
 Locale=
 Locale=
 
 
-# Specify the multiprocessing module, such as 'thread' or 'prefork'
-MultiProcessingModule=hybrid
+# Specify the multiprocessing module, such as thread or epoll.
+#  thread: multithreading assigned to each socket, available for all platforms
+#  epoll: scalable I/O event notification (epoll) in single thread, Linux only
+MultiProcessingModule=thread
 
 
 # Specify the absolute or relative path of the temporary directory
 # Specify the absolute or relative path of the temporary directory
 # for HTTP uploaded files. Uses system default if not specified.
 # for HTTP uploaded files. Uses system default if not specified.
@@ -28,10 +34,13 @@ UploadTemporaryDirectory=tmp
 # Specify setting files for SQL databases.
 # Specify setting files for SQL databases.
 SqlDatabaseSettingsFiles=database.ini
 SqlDatabaseSettingsFiles=database.ini
 
 
-# Specify the setting file for MongoDB.
+# Specify the setting file for MongoDB, mongodb.ini.
 MongoDbSettingsFile=mongodb.ini
 MongoDbSettingsFile=mongodb.ini
 
 
-# Specify the directory path to store SQL query files
+# Specify the setting file for Redis, redis.ini.
+RedisSettingsFile=
+
+# Specify the directory path to store SQL query files.
 SqlQueriesStoredDirectory=sql/
 SqlQueriesStoredDirectory=sql/
 
 
 # Determines whether it renders views without controllers directly
 # Determines whether it renders views without controllers directly
@@ -52,8 +61,8 @@ SqlQueryLogFile=
 # method.
 # method.
 ApplicationAbortOnFatal=false
 ApplicationAbortOnFatal=false
 
 
-# This directive specifies the number of bytes from 0 (meaning
-# unlimited) to 2147483647 (2GB) that are allowed in a request body.
+# This directive specifies the number of bytes that are allowed in
+# a request body. 0 means unlimited.
 LimitRequestBody=0
 LimitRequestBody=0
 
 
 # If false is specified, the protective function against cross-site request
 # If false is specified, the protective function against cross-site request
@@ -84,25 +93,31 @@ LDPreload=/usr/lib/x86_64-linux-gnu/libjemalloc.so
 ##
 ##
 Session.Name=TFSESSION
 Session.Name=TFSESSION
 
 
-# Specify the session store type, such as 'sqlobject', 'file', 'cookie'
-# or plugin module name.
+# Specify the session store type, such as 'sqlobject', 'file', 'cookie',
+# 'mongodb', 'redis', 'cachedb' or plugin module name.
+# For 'sqlobject', the settings specified in SqlDatabaseSettingsFiles are used.
+# For 'mongodb', the settings specified in MongoDbSettingsFile are used.
+# For 'redis', the settings specified in RedisSettingsFile are used.
 Session.StoreType=cookie
 Session.StoreType=cookie
 
 
 # Replaces the session ID with a new one each time one connects, and
 # Replaces the session ID with a new one each time one connects, and
 # keeps the current session information.
 # keeps the current session information.
 Session.AutoIdRegeneration=false
 Session.AutoIdRegeneration=false
 
 
-# Specifies the lifetime of the session in seconds. The value 0 means
-# "until the browser is closed." Defaults to 0.
-Session.LifeTime=0
+# Specifies a Max-Age attribute of the session cookie in seconds. The value 0
+# means "until the browser is closed."
+Session.CookieMaxAge=0
+
+# Specifies a domain attribute to set in the session cookie.
+Session.CookieDomain=
 
 
-# Specifies path to set in the session cookie. Defaults to /.
+# Specifies a path attribute to set in the session cookie. Defaults to /.
 Session.CookiePath=/
 Session.CookiePath=/
 
 
 # Probability that the garbage collection starts.
 # Probability that the garbage collection starts.
 # If 100 specified, the GC of sessions starts at the rate of once per 100
 # If 100 specified, the GC of sessions starts at the rate of once per 100
 # accesses. If 0 specified, the GC never starts.
 # accesses. If 0 specified, the GC never starts.
-Session.GcProbability=100
+Session.GcProbability=100000
 
 
 # Specifies the number of seconds after which session data will be seen as
 # Specifies the number of seconds after which session data will be seen as
 # 'garbage' and potentially cleaned up.
 # 'garbage' and potentially cleaned up.
@@ -117,26 +132,23 @@ Session.Secret=0I3EINu8nxl1hMu0dVDdDpIvbT2zKs
 Session.CsrfProtectionKey=_csrfId
 Session.CsrfProtectionKey=_csrfId
 
 
 ##
 ##
-## MPM Thread section
+## MPM thread section
 ##
 ##
 
 
 # Number of application server processes to be started.
 # Number of application server processes to be started.
 MPM.thread.MaxAppServers=
 MPM.thread.MaxAppServers=
 
 
 # Maximum number of action threads allowed to start simultaneously
 # Maximum number of action threads allowed to start simultaneously
-# per server process.
+# per server process. Set max_connections parameter of the DBMS
+# to (MaxAppServers * MaxThreadsPerAppServer) or more.
 MPM.thread.MaxThreadsPerAppServer=100
 MPM.thread.MaxThreadsPerAppServer=100
 
 
 ##
 ##
-## MPM Hybrid section
+## MPM epoll section
 ##
 ##
 
 
 # Number of application server processes to be started.
 # Number of application server processes to be started.
-MPM.hybrid.MaxAppServers=
-
-# Maximum number of worker threads allowed to start simultaneously
-# per server process.
-MPM.hybrid.MaxWorkersPerAppServer=100
+MPM.epoll.MaxAppServers=
 
 
 ##
 ##
 ## SystemLog settings
 ## SystemLog settings
@@ -201,6 +213,9 @@ ActionMailer.smtp.HostName=
 # Specify the connection's port number.
 # Specify the connection's port number.
 ActionMailer.smtp.Port=
 ActionMailer.smtp.Port=
 
 
+# Enables STARTTLS extension if true.
+ActionMailer.smtp.EnableSTARTTLS=false
+
 # Enables SMTP authentication if true; disables SMTP
 # Enables SMTP authentication if true; disables SMTP
 # authentication if false.
 # authentication if false.
 ActionMailer.smtp.Authentication=false
 ActionMailer.smtp.Authentication=false
@@ -217,7 +232,26 @@ ActionMailer.smtp.DelayedDelivery=false
 
 
 ##
 ##
 ## ActionMailer Sendmail section
 ## ActionMailer Sendmail section
-## 
+##
 
 
 #ActionMailer.sendMail.CommandLocation=/usr/sbin/sendmail
 #ActionMailer.sendMail.CommandLocation=/usr/sbin/sendmail
 
 
+##
+## Cache section
+##
+
+# Specify the settings file to enable the cache module.
+# Comment out the following line.
+#Cache.SettingsFile=cache.ini
+
+# Specify the cache backend, such as 'sqlite', 'mongodb'
+# or 'redis'.
+Cache.Backend=sqlite
+
+# Probability of starting garbage collection (GC) for cache.
+# If 100 is specified, GC will be started at a rate of once per 100
+# sets. If 0 is specified, the GC never starts.
+Cache.GcProbability=100
+
+# If true, enable LZ4 compression when storing data.
+Cache.EnableCompression=true

+ 1 - 1
frameworks/C++/treefrog/controllers/controllers.pro

@@ -1,6 +1,6 @@
 TARGET = controller
 TARGET = controller
 TEMPLATE = lib
 TEMPLATE = lib
-CONFIG += shared x86_64 c++11
+CONFIG += shared x86_64 c++14
 QT += network sql xml qml
 QT += network sql xml qml
 QT -= gui
 QT -= gui
 DEFINES += TF_DLL
 DEFINES += TF_DLL

+ 1 - 1
frameworks/C++/treefrog/helpers/helpers.pro

@@ -1,6 +1,6 @@
 TARGET = helper
 TARGET = helper
 TEMPLATE = lib
 TEMPLATE = lib
-CONFIG += shared x86_64 c++11
+CONFIG += shared x86_64 c++14
 QT  -= gui
 QT  -= gui
 QT  += qml
 QT  += qml
 DEFINES += TF_DLL
 DEFINES += TF_DLL

+ 1 - 1
frameworks/C++/treefrog/models/models.pro

@@ -1,6 +1,6 @@
 TARGET = model
 TARGET = model
 TEMPLATE = lib
 TEMPLATE = lib
-CONFIG += shared x86_64 c++11
+CONFIG += shared x86_64 c++14
 QT += sql qml
 QT += sql qml
 QT -= gui
 QT -= gui
 DEFINES += TF_DLL
 DEFINES += TF_DLL

+ 9 - 7
frameworks/C++/treefrog/treefrog-hybrid.dockerfile → frameworks/C++/treefrog/treefrog-epoll.dockerfile

@@ -1,14 +1,15 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
-RUN apt update -yqq && apt install -yqq software-properties-common unzip cmake
+ENV DEBIAN_FRONTEND noninteractive
+ENV TFVER=1.27.0
 
 
-ENV TFVER=1.24.0
-
-RUN apt install -yqq g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
+RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
+    software-properties-common unzip cmake g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
 
 
+WORKDIR /usr/src
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN cd treefrog-framework-${TFVER} && \
 RUN cd treefrog-framework-${TFVER} && \
@@ -20,10 +21,11 @@ RUN cd treefrog-framework-${TFVER} && \
     make -j4 && \
     make -j4 && \
     make install
     make install
 
 
+WORKDIR /workspace
 COPY ./ ./
 COPY ./ ./
 
 
 RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
-RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=hybrid|g' config/application.ini
+RUN sed -i 's|MultiProcessingModule=.*|MultiProcessingModule=epoll|g' config/application.ini
 
 
 # 1. Generate Makefile
 # 1. Generate Makefile
 RUN qmake -r CONFIG+=release
 RUN qmake -r CONFIG+=release
@@ -32,4 +34,4 @@ RUN qmake -r CONFIG+=release
 RUN make
 RUN make
 
 
 # 3. Start TreeFrog
 # 3. Start TreeFrog
-CMD treefrog /
+CMD treefrog /workspace

+ 8 - 6
frameworks/C++/treefrog/treefrog-mongodb.dockerfile

@@ -1,14 +1,15 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
-RUN apt update -yqq && apt install -yqq software-properties-common unzip cmake
+ENV DEBIAN_FRONTEND noninteractive
+ENV TFVER=1.27.0
 
 
-ENV TFVER=1.24.0
-
-RUN apt install -yqq g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
+RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
+    software-properties-common unzip cmake g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
 
 
+WORKDIR /usr/src
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN cd treefrog-framework-${TFVER} && \
 RUN cd treefrog-framework-${TFVER} && \
@@ -20,6 +21,7 @@ RUN cd treefrog-framework-${TFVER} && \
     make -j4 && \
     make -j4 && \
     make install
     make install
 
 
+WORKDIR /workspace
 COPY ./ ./
 COPY ./ ./
 
 
 RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
@@ -32,4 +34,4 @@ RUN qmake -r CONFIG+=release
 RUN make
 RUN make
 
 
 # 3. Start TreeFrog
 # 3. Start TreeFrog
-CMD treefrog /
+CMD treefrog /workspace

+ 8 - 6
frameworks/C++/treefrog/treefrog-postgres.dockerfile

@@ -1,14 +1,15 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
-RUN apt update -yqq && apt install -yqq software-properties-common unzip cmake
+ENV DEBIAN_FRONTEND noninteractive
+ENV TFVER=1.27.0
 
 
-ENV TFVER=1.24.0
-
-RUN apt install -yqq g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
+RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
+    software-properties-common unzip cmake g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
 
 
+WORKDIR /usr/src
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN cd treefrog-framework-${TFVER} && \
 RUN cd treefrog-framework-${TFVER} && \
@@ -20,6 +21,7 @@ RUN cd treefrog-framework-${TFVER} && \
     make -j4 && \
     make -j4 && \
     make install
     make install
 
 
+WORKDIR /workspace
 COPY ./ ./
 COPY ./ ./
 
 
 RUN sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
 RUN sed -i 's|DriverType=.*|DriverType=QPSQL|g' config/database.ini
@@ -32,4 +34,4 @@ RUN qmake -r CONFIG+=release
 RUN make
 RUN make
 
 
 # 3. Start TreeFrog
 # 3. Start TreeFrog
-CMD treefrog /
+CMD treefrog /workspace

+ 8 - 6
frameworks/C++/treefrog/treefrog.dockerfile

@@ -1,14 +1,15 @@
-FROM buildpack-deps:xenial
+FROM buildpack-deps:bionic
 
 
-RUN apt update -yqq && apt install -yqq software-properties-common unzip cmake
+ENV DEBIAN_FRONTEND noninteractive
+ENV TFVER=1.27.0
 
 
-ENV TFVER=1.24.0
-
-RUN apt install -yqq g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
+RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
+    software-properties-common unzip cmake g++ gcc libjemalloc-dev qt5-qmake qt5-default qtbase5-dev \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtbase5-dev-tools libqt5sql5 libqt5sql5-mysql libqt5sql5-psql libqt5qml5 libqt5xml5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     qtdeclarative5-dev libqt5quick5 libqt5quickparticles5 libqt5gui5 libqt5printsupport5 \
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
     libqt5widgets5 libqt5opengl5-dev libqt5quicktest5
 
 
+WORKDIR /usr/src
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN wget -q https://github.com/treefrogframework/treefrog-framework/archive/v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN tar xf v${TFVER}.tar.gz
 RUN cd treefrog-framework-${TFVER} && \
 RUN cd treefrog-framework-${TFVER} && \
@@ -20,6 +21,7 @@ RUN cd treefrog-framework-${TFVER} && \
     make -j4 && \
     make -j4 && \
     make install
     make install
 
 
+WORKDIR /workspace
 COPY ./ ./
 COPY ./ ./
 
 
 RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
 RUN sed -i 's|DriverType=.*|DriverType=QMYSQL|g' config/database.ini
@@ -32,4 +34,4 @@ RUN qmake -r CONFIG+=release
 RUN make
 RUN make
 
 
 # 3. Start TreeFrog
 # 3. Start TreeFrog
-CMD treefrog /
+CMD treefrog /workspace

+ 1 - 1
frameworks/C++/treefrog/views/_src/_src.pro

@@ -1,6 +1,6 @@
 TARGET = view
 TARGET = view
 TEMPLATE = lib
 TEMPLATE = lib
-CONFIG += shared x86_64 c++11
+CONFIG += shared x86_64 c++14
 QT += network xml qml
 QT += network xml qml
 QT -= gui
 QT -= gui
 DEFINES += TF_DLL
 DEFINES += TF_DLL