I notice in Admin CP you can check for updates and says I'm running latest version.
Does running the Alpha auto update to new releases?
I notice in Admin CP you can check for updates and says I'm running latest version.
Does running the Alpha auto update to new releases?
Hi
it does not.
Quote from TimWollait does not.
Maybe it would, if there were any releases, but we didn't reach the Beta-state yet so there are no official "releases".
In a nutshell: While we're alpha, there is no automatic renewal of the code because that would be unnecessary and much work.
#justwantedtosaysomething
On this site were it says "Last Modified" for the download branch_next.zip. It shows todays date and time, does that mean the time changes was last made to the download? So the package has been updated since yesterday and is now different with more fixes, etc
https://wcf.stricted.de/?dir=WCF%2Fdev_unstable
As it says it gets updated every two hours and notice the other two downloads above it have not changed with date and time
Quote from GTBOn this site were it says "Last Modified" for the download branch_next.zip. It shows todays date and time, does that mean the time changes was last made to the download? So the package has been updated since yesterday and is now different with more fixes, etc
That's the time when the current download has been packed to a usable archive. The code get's updated like every few hours or even every few minutes at the moment as you can see there: https://github.com/WoltLab/WCF/commits/next
The other two downloads are from the stable branch which is not that active at the moment, so they won't get renewd within the same short interval than the next-branch.
GTB if you want to have a script which updates (some) of the changes let me know.
I automatically upgrade via cronjob and a script @Morik gave me.
How long do you estimate it might be before a Beta is used here?
I know you can't say exactly. But do you think it's going to be longer than another 7 days from now.
GTB if you want to have a script which updates (some) of the changes let me know.
Would be nice, if you have one. I'm always to lazy to write one.
shell or php-based?
mit einem cronjob bei allink starte ich die Upgrade.php:
<?php
exec("/bin/bash /www/htdocs/xxx/websites/xxx/update_wcf.sh 2>&1", $out, $result);
//echo "Returncode: " .$result ."<br>";
//echo "Ausgabe des Scripts: " ."<br>";
//echo "<pre>"; print_r($out);
function rmFullDir($dirpath){
$it = new RecursiveDirectoryIterator($dirpath, RecursiveDirectoryIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it,
RecursiveIteratorIterator::CHILD_FIRST);
foreach($files as $file) {
if ($file->isDir()){
rmdir($file->getRealPath());
} else {
unlink($file->getRealPath());
}
}
}
rmFullDir("/www/htdocs/xxx/websites/xxx/tmp/");
rmFullDir("/www/htdocs/xxx/websites/xxx/WCF22/cache/");
rmFullDir("/www/htdocs/xxx/websites/xxx/WCF22/templates/compiled/");
unlink('/www/htdocs/xxx/websites/xxx/WCF22/options.inc.php');
unlink('/www/htdocs/xxx/websites/xxx/WCF22/style/style-1.css');
unlink('/www/htdocs/xxx/websites/xxx/WCF22/style/style-1-rtl.css');
unlink('/www/htdocs/xxx/websites/xxx/WCF22/acp/style/style.css');
unlink('/www/htdocs/xxx/websites/xxx/WCF22/acp/style/style-rtl.css');
Display More
Und das ruft folgendes Script auf:
WCF_DIR=/www/htdocs/xxx/websites/xx/WCF22
TMP_DIR=/www/htdocs/xxx/websites/xx/tmp
cd $TMP_DIR
wget https://github.com/WoltLab/WCF/archive/next.zip
unzip next.zip
rm next.zip
rsync -azvv --exclude='/*.php' WCF-next/wcfsetup/install/files/ $WCF_DIR
rsync -azvv WCF-next/com.woltlab.wcf/templates/ $WCF_DIR/templates/
rm -rf WCF-next
rm $WCF_DIR/options.inc.php
rm $WCF_DIR/cache/*
rm $WCF_DIR/templates/compiled/*
rm $WCF_DIR/style/*.css
Display More
How long do you estimate it might be before a Beta is used here?
I know you can't say exactly. But do you think it's going to be longer than another 7 days from now.
Unfortunately I do not know haha.
I can only assume thats about it.
But since i only started to be active today I do not know =) and cannot estimate.
IT IS DONE WHEN IT IS DONE haha;)
It should not matter, cause it will be created from scratch anyway, correct @Morik ?
Hmm, that's right.
Btw: The script updates files only. I'm currenty working on a script that updates the database-things as well (SQL-Commands excluded).
Hmm, that's right.
Btw: The script updates files only. I'm currenty working on a script that updates the database-things as well (SQL-Commands excluded).
Alright
maybe
@Morik can join the discussion. cause he stated to me once why he did not make that within he script
I'm currenty working on a script that updates the database-things as well (SQL-Commands excluded).
someting like this ?
<?php
namespace wcf\system\package;
use wcf\system\io\Zip;
use wcf\system\WCF;
use wcf\util\XML;
require_once('./global.php');
// dummy class
class PackageInstallationDispatcher {
public $package = 'com.woltlab.wcf';
public $isApplication = true;
public $updateDir=''
public function __construct($updateDir){
$this->updateDir=$updateDir;
}
public function getAction(){
return 'update';
}
public function getPackageID(){
return 1;
}
public function getPackage(){
return $this;
}
public function getArchive(){
return $this;
}
public function getTar(){
return $this;
}
public function getIndexByFilename($file){
return $file;
}
public function extract($file, $tmpFile){
copy($this->updateDir.'WCF-next/com.woltlab.wcf/'.$file,$tmpFile);
}
}
class wcfUpdater {
protected $updateDir='';
protected $updateFileDir='';
protected $dispatcher=NULL;
public function __construct(){
$this->updateDir=__DIR__.'/wcf_update/';
if(!is_dir($this->updateDir)) mkdir($this->updateDir);
$this->updateFileDir=$this->updateDir.'WCF-next/wcfsetup/install/files/';
}
public function run(){
$this->loadUpdateFiles();
$this->unzipUpdate();
$this->updateFiles();
$this->updateXML();
$this->cleanup();
}
public function cleanDir($dir) {
$it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it,
RecursiveIteratorIterator::CHILD_FIRST);
foreach($files as $file) {
if ($file->isDir()){
rmdir($file->getRealPath());
} else {
unlink($file->getRealPath());
}
}
}
protected function getDispatcher(){
if(!$this->dispatcher) $this->dispatcher = new PackageInstallationDispatcher($this->updateDir);
return $this->dispatcher;
}
protected function loadUpdateFiles(){
copy ('https://github.com/WoltLab/WCF/archive/next.zip',$this->updateDir.'next.zip');
}
protected function unzipUpdate(){
$zip = new Zip($this->updateDir.'next.zip');
$zip->extractAll($this->updateDir);
}
protected function updateFiles(){
// do not update dummy files
@unlink($this->updateFileDir.'app.config.inc.php');
@unlink($this->updateFileDir.'global.php');
@unlink($this->updateFileDir.'options.inc.php');
$it = new RecursiveDirectoryIterator($this->updateFileDir, RecursiveDirectoryIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it,
RecursiveIteratorIterator::CHILD_FIRST);
foreach($files as $file) {
$realPath = $file->getRealPath();
$targetPath = __DIR__.'/'.explode($this->updateFileDir,$realPath)[1];
if ($file->isDir()){
if(!is_dir($targetPath)) mkdir($targetPath);
chmod($targetPath, 0777);
rmdir($realPath);
} else {
rename($realPath,$targetPath);
}
}
}
protected function updateXML(){
$xml = new XML();
$xml->load($this->updateDir.'WCF-next/com.woltlab.wcf/package.xml');
$xpath = $xml->xpath();
$package = $xpath->query('/ns:package')->item(0);
$elements = $xpath->query('./ns:instructions', $package);
foreach ($elements as $element) {
$type = $element->getAttribute('type');
if($type !== 'install') continue;
$instructionData = [];
$instructions = $xpath->query('./ns:instruction', $element);
/** @var \DOMElement $instruction */
foreach ($instructions as $instruction) {
$data = [];
$attributes = $xpath->query('attribute::*', $instruction);
foreach ($attributes as $attribute) {
$data[$attribute->name] = $attribute->value;
}
if(!in_array($instruction->getAttribute('type'), ['script','style','template','acpTemplate','file','sql'])){
$nodeData = [
'attributes' => $data,
'pip' => $instruction->getAttribute('type'),
'value' => $instruction->nodeValue
];
$sql = "SELECT pluginName, className
FROM wcf".WCF_N."_package_installation_plugin
WHERE pluginName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$nodeData['pip']]);
$row = $statement->fetchArray();
// PIP is unknown
if (!$row || (strcmp($nodeData['pip'], $row['pluginName']) !== 0)) {
throw new SystemException("unable to find package installation plugin '".$nodeData['pip']."'");
}
// valdidate class definition
$className = $row['className'];
if (!class_exists($className)) {
throw new SystemException("unable to find class '".$className."'");
}
// set default value
if (empty($nodeData['value'])) {
$defaultValue = call_user_func([$className, 'getDefaultFilename']);
if ($defaultValue) {
$nodeData['value'] = $defaultValue;
}
}
// Execute each pip for update !
$plugin = new $className($this->getDispatcher(), $nodeData);
$document = $plugin->install();
}
}
}
}
protected function cleanup(){
// rename($this->updateDir.'WCF-next/wcfsetup/setup/db/install.sql',__DIR__.'/com.woltlab.wcf/install.sql');
$this->cleanDir($this->updateDir);
$this->cleanDir(__DIR__.'/cache/');
$this->cleanDir(__DIR__.'/templates/compiled/');
$this->cleanDir(__DIR__.'/acp/templates/compiled/');
@unlink(__DIR__.'/style/style-1.css');
@unlink(__DIR__.'/style/style-1-rtl.css');
@unlink(__DIR__.'/acp/style/style.css');
@unlink(__DIR__.'/acp/style/style-rtl.css');
@unlink(__DIR__.'/options.inc.php');
}
}
$update = new wcfUpdater();
$update->run();
Display More
Had also problems with SQL changes, but the rest is simple^^
Had also problems with SQL changes, but the rest is simple^
thanks. That's exactly what i need.
In a nutshell: If your's is working, i can remove my 100 lines I already got.
When you guys are done let me know of the finals cript haha
Had also problems with SQL changes, but the rest is simple^^
done?
it simply parses all xml files and use the corresponding pips like a normal update
No duplicate exodus , it ignores SQL changes, but it updates xml changes.
Alright currently I haven't had the time to install a fresh version anyway.
Gonna do that when the public beta version is out.
Don’t have an account yet? Register yourself now and be a part of our community!