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 arrayobject returns whether the requested index existsphp vector returns whether the vector is emptyphp sqlite 函数 returns whether or not a previous row is availablephp mongodb driver exception runtimeexception returns whether an error label is associated with an exceptionphp phar returns the api versionphp phar returns whether phar extension supports compression using either zlib or bzip2php phar returns whether phar extension supports writing and creating pharsphp phar returns the number of entries files in the phar archivephp what makes a phar a phar and not a tar or a zip? tar based pharsphp phar returns whether phar has global meta dataphp phar used to determine whether phar write operations are being buffered or are flushing directly to diskphp phar returns phar gz or phar bz2 if the entire phar archive is compressed .tar.gz/tar.bz and so on php phar returns true if the phar archive is based on the tar/phar/zip file format depending on the parameterphp phar returns whether the given filename is a valid phar filenamephp pharfileinfo returns the phar file entry flagsphp recursivearrayiterator returns whether current entry is an array or an objectphp reflectionparameter returns whether this parameter can be passed by valuephp reflectionparameter returns whether the default value of this parameter is a constantphp solrquery returns whether or not morelikethis results should be enabledphp solrquery returns whether or not the query will be boosted by the interesting term relevance
关注编程学问公众号