Giter VIP home page Giter VIP logo

php-auto-update's People

Contributors

0legkolomiets avatar fabiante avatar jitheshgopan avatar kieronsutton00 avatar metallizzer avatar migliori avatar omarhen avatar r23 avatar robinflyhigh avatar thelfensdrfer avatar tikky avatar ttimot24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-auto-update's Issues

No new version available

When attempting to run the update I get "no new version available"
I'm not sure why this is happening.

Current Version is up to date
Log:
[2015-02-20 15:30:50] auto-update.NOTICE: Checking for a new update... [] []
 [2015-02-20 15:30:50] auto-update.DEBUG: Get new updates from http://_the_website_/update.json [] []
 [2015-02-20 15:30:51] auto-update.DEBUG: No new version available [] []

Here's my update.json

{
    “1.4.0”: "http://_the_website_/1.4.0.zip",
    “1.5.0”: "http://_the_website_/1.5.0.zip"
}

Here's my index.php script

<?php

require '../vendor/autoload.php';

use \VisualAppeal\AutoUpdate;

$update = new AutoUpdate(__DIR__ . '/temp', __DIR__ . '/../', 60);
$update->setCurrentVersion('1.4.0'); //Must be an integer - you can't compare strings
$update->setUpdateUrl('http://_the_website_'); //Replace with your server update directory

// Optional:
//$update->addLogHandler(new Monolog\Handler\StreamHandler(__DIR__ . '/update.log'));
//$update->setCache(new Desarrolla2\Cache\Adapter\File(__DIR__ . '/cache'), 3600);

//Check for a new update
if ($update->checkUpdate() === false)
    die('Could not check for updates! SEe log file for details.');

if ($update->newVersionAvailable()) {
    //Install new update
    echo 'New Version: ' . $update->getLatestVersion() . '<br>';
    echo 'Installing UPdates: <br>';
    echo '<pre>';
    var_dump(array_map(function($version) {
        return (string) $version;
    }, $update->getVersionsToUpdate()));
    echo '</pre>';

    $result = $update->update();
    if ($result === true) {
        echo 'Update successful<br>';
    } else {
        echo 'Update failed: ' . $result . '!<br>';
        if ($result = AutoUpdate::ERROR_SIMULATE) {
            echo '<pre>';
            var_dump($update->getSimulationResults());
            echo '</pre>';
        }
    }


} else {
    echo 'Current Version is up to date<br>';
}

echo 'Log:<br>';
echo nl2br(file_get_contents(__DIR__ . '/update.log'));

PHP Requirement

Can you tell me why PHP 5.4 is no longer supported? Did you add something that is only supported in PHP 5.5+?

AutoUpdate.php Line 338 Error

I'm testing the new version and I get this error.

PHP Parse error:  syntax error, unexpected '[' in C:\inetpub\wwwroot\mamobile_test\vendor\visualappeal\php-auto-update\src\AutoUpdate.php on line 338

BUG

$filename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $fileStats['filename']);

$fileStats['filename'] -> $fileStats['name']

$absoluteFilename = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->installDir . $filename);

, $this->installDir . $filename); -> , $this->installDir);

if ($zip->extractTo($absoluteFilename, $fileStats['filename']) === false) {

$fileStats['filename'] -> $fileStats['name']

which License?

Can you please add information about the license?

thanks

What happens if the user skipped multiple updates?

Hello,
I just had a look at your code and it looks quite good so far,
but then I found that you are only downloading the latest version, which would either force the user to never skip an update or the developer has to include all previous updates in the new version.zip file, which would lead to quite big zip files containing useless data for some users.
So wouldn't it be better to just loop through all the skipped versions and download them and afterwards install them?
Greetings, flx5.

Update from server-side

Hello,

Would be great if we could have a list of clients in the server side and be able to update all of them from there

Is it possible?
Thanks!

Monolog Dependency

I am currently using Monolog 1.22., but PHP Auto Update requires 1.21.

Is there something in 1.22.* that is not supported in the latest release of PHP Auto Update?

Error Message:
- visualappeal/php-auto-update 0.9.4 requires monolog/monolog 1.21.* -> satisfiable by monolog/monolog[1.21.0] but these conflict with your requirements or minimum-stability.

Need help

Hello,

cool project :-)

