|
Andrew O'Melia - 2014-03-05 01:16:45
Hi there, I have been poking around with your Crud class, but I have hit a snag when adding to a remote server. I'm really curious to test this out remotely and would love to be able to get past this hiccup, but I'm a relative PHP newb.
Here is the warning I get when using your demo:
Warning: file_put_contents(example.txt): failed to open stream: Permission denied in /sandbox/csv-crud-2013-02-27/class.csvCRUD.php on line 159
***And here is the block where line 159 lives***
/**
* csvCRUD::save_file()
* @desc Commits the current row data array to the CSV file by overwriting existing data
* @return boolean
*/
function save_file(){
if($this->data_changed){
$txt = $this->get_latest_text();
if(file_put_contents($this->f,$txt)){
return true;
}else{
return false;
}
}
}
/**
Mark Berube - 2014-03-05 01:28:29 - In reply to message 1 from Andrew O'Melia
This just looks like a permission error. You need to make sure that the web server has write permission of the CSV file.
You can try making the web server owner of the file, or just assign 777 for testing.
Andrew O'Melia - 2014-03-05 17:09:13 - In reply to message 2 from Mark Berube
That was exactly it, thank you so much Mark!
I'm very excited to add new input types as well, I would love to be able to add a file upload field, a date field and a comments field. I see that you have something in the works, I was going to try and add myself, but if you've got something working I'd be happy to serve as a beta user.
Thanks again!
Mark Berube - 2014-03-05 21:01:21 - In reply to message 3 from Andrew O'Melia
Yes that could be useful...the class was originally intended to work with Arrays and store contents in flat files using SQL-like simplicity...without the need for a DB. I find myself requiring small datasets of 1000 records or less very often and setting up a database is overkill, and its much easier to plug in this class and it should work out of the box for simpler record storage.
Anyway, after developing the CSV editing methods and creating separate scripts to generate forms and edit records, I figured it was best to include them in the class...and now, it is nearly a data management framework. I use it all the time.
I do want to include file upload mgmt, and file-type detection with thumbnail generation...but development of those features is pretty much on an "as needed" basis.
If you have any questions on how to use the class, let me know. There are a lot of things you can do with it, and I dont think they are all documented.
|