rene7705 | 1 May 10:59 2012
Picon

code deployment through php

Hi folks.

I was here a while ago, trying to figure out how to keep deployment
instances of my common code, running on more than 1 site, in sync with
eachother.

I've looked at rsync which was recommended here, but didn't like it much,
nor could I find a good windows version of it.

So yesterday, I decided to try a pure PHP solution. My thinking was: run a
PHP sync script once on each physical machine that holds possibly multiple
copies of my common code, and FTP the common code only 1 time because I use
only 1 shared hosting account besides my windows development machine.

I've gotten it so far that it creates an imo good list of what to copy
where.

The only problem I can foresee is that the copy command will take more than
30 seconds, which makes it hard to run at the shared hoster.

And obviously, it's going to need some good input checking to prevent
abuse.

I've put up a demo at
http://skatescene.biz/sites/mediabeez.ws/sync_secret_cndj593n2/ , you can
"execute" the "code" job to see it in action.

I'll also post the working copy of my sync library at the bottom of this
post. The only thing missing is the actual copy($source,$dest), I think.

(Continue reading)

Camilo Sperberg | 1 May 11:11 2012
Picon

Re: code deployment through php


On 1 mei 2012, at 10:59, rene7705 wrote:

> Hi folks.
> 
> I was here a while ago, trying to figure out how to keep deployment
> instances of my common code, running on more than 1 site, in sync with
> eachother.
> 
> I've looked at rsync which was recommended here, but didn't like it much,
> nor could I find a good windows version of it.
> 
> So yesterday, I decided to try a pure PHP solution. My thinking was: run a
> PHP sync script once on each physical machine that holds possibly multiple
> copies of my common code, and FTP the common code only 1 time because I use
> only 1 shared hosting account besides my windows development machine.
> 
> I've gotten it so far that it creates an imo good list of what to copy
> where.
> 
> The only problem I can foresee is that the copy command will take more than
> 30 seconds, which makes it hard to run at the shared hoster.
> 
> And obviously, it's going to need some good input checking to prevent
> abuse.
> 
> I've put up a demo at
> http://skatescene.biz/sites/mediabeez.ws/sync_secret_cndj593n2/ , you can
> "execute" the "code" job to see it in action.
> 
(Continue reading)

rene7705 | 1 May 11:19 2012
Picon

Re: code deployment through php

On Tue, May 1, 2012 at 11:11 AM, Camilo Sperberg <unreal4u <at> gmail.com> wrote:

> If I understood the problem correctly, you want to keep a single copy of
> your code on every machine you work, including the final server.
>
>
Well, I want to work on 1 copy of my common code on my windows machine,
then sync those changes to all my sites (hosted on the win dev box) to see
if it messes up the other sites, then FTP those changes to my hosting
account, and run the sync script there as well.

> Have you read about SVN ? You can set up a cronjob to execute it
> automatically if you want, there are clients for Windows, Zend Studio, etc
> etc.
>

I've read about some source control systems, I've tried them out, but I'd
rather go for this simpler approach tbh.
I already do regular backups that are timestamped, it's enough for me right
now I think.
Stuart Dallas | 1 May 14:18 2012

Re: code deployment through php

On 1 May 2012, at 10:19, rene7705 wrote:

> On Tue, May 1, 2012 at 11:11 AM, Camilo Sperberg <unreal4u <at> gmail.com> wrote:
> 
>> If I understood the problem correctly, you want to keep a single copy of
>> your code on every machine you work, including the final server.
>> 
>> 
> Well, I want to work on 1 copy of my common code on my windows machine,
> then sync those changes to all my sites (hosted on the win dev box) to see
> if it messes up the other sites, then FTP those changes to my hosting
> account, and run the sync script there as well.
> 
> 
>> Have you read about SVN ? You can set up a cronjob to execute it
>> automatically if you want, there are clients for Windows, Zend Studio, etc
>> etc.
>> 
> 
> I've read about some source control systems, I've tried them out, but I'd
> rather go for this simpler approach tbh.
> I already do regular backups that are timestamped, it's enough for me right
> now I think.

If you really think rolling your own deployment system is simpler than using source control then I don't
think you've understood all of the advantages of source control. I know it can look complicated, but it's
really not, and it will make it far easier to keep track of what you're doing and what changes are deployed
where than the system you described. I strongly recommend you reconsider.

-Stuart
(Continue reading)

admin | 1 May 19:18 2012

RE: code deployment through php


-----Original Message-----
From: Stuart Dallas [mailto:stuart <at> 3ft9.com] 
Sent: Tuesday, May 01, 2012 8:19 AM
To: rene7705
Cc: Camilo Sperberg; php-general
Subject: Re: [PHP] code deployment through php

On 1 May 2012, at 10:19, rene7705 wrote:

