Phar::canWrite

(PHP 5 >= 5.3.0, PHP 7, PECL phar >= 1.0.0)

Phar::canWriteReturns whether phar extension supports writing and creating phars

说明

final public static Phar::canWrite ( void ) : bool

This static method determines whether write access has been disabled in the system php.ini via the phar.readonly ini variable.

参数

返回值

TRUE if write access is enabled, FALSE if it is disabled.

范例

Example #1 A Phar::canWrite() example

<?php
if (Phar::canWrite()) {
    
file_put_contents('phar://myphar.phar/file.txt''hi there');
}
?>

参见

相关文章
php domtext returns whether this text node contains whitespace in element contentphp priorityqueue returns whether the queue is emptyphp stack returns whether the stack is emptyphp maxdb 函数 returns whether thread safety is given or notphp rpm reader 函数 returns a string representing the current version of the rpmreader extensionphp mongodb driver writeresult returns whether the write was acknowledgedphp phar returns whether phar extension supports compression using either zlib or bzip2php phar returns whether phar extension supports writing and creating pharsphp phar returns whether phar has global meta dataphp phar returns whether the given filename is a valid phar filenamephp phar returns the full path on disk or full phar url to the currently executing phar archivephp phar mapphar for web based phars. front controller for web applicationsphp pharfileinfo returns the actual size of the file with compression inside the phar archivephp recursivedirectoryiterator returns whether current entry is a directory and not . or .. php reflectionparameter returns whether parameter must be callablephp sdo das relational 函数 returns the special root object in an otherwise empty data graph. used when creating a data graph from scratchphp solrquery returns whether or not morelikethis results should be enabledphp solrquery returns whether or not stats is enabledphp spldoublylinkedlist returns whether the requested $index existsphp sqlite3stmt returns whether a statement is definitely read only
关注编程学问公众号