Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #19134 files wont write
Submitted: 2011-12-13 18:19 UTC
From: wolfdogg Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: 5.3.8 OS: arch linux x64
Roadmaps: (Not assigned)    
Subscription  


 [2011-12-13 18:19 UTC] wolfdogg (wolf dogg)
Description: ------------ i can run createTables.php from inside the DB_DataObject directory, or anywhere else on the system, i copied the entire PEAR directory to my user folder, and chowned the files to myself:http group, and ran it, i have tried DB driver, and MDB2 driver, the database is connecting correctly, the arrays are built, in getting DB_DataObject_Generator : 0 : writing etc... then DB_DataObject_Generator : 0 : Done, i dont see any errors in debug level 5, BUT.... i dont have the files. they arent writing. I tried changing the permissions on the Generator.php lines 348 etc. to 0777 to see if that would help since im not sure what PEAR is running as, that didnt help. Is teh function <?php System::mkdir('-p','- m',0755,dirname($file))); ?> kosher? when i # mkdir --help i see that there is no -p switch, but a -P switch. maybe ill try that next. any suggestions? no matter what config i use, proxy=full, mysqli, mysql, DB, MDB2, altering output directories, running as root, running as user, nothing is making any files.

Comments

 [2011-12-13 18:22 UTC] wolfdogg (wolf dogg)
one more thing, should i be running on linux as user $ php /usr/share/pear/DB/DataObject/createTables /home/myuser/data_objects/create.ini or root # php /usr/share/pear/DB/DataObject/createTables /home/myuser/data_objects/create.ini and should i be using the -f switch, or the -F switch $ php -f /usr/share/pear/DB/DataObject/createTables /home/myuser/data_objects/create.ini
 [2011-12-13 18:24 UTC] wolfdogg (wolf dogg)
oops, of course i meant 'createTables.php' in those command lines, not just 'createTables' and i wanted to mention theres no documentation on a linux command line, just a windows command line. whats up with that? guess its assumed linux users are smart enough to figure that one out. well, i think i got that part correct.
 [2011-12-13 18:57 UTC] wolfdogg (wolf dogg)
ok, i found a problem by backtracing the fwrite function near line 358 of Generator.php. the fwrite($fh,$this->_newConfig) function fails because $fh is an empty variable, and before that $fh = fopen($tmpname, 'w'); faile because $tmpname is empty, and $tmpname = tempnam(session_save_path(),'DataObject_'); fails because session_save_path() is empty, can somebody please troubleshoot and see why the session save path is empty? so when i changed line 354 to this it worked $tmpname - tempnam(session_save_path('/tmp'),'DataObject_'); victory! so if i spend time on it tomorrow i can find out whats going on here, except the problem may be much deeper than i think, thats why i would hope one of your devs in charge of this project might need to take a look as well. regards.
 [2011-12-13 18:58 UTC] wolfdogg (wolf dogg)
looks like it was lijne 352, i made a few comments so it was hard to see what line number.
 [2011-12-14 02:54 UTC] doconnor (Daniel O'Connor)
http://au.php.net/manual/pl/session.configuration.php#ini.session.save-path is not configured - does your php have the session extension disabled or something like that? http://svn.php.net/viewvc/pear/packages/DB_DataObject/trunk/DataObject/Generato r.php?view=markup#l376 It would be good to use http://au.php.net/manual/pl/function.sys-get-temp-dir.php instead if available; or http://au.php.net/manual/pl/function.tmpfile.php instead
 [2011-12-14 02:54 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Analyzed
 [2011-12-14 09:32 UTC] alan_k (Alan Knowles)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: alan_k
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Warning added now.
 [2011-12-14 15:18 UTC] wolfdogg (wolf dogg)
in my php.ini file i have under [Session] session.save_handler = files ; session.save_path = "N;/path" note its commented out. so i see its suggested to use sys_get_temp_dir(), that may be a good suggestion. furthermore, where do i find the fix that has implemented. does the 'warning added now' mean its been added to the package, if so, this current version, i.e. reinstall, or the next version released in the future? Also, i assume the way i addressed it by setting the session_save_path('/tmp') on line 376 here in your example http://svn.php.net/viewvc/pear/packages/DB_DataObject/trunk/DataObject/Gener ator.php?view=markup#l376 that it will be set from here forth when its needed again in line 554, and 912, or would i be missing some files? according to the function http://php.net/manual/en/function.session-save-path.php it says "If specified, the path to which data is saved will be changed" so it would seem that in lines 54 and 912 it will use the setting that was placed in line 376. atleast in my case. is this correct? is this an acceptable temporary fix for now?
 [2011-12-14 15:26 UTC] wolfdogg (wolf dogg)
sorry about the other question, i noticed after re-reading your message a 3rd time alan-k that it will be in the next release. i still have the question about my temporary fix, so can someone please answer that please? and i wanted to note, i thought what i enclosed was all in my php.ini about session.save_path, but i didnt scroll far enough, i also see 2 more lines, im sure you knwo which ones, ;sessionsave_path = "N:MODE;/path" ;session.save_path= "/tmp" it looks like i was supposed to uncomment on, this is not a very fun way to find this out. alot of work. so im wondering if the latter setting is supposed to be uncommented in a default development, and production server environment. if so, then i missed that one and dont know why it was commented. After referring to php.net i dont find the default operations for that line yet. if somebody knows, this would be a good place to include that information. thanks.
 [2011-12-14 15:44 UTC] alan_k (Alan Knowles)
you need to have this line in php.ini session.save_path= "/tmp" (without the ';' comment)
 [2011-12-14 15:48 UTC] alan_k (Alan Knowles)
sys_get_temp_dir() is PHP5 only, I guess when I get round to five'ing the code, it can be changed...