> On Tue, May 1, 2012 at 11:11 AM, Camilo Sperberg <unreal4u <at> gmail.com>
wrote:
> 
>> If I understood the problem correctly, you want to keep a single copy 
>> of your code on every machine you work, including the final server.
>> 
>> 
> Well, I want to work on 1 copy of my common code on my windows 
> machine, then sync those changes to all my sites (hosted on the win 
> dev box) to see if it messes up the other sites, then FTP those 
> changes to my hosting account, and run the sync script there as well.
> 
> 
>> Have you read about SVN ? You can set up a cronjob to execute it 
>> automatically if you want, there are clients for Windows, Zend 
>> Studio, etc etc.
>> 
> 
> I've read about some source control systems, I've tried them out, but 
> I'd rather go for this simpler approach tbh.
(Continue reading)

Larry Garfield | 1 May 20:24 2012

Re: code deployment through php

On 5/1/12 4:19 AM, rene7705 wrote:
> On Tue, May 1, 2012 at 11:11 AM, Camilo Sperberg<unreal4u <at> gmail.com>  wrote:
>
>> If I understood the problem correctly, you want to keep a single copy of
>> your code on every machine you work, including the final server.
>>
>>
> Well, I want to work on 1 copy of my common code on my windows machine,
> then sync those changes to all my sites (hosted on the win dev box) to see
> if it messes up the other sites, then FTP those changes to my hosting
> account, and run the sync script there as well.
>
>
>> Have you read about SVN ? You can set up a cronjob to execute it
>> automatically if you want, there are clients for Windows, Zend Studio, etc
>> etc.
>>
>
> I've read about some source control systems, I've tried them out, but I'd
> rather go for this simpler approach tbh.
> I already do regular backups that are timestamped, it's enough for me right
> now I think.

No it's not.  Really.  For what you describe, a proper version control 
system is the correct tool.  Rolling your own with rsync and cron is 
setting yourself up for failure.

A couple people here have mentioned SVN.  I used to use SVN, but now 
have migrated everything I do to Git.  Without getting into a religious 
battle between Git and SVN, I do strongly recommend you look into it. 
(Continue reading)

Lester Caine | 1 May 21:03 2012
Picon

Re: code deployment through php

rene7705 wrote:
> Well, I want to work on 1 copy of my common code on my windows machine,
> then sync those changes to all my sites (hosted on the win dev box) to see
> if it messes up the other sites, then FTP those changes to my hosting
> account, and run the sync script there as well.

I have a number of windows based customers who also like to review what we are 
doing, so I ended up with HG. TortoiseHg provides a nice gui based DVCS system 
interface on Windows which works identically on Linux and I can push and pull 
changes around the place without having to worry about anything.

The servers 'pull' a copy of the code base from a local server master, which is 
managed from the development environment. Config information is protected on 
each site, and the whole thing works identically on both windows and linux so I 
don't have to worry what the customers are using. THEY can work to their own 
site and change what we give them access to, while the core code is managed from 
the central repo.

If they come up with something useful it can be merged back into the master copy 
:) One of the few pieces of software I actually pay for is BeyondCompare which 
provides the same cross platform facilities for merging files and with it's 
built in ftp interface allows manually inspecting the file structure on any of 
the machines. A couple of my Mac based customers are now investigating the same 
development base.

Add Eclipse/PHPEclipse on top and you have the ultimate cross platform IDE :)

--

-- 
Lester Caine - G8HFL
-----------------------------
(Continue reading)

Marco Behnke | 1 May 22:14 2012

Re: PHP Mailto() - Google now displaying HTML as Plain Text


Am 29.04.2012 22:31, schrieb Terry Ally (Gmail):
> Hi all,
>
> I have been using a mailto() script for the last three years and from April
> 25, 2012 incoming HTML email in Goggle mail is displaying as Plain Text.
>   Something clearly changed with Google. Perhaps there is some change I need
> to make with my script??
>
> $message .= "<p><b>Message:</b><blockquote>  ".$m."</blockquote></p>";
>

As far as I can see your main html tags are missing?

$message = '<html><body>' . $message . '</body></html>';

--

-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: marco <at> behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

(Continue reading)

Nathan Ridge | 2 May 08:45 2012
Picon

problem loading php extension: undefined reference to __gxx_personality_v0‏


Hi,

I'm having trouble loading a PHP extension that I made. 
When starting PHP, I get the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/libtg.so' -
/usr/lib/php5/20090626/libtg.so: undefined symbol: __gxx_personality_v0 in Unknown on line 0

libtg.so is my extension. It is a wrapper around a C++ library, made
using SWIG (http://www.swig.org/).

I know __gxx_personality_v0 is a symbol from libstdc++, but my extension,
libtg.so, is linked to libstdc++. I have confirmed this using ldd:

$ ldd libtg.so
linux-vdso.so.1 =>  (0x00007fff5f932000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f3fc937c000)
libm.so.6 => /lib/libm.so.6 (0x00007f3fc90f9000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f3fc8ee2000)
libc.so.6 => /lib/libc.so.6 (0x00007f3fc8b5f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3fc98fc000)

Any ideas as to why PHP is not finding this symbol, or how I can further 
diagnose the problem?

Thanks,
Nate 		 	   		  

--

-- 
(Continue reading)

rene7705 | 2 May 11:47 2012
Picon

Re: code deployment through php

I can't use anything like git on my shared hoster. But I suppose I could
use something like git at home, and use a sync script like I posted in my
OP on the shared hoster.

Gmane