mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 22:02:13 +09:00
#18353187 : add file object class
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6825 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a2fbbe9a2d
commit
fb9f2dd4a4
2 changed files with 147 additions and 1 deletions
|
|
@ -557,7 +557,7 @@
|
|||
* @brief write array into ini file
|
||||
* @param[in] $filename target ini file name
|
||||
* @param[in] $arr array
|
||||
* return if array contains nothing it returns false, otherwise true
|
||||
* @return if array contains nothing it returns false, otherwise true
|
||||
**/
|
||||
function writeIniFile($filename, $arr){
|
||||
if(count($arr)==0) return false;
|
||||
|
|
@ -581,5 +581,23 @@
|
|||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return file object
|
||||
* @param[in] $file_name target file name
|
||||
* @param[in] $mode file mode for fopen
|
||||
* @remarks if the directory of the file does not exist, create it.
|
||||
* @return file object
|
||||
**/
|
||||
function openFile($file_name, $mode)
|
||||
{
|
||||
$pathinfo = pathinfo($file_name);
|
||||
$path = $pathinfo['dirname'];
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
|
||||
require_once("FileObject.class.php");
|
||||
$file_object = new FileObject($file_name, $mode);
|
||||
return $file_object;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue