php-general Digest 10 Mar 2007 09:14:49 -0000 Issue 4669
Topics (messages 250182 through 250193):
Hive Dekoder
250182 by: Richard Lynch
250183 by: Tijnema !
DB_DataContainer
250184 by: php trainer
Re: looking for two remote functions
250185 by: Riyadh S. Alshaeiq
Troubles from the newb again
250186 by: Jeff Taylor
250187 by: Robert Cummings
250188 by: Ryan Fielding
250189 by: Jeff Taylor
250190 by: Jeff Taylor
250191 by: Robert Cummings
250192 by: Stut
250193 by: M.Sokolewicz
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Short Version:
Anybody got a good quick clean hack to "crack" Hive Logic Enkoder?
CC me off-list on this one, please.
Long Version:
So this guy I'm working for has 55,000 web pages he built by hand, and
I need to scrape them into a database, to assimilate them into the new
system where all the new documents are db-driven.
In some of these documents, he used the Hive Logic Enkoder online to
create that gnarly JavaScript to obfuscate emails, and pasted it into
hist documents.
[And in some cases back in 2000 he didn't, which is one of the reasons
for importing and re-publishing all these documents, so we can control
email exposure much better.]
So what I need is a Hive Logic Dekoder.
I've found phpjs, which seemed like a winner, but it choked on my
first sample. :-(
I've found J4P5 (Javascript 4 (for) PHP 5) which requires PHP 5,
which, for complex reasons not relevant here, we're not using (yet).
If I absolutely HAVE to, I can probably convince gentoo to install PHP
5 CLI next to PHP 4, and run it via exec() from PHP4, just for this
one task. Sounds pretty cumbersome, and I like to K.I.S.S.
Plus, it took me a week to figure out how to trick Gentoo into giving
me pcntl in PHP 4 CLI and not in APXS, and to have both installed at
the same time. So getting PHP 5 without it assuming I'm trying to
upgrade and remove PHP 4 would probably take another week or two, just
to install. :-(
J4P5 references MetaPHP, which looks really nifty, but I don't want to
write my own PHP4-based JS interpreter in MetaPHP, as I'm a)
unqualified and b) under time constraints that make that *WAY* out of
scope.
I could, in theory, run Windows plus a COM object to fire up IE and
possibly hook into the DOM to get the result of the JS, as I have a
testing framework I hacked from a php|arch article that does that...
Except I'm not using Windows here, so I'd have to re-do the whole
thing with, errr, whatever is the moral equivalent...
I suppose I could attempt (again) to use Perl [shudder] and get that
Package thingie I've heard of that lets Perl execute JS, and then
exec() Perl to execute the JS, but that sounds awfully cumbersome, and
I'm a K.I.S.S. kind of guy.
At this point, I've got several unattractive options, and am hoping
somebody who has been down this road can help me eliminate some of
them, or, in an ideal world, point me to the perfect solution I've
managed to miss.
CC me on this one, please.
TIA!
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--- End Message ---
--- Begin Message ---
Maybe you want to give an example of what you have, and what it should be
after decoding.
I have no idea what Hive Logic Enkoder exactly does, but somebody might give
you a help on how to decode.
Tijnema
On 3/9/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
Short Version:
Anybody got a good quick clean hack to "crack" Hive Logic Enkoder?
CC me off-list on this one, please.
Long Version:
So this guy I'm working for has 55,000 web pages he built by hand, and
I need to scrape them into a database, to assimilate them into the new
system where all the new documents are db-driven.
In some of these documents, he used the Hive Logic Enkoder online to
create that gnarly JavaScript to obfuscate emails, and pasted it into
hist documents.
[And in some cases back in 2000 he didn't, which is one of the reasons
for importing and re-publishing all these documents, so we can control
email exposure much better.]
So what I need is a Hive Logic Dekoder.
I've found phpjs, which seemed like a winner, but it choked on my
first sample. :-(
I've found J4P5 (Javascript 4 (for) PHP 5) which requires PHP 5,
which, for complex reasons not relevant here, we're not using (yet).
If I absolutely HAVE to, I can probably convince gentoo to install PHP
5 CLI next to PHP 4, and run it via exec() from PHP4, just for this
one task. Sounds pretty cumbersome, and I like to K.I.S.S.
Plus, it took me a week to figure out how to trick Gentoo into giving
me pcntl in PHP 4 CLI and not in APXS, and to have both installed at
the same time. So getting PHP 5 without it assuming I'm trying to
upgrade and remove PHP 4 would probably take another week or two, just
to install. :-(
J4P5 references MetaPHP, which looks really nifty, but I don't want to
write my own PHP4-based JS interpreter in MetaPHP, as I'm a)
unqualified and b) under time constraints that make that *WAY* out of
scope.
I could, in theory, run Windows plus a COM object to fire up IE and
possibly hook into the DOM to get the result of the JS, as I have a
testing framework I hacked from a php|arch article that does that...
Except I'm not using Windows here, so I'd have to re-do the whole
thing with, errr, whatever is the moral equivalent...
I suppose I could attempt (again) to use Perl [shudder] and get that
Package thingie I've heard of that lets Perl execute JS, and then
exec() Perl to execute the JS, but that sounds awfully cumbersome, and
I'm a K.I.S.S. kind of guy.
At this point, I've got several unattractive options, and am hoping
somebody who has been down this road can help me eliminate some of
them, or, in an ideal world, point me to the perfect solution I've
managed to miss.
CC me on this one, please.
TIA!
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Could someone explain what this does and why it's beneficial?
Thanks,
Ed
--------------------------------------------------
if (version_compare(phpversion(), '5.0.0', 'ge')) {
class DB_DataContainer_Overload {
function __call($method,$args) {
$retval = null;
$this->___call($method,$args,$retval);
return($retval);
}
}
} else {
eval('
class DB_DataContainer_Overload {
function __call($method,$args,&$retval) {
return($this->___call($method,$args,$retval));
}
}
');
}
--- End Message ---
--- Begin Message ---
Thank you Mickey, but I have already looked in there and the function posted
in the notes is working just fine for getting the size on disk which I am
not interested in..
Riyadh
-----Original Message-----
From: Mikey [mailto:[EMAIL PROTECTED]
Sent: 9/Mar/2007 2:57 PM
To: [email protected]
Subject: Re: looking for two remote functions
Riyadh S. Alshaeiq wrote:
> Hello everybody,
>
> I am looking for an HTTP function for getting remote filesizes. Keeping
in
> mind that I am NOT interested in getting the "size on disk" figure, I need
> the actual size of the files when downloaded to a local machine. Please
let
> me know if there are any..
>
> Another thing, I also need a remote function that gets the created date
and
> last modified separately, if possible..
>
> Best regards
>
>
>
>
Try looking here:
http://uk.php.net/manual/en/function.filesize.php
If the function itself isn't of use to you, look further down in the
notes and I am sure you will find something useful.
Mikey
--- End Message ---
--- Begin Message ---
Hey everyone,
Newb back again - Im trying to populate my arrays, but getting this error
again:
Warning: Illegal offset type in
c:\Inetpub\wwwroot\MyProjects\SecondOffering\myFuncs.php on line 242
Code:
$newarray = array();
foreach ($array as $name)
{
if ($name->currentHP >0)
{
$newarray[$name];
}
}
--- End Message ---
--- Begin Message ---
On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote:
> Hey everyone,
> Newb back again - Im trying to populate my arrays, but getting this error
> again:
> Warning: Illegal offset type in
This usually means that you are using a non-scalar value as an index.
Use var_dump( $array ) to see what's in there. You will probably find
one of the following: an array, and object, or the null value.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote:
Hey everyone,
Newb back again - Im trying to populate my arrays, but getting this error
again:
Warning: Illegal offset type in
This usually means that you are using a non-scalar value as an index.
Use var_dump( $array ) to see what's in there. You will probably find
one of the following: an array, and object, or the null value.
Cheers,
Rob.
A good habit to get into is always using if(is_array()) when using foreach.
--- End Message ---
--- Begin Message ---
Is it possible to just add a value to the existing? here is my current
script:
foreach ($newarray as $name)
{
$newarray[$name] = $name->currentInitiative =
rand(1,$name->GetInitiative()));
}
// sort array by ranking (initiative)
sort($newarray,SORT_NUMERIC);
can I change the $newarray[$name] to something to represent the current
element and just add the value to it?
I might be able to work around it then
""Jeff Taylor"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey everyone,
> Newb back again - Im trying to populate my arrays, but getting this error
> again:
> Warning: Illegal offset type in
> c:\Inetpub\wwwroot\MyProjects\SecondOffering\myFuncs.php on line 242
>
> Code:
> $newarray = array();
> foreach ($array as $name)
> {
> if ($name->currentHP >0)
> {
> $newarray[$name];
> }
> }
--- End Message ---
--- Begin Message ---
Yeah I have, but what I dont understand is that the value of $name is an
object, and was accepted in the original array as the index:
the original array was:
$me = new Toon(xxxx,xxx,xxx,xxxx,xxx,etc,etc,etc)
$him = new Toon(xxx,xxxxxx,xxxxx,etc,etc,etc,etc)
....
$array=array($me,$him)
So this new array, I want to isolate those toons still alive:
if alive then
add toon to new array
Is this possible in anyway?
The reason why I dont want it to put it in a value:
foreach ($newarray as $name)
{
if (in_array($name,$characters))
{
$newarray[$name] = 1;
}
else
{
$newarray[$name] = 2;
}
}
Sorry for the spam everyone
"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote:
> > Hey everyone,
> > Newb back again - Im trying to populate my arrays, but getting this
error
> > again:
> > Warning: Illegal offset type in
>
> This usually means that you are using a non-scalar value as an index.
> Use var_dump( $array ) to see what's in there. You will probably find
> one of the following: an array, and object, or the null value.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
On Sat, 2007-03-10 at 16:39 +1100, Ryan Fielding wrote:
> Robert Cummings wrote:
> > On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote:
> >
> >> Hey everyone,
> >> Newb back again - Im trying to populate my arrays, but getting this error
> >> again:
> >> Warning: Illegal offset type in
> >>
> >
> > This usually means that you are using a non-scalar value as an index.
> > Use var_dump( $array ) to see what's in there. You will probably find
> > one of the following: an array, and object, or the null value.
> >
> > Cheers,
> > Rob.
> >
> A good habit to get into is always using if(is_array()) when using foreach.
Sure, if you don't know what is in the array and are quite happy to
waste cycles calling a function on every single value :( ... In other
words... HELL NO! You shouldn't have to filter your data if it should
already be in an expected format. If it isn't in the expected format
then you have a bug -- fix the bug instead of "handling" it within every
foreach loop that touches the data.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Jeff Taylor wrote:
Is it possible to just add a value to the existing? here is my current
script:
foreach ($newarray as $name)
{
$newarray[$name] = $name->currentInitiative =
rand(1,$name->GetInitiative()));
}
// sort array by ranking (initiative)
sort($newarray,SORT_NUMERIC);
can I change the $newarray[$name] to something to represent the current
element and just add the value to it?
I might be able to work around it then
That's not the problem. Your problem is that you are trying to use an
object ($name) as the key of an array. You can't do this. Array keys
must be a scalar value, that is to say a 'normal' value (essentially a
string or a number).
The object in $name probably has some unique value that represents that
particular instance. Use that instead of the object itself.
-Stut
--- End Message ---
--- Begin Message ---
Jeff Taylor wrote:
Yeah I have, but what I dont understand is that the value of $name is an
object, and was accepted in the original array as the index:
the original array was:
$me = new Toon(xxxx,xxx,xxx,xxxx,xxx,etc,etc,etc)
$him = new Toon(xxx,xxxxxx,xxxxx,etc,etc,etc,etc)
....
$array=array($me,$him)
Hell no,
there's a difference between:
$array[$me] and array($me);
The first results in:
$array[$me] = null;
the other results in
$array[0] = $me;
Note that in the 2nd one you assign $me as the first value of the array,
and in the 1st one you assign $me to be the first index/key of the array
(with a null value).
So this new array, I want to isolate those toons still alive:
if alive then
add toon to new array
Is this possible in anyway?
The reason why I dont want it to put it in a value:
foreach ($newarray as $name)
{
if (in_array($name,$characters))
{
$newarray[$name] = 1;
}
else
{
$newarray[$name] = 2;
}
}
Sorry for the spam everyone
Then use $name as being an actual NAME (aka "string") instead of the
entire `toon` you are talking about (aka "object").
- tul
--- End Message ---