Esempio n. 1
0
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);
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
int64_t f_hphp_splfileinfo_getinode(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_fileinode(fileInfo->getFileName());
}
Esempio n. 5
0
String f_hphp_splfileinfo_getfilename(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_basename(fileInfo->getFileName());
}
Esempio n. 6
0
String f_hphp_splfileinfo_getbasename(CObjRef obj, CStrRef suffix) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_basename(fileInfo->getFileName(), suffix);
}
Esempio n. 7
0
String f_hphp_splfileinfo___tostring(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return fileInfo->getFileName();
}
Esempio n. 8
0
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);
}
Esempio n. 9
0
bool f_hphp_splfileinfo_iswritable(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_is_writable(fileInfo->getFileName());
}
Esempio n. 10
0
bool f_hphp_splfileinfo_islink(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_is_link(fileInfo->getFileName());
}
Esempio n. 11
0
Variant f_hphp_splfileinfo_getrealpath(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_realpath(fileInfo->getFileName());
}
Esempio n. 12
0
int64 f_hphp_splfileinfo_getgroup(CObjRef obj) {
  SplFileInfo *fileInfo = get_splfileinfo(obj);
  return f_filegroup(fileInfo->getFileName());
}
Esempio n. 13
0
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));
}