Re: [Cppcms-users] Migration Guide
Brought to you by:
artyom-beilis
From: Markus R. <us...@ma...> - 2012-03-04 18:04:11
|
Hi! Artyom Beilis wrote: >> From: Markus Raab <mai...@ma...> > >> To: cpp...@li... >> Cc: > > First of all please register this e-mail to the mailing > list so I would not have to moderate it. Sorry, the post was from a wrong e-mail address. >> I started a migration guide from 0.x to 1.x. It is basically a step by >> step what I needed to do to port my 0.x application: >> http://cppcms.com/wikipp/en/page/cppcms_1x_migration >> > > First of all I'm quite surprised that there are still 0.0.8 users > around. Almost all CppCMS users actually develop using CppCMS 1.x.x > version even during its beta. Yeah, I was also using CppCMS 1.x.x for some time now. But I had some legacy code which needed to be ported to 1.x. I am sure, however, I am not the only one in this situation, so I finished the article: http://cppcms.com/wikipp/en/page/cppcms_1x_migration CppCMS 1.x is vastly superior to 0.x - I realized that again during porting ;) >> The guide (and the porting) is not yet finished, I have some preliminary >> questions: >> >> For settings() it seems like that a const is missing. I could not find a >> page about the accessing of the configuration in the wiki, so maybe I am >> missing something. >> > > Settings returns cppcms::json::value object. > > Read: > > http://cppcms.com/wikipp/en/page/cppcms_1x_json > http://cppcms.com/cppcms_ref/latest/namespacecppcms_1_1json.html > > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1json_1_1value.html I am not very fond of json as configuration format - even though it is very good as data exchange format - because it lacks comments. What do you think about a patch which let you switch to http://www.libelektra.org/ at compiletime if preferred? Basically it would be just an alternative implementation of json::value service::load_settings(int argc,char *argv[]) What do you think? >> Btw. it would be nice to have a full text search somewhere in the wiki, >> because the navigation is far from perfect - there are not many links >> interconnecting the pages. >> > > I know... It is the question of time (which I don't have too much) > and priorities > > Meanwhile google has very good index for the web site, including reference > documentation. Ok. >> Is it a bug that on some browsers (firefox, chrome) the source code of >> wikipp has two spaces at the end of the line when being copied? In >> konqueror no spaces are appended. > > I don't understand the question, you mean extra spaces when you press on > "view plain" ? Steps to reproduce: Go to http://cppcms.com/wikipp/en/page/cppcms_1x_json with firefox/chrome Select some text of a sourcecode, press ctrl+c and ctrl+v or middle mouse. I get: my_object["name"]="Moshe"; my_object["salary"]=1000.0; (Note the two spaces at the end of each line) I expect: No spaces at the end of lines. It seems to be some problem within the syntax highlighter, which generates a "<span>; </span>" that adds these two spaces. It is a little bit strange, because the line numbers are suppressed successfully. Workaround: Press "view plain" and copy there. >> What is the replacement from the previous env->getQueryString(); and >> cgicc::CgiEnvironment? Maybe some tutorial page how to access this >> information directly would be nice. >> > > You should use cppcms::http::request. > > http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html > > > Fir example env->getQueryString() goes to request().query_string() > > CppCMS 1.0.0 does not use CgiCC any more (CgiCC allows to start CppCMS > easily but it wasn't really good library in long term). Yeah, the decision to drop CgiCC is ok, cppcms is now more homogen and easier to use. best regards Markus Raab |