经期吃榴莲有什么好处| 大寒是什么意思| 午时五行属什么| 薤白是什么东西| 维生素b3又叫什么| 嗓子发干是什么原因| 位移是什么| 什么是原研药| 德国是什么民族| 咽喉炎吃什么药好| 办理健康证需要带什么| 鼻子干痒是什么原因| 西洋参和人参有什么区别| 做梦梦到别人死了是什么征兆| 大米含有什么营养成分| 标准差是什么| 为什么会一直流鼻涕| 白矾是什么| 鸽子单眼伤风用什么药| 吃什么排气最快| 化疗中的病人应该吃什么| 沏茶是什么意思| 绿草如茵是什么生肖| 玉米什么时候播种| 子宫内膜16mm说明什么| 什么的虾| cocoon是什么品牌| 起大运是什么意思| 胃出血有什么症状| 高回声是什么意思| 为什么总是睡不着| 阴虱长什么样子| 靴型心见于什么病| 多普勒超声检查是什么| 全身皮肤瘙痒是什么原因引起的| 净身是什么意思| 骨折什么意思| 银色的什么| 齐活儿是什么意思| 咳嗽什么原因引起的| 黑枸杞的功效是什么| 长期腹泻是什么病| 更年期是什么意思| 晚上尿多吃什么药| 梦见别人开车撞死人是什么意思| 偏头痛吃什么药效果好| 小便多是什么原因男性| 龟奴是什么| 南无是什么意思| 苏打水为什么是甜的| 叶黄素对眼睛有什么好处| 岁月如歌下一句是什么| 双克是什么药| 兽性大发是什么生肖| 画龙点睛指什么生肖| 狗毛对人体有什么危害| 吃羊肉有什么好处| 白带发黄有异味是什么原因| 盥洗室什么意思| 蚂蝗是什么| 强迫症吃什么药效果好| 菩提萨婆诃是什么意思| 国防部长什么级别| 绝育是什么意思| 什么血型好| 杨利伟什么军衔| 燃烧卡路里是什么意思| 甲状腺是什么科| 知了猴什么时候出土| 甲状腺结节什么东西不能吃| 尿常规是检查什么的| 莜面是什么面| 麦芽糖醇是什么| 可吸收线是什么颜色| 茄子吃多了有什么坏处| 报应不爽什么意思| 吃什么都苦是什么原因| 爆单是什么意思| 晚上10点属于什么时辰| 头秃了一块是什么原因| 9.21是什么星座| 过指什么生肖| 最大的罩杯是什么杯| 机遇什么意思| 肠炎能吃什么| 益母草煮鸡蛋有什么功效| 人养玉三年玉养人一生是什么意思| 胃火旺吃什么中成药| 牙龈有点发黑是什么原因| 性功能障碍挂什么科| 阴道有异味用什么药| 头发一把一把的掉是什么原因| 尿常规挂什么科| 拉雪橇的狗是什么狗| 什么护肤产品补水最好| 剪切是什么意思| 牙齿突然酸痛什么原因| 常务理事是什么职位| 做了胃镜多久可以吃东西吃些什么| 妇科腺肌症是什么病| 女人吃牛蛙有什么好处| unicorn是什么意思| 恶寒发热是什么意思| 细菌是什么生殖| 孕妇肚子疼是什么原因| 什么茶不影响睡眠| 梦见女儿哭意味着什么| 尿酸高适合吃什么食物| 当归有什么功效| 小腿浮肿是什么原因女性| 100元人民币什么时候发行的| 为什么不建议打卧蚕呢| 心脏不舒服有什么症状| 变蛋吃多了有什么好处和坏处| 确认妊娠是什么意思啊| 胆囊萎缩是什么原因| 318号是什么星座| 术后改变是什么意思| 为什么干红那么难喝| 子宫内膜单纯性增生是什么意思| 粒字五行属什么| 用什么泡脚可以活血化瘀疏通经络| 建档是什么意思| 维生素b1有什么作用| 不正常的人有什么表现| 早上8点属于什么时辰| 眼睛发粘是什么原因| 汁男什么意思| 太阳出来我爬山坡是什么歌| 主动脉夹层a型是什么病| 阴血亏虚吃什么中成药| 直捣黄龙是什么意思| 压力山大什么意思| 尿常规是检查什么的| 阴历7月22是什么日子| 紫癜有什么症状| nba打铁是什么意思| 血糖高可以吃什么蔬菜| 排比句是什么意思| 热休克蛋白90a检查高是什么原因| 看见乌鸦有什么预兆| 阳历12月是什么星座| 牛属相和什么属相配| 四季花是什么花| 生蚝补什么| 眼睛干痒滴什么眼药水| 双子座是什么星座| 价值连城是什么意思| 虚病是什么意思| 不二人选是什么意思| 美味佳肴是什么意思| 开平方是什么意思| 奠是什么意思| 便是什么意思| 耳朵有回音是什么原因| 病危通知书意味着什么| 半边脸肿是什么原因引起的| 什么叫桑拿| 小巫见大巫是什么意思| 梦见抽血是什么预兆| 什么情况下要做宫腔镜| 二脚趾比大脚趾长代表什么| 小猫打什么疫苗| 尿路感染吃什么| 早餐应该吃什么| 皮蛋是什么蛋做的| 便是什么意思| 备胎是什么意思| 肩周炎口服什么药最好| 吃什么补脑最快| 三伏天什么时候开始| 娘是什么意思| 日照有什么特产| 2019年是什么生肖| 做梦梦到男朋友出轨了是什么意思| 豆芽不能和什么一起吃| 麻蛇是什么蛇| 男性手心热是什么原因| 髻是什么意思| 罗盘是干什么用的| 凌晨三点是什么时辰| 呆子是什么意思| 白毫银针属于什么茶| 亚裔人是什么意思| 什么神什么注| 网球肘用什么方法能彻底治好呢| 水的ph值是什么意思| 甲状腺结节用什么药| 肾阴虚有什么症状表现| 吃什么可以让胸部变大| ecg医学上什么意思| 87年是什么命| 荔枝都有什么品种| 窦性心律早期复极是什么意思| 6月21号什么星座| 什么是四环素牙| 头皮痒用什么药最有效| 氢化聚异丁烯是什么| 什么的陪伴| 今年是什么属相| 孕妇梦见自己出轨是什么意思| 儿童风热感冒吃什么药| 晚上睡觉流口水是什么病| 铅是什么| 胆红素高有什么症状| 蓝莓什么味道| 用加一笔是什么字| 打屁很臭是什么原因| 子宫肌瘤做什么检查| 白细胞低吃什么| 生产方式是什么| 八0年属什么生肖| 梦见别人过生日是什么意思| 肠胃炎能吃什么水果| 六月一日是什么星座| 同人是什么意思| 晚上喝什么茶好| 人老了为什么会瘦| 女生吃什么可以丰胸| 胸有成竹是什么生肖| 脱式计算是什么意思| 富贵病是什么病| 霉菌性炎症用什么药效果最好| 狗是什么时辰| 七夕节是什么时候| 雄激素是什么意思| 乙肝两对半25阳性是什么意思| 5月17日是什么星座| 沉默不是代表我的错是什么歌| 负氧离子是什么| 风热证是什么意思| 经常熬夜吃什么好| 什么叫桥本甲状腺炎| 一什么珍珠| 吃了龙虾后不能吃什么| 天然气主要成分是什么| 交泰殿是干什么的| 过敏性紫癜有什么症状| 热毒是什么| 9月3号是什么星座| 洋葱有什么功效与作用| 水肿是什么样子| 舌苔发黑是什么原因| 11.20是什么星座| 空腹打嗝是什么原因引起的| ex是什么的缩写| 前列腺有什么症状| 什么动作可以提高性功能| 眼睛肿疼是什么原因引起的| 多发肿大淋巴结是什么意思| 满是什么结构| 兰蔻是什么品牌| 冷沉淀是什么| 生姜和红糖熬水有什么作用| 冠状沟是什么位置| 幼儿急疹为什么不能碰水| 奥斯卡小金人什么意思| 脑梗什么不能吃| hpa是什么单位| 原发性肝ca什么意思| 爱而不得是什么感觉| 硬下疳是什么样子| 吃恩替卡韦有什么副作用| 乙状结肠炎吃什么药| 百度
rfc:streamline-phar-api

