You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by swdev <sw...@gmail.com> on 2005/03/19 11:49:54 UTC

PHP, Subversion and Hook Scripts

Hi all

My system
  Windows XP Pro + SP2
  Apache 2.0.52
  PHP 4.3.10
  Subversion 1.1.3 (r12730)
  TortoiseSVN 1.1.3 (2502)

Thanks for creating a great version control system and for making
it FREE!!

I have seen the example hook scripts and they use PERL and PYTHON.

1) Can I use PHP as I don't have either PERL or PYTHON installed on my
system and I don't know either language?

2) Are there any further examples of the kind of things these hook scripts
can do?

3) Is there a website with a collection of scripts?

4) Has anyone looked at creating a PHP extension module (library) that
can interface directly to the Subverion libraries?

5) Would anyone have any ideas as to how to go about implementing this?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP, Subversion and Hook Scripts

Posted by swdev <sw...@gmail.com>.
Thanks for the quick reply and clearing up my confusion about hook scripts.

I will check out svn's own tree as you suggest.

I have not come across SWIG before, but if someone is able to point me
in the right direction with some FAQs, general guidelines on how to
start, then I will have a bash (pun intended!) at creating some PHP
bindings.

I am a software developer, have been writing C and C++ code for 15+ years.




On Sat, 19 Mar 2005 06:06:13 -0600, Ben Collins-Sussman
<su...@collab.net> wrote:
> 
> On Mar 19, 2005, at 5:49 AM, swdev wrote:
> 
> > Hi all
> >
> > My system
> >   Windows XP Pro + SP2
> >   Apache 2.0.52
> >   PHP 4.3.10
> >   Subversion 1.1.3 (r12730)
> >   TortoiseSVN 1.1.3 (2502)
> >
> > Thanks for creating a great version control system and for making
> > it FREE!!
> >
> > I have seen the example hook scripts and they use PERL and PYTHON.
> >
> > 1) Can I use PHP as I don't have either PERL or PYTHON installed on my
> > system and I don't know either language?
> 
> It doesn't matter... you can write a hook script in COBOL if you want.
> Subversion simply tries to execute a particular filename, and then
> looks at the program's return value.
> 
> >
> > 2) Are there any further examples of the kind of things these hook
> > scripts
> > can do?
> 
> Have you read the template hook-scripts?  The ones you get when you
> create a repository?  They answer this question.  So does chapter 5 in
> the book.
> 
> 
> >
> > 3) Is there a website with a collection of scripts?
> >
> 
> The most common ones (authorization-checking ones for pre-commit, and
> mail-sending ones for post-commit) are kept in svn's own tree, in
> /trunk/contrib/hook-scripts/ and /trunk/tools/hook-scripts/
> 
> > 4) Has anyone looked at creating a PHP extension module (library) that
> > can interface directly to the Subverion libraries?
> >
> 
> We use SWIG to generate Perl and Python bindings to the svn C
> libraries... in theory it can generate bindings for PHP also.  Nobody's
> bothered to make that happen yet, so we're always looking for
> volunteers.
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: PHP, Subversion and Hook Scripts

Posted by Ben Collins-Sussman <su...@collab.net>.
On Mar 19, 2005, at 5:49 AM, swdev wrote:

> Hi all
>
> My system
>   Windows XP Pro + SP2
>   Apache 2.0.52
>   PHP 4.3.10
>   Subversion 1.1.3 (r12730)
>   TortoiseSVN 1.1.3 (2502)
>
> Thanks for creating a great version control system and for making
> it FREE!!
>
> I have seen the example hook scripts and they use PERL and PYTHON.
>
> 1) Can I use PHP as I don't have either PERL or PYTHON installed on my
> system and I don't know either language?

It doesn't matter... you can write a hook script in COBOL if you want.  
Subversion simply tries to execute a particular filename, and then 
looks at the program's return value.

>
> 2) Are there any further examples of the kind of things these hook 
> scripts
> can do?

Have you read the template hook-scripts?  The ones you get when you 
create a repository?  They answer this question.  So does chapter 5 in 
the book.


>
> 3) Is there a website with a collection of scripts?
>

The most common ones (authorization-checking ones for pre-commit, and 
mail-sending ones for post-commit) are kept in svn's own tree, in 
/trunk/contrib/hook-scripts/ and /trunk/tools/hook-scripts/

> 4) Has anyone looked at creating a PHP extension module (library) that
> can interface directly to the Subverion libraries?
>

We use SWIG to generate Perl and Python bindings to the svn C 
libraries... in theory it can generate bindings for PHP also.  Nobody's 
bothered to make that happen yet, so we're always looking for 
volunteers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org