But i have any questions. Can you help me?

I make the Server/client config und the update file to update, but it seems like SIMULATE.

[2016-10-17 15:10:56] auto-update.DEBUG: Latest update downloaded to "/html/cms/temp/0.2.0.zip" [] []
[2016-10-17 15:10:56] auto-update.NOTICE: Trying to install update "/html/cms/temp/0.2.0.zip" [] []
[2016-10-17 15:10:56] auto-update.NOTICE: [SIMULATE] Install new version [] []
[2016-10-17 15:10:56] auto-update.NOTICE: Update "0.2.0" successfully installed [] []
[2016-10-17 15:10:56] auto-update.DEBUG: Trying to delete update file "/html/cms/temp/0.2.0.zip" after successfull update [] []
[2016-10-17 15:10:56] auto-update.INFO: Update file "/html/cms/temp/0.2.0.zip" deleted after successfull update [] []

Where kann i set run a LIVE Update?
Where set the Version change after Update?

greetings Sam

Let AutoUpdate class throw exceptions

Hi!

Please remove the @ chars from the class, so one can handle connection exceptions in their program. Exceptions are an important part of object oriented programming.

Thanks!

Zip extraction with top level file fails

Hi,

I have an update package that looks like this:

UPDATE.md
logs/
  test.txt

The extraction of UPDATE.md fails with this exception:

ZipArchive::extractTo(/var/www/html/mysecretapp/UPDATE.md/UPDATE.md): failed to open stream: No such file or directory

Strange thing is that, when debugging, like the extraction should actually work (sorry for the blurring, it all says the same very secret application name 😉):

grafik

I don't really get why the path is duplicated.

Edit: Oh, and the foldername is /var/www/html/mysecretapp/.

addDebug error in AutoUpdate.php

Hi
in line 589

$this->_log->addDebug('[SIMULATE] Update script "%s" found', $absoluteFilename);

replace by

$this->_log->addDebug(sprintf('[SIMULATE] Update script "%s" found', $absoluteFilename));

CURLOPT_SSL_VERIFYHOST

Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in C:\xampp\htdocs\xx\xxx\xxx\vendor\visualappeal\php-auto-update\src\AutoUpdate.php on line 590

contact stablehost to update to php to 5.6 , 7.0

Hi,

For security reasons and an increase in speed I want to update the PHP version of my WordPress website to PHP 7. WordPress also strongly recommends the latest version of PHP on their requirements page, https://wordpress.org/about/requirements/.

More information about currently supported versions of PHP can be found here: http://php.net/supported-versions.php.

I've heard that sometimes a website can break when updating the PHP version. Can you assist me and update my site safely to PHP 7?

Thanks!

Could not update `\update/../files/file1.php`, not writeable!

Hello @VisualAppeal

First of all simple and great script.

While we were testing, we notice that if (!is_writable($this->installDir.$filename)) is called to check if the file is writable or not.

What is there is a case where a new files needs to be added, since the file is new then the check would fail and stop the script execution as it returns false.

Hope you are getting me...

Add php 8.0 support to composer.json

Hi!

I can not install the package in PHP 8. Can you please also add 8.0 to composer.json

Problem 1

    - Installation request for visualappeal/php-auto-update 0.13.1 -> satisfiable by visualappeal/php-auto-update[0.13.1].

    - visualappeal/php-auto-update 0.13.1 requires php ^7.2.0 -> your PHP version (8.0.0) does not satisfy that requirement.

Thank you!

Dynamic currentVersion

Hello,

The currentVersion variable in index.php (client side) should be dynamic, and change when the update is complete

index.php code in question:
$update->currentVersion = 1;

It's a static field, if I update my code to Version 2, I have to change this value manually, wich kills the purpose of an automated PHP system

Thanks

Error certificate with Curl

[2019-01-02 13:27:56] auto-update.NOTICE: Checking for a new update... [] []
[2019-01-02 13:27:56] auto-update.DEBUG: Get new updates from https://mysite.com/migrations/1.1/update.json [] []
[2019-01-02 13:27:56] auto-update.ERROR: Could not download update "https://mysite.com/migrations/1.1/update.json" via curl: SSL: no alternative certificate subject name matches target host name 'mysite.com'! [] []
[2019-01-02 13:27:56] auto-update.ERROR: Could not download update file "https://mysite.com/migrations/1.1/update.json" via curl! [] []