刚刚登陆安徽卫视和江苏卫视的电视剧《白鹿...

  • Version: 0.1
  • Date: 2025-08-04
  • Author: Lars Strojny, based on ideas from Elizabeth M. Smith, Marcus Boerger, Benjamin Schulz
  • Status: Under development

Abstract

百度 【相关阅读】

This proposal aims to streamline the Phar API to make it more usable and intuitive.

Basic change proposals

Phar

Modifying Phar archive content

  • offsetSet()
  • offsetGet()
  • offsetExists()
  • offsetUnset()
Proposal

In the current API, every path is represented by a single array index. This is counter intuitive, as a multi-dimensional structure (the archive) is represented as a single dimensional array accessible object. The idea is to change that object to represent every path element (e.g. “bar” in “foo/bar/baz”) as a single index. This would be accomplished by letting the DirectoryIterator implement ArrayAccess.

Code
$phar = new Phar('test.phar');
$phar['path']['to']['file'] = 'test'; // Set content 'test' in path/to/file

Adding isWritable() method

Proposal

Add an isWritable() method to determine whether an archive can be written or not. Not being able to write an archive either means it is disabled in the php.ini (see Phar::canWrite()) or that PHP can't write to the requested location of the phar archive. PharFileInfo must overload the method in order to accomplish that.

Code
$phar = new Phar('test.phar');
if ($phar->isWritable()) {
    $phar['path']['to']['file'] = "test";
}

Adding createDirectory()

Proposal

Add the method Phar->createDirectory() to explicitly create a new directory. createDirectory() will return another Phar object and takes a dirname (string) as an argument.

Code
$phar = new Phar('test.phar');
$dir = $phar->createDirectory('foo');
$dir['file'] = 'content'; // Set the file 'foo/file' to 'content'

Adding static create()-factory method

Proposal

Add a static create method to allow the convenient creation of a Phar-archive from the file system. The create()-method will take two arguments. The first argument is a string with the path to the archive. The second argument is a string with the path to the directory containing the files to be added to the archive. create() will return a Phar-object.

Code
$phar = Phar::create('test.phar', 'path/to/source/dir'); // Adds every file and subdirectory to test.phar

SplFileInfo

PharFileInfo is derived from SplFileInfo. Every change in SplFileInfo will be visible in PharFileInfo.

setContent/getContent

Proposal

Add two simple methods to write/retrieve content.

Code
$file = new SplFileInfo("file");
$file->setContent('foo');
echo $file->getContent(); // returns 'foo'

get*Time() methods

  • getMTime()
  • getATime()
  • getCTime()
Proposal

Rename the methods to make them more independent from their origin, the UNIX naming scheme and therefore better to understand for a people with non-UNIX backgrounds. Leave the original method names but trigger deprecation warnings and remove them in PHP 6.

  • getMTime() => getModificationTime()
  • getATime() => getAccessTime()
  • getCTime() => getCreateTime()

PharFileInfo

setCompressed*() methods

  • setCompressedBZIP2()
  • setCompressedGZ()
  • setUncompressed()
Proposal

Unify this methods to a single method compress(). The compress method will take one argument indicating the compression algorithm. The compression algorithm is represented as a Phar class constant. The setUncompressed() method should be renamed to uncompress().

Code
$file->compress(Phar::BZ2); // Compress with bzip2
$file->compress(Phar::GZ);  // Compress with gzip
$file->uncompress();

isCompressed*() methods

  • isCompressedBZIP2()
  • isCompressedGZ()
  • isCompressed()
Proposal

Unify this methods to one PharFileInfo::isCompressed(). The new isCompressed() would take an optional argument with the compression algorithm. The compression algorithm is represented as a Phar class constant.

Code
$file->isCompressed(); // Is the file compressed at all?
$file->isCompressed(Phar::GZ); // Is the file gzip compressed?
$file->isCompressed(Phar::BZ2); // Is the file bzip compressed?

DirectoryIterator

Implement DirectoryIterator

Let DirectoryIterator implement the ArrayAccess interface. By accessing an array index of a directory iterator, the related SplFileInfo object is returned.

Code

$iterator = new DirectoryIterator(__DIR__);
$file = $iterator['file'];

SplFileObject

Overload getContent()/setContent()

It is necessary to overload getContent()/setContent() in SplFileObject to properly reset internal flags. This is merely an implementation detail of the SplFileInfo::getContent()/setContent().

Extended change proposals

SplFileObject

Rename methods

Renamed methods
  • eof() => isEndOfFile()
  • fflush() => flush()
  • fgetc() => getChar()
  • fgetcvs() => getCsv()
  • fgets() => getLine()
  • fgetss() => getStripped()
  • flock() => lock()
  • fpassthru() => getRest()
  • fseek() => seek()
  • fstat() => stat()
  • ftell() => getLine()
  • ftruncate() => truncate()
  • fwrite() => write()
Proposal

Rename this methods to make their names more OO-alike, but leave the old names as deprecated aliases and remove them in PHP 6. This belongs to the extended change proposal as it would be practical to do but is not strictly related to Phar.

rfc/streamline-phar-api.txt · Last modified: by 127.0.0.1

?
信五行属什么 最快的速度是什么 1949属什么生肖 势不可挡是什么意思 风湿类风湿有什么症状表现
六月二十九日是什么星座 淋巴细胞偏高说明什么 爱因斯坦发明了什么 婴儿蚊虫叮咬红肿用什么药 脸上老长痘痘是什么原因
腰肌劳损吃什么药 慢性胃炎要吃什么药 碗摔碎了预示着什么 荞头是什么 睡不着觉是什么原因引起的
查血压高挂什么科室 紫色适合什么肤色的人 血尿吃什么药见效快 什么是负数 构树是什么树
杜甫自号什么hcv9jop2ns6r.cn 吃什么清肺养肺hcv8jop6ns7r.cn 什么是机械手表dayuxmw.com 合成立方氧化锆是什么hcv9jop3ns4r.cn 嗓子痒痒老想咳嗽是什么原因hcv8jop0ns2r.cn
怀孕做梦梦到蛇是什么意思onlinewuye.com 接济是什么意思hcv9jop5ns7r.cn lotus是什么意思hcv8jop2ns5r.cn 眼睑炎用什么药效果好hcv8jop6ns3r.cn 结核是什么hcv9jop0ns6r.cn
戾气什么意思hcv8jop2ns0r.cn 子宫增大是什么原因hcv8jop0ns0r.cn 588是什么意思hcv8jop8ns7r.cn 爱什么分明hcv8jop1ns6r.cn 墓志铭什么意思naasee.com
五行缺金是什么命zhiyanzhang.com 相位是什么hcv8jop8ns5r.cn 米豆腐是什么做的520myf.com 灰指甲不治疗有什么后果hcv8jop9ns7r.cn 侯字五行属什么luyiluode.com
百度