php-general Digest 2 Jun 2011 17:02:52 -0000 Issue 7340

Topics (messages 313307 through 313312):

Re: PHP 5.3.3 operator & problem
        313307 by: 李白|字一日
        313310 by: Lester Caine

Re: notices nightmare - looking for a regex solution
        313308 by: Hans Åhlin

Re: [PHP-WEBMASTER] encoding issue
        313309 by: Richard Quadling
        313311 by: Geoff Shang

Re: phpsadness
        313312 by: Daniel Brown

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 ---
both php 5.1.6 and php 5.3.3 are php 5.
but it seems they are different in processing & operator.

2011/6/2 Simon J Welsh <[email protected]>

> On 2/06/2011, at 2:44 PM, 李白|字一日 wrote:
>
> > hi, all
> >
> > i currently have a project which using & operator on creating a new
> object.
> >
> > like:
> >  $class =& new Class();
> >
> > it works properly in  php 5.1.6,
> > but not in php 5.3.3
> > and it gives offset errors to me.
> >
> > is there anyone knows why and how to fix this problem?
>
> In PHP 5, objects are always assigned by reference, you do not need to make
> it explicit.
> ---
> Simon Welsh
> Admin of http://simon.geek.nz/
>
>

--- End Message ---
--- Begin Message ---
李白|字一日 wrote:
both php 5.1.6 and php 5.3.3 are php 5.
but it seems they are different in processing&  operator.

PHP5.3 changed a lot of things that are more than simple updates so you need to treat 5.3 as a major upgrade. It was a sort of PHP6 rather than a .X more minor one, so a lot of things now flag warnings.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
2011/6/2 Merlin Morgenstern <[email protected]>:
> Hi there,
>
> I am working on a pretty huge site with thousands of files with php code.
> Unfortunatelly the app throws a ton of notices du to missing '' in arrays.
> Of course I could simply disable the output on the dev server to surpress
> notices, but I would rather like to get it fixed.
>
> Has somebody a good idea on how to fix this automated somehow with regex?
>
> The vars are right now: $var[element] and should be $var['element']
>
> I was looking into sed, but I was hoping that there is also a way in php.
> Has anybody a hint on how to get the regex done?
>
> I appreciate any help on that.
>
> Best regards,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I don't have the time to write a complete script, but here is an idea
(Pseudocode):

Read dir.
Foreach "File"{

    open file
    new var $NewFile
    new var $Line
  foreach "Line"{
    read new line, look for "$?[?]"

   tmp var $Pos = strpos($Line, '[')+1
   tmp var $Pos2 = strpos($NewFile, ']')
   tmp var $Ctrl = true

   while($Ctrl){

    if( $Line[$Pos] !='$' && $Line[$Pos] != '\''] && $Line[$Pos] !=
'"']){ //or some reg match (it's probably the wisest to use so you can
find blank spaces before $ ' or "){

        add the content of the line before $Pos-1 to $NewFile
        add ' or " to $NewFile
        add content between $Pos-1 and $Pos2 to $NewFile
        add ' or " and the ']' to $NewFile

       search the rest of the line for more arrays in the same way
        $Pos = strpos($Line, '[', $Pos2)
        $Pos2 = strpos($Line, ']' , $Pos)
        if($Pos == false || $Pos2 == false){
            $Ctrl = false
        }
    }else{
       copy the whole line to $NewFile
    }
    add \r\n to $NewFile
   }
  }
 save file
}
-- 


**********************************************
 Hans Åhlin
   Tel: +46761488019
   icq: 275232967
   http://www.kronan-net.com/
   irc://irc.freenode.net:6667 - TheCoin
**********************************************

--- End Message ---
--- Begin Message ---
On 2 June 2011 06:34, bandhu chithi <[email protected]> wrote:
> Hi There,
>
> I have a website up & running.
>
> I want to change my developer, but the code of the website is entirely in
> coded format and when i took the backup and passed it on to my new
> developer, they can not read anything and all the .php files looks the same
> except the name of the files.
>
> So what shall i do to get my code. Being an owner of the website, i don't
> have any control, feeling so helpless.
>
> Any sort of help is welcome.
>
> Regards,
>
> Bandhu
>

[Moved to PHP General list]

By the sounds it it, the developer has used an encoder to protect his
work from being sold/reused without him being paid for it.

If you are able to supply 1 file (you'd have probably zip the file
first to preserve it's content and have to send it to me directly as
the mailing list would just bounce it), then I could take a look and
see what I see. Various encoders leave a "fingerprint" behind - though
not all.

One way you can check to see if an encoder was used is to create a
file called info.php and have it contain ...

<?php
phpinfo();

Just those 2 lines.

Place this in the same directory as your existing files on your web server.

Now load http://www.your-site-name-here.com/info.php

Look through the page, seeing if you see anything related to an
"encoder". Some that come to mind ... Zend Guard, IONCube, NU-Coder.

If you see something like that, then that suggests a decoder (the
decoders tend to be free and would have been installed when you got
your site working), is being used.


Depending upon the contract you had with the developer, you may be
entitled to the source or not.

I'm guessing you paid for "a web site". You got that. You didn't pay
for access to the source.

A bit like buying MS Office. You pay for a license to use the
software. You do not buy the source.


What can you do?

In the first instance, I'd ask the developer for the source. If you've
had a falling out, don't worry. If he is running a proper business, he
shouldn't let personal issue get in the way (too much), but don't pay
too much though. Consider the cost to you of buying the code vs paying
for a new developer to build a copy of the site.

There are other possibilities, but they could have legal repercussions
- essentially reversing the encoding may be considered as an attempt
to bypass a copyright protection system which could contravene the
http://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act.

Personally, for a business, I'd not consider that as an option. If you
use a tool to do this and then rely upon the code that is made
available, you could open yourself up for a nice little law suit.

Please note : I am not a lawyer.

Of course, there could be any other reason why you can't read the
code, but without seeing at least 1 file, it would be hard to say why.

Regards,

Richard Quadling.
-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--- End Message ---
--- Begin Message ---
On Thu, 2 Jun 2011, Richard Quadling wrote:

There are other possibilities, but they could have legal repercussions
- essentially reversing the encoding may be considered as an attempt
to bypass a copyright protection system which could contravene the
http://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act.

Note that the DMCA is United States legislation and may not be relevant. Copyright law is pretty universal though and you could get into trouble with this anyway.

Geoff.


--- End Message ---
--- Begin Message ---
On Tue, May 31, 2011 at 22:13, Bill Guion <[email protected]> wrote:
>
> So if I understand, you want an explode() with empty parameters to explode
> the host machine?

    That's correct.  If it causes too much userland confusion, we can
alias it as detonate() as well.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---

Reply via email to