本文整理汇总了PHP中Filesystem::openFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::openFile方法的具体用法?PHP Filesystem::openFile怎么用?PHP Filesystem::openFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filesystem
的用法示例。
在下文中一共展示了Filesystem::openFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readFile
/**
* Read file
*
* WARNING: Don't use this method with a TTBIN-file.
* TTBIN-files have to be parsed first with parseFile($Filename).
*
* For unittesting, this method accepts a filename of the output of ttbincnv
*
* @param string $filename [optional] absolute path
*/
public function readFile($filename = '')
{
if (!empty($filename)) {
$this->Filename = $filename;
}
$Handle = @fopen(FRONTEND_PATH . $this->Filename, "r");
if ($Handle) {
$firstLine = stream_get_line($Handle, 4096, PHP_EOL);
if (strpos($firstLine, 'ttbincnv') !== FALSE) {
$this->Errors[] = 'Importing your *.ttbin-file did not work. Please compile ttbincnv for your environment.';
$this->Parser = new ParserTCXMultiple('');
} else {
$Filecontent = Filesystem::openFile($this->Filename);
$this->Parser = new ParserTCXMultiple($Filecontent);
$this->Parser->parse();
}
fclose($Handle);
}
Filesystem::deleteFile($this->Filename);
}
示例2: parseCompressedFile
/**
* Load compressed file (base64, gzip)
* @param string $Filename relative path (from FRONTEND_PATH) to file
*/
public final function parseCompressedFile($Filename)
{
$this->parseCompressedString(Filesystem::openFile($Filename));
}
示例3: addVariableToConfigFile
/**
* Add variable to config file
* @param string $Variable
*/
private static function addVariableToConfigFile($Variable)
{
$ConfigFile = str_replace('?>', NL, Filesystem::openFile('../data/config.php'));
$ConfigFile .= self::defineAndGetConfigLinesFor($Variable);
$ConfigFile .= NL . '?>';
Filesystem::writeFile('../data/config.php', $ConfigFile);
}