Welcome Guest, Not a member yet? Register   Sign In
Check if new version available?
#1

[eluser]Spelljack[/eluser]
Hello. Is there any url that prints current CodeIgniter version? I am building a cli tool with php for myself. I want to check if there is new version of CodeIgniter. If there is, I will replace the new one with mine.
#2

[eluser]marcogmonteiro[/eluser]
humm, that's a good question, I'd like to know that myself.
#3

[eluser]danmontgomery[/eluser]
CodeIgniter.php:

Code:
/*
* ------------------------------------------------------
* Define the CodeIgniter Version
* ------------------------------------------------------
*/
define('CI_VERSION', '2.0.2');
#4

[eluser]Spelljack[/eluser]
[quote author="noctrum" date="1308584855"]CodeIgniter.php:

Code:
/*
* ------------------------------------------------------
* Define the CodeIgniter Version
* ------------------------------------------------------
*/
define('CI_VERSION', '2.0.2');
[/quote]

I know that. Please read my question carefully!

I want to download if there is new version of CodeIgniter via PHP.
#5

[eluser]danmontgomery[/eluser]
You can use the BitBucket API to check for new tags, something like https://api.bitbucket.org/1.0/repositori...ctor/tags/
#6

[eluser]adityamenon[/eluser]
Hi, I would do this using the main page of http://codeigniter.com/

Just navigate to html->body#home->div#wrapperWit->div#gooey->div#home_banner->ul->li[0]->em using simplehtmldom(http://simplehtmldom.sourceforge.net/), DOMDocument Class(http://php.net/manual/en/class.domdocument.php) or any other DOM parser of your choice Smile

That html code never changes AFAIK, just set up your script so that you get an email whenever the version value is not returned. This way, you will know when you need to make changes to your script whenever EllisLab decides to change the markup on the home page.
#7

[eluser]Spelljack[/eluser]
[quote author="adityamenon" date="1308589688"]Hi, I would do this using the main page of http://codeigniter.com/

Just navigate to html->body#home->div#wrapperWit->div#gooey->div#home_banner->ul->li[0]->em using simplehtmldom(http://simplehtmldom.sourceforge.net/), DOMDocument Class(http://php.net/manual/en/class.domdocument.php) or any other DOM parser of your choice Smile

That html code never changes AFAIK, just set up your script so that you get an email whenever the version value is not returned. This way, you will know when you need to make changes to your script whenever EllisLab decides to change the markup on the home page.[/quote]

Yes. I can grab the current version of CI from main page. But I think there should be a URI for this purpose. After all CI is phenomenom of flexibility and simplicity. I don't like the idea of parsing the CI main site to get what I need. There could be some cases that execution time of application is important.

Many CI users could want to check their framework is uptodate or not. Or I could write a library or something that updates framework automaticly if newer version available. There is much more posibilities with a URI that returns current version of CI.

I am requesting for a URI that just returns Current version of CodeIgniter in a plain/text.
And a URI that prints out changes in new version in a plain/text.
#8

[eluser]Aken[/eluser]
It's a nice thought - I wouldn't mind seeing that, either.

In the meantime, the User Guide is a fairly static piece of documentation - you could easily parse both the current version and change log from the CI.com user guide pages. I can pull the most recent version with three lines of code.
Code:
$html = file_get_contents('http://ellislab.com/codeigniter/user-guide');

preg_match('/<h1>CodeIgniter User Guide Version ([0-9\.]+)<\/h1>/', $html, $match);

$latest_version = $match[1];
#9

[eluser]Spelljack[/eluser]
[quote author="Aken" date="1308657204"]It's a nice thought - I wouldn't mind seeing that, either.

In the meantime, the User Guide is a fairly static piece of documentation - you could easily parse both the current version and change log from the CI.com user guide pages. I can pull the most recent version with three lines of code.
Code:
$html = file_get_contents('http://ellislab.com/codeigniter/user-guide');

preg_match('/<h1>CodeIgniter User Guide Version ([0-9\.]+)<\/h1>/', $html, $match);

$latest_version = $match[1];
[/quote]

Yes. I am using the same method for now. But what about if someone decide to change the raw html of user guide, or main site? I think it is not reliable. After all we will rely on this information that we grab.

What about if I create an automatic update library. It will rely on title of the user guide. And someone decide to change title to "CodeIgniter User Guide - Version 2.0.2". What happens? No one can know for sure. There could be an error that ruins all project. Because I am trusting it to update project core files. This error could delete all project.

Thanks.


P.S.: I am not much of a english speaker. Forgive me if I did some typo, spelling and grammar mistakes.
#10

[eluser]danmontgomery[/eluser]
Relying on someone else not to change their HTML structure to pull something like version information is a terrible idea, sorry.

Did anyone even check the link I posted? You can easily get version information for every release back to 1.6.1 in json, xml or yaml.




Theme © iAndrew 2016 - Forum software by © MyBB