Friday, 2011-07-29

*** Joins: roentgen (~arthur@openvpn/community/support/roentgen)01:44
*** Joins: soustruh (~Miranda@ip-86-49-121-75.net.upcbroadband.cz)01:55
*** Quits: roentgen (~arthur@openvpn/community/support/roentgen) (Ping timeout: 260 seconds)01:58
*** Joins: kirillka (~Miranda@195.242.142.17)02:04
*** Joins: roentgen (~arthur@openvpn/community/support/roentgen)02:11
*** Joins: Cupertino (~Cupez@62-177-158-122.dsl.bbeyond.nl)02:29
*** Quits: Cupertino (~Cupez@62-177-158-122.dsl.bbeyond.nl) (Changing host)02:29
*** Joins: Cupertino (~Cupez@unaffiliated/cupertino)02:29
*** Quits: Cupertino (~Cupez@unaffiliated/cupertino) (Client Quit)02:34
*** Quits: Cesare (~Adium@creati59.lnk.telstra.net) (Quit: Leaving.)02:36
*** Joins: asm89 (~asm89@unaffiliated/asm89)03:00
*** Quits: thraxisp (~thraxisp@24-246-24-251.cable.teksavvy.com) (Read error: Connection reset by peer)03:08
*** Joins: thraxisp (~thraxisp@24-246-24-251.cable.teksavvy.com)03:09
*** Joins: cerf (~quassel@mcl71-3-78-241-52-239.fbx.proxad.net)03:15
*** Joins: dregad_ (534c8bab@gateway/web/freenode/ip.83.76.139.171)03:42
dregadjreese: thanks for adding the changeset, that's what I intended to do. Should have thought about commit vs signoff date :-o03:49
*** Quits: roentgen (~arthur@openvpn/community/support/roentgen) (Remote host closed the connection)03:50
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)03:57
*** Joins: Paul_ (~IceChat09@2001:470:9310:aaaa:71f4:1d42:9e2a:884a)04:34
* Paul_ yawns04:48
*** Quits: dregad (~dregad@wwwgate1.merck.de) (Quit: I Quit)04:56
*** Quits: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl) (Read error: Connection reset by peer)05:07
* dregad_ throws a bucket of water at Paul05:13
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)05:13
dregad_Paul: looks like your cron job for the chat logs is still not running as it should05:16
*** Quits: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl) (Read error: Connection reset by peer)05:19
Paul_wtf05:19
Paul_I need dhx :(05:19
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)05:19
Paul_.05:20
asm89dhx1: ping05:20
asm89will it work?05:20
asm89:p05:20
Paul_*/5 * * * *05:20
Paul_that is every 5 minutes05:20
Paul_not every 5 days right? :P05:20
asm89i believe it is05:21
asm89ah wait05:21
asm89isn't that 05 over?05:21
asm89no05:21
asm89Paul_: what does the full line look like?05:22
asm89and where did you put it?05:22
Paul_scribe@mantisforge:~$ crontab -l05:23
Paul_# m h  dom mon dow   command05:23
Paul_@reboot /home/scribe/scribe/run05:23
Paul_*/5 * * * * /home/scribe/irclog2html-2.9.2/src/irclog2html/logs2html.py /home/scribe/irclogs05:23
Paul_line works fine if run manually :P05:24
asm89ok05:24
asm89i believe you can't have a . in you scripts name05:24
asm89i'm not making this up05:24
Paul_it used to work :P05:25
Paul_but ok05:25
asm89that's just what i know..05:26
asm89Paul_: and?05:37
dregad_asm89: where did you get that about "." in script name ? first I hear about it05:37
dregad_even in the manpage for crontab(5) they give an example command like $HOME/bin/daily.job05:38
asm89dregad_: http://www.reddit.com/r/raldi/comments/i8z20/frustrating_unix_pitfall_of_the_day_esoteric_cron/05:40
dregad_Paul_: */5 * * * * is indeed every 5 minutes in my book05:40
Paul_nod05:42
dregad_asm89: nice one, thanks for the info05:44
dregad_Paul_: so can you rename the script (or create an alias) without a . ?05:44
asm89dregad_: one to never forget i guess :P05:44
asm89if the script contains the right shebang, it shouldn't need the .py05:45
dregad_according to man run-parts "the names must consist entirely of ASCII upper- and lower-case letters, ASCII digits, ASCII underscores and ASCII minus-hyphens05:45
asm89yes05:46
dhx1asm89: hi05:46
dhx1Paul_: hi05:46
* dregad_ waves at dave05:47
asm89hi dhx1 :)05:48
Paul_dhx1!!!!!!!!!!!!!!!05:48
dhx1dregad_: hi :)05:48
dhx1I get a sense that many questions follow... :)05:48
Paul_how do I use github?05:49
dhx1haha05:49
Paul_$query = 'SELECT user_id FROM {bug_monitor} WHERE bug_id = ' . db_param();05:49
Paul_so much tidier!05:49
Paul_I dont like db_param() now though ;/05:50
Paul_$query = 'SELECT user_id FROM {bug_monitor} WHERE bug_id = %d'05:50
Paul_would look much nicer05:50
dregad_agreed05:50
Paul_[I put %d as opposed to $, so we get some scope for checking for binary crap/db stuff later on]05:51
Paul_[as db_param atm just does echo $]05:51
Paul_effectively, that would be implemented as:05:51
Paul_return $sql = strtr( $sql, array( '%s' => '$', '%d' => '$', '%b' => '$', '%wtfyoucallboolifbisbinary' => '$');05:52
dhx1noooo05:54
dhx1use PDO... no db_param() :)05:54
Paul_that means we can only use $05:55
dhx1right05:55
Paul_as iirc, some db's dont support named params05:55
Paul_in pdo05:55
Paul_and if we use $05:55
Paul_and end up having to do something for specific (binary) data05:55
dhx1I'd prefer the PDO approach where you create a query object then assign parameters one by one (each per line)05:55
dhx1specifying the data type as you go05:56
Paul_i'm thinking when we find we need to do something like:05:56
Paul_$stmt->bindParam(1, $return_value, PDO::PARAM_STR, 4000);05:56
Paul_if we had a set of %s's etc, you could work that out in the driver05:57
dhx1ah sorry, I see where you're going05:57
Paul_http://msdn.microsoft.com/en-US/library/ff754357(v=SQL.90).aspx05:57
Paul_e.g. they do:05:58
Paul_$tsql = "INSERT INTO Production.ProductPhoto (LargePhoto)05:58
Paul_ VALUES (?)";05:58
dhx1or even just $ourDBObject->bindString('name_of_parameter', $value)05:58
Paul_$uploadPic->bindParam(1,05:58
Paul_  $fileStream,05:58
Paul_  PDO::PARAM_LOB,05:58
Paul_  0,05:58
Paul_  PDO::SQLSRV_ENCODING_BINARY);05:58
Paul_but when doing strings just do:05:58
Paul_$associateIds->execute(array($photoID, $_POST['productid']));05:58
Paul_so we'd hope that %X would always become $05:59
Paul_until we find a $ that doesn't work :P05:59
Paul_but then it's down to someone to work out within query execute function how to handle %X/$ with that db06:00
dhx1yeah I quite like that approach06:00
dhx1assuming the string replacement is cheap (processing wise)06:00
Paul_i'm glad you like {config}06:00
Paul_can't see it being any more expensive then calling db_param 5 times to return $ and concatenate the string06:00
Paul_benchmark time!06:00
dhx1we can cheat a little bit too:06:00
Paul_I dont care as long as you like {config} :P06:01
dhx1$query = 'SELECT user_id FROM bug_monitor WHERE bug_id = %d'06:01
dhx1then search for "FROM " and replace it with "FROM " . config_get( 'db_prefix') . "_"06:02
dhx1probably needs preg_replace which is likely expensive06:02
dhx1but just as expensive as {}06:02
Paul_remember you can have {bug_monitor}.user_id06:02
dhx1unless we guarantee those characters are only used for table names06:02
Paul_and i'm assuming that { and } are safe as you aren't really going to have06:03
Paul_select user from plugin_{}!££$_table06:03
dhx1in which case { is always replaced with the db prefix, } with the suffix06:03
dhx1although saying this... do we really need to have prefix/suffix support?06:04
dhx1I think if people want to use it, they can pay for it (preg_replace)06:04
dhx1because I just don't see it being useful in 2011 anymore06:04
dhx1it's cheap and easy to get a VPS where you can create as many databases as you want06:05
dhx1*and* it's more secure, robust, easy to manage, etc06:05
Paul_i'd say yes, keep06:05
dhx1robust = no accidental data collisions, etc06:05
Paul_{config} is shorter then mantis_config_table anyway06:05
Paul_:P06:05
dhx1I'd still be happier with optional preg_replace instead of {}06:05
dhx1agreed we should remove mantis_ and _table... I have already done that in 1.3.x06:06
dhx1in the db_get_table function06:06
Paul_well, probably doesn't matter, I implemented the { } stuff already06:06
Paul_so can always find/replace for {config} to whatever we use06:06
dhx1I'm just worried that someone may want to write a query along the lines of:06:06
dhx1$query = 'SELECT user_id FROM bug_monitor WHERE bug_id = %d AND something = "{value}"'06:07
dhx1ie. where {,} characters are hardcoded into the query06:07
Paul_no because they should be using pdo params....06:07
dhx1not for hardcoded stuff they don't need to06:07
Paul_for {value}06:07
dhx1{value} in that case is a string, hardcoded... not taken from any PHP variables06:07
Paul_strtr( $sql, array( '%s' => '$', '%d' => '$', '%b' => '$','%t' => '$'));06:10
Paul_100,000 runs of that take 0.1seconds06:10
dhx1:)06:11
dhx1well we need to do more than that06:11
dhx1record the data types and their position in the string?06:12
Paul_nope06:12
Paul_as we'd hope we dont need to06:12
dhx1don't you want to be able to ->bindParam($value)06:12
dhx1and not specify the data type (because that is specified in the query string)06:12
Paul_basically I want mantis to do:06:13
Paul_db_query_bound( "insert into {files} VALUES( %d, %b )", array( $id, $binary));06:13
Paul_which we translate to06:13
Paul_pdo->prepare( "insert into mantis_file_table VALUES( $,$ )" ;06:14
Paul_pdo->execute( $stmt, array( $id, $binary);06:14
Paul_but we have the option if oracle/sqlite/mysql can't copy with %b06:14
Paul_to bind params within the driver06:14
dhx1hmmm not convinced on passing an array of values06:14
dhx1gets ugly when you have 5 or more values06:15
dhx1working out the order, etc06:15
Paul_i'm hoping that we never need to though :)06:15
dhx1we will, for instance, adding a new bug report06:16
dhx1that will populate 10+ columns in a single go06:16
Paul_the problem there remember is06:16
Paul_if the PDO statement is06:16
Paul_INSERT INTO TABLE VALUES ( $, $ )06:16
Paul_INSERT INTO TABLE VALUES ( ?, ? )06:17
Paul_even06:17
Paul_your then doing06:17
Paul_$stmt->bindParam(1, $name);06:17
Paul_$stmt->bindParam(2, $value);06:17
Paul_in the code06:17
Paul_which seems as messy as passing an array06:17
dhx1you could do: $stmt->bindParam(':parameter_name', $value)06:18
dhx1which makes it clearer which value is assigned to which parameter06:18
dhx1also potentially easier for query building06:18
Paul_yea, although iirc, some of the pdo drivers dont support named params06:18
dhx1where you don't know all the parameters up front06:19
dhx1:o06:19
dhx1no comment at http://www.php.net/manual/en/pdostatement.bindparam.php indicates that06:19
Paul_I just googled and hit http://sebsauvage.net/wiki/doku.php?id=php:pdo_sqlite_named_parameters_bug_workaround06:20
*** Quits: dregad_ (534c8bab@gateway/web/freenode/ip.83.76.139.171) ()06:20
dhx1seems to be linking to: http://pecl.php.net/bugs/bug.php?id=756006:21
dhx1which is irrelevant to us?06:21
dhx1and we could do our own string replacement in the SQLite driver too06:22
dhx1(if a workaround is needed)06:22
Paul_tbh, I think i'm more interested in describing the data type06:25
Paul_rather then the name06:25
Paul_or well06:25
Paul_you can't do06:25
Paul_select * from user where id = :user and id = :user [consider if that's an ested query]06:26
*** Joins: giallu (~giallu@host14-118-dynamic.252-95-r.retail.telecomitalia.it)06:26
*** Quits: giallu (~giallu@host14-118-dynamic.252-95-r.retail.telecomitalia.it) (Changing host)06:26
*** Joins: giallu (~giallu@fedora/giallu)06:26
*** Quits: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl) (Read error: Connection reset by peer)06:26
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)06:27
dhx1no, you'd have to rename parameters anyway06:29
dhx1:user_id, :user1, :user2, etc06:29
*** lukosanthropos is now known as Lukosanthropos06:29
*** Quits: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl) (Read error: Connection reset by peer)06:29
dhx1not too hard to do if you're building a query based on an unknown number of users to match06:29
dhx1just have a counter in the loop06:29
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)06:29
Paul_ew, but yea06:30
dhx1saying that, I think the hardest part will be ensuring that built queries can be translated into other DB SQL formats as needed06:30
Paul_thats why I kinda like the idea of %s etc06:30
Paul_as you effectively in some form get a type06:31
dhx1if we're appending " OR user = :user_1" over and over... but a certain database types needs a different syntax06:31
dhx1yeah on the basis of what I just said about translating queries, I can see the argument for not naming parameters06:31
Paul_i.e. we'd effectively need to do:06:31
dhx1otherwise it'd be impossible/too hard to translate those06:31
Paul_$db->prepare( "select * from :name);06:31
Paul_$db->bind( ":name", DBTYPE_STRING, $value);06:31
Paul_$db->execute06:32
Paul_or more maybe makg the type optional but06:32
dhx1not disagreeing on table names06:32
asm89still no dbal? :P06:32
dhx1asm89: couldn't see how it helps us...?06:32
asm89i know i know, just teasing ;P06:32
dhx1haha06:33
asm89mantis supports some exotic databases right?06:33
Paul_not really :)06:33
Paul_I suspect we'll move more to supporting mysql, pgsql,mssql and add sqlite, and probably drop db2/oracle06:34
Paul_[and let someone else add db2/oracle]06:34
asm89;P06:34
asm89i thought that the exotic database support in mantis was the reason not to use a dbal06:35
Paul_i'd say not exactly06:35
Paul_more a case that06:35
Paul_if you go off and find some that support those db's06:35
Paul_then support schema generation and modification06:35
Paul_then support converting a column from an int to a bool06:35
Paul_for example06:35
Paul_you suddenly find it becomes a very short list06:36
asm89maybe06:36
Paul_even from what I've read on pdo06:36
Paul_it seems to have it's own quirks06:36
asm89but there might still be interesting things on the list? :)06:37
Paul_I looked at doctrine realy early on06:37
asm89and it's probably beneficial for mantis AND the choosen project06:37
asm89:)06:37
Paul_and zend's stuff06:37
Paul_lsmith was involved in doctrine iirc06:37
asm89yes06:38
asm89you know him?06:38
Paul_only from fact I used to hang around #php's irc channel on efnet06:38
asm89ah ok06:39
asm89doctrine dbal is quite nice imo06:39
Paul_iirc, doctrine was a gsoc project a couple of years back06:39
asm89i don't know, and was that 1.x or 2?06:42
Paul_dunno06:44
Paul_:)06:44
asm89but doctrine dbal handles the schema abstraction, type conversion etc06:44
*** Quits: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl) (Read error: Connection reset by peer)06:44
asm89and that's what you need?06:44
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)06:44
Paul_it's more whether it handles converting existing stuff06:44
Paul_all the way through so for example06:44
Paul_lets say originally in mantis06:44
Paul_there was a column of type int06:44
Paul_with an index on it06:44
Paul_where the int value is either 0 or 106:45
Paul_and that's now been changed to a boolean06:45
Paul_mysql for example will happily change that06:45
Paul_mssql will change that if you drop/create the index06:45
asm89ah, migrations?06:45
Paul_and postgres will change that if you update the table format whilst doing USING (cast to bool)06:45
Paul_or whatever06:45
asm89i'm not sure how it handles that, but i believe there quite ok support for it06:46
asm89but let's say that it doesn't06:46
asm89isn't the schema abstraction convenient anyway?06:46
asm89yes, you'd still have to be careful when changing the schema between version upgrades, but that will always be the case06:47
asm89:)06:47
Paul_what I kinda found with adodb was06:47
Paul_for what could be simple aka as dhx says "pdo is nice"06:47
Paul_you end up with a big framework [which is fine]06:47
Paul_then you find out you find a specific change you want to do that not all db's like [post doing a release]06:47
Paul_that's fine, you work around it within the big framework06:48
Paul_at which point, people then complain that it breaks package on linux for that framework06:48
asm89hm06:48
Paul_so you get messing around06:48
Paul_:)06:48
asm89i think the whole point of using something like doctrine dbal is that it handles stuff like that06:49
asm89if it doesn't work, someone will fix it in the dbal, or you get to fix it and send a patch :)06:49
asm89which benefits other projects too06:49
Paul_the other thing is we've probably learnt - but it depends how you do it06:49
Paul_for example06:49
Paul_take my bool -> int example06:50
Paul_method one: ALTER SQL COLUMN bool->int06:50
Paul_method two:06:50
Paul_add column06:50
Paul_copy data to new column in php06:50
Paul_drop index on old column06:50
Paul_drop old column06:50
Paul_add index on new column06:50
asm89yes06:51
Paul_in the case of A, your probably gonna get db specific issues06:51
Paul_in the case of B, you've got major db work going on to implement a one line 2second change ;p06:51
asm89there is also doctrine migrations06:52
asm89which i believe handles part of that06:52
asm89and the part that doesn't that could be contributed / made with the other devs? :)06:52
dhx1Paul_: interesting, which database doesn't support ALTER?06:53
Paul_not doesn't support06:54
Paul_but pgsql used to require one to do a USING clause to convert from bool to int06:54
asm89but does other things when int -> bool06:54
dhx1I guess we could use query translations with one->many queries06:54
Paul_and remember06:54
Paul_it's a legacy problem really06:54
*** Joins: pcperini (~pcperini@c-67-186-56-61.hsd1.pa.comcast.net)06:54
dhx1no need to worry about legacy so much06:55
Paul_sure06:55
Paul_but you need to allow people to upate06:55
Paul_you could do06:55
pcperinihey, i'm trying to install mantis, and i put in the wrong hostname (typo), and now it's angrily cacheing it. i can't get the install process to change the hostname at all.06:55
Paul_database_schema2_Version = 106:55
Paul_and make it go from 185 to 1 :)06:55
asm89?06:55
dhx1I'd like to try and write the queries in SQL:2008 and if that isn't supported for a particular backend, we translate that query in a similar way we handle languages06:55
dhx1that does mean plugins, core, etc have to have knowledge of the different database types supported06:56
dhx1but at least it's easy to see what has been developed/tested and what hasn't06:56
Paul_tbh, as most of our stuff is simple06:56
Paul_with some oddities06:56
dhx1yep06:56
dhx1it's more of an issue with creating, altering tables06:57
Paul_yea06:57
dhx1and doing fancier stuff that I want to try down the track like CHECK constraints, handling database permissions, etc06:57
asm89hm06:57
dhx1referential integrity06:57
Paul_GL!06:57
asm89i still didn't hear any reasons _not_ to use a dbal ;)06:57
Paul_asm89: we've kinda got one06:57
dhx1asm89: that same argument could lead us to use almost anything :P06:57
Paul_it's more a case of whether we use our own one06:58
Paul_and try to keep a simple layer06:58
asm89ah ok06:58
Paul_also06:58
Paul_some people like06:58
* jreese hates most ORM for record06:58
Paul_$query->select('userid')->from('table')->where(userid, 10);06:58
dhx1asm89: DBALs need to be complex as they have to generically rewrite queries06:58
Paul_others like db_query( select * from foo);06:58
asm89ORM != DBAL06:58
dhx1asm89: whereas the approach I was advocating is essentially one where we translate non-conforming queries by hand06:59
dhx1jreese: hi :)06:59
jreeseI know, just staing my position :)06:59
jreesehi06:59
dhx1jreese: and agreed :P06:59
dhx1yep, DBAL = ADOdb, ORM = .... run07:00
asm89i think it would benefit mantis + the other project = open source php land as a whole, if mantis would use an 'external' dbal :)07:00
jreesedhx1: I would highly reccomend against anything that requires plugins to have to deal with multiple database targets07:00
asm89jreese: why?07:00
asm89ah07:00
dhx1jreese: it's necessary... plugins need to be tested against multiple targets anyway07:00
asm89like that07:00
jreesedhx1: my point is that ideally they shouldn't07:01
dhx1jreese: ideally everyone would use SQL:2008 syntax... :)07:01
Paul_[thats kinda why we've got to point of only using ints, strings and binary in the database ;p]07:01
jreesedhx1: my point is that I don't want plugins to have to check what database type is being used every time they want to make a query07:02
pcperiniok… well, i got that, but i'm trying to create a new user and the "verification code image" is a broken image...07:02
dhx1if we go down the DBAL route again (an ADOdb replacement that is supported) then I agree with your choice07:02
dhx1jreese: oh no, they won't... they'll assume that the database adheres to SQL:200807:03
jreesepcperini: I assume your problem is actually with your browser07:03
* Paul_ wonders what sql:2008 is07:03
pcperinijreese: i'll try another one07:03
jreesepcperini: you might want to try restarting your browser and/or clearing its cache07:03
Paul_or gd2 not compiled/enbled in php07:03
pcperinijreese: m'k07:03
Paul_so07:04
dhx1jreese: and where the database backends don't adhere (easily noticed during testing of the plugin) the plugin author would open up a file similar to strings_english.txt and rewrite the offending query to work on a particular database type07:04
Paul_select * from {config} where id=%d07:04
pcperinijreese: no good. i jumped on another browser, and it's still a broken jpg07:04
dhx1jreese: hence it's transparent to the PHP code in the core of the plugin07:04
jreese< dhx1> that does mean plugins, core, etc have to have knowledge of the different database types supported07:04
Paul_pcperini: gd2 enabled in php?07:04
pcperiniPaul_: maybe? where would i check?07:04
Paul_dhx: do we have a check for that?07:05
dhx1jreese: for complex queries and crap database servers, yes07:05
asm89nah07:05
asm89ah dbal can handle creating etc07:05
asm89i agree with Paul_ that schema transitions are tricky07:05
Paul_so anyone against select * from {config} where id=%d over db_param? :P07:05
dhx1Paul_: SQL:2008 is the latest standard on SQL features, syntax, etc07:06
asm89but creating etc not07:06
dhx1Paul_: potentially...07:06
Paul_CREATE table = easy07:06
Paul_select = easy07:06
Paul_ALTER = more challenging07:06
asm89yes07:06
dhx1Paul_: the issue arrising in complex queries where one database backend doesn't need to use all the parameters provided to it07:07
Paul_in an ideal world07:07
Paul_you never need to alter07:07
Paul_as erm07:07
Paul_you'd get your column types correct to begin with ;p07:07
asm89Paul_: and the ALTER things that are tricky and are not supported, if you're gonna code something up for that anyway, why not in a dbal/migrations project ? :)07:07
dhx1Paul_: creating tables is hard when you factor in more advanced things like primary keys, foreign keys, check constraints, etc07:07
dhx1Paul_: almost every database backend implements something differently07:08
asm89that's why you don't want to do that yourselves07:08
Paul_no that's why you do!07:08
Paul_:)07:08
Paul_to be fair07:08
Paul_with mantis using pretty much either07:09
Paul_a) int07:09
Paul_b) string07:09
Paul_c) binary07:09
* jreese votes to ban any discussion regarding databases07:09
Paul_and in case of b - most db's now effectively implementing varchar(max)07:09
Paul_i.e. we'll work out the size stuff internally for you07:09
asm89ok07:09
Paul_i.e. we tend not to use char(20)07:10
Paul_or boolean07:10
Paul_or07:10
asm89mantis dev team just doesn't trust other projects ;)07:10
Paul_;)07:10
asm89:p07:10
Paul_depends on the project :)07:10
asm89too bad though, i'll try to not repeat it anymore, but i think both mantis + the chosen dbal would benefit :)07:11
Paul_the problem is07:11
Paul_lets say we do a release07:11
Paul_then find out in some circumstance, a version of db needs a different query to do the upgrade07:11
Paul_we then need that fixed in the dbal layer07:11
dhx1asm89: I like the look of the Doctrine project, but like most other PHP database abstraction frameworks, I've yet to see complex queries being demoed07:11
asm89no07:11
dhx1asm89: creating a table with complex primary keys, multiple foreign keys, check constraints, multiple data types, etc07:12
asm89Paul_: that is handled by migrations -> migration != dbal07:12
asm89migrations use the dbal, yes07:12
Paul_there's no code in doctring-migrations thing to deal with specific database drivers07:12
asm89dhx1: i believe the doctrine dbal handles a lot of that quite nicely07:12
dhx1jreese: ignored! :)07:12
jreeseapparently07:12
asm89Paul_: i believe the migrations project is pretty fresh07:13
pcperiniPaul_: i just made sure i had gd2 installed, and it's still not rendering the image. any ideas?07:13
Paul_nmm, try going to the image directly in the browser and see if it's return some error string [under view source]07:14
dhx1pcperini: isn't built into your PHP binary?07:14
pcperiniPaul_: ok07:14
Paul_asm89: nothing specific for alter tables in https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php07:14
pcperiniPaul_: the captcha image is a php file.07:14
pcperini"make_captcha_img.php?public_key=#####"07:15
Paul_i mean go to http://foo/make_captcha_img.php?public_key=####07:15
Paul_and see if it's return an image or php code or text or nothing07:15
pcperiniit's blank07:15
Paul_my first guess would be gd2 isn't there07:16
Paul_I dont think it does anything strnage ;/07:16
Paul_but if it's blank, that's normally php failing - check apache error log07:16
Paul_asm89: so yea, pretty sure07:16
pcperiniPaul_: ok07:17
Paul_we do stuff historically that doctrine wouldn't like amt07:17
dhx1pcperini: you need to turn on PHP error handling to see PHP errors07:17
dhx1pcperini: add the following to config_inc.php:07:17
asm89like what Paul_ ?07:17
Paul_my example from earlier on about changing default values etc07:17
dhx1$g_show_friendly_errors = OFF;07:18
dhx1$g_show_detailed_errors = ON;07:18
dhx1$g_display_errors = array(E_WARNING => 'halt',07:18
dhx1                           E_NOTICE => 'halt',07:18
dhx1                           E_USER_ERROR => 'halt',07:18
dhx1                           E_USER_WARNING => 'halt',07:18
asm89on migrations you mean?07:18
dhx1                           E_USER_NOTICE => 'halt',07:18
dhx1                           E_ALL => 'halt');07:18
Paul_asm89: yes07:18
asm89yes07:18
pcperinidhx1: ok07:18
asm89but i bet they'd like to add it07:19
* asm89 promises not to talk about the ORM ;P07:21
dhx1asm89: it would be very hard for them to support one->many query remapping07:21
asm89an example?07:21
dhx1asm89: maybe not "very hard", more time consuming and complex07:21
asm89i don't get what you mean by that07:21
asm89* brb07:22
Paul_so anyone against select * from {config} where id=%d over db_param? :P07:22
dhx1asm89: if SQL:2008 allows "ALTER ... RENAME INDEX ... blah" (made up example) and this works as a single query on one database server07:23
dhx1but another requires you to do multiple separate queries: DROP INDEX, ADD INDEX07:23
Paul_going.... going...07:23
dhx1perhaps the multiple queries (in another example) aren't standard or aren't supported widely either07:23
dhx1Paul_: not that I've heard07:23
Paul_i've got a better idea07:24
dhx1Paul_: or at least not yet... we haven't started rewriting queries yet to see whether that is adequate in all situations07:24
Paul_asm89: does doctring support SQL:2008?07:24
asm89back07:26
asm89Paul_: i don't know07:30
asm89is there new stuff in there that you really need?07:30
asm89dhx1: that would be something that a migration module should do i guess07:31
asm89$.. = new SchemaMigration; .. $..->renameIndex('..', '..');07:31
asm89then you can do all you want ? :) and make it portable07:31
dhx1yeah07:32
asm89i think that trying to translate queries is possible07:32
asm89but that you probably don't want that07:32
asm89unless you're doing your own query language ;)07:33
Paul_gone!07:35
asm89?07:35
Paul_too late07:35
Paul_it's gone!07:35
asm89i'm not following?07:36
dhx1asm89: he's referring to db_param()07:36
asm89xD07:36
dhx1asm89: a function in the current version of MantisBT07:36
asm89brr07:36
dhx1asm89: hmmm I follow... and DBAL's Schema class seems pretty good for creating tables, etc07:36
asm89dhx1: i'm not bullshitting you :P07:37
asm89i don't want to waste to much of your time :P07:37
pcperinihow does mantis account creation send mail? because i didn't have a mail service set up previously, and don't really need one outside of mantis.07:38
dhx1asm89: not at all, if you were full of it you would have stopped the discussion by now :P07:38
dhx1Paul_: we're using DBAL :p07:38
asm89haha07:38
asm89symfony2 kind of standard ships doctrine dbal, i think that's also a huge +07:39
asm89the fact that a 'big' framework uses it, that is07:39
dhx1asm89: yep that's very important, more than most other factors IMO07:41
dhx1I guess we'd be programmatically creating tables then, as opposed to using raw SQL07:41
asm89i guess07:42
asm89but that's quite nice imo07:42
asm89having objects to work with07:42
asm89:)07:42
dhx1http://troels.arvin.dk/db/rdbms/ is of interest07:44
asm89404?07:44
dhx1not for me?07:45
dhx1http://troels.arvin.dk/db/rdbms/07:45
asm89not in our dns07:45
asm89meh07:45
asm89dhx1: ah nice07:46
Paul_dhx1: have you looked at lithium?07:47
dhx1Paul_: yeah, Daryn has a branch on Github with some sample stuff07:47
dhx1Paul_: I'm not convinced though (at least, not yet)07:48
Paul_we should require php 5.3.607:49
Paul_according to doctrine:07:49
Paul_"Up until PHP 5.3.6 PDO has a security problem when using non ascii compatible charsets. Even if specifying the charset using “SET NAMES”, emulated prepared statements and PDO#quote could not reliably escape values, opening up to potential SQL injections. If you are running PHP 5.3.6 you can solve this issue by passing the driver option “charset” to Doctrine PDO MySQL driver. Using SET NAMES does not suffice!"07:49
asm89lithium?07:49
Paul_related to symfony?07:50
asm89mantis going framework?07:50
Paul_http://lithify.me/07:50
Paul_asm89: probably not :P07:50
asm89i've never heard of it07:51
asm89but i don't like the sound of it07:51
asm89"Lithium is the first and only major PHP framework built from the ground up for PHP 5.3+, and the first to break ground into major new technologies"07:51
asm89..07:51
Paul_I think it's supposed to be a symfony replacement07:52
asm89sf1 that is?07:52
*** Parts: pcperini (~pcperini@c-67-186-56-61.hsd1.pa.comcast.net) ()07:52
Paul_ahh07:52
Paul_no cake07:52
Paul_http://benmilleare.com/li3-lithium-cake3/07:52
asm89ah07:55
asm89mantis going to a framework would be huge :P07:56
asm89template engines and stuff ;)07:56
* asm89 runs07:56
dhx1Paul_: let's do it! :P07:57
asm89do what? :P07:57
asm89db_param? ;P07:57
dhx1asm89: convert everything to Lithium :)07:58
asm89brr07:58
dhx1ugh, they implement Blowfish in PHP07:58
asm89-107:58
dhx1for their password salting07:58
asm89bye bye lithium07:58
asm89;P07:58
Paul_dhx1: one thing at a time08:02
Paul_757 db_param()'s08:03
Paul_so08:03
Paul_%s = string08:03
dhx1Paul_: push it and I'll help :)08:03
Paul_%d = number/float etc08:03
Paul_%b = binary08:03
asm89sed -i 's/db_param//'08:03
dhx1asm89: exactly :)08:03
asm89:P08:03
dhx1asm89: however it will require manual type checking in each instance08:04
dhx1asm89: so it's all hand-written08:04
asm89:<08:04
asm89you've got to check the type of the param?08:04
dhx1asm89: we have to replace queries anyway to use SQL:2008 syntax (instead of MySQL syntax)08:04
Paul_yea08:05
Paul_we use08:05
Paul_int08:05
Paul_varchar08:05
Paul_blob08:05
Paul_binary08:05
Paul_so08:05
Paul_%d = int, %s = varchar/blob, %b = binary08:05
dhx1ugh blob/binary can please die08:05
Paul_the blob/binary stuff might need some splitting later on08:06
Paul_dhx1: by blob i mean longtext08:06
Paul_binary  == file storage in db08:06
dhx1Paul_: right, I see08:06
Paul_i.e.08:06
Paul_numbers08:06
Paul_strings08:06
Paul_othershit08:06
dhx1file storage in the database can disappear please :D08:06
Paul_%d, %s, %b08:06
Paul_:)08:06
Paul_my point was we might find we need to split %s later into blob[oracle] and char[]08:06
dhx1especially after I implemented X-Sendfile type support in 1.3.x08:07
Paul_1.3.x = master?08:07
Paul_hmm08:07
dhx1ie. zero-copy disk->network transfers on Linux machines with nginx, Lighttpd, Apache and so forth08:07
dhx1yeah08:07
Paul_doing %s/%d etc will break my query_bound 'checking' of correct number of variables08:07
Paul_although in theory can search for % and count them08:07
dhx1why check? PDO should trigger an error if parameter values aren't defined or if we try to assign a value to a non-existent parameter?08:09
Paul_true08:10
Paul_dhx1: the reason for having a debug mode for checking would be to spot incorrect %d/%s's etc :P08:12
dhx1yeah, perhaps check the variable type vs %s, %d, etc08:13
asm89run the tests!08:15
asm89:P08:15
asm89* brb08:16
Paul_dhx1: this makes source look so much cleaner btw08:21
dhx1Paul_: indeed08:21
Paul_$t_query = "DELETE FROM {tokens} WHERE " . db_param() . " > expiry";08:22
Paul_wtf08:22
Paul_ahh08:22
Paul_order confusing me08:22
dhx1?08:23
Paul_I thought that was a column name ;p08:23
dhx1ah08:23
Paul_whens a realistic time to release 1.308:24
dhx1Paul_: when it's ready :P08:32
Paul_so sunday08:33
Paul_?08:33
asm89do it now!08:35
asm89no08:35
Paul_na08:36
Paul_it'sn ot ready yet08:36
asm89what's new in 1.3x?08:41
dhx1asm89: X-Content-Security-Policy, Javascript rewrite with jQuery, etc08:48
Paul_etc08:59
Paul_I like that08:59
Paul_btw09:00
Paul_we should call it 2.009:00
dhx1hah09:08
dhx1maybe09:08
asm89lol09:10
asm89just for the version bumping ? ;)09:10
Paul_we been version 1 for ages09:13
Paul_it makes more sense to break plugins between version 1 and 209:14
Paul_then between 1.2 and 1.309:14
asm89true09:14
Paul_and i'm pretty confident this will break stuff ;;p09:15
*** Joins: daryn (~daryn@h158.249.190.173.static.ip.windstream.net)09:31
*** Quits: kirillka (~Miranda@195.242.142.17) (Quit: kirillka)10:01
*** Joins: tmckeown (~Adium@206.205.36.222)10:05
*** Parts: tmckeown (~Adium@206.205.36.222) ()10:07
GitHub20[mantisbt] rombert pushed 3 new commits to master-1.2.x: https://github.com/mantisbt/mantisbt/compare/4c9eb5a...45e2b0310:38
GitHub20[mantisbt/master-1.2.x] First version of building a installable archive and calculating checksums - Robert Munteanu10:38
GitHub20[mantisbt/master-1.2.x] Use a custom Phing task to extract the MantisBT version - Robert Munteanu10:38
GitHub20[mantisbt/master-1.2.x] Create both zip and tar.gz installable archives - Robert Munteanu10:38
GitHub178[mantisbt] rombert pushed 1 new commit to master-1.2.x: https://github.com/mantisbt/mantisbt/commit/91175d957af9fac4ba671abdaca221a869eae96710:47
GitHub178[mantisbt/master-1.2.x] Manual: correct valid target to require builddate - Robert Munteanu10:47
*** Quits: Paul_ (~IceChat09@2001:470:9310:aaaa:71f4:1d42:9e2a:884a) (Ping timeout: 260 seconds)10:51
asm89i'll be leaving11:02
asm89bye everyone :)11:02
*** Quits: asm89 (~asm89@unaffiliated/asm89) (Quit: bye!)11:02
*** Joins: Paul_ (~IceChat09@2001:470:9310:aaaa:71f4:1d42:9e2a:884a)11:17
Paul_moo11:18
*** Quits: dhx1 (~anonymous@60-242-108-164.static.tpgi.com.au) (Remote host closed the connection)11:25
*** Joins: dhx1 (~anonymous@60-242-108-164.static.tpgi.com.au)11:32
*** Quits: thraxisp (~thraxisp@24-246-24-251.cable.teksavvy.com) (Quit: thraxisp)12:39
*** Quits: giallu (~giallu@fedora/giallu) (Ping timeout: 255 seconds)12:39
Paul_john?13:24
Paul_jreese?13:24
jreeseyes?13:44
Paul_i pushed the db api changes13:54
Paul_to github13:54
jreeseand? :P14:02
Paul_jreese: well, did you see what's changed? ;p15:07
*** Quits: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl) (Read error: Connection reset by peer)15:34
*** Joins: siebrand (~siebrand@5353A6DC.cm-6-4c.dynamic.ziggo.nl)15:34
Paul_lo siebrand16:01
siebrandhi Paul_16:01
Paul_which of our language file formats do you translate atm16:01
siebrandPaul_: only the 1.2 branch one.16:10
siebrandPaul_: I have identified some serious issues migrating to the new format, for two reasons:16:11
siebrandPaul_: (1) change of key names and (2) use of constants in keys.16:11
siebrandPaul_: if (1) is done consistently, I can fix that. I'd like to see (2) killed with fire.16:12
siebrandPaul_: we'll only be supporting one branch, and once 1.3 has an actual probably release moment (not there yet, AFAIK), I'll give moving to that format a priority.16:13
Paul_we've not changed kery names?16:16
Paul_or what you mean :P16:17
*** Quits: cerf (~quassel@mcl71-3-78-241-52-239.fbx.proxad.net) (Remote host closed the connection)16:51
*** Quits: daryn (~daryn@h158.249.190.173.static.ip.windstream.net) (Quit: Ex-Chat)17:22
*** Joins: giallu (~giallu@fedora/giallu)17:43
*** Joins: thraxisp (~thraxisp@24-246-24-251.cable.teksavvy.com)18:23
*** Quits: soustruh (~Miranda@ip-86-49-121-75.net.upcbroadband.cz) (Quit: visit http://wormscesky.cz)18:37
* Paul_ pokes siebrand19:14
*** Joins: roentgen (~arthur@openvpn/community/support/roentgen)19:15
*** Quits: giallu (~giallu@fedora/giallu) (Ping timeout: 255 seconds)19:46
*** Quits: scribe9343423 (~scribe934@static.96.23.63.178.clients.your-server.de) (Remote host closed the connection)20:00
*** Joins: scribe9343423 (~scribe934@static.96.23.63.178.clients.your-server.de)20:00
*** Quits: Paul_ (~IceChat09@2001:470:9310:aaaa:71f4:1d42:9e2a:884a) (Quit: Depression is merely anger without enthusiasm)20:01
*** Quits: micahg (~micahg@ubuntu/member/micahg) (Ping timeout: 240 seconds)20:22
*** Joins: daryn (~daryn@h103.155.16.98.dynamic.ip.windstream.net)23:29
*** Quits: dhx1 (~anonymous@60-242-108-164.static.tpgi.com.au) (Quit: Leaving)23:33
*** Joins: dhx1 (~anonymous@60-242-108-164.static.tpgi.com.au)23:34

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!