Advertisement

09.08.2007 at 09:24PM PDT, ID: 22815780
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Simple PHP Script

Asked by nerdzoll in PHP Scripting Language, Scripting Languages, Shell Scripting

Tags: , ,

Hi Guys,
I want to have a PHP script that I can run from my webserver (in a secure directory using httpd authentication) so that I can do an svn update command on several directories on my server.

For example, I currently have the following Bash Script:
--------------------------------------------------------------------
#!/bin/bash
echo "Updating FIT"
cd /home/scryan
svn update
echo ""
echo "Updating DSPP"
cd /home/scryan/dspp
svn update
echo""
echo "Updating Study"
cd /home/scryan/study
svn update
--------------------------------------------------------

Basically I would like to turn that into a php script that I can just browse to the page, hit a button Update SVN and it will run those commands and print the output to the page.

On the flip side I would also really like it if I could have another button on the page which said SVN Commit and would take a string of text then run the following:

------------------------------------------------------------
#!/bin/bash
host=`hostname`
echo ""
echo "Do you wish to do an SVN Commit? y/n "
read commit

if [ "$commit" == "y" ]
then
echo ""
echo "What Were you working on?"
echo "1 - DSPP"
echo "2 - FIT"
echo "3 - Study"
echo "4 - All (generic commit)"
echo ""
echo "Enter either 1, 2, 3 or 4 and press enter"
read svnnumber
if [ "$svnnumber" == "1" ]
then
cd /home/scryan/dspp
svn add --force *
echo "Enter commit message for DSPP Subversion Log"
read svn_commit_message
svn ci -m "$host Logout AutoCommit on: $date - $svn_commit_message"
elif [ "$svnnumber" == "2" ]
then
cd /home/scryan
svn add --force *
echo "Enter commit message for FIT Subversion Log"
read svn_commit_message
svn ci -m "$host Logout AutoCommit on: $date - $svn_commit_message"

elif [ "$svnnumber" == "3" ]
then
cd /home/scryan/study
svn add --force *
echo "Enter commit message for Study Subversion Log"
read svn_commit_message
svn ci -m "$host Logout AutoCommit on: $date - $svn_commit_message"
elif [ "$svnnumber" == "4" ]

then
cd /home/scryan
svn add --force *
echo "Enter commit message for *GENERAL COMMIT* to Subversion Log"
read svn_commit_message
svn ci -m "$host Logout AutoCommit on: $date - $svn_commit_message"

cd /home/scryan/study
svn add --force *
svn ci -m "$host Logout AutoCommit on: $date - $svn_commit_message"

cd /home/scryan/dspp
svn add --force *
svn ci -m "$host Logout AutoCommit on: $date - $svn_commit_message"
fi
fi
echo ""
------------------------------------------------------------

Does anyone know how I could do this, I am completely new to PHP (actually have never done any PHP before) and would really love if someone could please point me in the right direction.
Cheers
StuartStart Free Trial
[+][-]09.09.2007 at 12:04AM PDT, ID: 19856012

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, Scripting Languages, Shell Scripting
Tags: php, script, svn
Sign Up Now!
Solution Provided By: ray-solomon
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.09.2007 at 01:59AM PDT, ID: 19856186

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.09.2007 at 03:05AM PDT, ID: 19856281

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 - Hierarchy / EE_QW_2_20070628