本文整理汇总了PHP中Std::write方法的典型用法代码示例。如果您正苦于以下问题:PHP Std::write方法的具体用法?PHP Std::write怎么用?PHP Std::write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Std
的用法示例。
在下文中一共展示了Std::write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateFileList
public function updateFileList()
{
//$this->file_list=array();
if ($this->verification != $GLOBALS['data']->verification['local']) {
$file_list_copy = $this->file_list;
foreach ($GLOBALS['data']->installed_packages as $packageName => $packageData) {
if ($this->file_list[$packageName]) {
if ($this->file_list[$packageName]['version'] != $packageData['version']) {
// Update
$this->file_list[$packageName] = PacmanData::parsePacmanDataFile($GLOBALS['pacman_directory'] . 'local/' . $packageData['dir'] . '/files');
$packageFiles = $this->file_list[$packageName]['%FILES%'];
$files_count = count($packageFiles);
for ($i = 0; $i < $files_count; $i++) {
eval('$packageFiles[$i]="/' . str_replace(array('?', '$'), array('\\?', '\\$'), $packageFiles[$i]) . '";');
}
$this->file_list[$packageName]['%FILES%'] = $packageFiles;
$this->file_list[$packageName]['version'] = $packageData['version'];
}
} else {
// Add
$this->file_list[$packageName] = PacmanData::parsePacmanDataFile($GLOBALS['pacman_directory'] . 'local/' . $packageData['dir'] . '/files');
$packageFiles = $this->file_list[$packageName]['%FILES%'];
$files_count = count($packageFiles);
for ($i = 0; $i < $files_count; $i++) {
eval('$packageFiles[$i]="/' . str_replace(array('?', '$'), array('\\?', '\\$'), $packageFiles[$i]) . '";');
}
$this->file_list[$packageName]['%FILES%'] = $packageFiles;
$this->file_list[$packageName]['version'] = $packageData['version'];
}
unset($file_list_copy[$packageName]);
}
if (count($file_list_copy)) {
foreach ($file_list_copy as $packageName => $filesData) {
unset($this->file_list[$packageName]);
}
}
$this->verification = $GLOBALS['data']->verification['local'];
Std::write($GLOBALS['tupac_directory'] . '/tupac_filelist', serialize($this));
chmod($GLOBALS['tupac_directory'] . '/tupac_filelist', 0666);
}
}
示例2: saveData
public function saveData()
{
// Save cache
Std::write($GLOBALS['tupac_directory'] . '/tupac_data', serialize($this));
chmod($GLOBALS['tupac_directory'] . '/tupac_data', 0666);
}