hicklemr / rtgui

Automatically exported from code.google.com/p/rtgui
0 stars 1 forks source link

not working in PHP 5.4 #117

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
rtgui won't work in php 5.4. It is related with import_request_variables() 
which was removed in php 5.4.
I use version 0.2.8
Great software anyway
Thanks

Original issue reported on code.google.com by ion.dulg...@gmail.com on 26 Mar 2012 at 8:07

GoogleCodeExporter commented 8 years ago
A quick and _very_ dirty "solution" is to replace all lines containing :

  import_request_variables("gp","r_");

with the following two lines :

  foreach ($_POST as $key => $val) { $v = "r_$key"; $$v = $val; } 
  foreach ($_GET  as $key => $val) { $v = "r_$key"; $$v = $val; }

//krister

Original comment by kristerb...@gmail.com on 27 Mar 2012 at 6:05

GoogleCodeExporter commented 8 years ago
yes, i did this, and it worked, but as you said, it's a dirty solution
but there's another problem, and this one i can't figure it out, adding a 
torrent doesn't work, and no error it's thrown

Original comment by ion.dulg...@gmail.com on 28 Mar 2012 at 7:03

GoogleCodeExporter commented 8 years ago
I have the same problem.

Original comment by magostin...@gmail.com on 30 Mar 2012 at 9:32

GoogleCodeExporter commented 8 years ago
Add a torrent by file now works.

Add a 

  foreach ($_FILES as $key => $val) { $v = "r_$key"; $$v = $val; }

after the two ugly "foreach" statements in /usr/share/rtgui/www/control.php.

This is, of course, as hacky as it gets. 
The real solution would require lots of modifications to replace all the 
r_ variables with the corresponding $_GET/$_POST/$_FILES-variables.

//krister

Original comment by kristerb...@gmail.com on 1 Apr 2012 at 7:39

GoogleCodeExporter commented 8 years ago
New version to address this problem should be released in the next few days...

Original comment by lemonbe...@gmail.com on 5 Apr 2012 at 9:45

GoogleCodeExporter commented 8 years ago
Just in case it is usefull, I commited a patch set [0] to Debian git repository.

Regards,

[0] 
http://anonscm.debian.org/gitweb/?p=collab-maint/rtgui.git;a=blob_plain;f=debian
/patches/02-fixes-to-update-code-to-run-under-PHP-5.4.diff;hb=0f9a2f52cd98d748ed
d7726fbbe6f47b24db6fcb

Original comment by kocin...@gmail.com on 5 Apr 2012 at 2:18

GoogleCodeExporter commented 8 years ago
Thought I'd chime in with my two cents.. I just got around to updating my 
server... rtgui broke, did some digging, found out it was because of the 
upgrade to 5.4.

The solution I put in before I came here was to replace:

import_request_variables("gp","r_");

with:

extract($_REQUEST, EXTR_PREFIX_ALL|EXTR_REFS, 'r');

It appears to be working fine. I don't know if it's "better" or "less dirty" 
than the solution proposed by kristerb. Just figured I'd put it out there in 
case it is.

Original comment by flintcsci@gmail.com on 16 Jul 2012 at 1:49

GoogleCodeExporter commented 8 years ago
I updated rtgui in my system:
======
[Charlz_Klug@Meleena]/usr/local/www/rtgui>$ uname -a
FreeBSD Meleena.local 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 
UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
======
On rtgui's web page i see warning:
==================
Warning: extract() expects parameter 1 to be array, string given in 
/usr/local/www/rtgui/index.php on line 23
=================
My config.php:
=================
[Charlz_Klug@Meleena]/usr/local/www/rtgui>$ cat config.php
<?php
//
//  This file is part of rtGui.  http://rtgui.googlecode.com/
//  Copyright (C) 2007-2008 Simon Hall.
//
//  rtGui is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  rtGui is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with rtGui.  If not, see <http://www.gnu.org/licenses/>.

// Connect string for your local RPC/rTorrent connection:
$rpc_connect="http://localhost/RPC2";

// rtorrent 'watch' directory (used for upload torrent)
$watchdir="/home/p2p/dl/";

// Path to report disk usage
$downloaddir="/home/p2p/work";

// Threshold for disk usage alert (%)
$alertthresh=15;

// Time between ajax calls - default 5000 (5 secs).   Disable with 0
$defaultrefresh=5000;  

// Display tracker URL for each torrent on main page - you might want to 
disable this if you run lots (ie 30+ ?) 
// torrents - To get the tracker URL requires another RPC call for every 
torrent displayed.  
// If it's disabled, it only requires one RPC call to list all the torrents.
$displaytrackerurl=TRUE;

// URL to your rtGui installation (used in RSS feed).  Include trailing slash.
$rtguiurl="http://192.168.0.1/rtgui/";

// Speeds for the download cap settings dialog.
$defspeeds=array(5,10,15,20,30,40,50,60,70,80,90,100,125,150,200,250,300,400,500
,600,700,800,900,1000,1500,2000,5000,10000);

// Start download immediately after loading torrent
$load_start=FALSE;

// Enable debug tabs
$debugtab=FALSE;

// Tracker colour hilighting...
// Format is array(hexcolour, URL, URL, ...) The URL is a string to match 
identifiy tracker URL
// Add as many arrays as needed.
$tracker_hilite_default="#900";   // Default colour
$tracker_hilite[]=array("#990000","ibiblio.org","etree.org");
$tracker_hilite[]=array("#006699","another.com","tracker.mytracker.net","mytrack
er.com");
$tracker_hilite[]=array("#996600","moretrackers.com");

// Define your RSS feeds here - you can have as many as you like.   Used in the 
feedreader
// Feed name, feed URL, Direct download links? (0/1)
//$feeds[]=array("ibiblio.org","http://torrent.ibiblio.org/feed.php?blockid=3",0
);
//$feeds[]=array("etree","http://bt.etree.org/rss/bt_etree_org.rdf",0);
//$feeds[]=array("Utwente","http://borft.student.utwente.nl/%7Emike/oo/bt.rss",1
);

?>
================
How I can fix this warning?

Original comment by charlz.k...@gmail.com on 20 Jan 2013 at 6:07