IBOS open source
  • Namespace
  • Class

Namespaces

  • application
    • core
      • cache
        • driver
        • provider
      • components
      • controllers
      • engines
        • local
        • sae
      • model
      • modules
      • utils
      • widgets
    • modules
      • article
        • controllers
        • core
        • model
        • utils
      • calendar
        • controllers
        • model
        • utils
      • contact
        • controllers
        • model
        • utils
      • dashboard
        • controllers
        • model
        • utils
      • department
        • components
        • model
        • utils
      • diary
        • components
        • controllers
        • model
        • utils
        • widgets
      • email
        • controllers
        • core
        • model
        • utils
      • main
        • behaviors
        • components
        • controllers
        • model
        • utils
        • widgets
      • message
        • controllers
        • core
          • co
          • wx
            • callback
            • event
        • model
        • utils
      • mobile
        • components
        • controllers
        • utils
      • position
        • components
        • model
        • utils
      • recruit
        • components
        • controllers
        • core
        • model
        • utils
        • widgets
      • role
        • model
        • utils
      • user
        • components
        • controllers
        • model
        • utils
      • vote
        • components
        • controllers
        • model
        • utils
      • weibo
        • controllers
        • core
        • model
        • utils

Classes

  • Api
  • ApiCode
  • Attach
  • Cache
  • Cloud
  • Convert
  • Credit
  • Database
  • DateTime
  • Env
  • File
  • Ftp
  • IBOS
  • Image
  • Mail
  • Module
  • Org
  • Page
  • PHPExcel
  • String
  • System
  • Upgrade
  • Url
  • WebSite
  • Xml
  • XMLParse

Class File

Namespace: application\core\utils
Copyright: Copyright © 2012-2013 IBOS Inc
Author: banyanCheung banyan@ibos.com.cn
Located at system/core/utils/File.php

Methods summary

public static object
# getUpload( string $fileArea, string $module = 'temp' )

返回引擎上传接口

返回引擎上传接口

Parameters

$fileArea
上传文件域
$module
模块名

Returns

object
public static string
# getAttachUrl( )

获取附件目录

获取附件目录

Returns

string
public static
# download( array $attach, array $downloadInfo = array() )

下载文件接口

下载文件接口

Parameters

$attach
附件数组
$downloadInfo
下载额外信息
public static string
# fileName( string $fileName )

io:storage 读取storage文件地址接口

io:storage 读取storage文件地址接口

Parameters

$fileName
要读取的文件名

Returns

string
public static array
# imageSize( string $image )

获取图片规格

获取图片规格

Parameters

$image
图片地址

Returns

array
成功读取图片信息, false 读取失败
public static integer
# fileSize( string $file )

获取文件大小接口

获取文件大小接口

Parameters

$file
文件名

Returns

integer
返回文件大小的字节数,如果出错返回 false 并生成一条 E_WARNING 级的错误。
public static type
# fileExists( string $file )

io:storage 检查文件或目录是否存在

io:storage 检查文件或目录是否存在

Parameters

$file

Returns

type
public static type
# createFile( string $fileName, string $content )

io:storage 写入文件内容接口

io:storage 写入文件内容接口

Parameters

$fileName
要写入的文件名
$content
写入的内容

Returns

type
public static type
# readFile( string $fileName )

io:storage 读取文件名接口

io:storage 读取文件名接口

Parameters

$fileName
文件名

Returns

type
public static type
# getTempPath( )

io:storage 获取临时读写文件夹接口

io:storage 获取临时读写文件夹接口

Returns

type
public static boolean
# clearDir( string $dir )

io:stirage 清空指定目录里文件 (不包含子目录)

io:stirage 清空指定目录里文件 (不包含子目录)

Parameters

$dir

Returns

boolean
public static boolean
# deleteFile( string $fileName )

io:storage 删除指定文件

io:storage 删除指定文件

Parameters

$fileName

Returns

boolean
public static
# clearDirs( string $srcDir, $except = array() )

递归清空目录包括目录本身

递归清空目录包括目录本身

Parameters

$srcDir
目标文件夹路径
$except
public static mixed
# fileSockOpen( string $url, integer $limit = 0, string $post = '', string $cookie = '', string $bysocket = FALSE, integer $ip = '', boolean $timeout = 15, type $block = true, type $encodeType = 'URLENCODE', type $allowcurl = TRUE, $position = 0 )

远程文件请求函数

远程文件请求函数

Parameters

$url
请求的地址
$limit
请求的字符数
$post
要提交的参数
$cookie
设定HTTP请求中"Cookie: "部分的内容。
$bysocket
$ip
$ip
$timeout 连接超时时间
$timeout

$block If mode is 0, the given stream will be switched to non-blocking mode, and if 1, it will be switched to blocking mode.

$block
$encodeType
$encodeType
$allowcurl
$allowcurl
$position
$position

Returns

mixed
请求返回的内容
public static boolean
# checkFolderPerm( mixed $fileList )

检查文件所在目录的读写权限

检查文件所在目录的读写权限

Parameters

$fileList
文件路径,数组或字符串形式

Returns

boolean
public static boolean
# testDirWriteable( string $dir )

测试文件夹是否可写

测试文件夹是否可写

Parameters

$dir
文件夹路径

Returns

boolean
是否可写
public static type
# makeDir( string $dir, integer $mode = 0777, boolean $makeIndex = true )

创建单层文件夹

创建单层文件夹

Parameters

$dir
要创建的文件夹
$mode
文件夹权限
$makeIndex
创建文件夹索引文件

Returns

type
public static boolean
# makeDirs( string $dir, integer $mode = 0777, boolean $makeIndex = true )

递归创建文件夹

递归创建文件夹

Parameters

$dir
要创建的文件夹路径
$mode
文件夹权限
$makeIndex
创建文件夹索引文件

Returns

boolean
成功与否
public static boolean
# copyToDir( string $file, string $copyToPath )

复制一个文件到文件夹

复制一个文件到文件夹

Parameters

$file
文件名
$copyToPath
指定文件夹

Returns

boolean
public static
# copyDir( string $srcDir, string $destDir )

复制文件夹到另一个文件夹

复制文件夹到另一个文件夹

Parameters

$srcDir
目标文件夹
$destDir
指定文件夹
public static
# exportCsv( string $filename, string $data )

导出excel文件

导出excel文件

Parameters

$filename
导出的文件名
$data
导出的数据
public static
# exportHtml( $filename, $data )
IBOS open source API documentation generated by ApiGen