And PHP Error

Fatal error: Class 'VisualAppeal\Exceptions\DownloadException' not found in /home/mysite/public_html/lib/src/AutoUpdate.php on line 444

update.ini wrong url path

I had an update.ini file that looked like this.

[1]
version = 1.4
url = http://192.168.1.15/mamobile_update/1.4.zip

When the script tried to download the update, the path looked like this.

url = http://192.168.1.15/mamobile_update/1.zip 

For some reason it was using 1.zip instead of 1.4.zip

I had to change the update.ini like this for it to work correctly

[1.4]
version = 1.4
url = http://192.168.1.15/mamobile_update/1.4.zip

Shouldn't it be getting the full path from url?

Update database ?

Hello,
how to update the database at the same time as the update?
Thanks.

Replace LogHandler with LoggerInterface

Hi,

I am currently testing this library and noticed that it is only possible to set a Monolog\Handler\HandlerInterface for logging.

I think that using a Psr\Log\LoggerInterface would be a better option.

In a typical dependency injection chain I would not directly use a Handler for logging but rather the logger itself.

If this seems sensible I could submit a PR.

New release?

Hi,

thanks for this library, really useful and intuitive! Are you planning to add a new release anytime soon? I'm currently using the git-master as a dependency in composer because of the fixes applied after 0.9.2 (see #18 ). This messes up my CI workflow, since composer install also creates .git/ directories which I then have to exclude from the artifact … etc. Would really appreciate a new release version 👍 😃

New folders and files

New files and folders are not created.
Its ok to update files that already exist but imagine you need to update your scripts with some new files and folders.
Is this a normal procedure?

Update failed: 70!

i have problem
#1 what is this error


Notice: Undefined variable: zip in C:\xampp\htdocs\PHP-Auto-Update-master\updater\src\AutoUpdate.php on line 694

Warning: zip_close() expects parameter 1 to be resource, null given in C:\xampp\htdocs\PHP-Auto-Update-master\updater\src\AutoUpdate.php on line 694
Update failed: 70!

array(32) {
  [0]=>
  array(3) {
    ["filename"]=>
    string(6) "files/"
    ["foldername"]=>
    string(66) "C:\xampp\htdocs\PHP-Auto-Update-master\example\client\update/..//."
    ["absolute_filename"]=>
    string(71) "C:\xampp\htdocs\PHP-Auto-Update-master\example\client\update/..//files/"
  }

#2

how can use this code in codeigniter or other frameworks

subdirs created as files, touch throws exception.

Hi!

All the subdirs are created as files. And after that touch throws invalid argument exception.
Also is_dir returns false on subdirs.

I'm trieing on windows with xampp. I know that on linux folders are files too. Maybe this is the problem? I'll check it on linux later.

Can you please fix these problems? Thanx!

Unknown file extension "stable"

I have made a branch support but now the updater says to me:

[2015-02-24 16:29:45] auto-update.NOTICE: Checking for a new update... [] []
[2015-02-24 16:29:45] auto-update.DEBUG: Get new updates from http://media.xxxx.de/rpicms/server/update.json.stable [] []
[2015-02-24 16:29:45] auto-update.INFO: Unknown file extension "stable" [] []

What must I change to allow this file extension? Or can branches made as an feature?

Double slashes?

When checking the update logs, I noticed that appears with each entry a double slash?
Get new updates from https://update.server.de/folder//modul/update.json [] []
Furthermore, I always get the error "File not found" with Windows Server and everything works fine on Linux. Would be very grateful for an advice. Best regards, Daniel

Totally broken.

Hi,
I freshly required the library over composer and tried implementing it into my existing code. After a first Test run, I had 2 Unknown Variables in the source of this library... Like how could this happen? I'm just using it to update stuff?? You cannot tell me that nobody else ran into this issue.

Nevertheless, I will build on this foundation and created a fork where I'll be refactor the code and fix the above mentioned errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.