本文整理匯總了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);
}