String f_hphp_splfileinfo_getlinktarget(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); String ret = f_readlink_internal(fileInfo->getFileName(), false); if (!ret.size()) { throw Object(SystemLib::AllocExceptionObject(Variant( "Unable to read link "+std::string(fileInfo->getFileName()) + ", error: no such file or directory"))); } return ret; }
String f_hphp_splfileinfo_getlinktarget(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); String ret = f_readlink_internal(fileInfo->getFileName(), false); if (!ret.size()) { throw (Object)sp_exception(NEW(c_exception)())->create(Variant( "Unable to read link "+fileInfo->getFileName() +", error: no such file or directory")); } return ret; }
String f_hphp_splfileinfo_getpath(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); const char *fileName = fileInfo->getFileName().c_str(); const char *p1 = strrchr(fileName, '/'); if (!p1) return ""; return String(fileName, p1 - fileName, CopyString); }
int64_t f_hphp_splfileinfo_getinode(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_fileinode(fileInfo->getFileName()); }
String f_hphp_splfileinfo_getfilename(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_basename(fileInfo->getFileName()); }
String f_hphp_splfileinfo_getbasename(CObjRef obj, CStrRef suffix) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_basename(fileInfo->getFileName(), suffix); }
String f_hphp_splfileinfo___tostring(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return fileInfo->getFileName(); }
Object f_hphp_splfileinfo_openfile(CObjRef obj, CStrRef open_mode, bool use_include_path, CVarRef context) { SplFileInfo *fileInfo = get_splfileinfo(obj); return SystemLib::AllocSplFileObjectObject( String(fileInfo->getFileName()), open_mode, use_include_path, context); }
bool f_hphp_splfileinfo_iswritable(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_is_writable(fileInfo->getFileName()); }
bool f_hphp_splfileinfo_islink(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_is_link(fileInfo->getFileName()); }
Variant f_hphp_splfileinfo_getrealpath(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_realpath(fileInfo->getFileName()); }
int64 f_hphp_splfileinfo_getgroup(CObjRef obj) { SplFileInfo *fileInfo = get_splfileinfo(obj); return f_filegroup(fileInfo->getFileName()); }
Object f_hphp_splfileinfo_openfile(CObjRef obj, CStrRef open_mode, bool use_include_path, CVarRef context) { SplFileInfo *fileInfo = get_splfileinfo(obj); return p_SplFileObject(p_SplFileObject(NEWOBJ(c_SplFileObject)())-> create(String(fileInfo->getFileName()), open_mode, use_include_path, context)); }