php-general Digest 11 May 2008 04:32:34 -0000 Issue 5452

Topics (messages 274116 through 274124):

Improving development process / help with developer setup
        274116 by: robert mena
        274117 by: David Otton
        274123 by: Gabriel Sosa

Month with leading zeros
        274118 by: Ron Piggott
        274119 by: David Otton
        274120 by: David Otton

Division [maybe a bug]
        274121 by: jo opp

Re: unsubscribe
        274122 by: Jim Lucas

PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?
        274124 by: Rahul

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 ---
Hi,
I am looking for tips regarding improving the development process.  I'll
explain my current setup and please feel free to comment.

My developers all use windows + eclipse PDT, the workspace is hosted (via
samba) in a Linux server with Apache/PHP/MySQL.   I am in the process of
adopting Unit testing (PHPUnit2) and debug (Xdebug) so I have concerns about
how to property use this.

For example, in my current setup I'd have to enable SSH so they could run
the tests from the command line in the development server, but I am not sure
if I could remotely use Xdebug.

Thanks.

--- End Message ---
--- Begin Message ---
2008/5/10 robert mena <[EMAIL PROTECTED]>:

> I am looking for tips regarding improving the development process.  I'll
> explain my current setup and please feel free to comment.
>
> My developers all use windows + eclipse PDT, the workspace is hosted (via
> samba) in a Linux server with Apache/PHP/MySQL.   I am in the process of
> adopting Unit testing (PHPUnit2) and debug (Xdebug) so I have concerns about
> how to property use this.
>
> For example, in my current setup I'd have to enable SSH so they could run
> the tests from the command line in the development server, but I am not sure
> if I could remotely use Xdebug.

