Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Friday, June 6, 2008

New download of the cvs repository on Windows

I have moved to a new laptop, and I had to get all the data from the cvs repository to this new one.
I wasn't even expecting so many problems with the WinCVS application to have!
No, it's not that WinCVS is bad. It's great. The point is that It gives so many options to accomodate so many users behaviours that at someome moment these options became a burden!

So I have finally decided to describe, step-by-step all the operations one needs to do in order to download new repository to his/her place.
This list is for cvs windows only.
I may to do this for Linux/Unix as well some time.
If you want to install WinCVS then, please, search on the Internet, wait for my new blog, or write to me in the comments.


RUN: <<<WinCVS>>>

MENU: <<<Admin/Login...>>>
EDIT: <<<CVSROOT:>>> - avoid using <<<...>>> It's overly confusing. It is better to enter the path:
:pserver;username=USERNAME;hostname=HOSTNAME:REPOSITORY
EXAMPLE: :pserver;username=john;hostname=our.server.org:/Projects

BUTTON: <<<OK>>>
The CVS will ask you for the password which will be stored at your machine
in an encrypted form and will be used for communication every time you
access the repository, but until you click MENU: <<<Admin/Logout>>>
MENU: <<<Remote/Checkout module...>>>
DIALOG: <<<Checkout settings>>>
EDIT: <<<Module name and path on the server:>>>
ProjectAlpha
EDIT: <<<Local folder to checkout to:>>>
CHANGE IT so it points at the ROOT directory where the ProjectAlpha directory will be created.
EXAMPLE: c:\JohnsProject\ (yes, add the backslash at the end!)

NOTE: If you DO NOT WANT to create the ProjectAlpha\ directory in the c:\JohnsProject one then you need to do:
CHECKBOX: <<<Check out into directory:>>> Turn in ON
EDIT: <<<Check out into directory:>>>
JohnsProject
COMBOBOX: <<<CVSROOT:>>>
Drop down menu and select the last one that you have enteted a few steps above.
BUTTON: <<<OK>>>
Off you go!



-------------------------------------
After this operation, you will have your selected directory (c:\JohnsProject\ProjectAlpha, or c:\JohnsProject only) populated with the data.
from the server.

Tuesday, May 13, 2008

Setting up registry to run .php scripts from command line

I wanted to have a script in php that I could run in the following way:

c:\tmp> myscript.php argument1 "second argument"

This is what I came up to:

a) In the file explorer (not internet! file!) double click on your .php script, select the 'Select the program from a list', Browse to php.exe, mark 'always use the selected program to open this kind of file', and accept.

This, will create a HKEY_CLASS_ROOT/.php entry with the value php_auto_file.
It will also create the HKEY_CLASS_ROOT/php_auto_file/shell/open/command with the default entry: "c:\php\php.exe" "%1"
(the path to the php.exe file depends on where you have installed php in!)

This kind of registration will allow you now running your scripts from the command line but it WON'T allow you to pass any arguments.

b) That's why you have to the HKEY_CLASS_ROOT/php_auto_file/shell/open/command entry to the following: "c:\php\php.exe" "%1" %*

Here you go. Now you can prepare your myscript.php to look like this, and test the execution:
print_r( $argv ) ;
?>

myscript.php argument1 "second argument"

Result:

Array
(
[0] => c:\tmp\myscript.php
[1] => argument1
[2] => second argument
)