Your description (specifically, Samba) suggests that you're not using
source control. If you want to go for TDD (I don't know that you do,
but IMO it's a good direction to move in) I would suggest a
three-server setup - dev, staging and live.

The dev server(s) are where you work. One per developer. Once you're
happy with your code and your tests, you commit your changes to source
control. This is where it gets clever. You can use pre- and
post-commit hooks to run an automated build process that pushes the
changes to a staging server, automatically runs the unit tests, and
accepts/rejects the commits based on the test results. You can even
lint the code, and reject anything that isn't in the house style.

With larger projects, where an entire publish-and-test on each commit
becomes impractical, you can just run the build process and unit tests
every n hours, and mail out the results.

Publishing to the live server is simply a matter of running the build
scripts with a different destination.

On top of all that, run an issue tracker. /Everything/ goes in the
issue tracker, bugs, features, whatever. When you make a commit, that
commit should be closing an issue in the issue tracker (via commit
hooks again). That way you can track each change that's been made back
to its reason.

All of this is opinion, of course, there's no Right Way. Just take
what's useful to you.

--- End Message ---
--- Begin Message ---
I suggest you if you are running live on linux, then developing on
linux, could be the same dist or not..
but definitely don't mix OS, because the extensions could fail, etc.
one big issue it's the case insensitive in windows.

definitely some version control system such as SVN or GIT

you can use Hudson for continuous integration

and selenium for automatics QA test over browsers

again, try to don't mix OS.

saludos

gabriel

On Sat, May 10, 2008 at 1:44 PM, David Otton <[EMAIL PROTECTED]> wrote:
> 2008/5/10 robert mena <[EMAIL PROTECTED]>:
>
>> I am looking for tips regarding improving the development process.  I'll
>> explain my current setup and please feel free to comment.
>>
>> My developers all use windows + eclipse PDT, the workspace is hosted (via
>> samba) in a Linux server with Apache/PHP/MySQL.   I am in the process of
>> adopting Unit testing (PHPUnit2) and debug (Xdebug) so I have concerns about
>> how to property use this.
>>
>> For example, in my current setup I'd have to enable SSH so they could run
>> the tests from the command line in the development server, but I am not sure
>> if I could remotely use Xdebug.
>
> Your description (specifically, Samba) suggests that you're not using
> source control. If you want to go for TDD (I don't know that you do,
> but IMO it's a good direction to move in) I would suggest a
> three-server setup - dev, staging and live.
>
> The dev server(s) are where you work. One per developer. Once you're
> happy with your code and your tests, you commit your changes to source
> control. This is where it gets clever. You can use pre- and
> post-commit hooks to run an automated build process that pushes the
> changes to a staging server, automatically runs the unit tests, and
> accepts/rejects the commits based on the test results. You can even
> lint the code, and reject anything that isn't in the house style.
>
> With larger projects, where an entire publish-and-test on each commit
> becomes impractical, you can just run the build process and unit tests
> every n hours, and mail out the results.
>
> Publishing to the live server is simply a matter of running the build
> scripts with a different destination.
>
> On top of all that, run an issue tracker. /Everything/ goes in the
> issue tracker, bugs, features, whatever. When you make a commit, that
> commit should be closing an issue in the issue tracker (via commit
> hooks again). That way you can track each change that's been made back
> to its reason.
>
> All of this is opinion, of course, there's no Right Way. Just take
> what's useful to you.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Los sabios buscan la sabiduría; los necios creen haberla encontrado.
Gabriel Sosa

--- End Message ---
--- Begin Message ---
I am wanting to change 

         echo "<option value=\"" . $months[$month] . "\"";

to output the month number, between 01 and 12 --- DATE value m, the
month with leading 0's.  How do I do this?  $months is an array, as I
have shown below.  Ron

<?php
$months = array('1' => 'January', '2' => 'February', '3' => 'March', '4'
=> 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August',
'9' => 'September', '10' => 'October', '11' => 'November', '12' =>
'December');

$current_month = DATE("n");

echo "<SELECT NAME=\"order_received_month\">\r\n";

foreach (range(1, 12) as $month)
     {
         echo "<option value=\"" . $months[$month] . "\"";

if ( $month == $current_month ) { echo " SELECTED";}

echo">" . $months[$month] . "</option>\r\n";
     }
?>
</select>


--- End Message ---
--- Begin Message ---
2008/5/10 Ron Piggott <[EMAIL PROTECTED]>:
> I am wanting to change
>
>         echo "<option value=\"" . $months[$month] . "\"";
>
> to output the month number, between 01 and 12 --- DATE value m, the
> month with leading 0's.  How do I do this?  $months is an array, as I
> have shown below.  Ron
>
> <?php
> $months = array('1' => 'January', '2' => 'February', '3' => 'March', '4'
> => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August',
> '9' => 'September', '10' => 'October', '11' => 'November', '12' =>
> 'December');
>
> $current_month = DATE("n");
>
> echo "<SELECT NAME=\"order_received_month\">\r\n";
>
> foreach (range(1, 12) as $month)
>     {
>         echo "<option value=\"" . $months[$month] . "\"";
>
> if ( $month == $current_month ) { echo " SELECTED";}
>
> echo">" . $months[$month] . "</option>\r\n";
>     }
> ?>
> </select>

Try this (from memory, untested).

for ($i = 1; $i >= 12; $i++)
{
    $month = date( 'm', strtotime( "1970-$i-01" ));
    echo "<option value=\"$i\">$month</option>";
}

Or this:

printf( "%02d", 5 );

However, please consider replacing numeric identifiers for months with
textual ones ('M' rather than 'm'). [01] [Apr] [2008] doesn't cause
the confusion that [01] [04] [2008] does.

--- End Message ---
--- Begin Message ---
> for ($i = 1; $i >= 12; $i++)

I'm an idiot.

for ($i = 1; $i <= 12; $i++)

--- End Message ---
--- Begin Message ---
Hello!

$var1= 2155243640%31104000;
$var2= 2147309244%31104000;

echo $var1 // Return -24651656
echo $var2 // Return 1133244

$var2 return the correct result, but $var1 is wrong (the correct
result is 9067640)

¿?

Thanks for the help

--- End Message ---
--- Begin Message ---
bobcray wrote:
unsubscribe

Go to http://www.php.net/mailing-lists.php and do it yourself!

--- End Message ---
--- Begin Message --- I am using Fedora Core 4. As I was unable to use PHP or MySQL together, I uninstalled both of them and installed again using the following commands:

yum install mysql

And then

apt-get install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick

And then started the mysql server.

I am able to connect to the server from the console my typing

mysql -h <hostname> -u root -p <mypass>

However, when I try to connect to mysql through PHP I get the following errors:

PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /export/home/rahul/may/sample.php on line 5 PHP Warning: mysql_query(): A link to the server could not be established in /export/home/rahul/may/sample.php on line 5 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Can someone please help me out?

--- End Message ---

Reply via email to