php-general Digest 4 Oct 2010 08:05:12 -0000 Issue 6972

Topics (messages 308408 through 308416):

Re: Vermis - new issue tracker in PHP
        308408 by: Ashley Sheridan
        308409 by: Lukasz Cepowski

Is it possible to create a global namespace alias?
        308410 by: Matt Palermo

Syntax Error
        308411 by: Gary
        308412 by: chris h
        308414 by: Ashley Sheridan
        308416 by: kranthi

cant find uploaded file in /tmp.
        308413 by: Prekates Alexandros
        308415 by: Ashley Sheridan

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 ---
On Sun, 2010-10-03 at 11:38 +0200, Lukasz Cepowski wrote:

> Hello,
> 
> I would like to introduce the project that I'm working on for a few 
> months :)
> Project is called Vermis (lat. bug, worm). It is an Open Source issue 
> tracker and project management tool for software developers and project 
> managers that has been created for improving quality of code, efficiency 
> and speed of development. Designed as a standard web application written 
> in PHP, it can be used on almost any platform and hosting service, 
> including Windows, Linux and more.
> 
> Project is available here http://vermis.diabloware.com
> The online demo is here http://vermis.diabloware.com/demo
> 
> The long term goal is to compete with commercial products like Jira and 
> other open source software like Trac, Redmine, Mantis, Bugzilla etc.
> Vermis is being distributed under terms of GNU General Public License, 
> so you can use it both in open and closed source projects.
> 
> Why Vermis exists?
> - Jira has a lot of features but it is hard to use, and first of all it 
> is a commercial software
> - Redmine needs RoR which is resource consuming
> - Trac needs Python
> - Bugzilla needs Perl
> - Mantis, hmm i just didn't like it ;)
> 
> Why Vermis is better than the other products?
> - Vermis is written in PHP and uses MySQL, which is probably the most
> widespread and the cheapest web platform nowadays
> - It doesn't require any additional software on a hosting server (except 
> mod_rewrite which is also very popular)
> - Currently it has similar functionalities lika Jira
> - It growns very fast :)
> 
> What Vermis already has?
> - Multiple projects in one place
> - Web access from any place on Earth
> - Public and private projects
> - Many types of issues
> - Components
> - Milestones
> - Versioning and the history of changes
> - Dynamic grids (issue navigator)
> - Many user accounts
> - Online registration
> - Notes
> - File upload
> - Comments
> - Progress bars
> - Email notifications
> 
> What Vermis will have?
> - API via SOAP or REST
> - Graphical reporting
> - Burndown charts
> - Agile support (Scrum)
> - Custom issue types, priorities, statuses, etc
> - Dynamic access control list
> - Automatic collecting reports from the external applications
> - Wrappers for PHP, Java, C#
> - many more ;)
> 
> I'm inviting to watch, test and use Vermis.
> Since version 1.0 RC3 Vermis is its own bugtracker, which is available 
> at http://bugs.diabloware.com
> The latest source code you can download from 
> http://vermis.diabloware.com/download
> Any questions you can post at the official project's forum which is at 
> http://forum.diabloware.com
> 
> I'm looking forward for any feedback, comments and critique :)
> 
> Thanks,
> Lukasz (cepa) Cepowski
> DiabloWare :: Software from Hell!
> www.diabloware.com | www.cepowski.pl
> skype: lukasz.cepowski
> cell:  +48 502 670 711
> 


I like what you've done there. The way you've got the name of the bug in
the URL is good also, which is very different to how Mantis and Bugzilla
do it.

There was one slight issue I found with the search feature. I added a
bug called 'new bug 3rd Sept 2010', but when I searched for the words
'new bug' (without quotes) it wasn't found. Also, when I tried putting
quotes around the two words in the search box, the quote marks were
escaped back into the search box value as \'new bug\'

Aside from that, it all looks good, and I look forward to being able to
use it in the future.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On 03.10.2010 13:04, Ashley Sheridan wrote:
On Sun, 2010-10-03 at 11:38 +0200, Lukasz Cepowski wrote:

Hello,

I would like to introduce the project that I'm working on for a few
months :)
Project is called Vermis (lat. bug, worm). It is an Open Source issue
tracker and project management tool for software developers and project
managers that has been created for improving quality of code, efficiency
and speed of development. Designed as a standard web application written
in PHP, it can be used on almost any platform and hosting service,
including Windows, Linux and more.

Project is available here http://vermis.diabloware.com
The online demo is here http://vermis.diabloware.com/demo

The long term goal is to compete with commercial products like Jira and
other open source software like Trac, Redmine, Mantis, Bugzilla etc.
Vermis is being distributed under terms of GNU General Public License,
so you can use it both in open and closed source projects.

Why Vermis exists?
- Jira has a lot of features but it is hard to use, and first of all it
is a commercial software
- Redmine needs RoR which is resource consuming
- Trac needs Python
- Bugzilla needs Perl
- Mantis, hmm i just didn't like it ;)

Why Vermis is better than the other products?
- Vermis is written in PHP and uses MySQL, which is probably the most
widespread and the cheapest web platform nowadays
- It doesn't require any additional software on a hosting server (except
mod_rewrite which is also very popular)
- Currently it has similar functionalities lika Jira
- It growns very fast :)

What Vermis already has?
- Multiple projects in one place
- Web access from any place on Earth
- Public and private projects
- Many types of issues
- Components
- Milestones
- Versioning and the history of changes
- Dynamic grids (issue navigator)
- Many user accounts
- Online registration
- Notes
- File upload
- Comments
- Progress bars
- Email notifications

What Vermis will have?
- API via SOAP or REST
- Graphical reporting
- Burndown charts
- Agile support (Scrum)
- Custom issue types, priorities, statuses, etc
- Dynamic access control list
- Automatic collecting reports from the external applications
- Wrappers for PHP, Java, C#
- many more ;)

I'm inviting to watch, test and use Vermis.
Since version 1.0 RC3 Vermis is its own bugtracker, which is available
at http://bugs.diabloware.com
The latest source code you can download from
http://vermis.diabloware.com/download
Any questions you can post at the official project's forum which is at
http://forum.diabloware.com

I'm looking forward for any feedback, comments and critique :)

Thanks,
Lukasz (cepa) Cepowski
DiabloWare :: Software from Hell!
www.diabloware.com | www.cepowski.pl
skype: lukasz.cepowski
cell:  +48 502 670 711



I like what you've done there. The way you've got the name of the bug in
the URL is good also, which is very different to how Mantis and Bugzilla
do it.

There was one slight issue I found with the search feature. I added a
bug called 'new bug 3rd Sept 2010', but when I searched for the words
'new bug' (without quotes) it wasn't found. Also, when I tried putting
quotes around the two words in the search box, the quote marks were
escaped back into the search box value as \'new bug\'

Aside from that, it all looks good, and I look forward to being able to
use it in the future.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Thanks for your reply ;)

Vermis is still under development, actually this is the first version that can be widespreaded and used in production environment.
I will add this bug to project's bugtracker at http://bugs.diabloware.com
If you would like to trace project's progress just create an account at http://bugs.diabloware.com join Vermis project, and you will get automatic email messages about what has been changed.

Thanks,
Lukasz (cepa) Cepowski
DiabloWare :: Software from Hell!
www.diabloware.com | www.cepowski.pl
skype: lukasz.cepowski
cell:  +48 502 670 711


--- End Message ---
--- Begin Message ---
Is it possible to create a global namespace alias in PHP or does the alias 
have to be defined in EVERY file that I use?  Here is an example:

file:  main.php
<?php
use \this\is\my\custom\namespace\Item as nsItem;
?>


file:  index.php
<?php
require_once “main.php”;

// Attempt to use namespace alias defined in main.php file
nsItem::test();
?>


The above code doesn’t work for me.  The namespace alias defined in the 
main.php file isn’t accessible in the index.php file.  Is there a way to make 
the “nsItem” alias a “global” one, so that I don’t have to define it in EVERY 
file that I want to use?

-Matt

--- End Message ---
--- Begin Message ---
I have just created a registration page using Webassist, and I am getting a
syntax error that I am not understanding.  Anyone be able to point me in the
right direction?

You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near ' NULL, NULL)' at
line 1

This is the code (I have not modified it)

<?php require_once('Connections/local.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
// *** Redirect if username exists
$MM_flag="MM_insert";
if (isset($_POST[$MM_flag])) {
$MM_dupKeyRedirect="";
$loginUsername = $_POST['id'];
$LoginRS__query = "SELECT id FROM family WHERE id='" . $loginUsername . "'";
mysql_select_db($database_local, $local);
$LoginRS=mysql_query($LoginRS__query, $local) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);

//if there is a row in the database, the username was found - can not add
the requested username
if($loginFoundUser){
$MM_qsChar = "?";
//append the username to the redirect page
if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
$MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar
."requsername=".$loginUsername;
header ("Location: $MM_dupKeyRedirect");
exit;
}
}
?>
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

?>
<?php
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] ==
"WAATKRegistrationForm")) {
$insertSQL = sprintf("INSERT INTO family (firstname, lastname, email,
password, relationship, story, image, ip, submitted) VALUES (%s, %s, %s, %s,
%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['firstname'], "text"),
GetSQLValueString($_POST['lastname'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['relationship'], "text"),
GetSQLValueString($_POST['story'], "text"),
GetSQLValueString($_POST['image'], ""), GetSQLValueString($_POST['ip'],
"text"), GetSQLValueString($_POST['submitted'], "date"));

mysql_select_db($database_local, $local);
$Result1 = mysql_query($insertSQL, $local) or die(mysql_error());

$insertGoTo = "family_LogIn.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>

Thanks again for the help.

Gary



__________ Information from ESET Smart Security, version of virus signature 
database 5499 (20101003) __________

The message was checked by ESET Smart Security.

http://www.eset.com





--- End Message ---
--- Begin Message ---
On Sun, Oct 3, 2010 at 12:47 PM, Gary <[email protected]> wrote:

> I have just created a registration page using Webassist, and I am getting a
> syntax error that I am not understanding.  Anyone be able to point me in
> the
> right direction?
>
> You have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near ' NULL, NULL)'
> at
> line 1
>
> This is the code (I have not modified it)
>
> <?php require_once('Connections/local.php'); ?>
> <?php
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
>
> $theValue = function_exists("mysql_real_escape_string") ?
> mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
>
> switch ($theType) {
> case "text":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> break;
> case "long":
> case "int":
> $theValue = ($theValue != "") ? intval($theValue) : "NULL";
> break;
> case "double":
> $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
> break;
> case "date":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> break;
> case "defined":
> $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
> break;
> }
> return $theValue;
> }
> }
> ?>
> <?php
> // *** Redirect if username exists
> $MM_flag="MM_insert";
> if (isset($_POST[$MM_flag])) {
> $MM_dupKeyRedirect="";
> $loginUsername = $_POST['id'];
> $LoginRS__query = "SELECT id FROM family WHERE id='" . $loginUsername .
> "'";
> mysql_select_db($database_local, $local);
> $LoginRS=mysql_query($LoginRS__query, $local) or die(mysql_error());
> $loginFoundUser = mysql_num_rows($LoginRS);
>
> //if there is a row in the database, the username was found - can not add
> the requested username
> if($loginFoundUser){
> $MM_qsChar = "?";
> //append the username to the redirect page
> if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
> $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar
> ."requsername=".$loginUsername;
> header ("Location: $MM_dupKeyRedirect");
> exit;
> }
> }
> ?>
> <?php
> $editFormAction = $_SERVER['PHP_SELF'];
> if (isset($_SERVER['QUERY_STRING'])) {
> $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
> }
>
> ?>
> <?php
> if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] ==
> "WAATKRegistrationForm")) {
> $insertSQL = sprintf("INSERT INTO family (firstname, lastname, email,
> password, relationship, story, image, ip, submitted) VALUES (%s, %s, %s,
> %s,
> %s, %s, %s, %s, %s)",
> GetSQLValueString($_POST['firstname'], "text"),
> GetSQLValueString($_POST['lastname'], "text"),
> GetSQLValueString($_POST['email'], "text"),
> GetSQLValueString($_POST['password'], "text"),
> GetSQLValueString($_POST['relationship'], "text"),
> GetSQLValueString($_POST['story'], "text"),
> GetSQLValueString($_POST['image'], ""), GetSQLValueString($_POST['ip'],
> "text"), GetSQLValueString($_POST['submitted'], "date"));
>
> mysql_select_db($database_local, $local);
> $Result1 = mysql_query($insertSQL, $local) or die(mysql_error());
>
> $insertGoTo = "family_LogIn.php";
> if (isset($_SERVER['QUERY_STRING'])) {
> $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
> $insertGoTo .= $_SERVER['QUERY_STRING'];
> }
> header(sprintf("Location: %s", $insertGoTo));
> }
> ?>
>
> Thanks again for the help.
>
> Gary
>
>
>
> __________ Information from ESET Smart Security, version of virus signature
> database 5499 (20101003) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

MySQL is not liking a query.  It looks to be this one:

$insertSQL = sprintf("INSERT INTO family (firstname, lastname, email,
password, relationship, story, image, ip, submitted) VALUES (%s, %s, %s, %s,
%s, %s, %s, %s, %s)",

I would echo or log $insertSQL just before you pass it to mysql_query() and
see if the SQL syntax looks right.


Chris.

--- End Message ---
--- Begin Message ---
On Sun, 2010-10-03 at 13:14 -0400, chris h wrote:

> On Sun, Oct 3, 2010 at 12:47 PM, Gary <[email protected]> wrote:
> 
> > I have just created a registration page using Webassist, and I am getting a
> > syntax error that I am not understanding.  Anyone be able to point me in
> > the
> > right direction?
> >
> > You have an error in your SQL syntax; check the manual that corresponds to
> > your MySQL server version for the right syntax to use near ' NULL, NULL)'
> > at
> > line 1
> >
> > This is the code (I have not modified it)
> >
> > <?php require_once('Connections/local.php'); ?>
> > <?php
> > if (!function_exists("GetSQLValueString")) {
> > function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> > $theNotDefinedValue = "")
> > {
> > $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
> >
> > $theValue = function_exists("mysql_real_escape_string") ?
> > mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
> >
> > switch ($theType) {
> > case "text":
> > $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> > break;
> > case "long":
> > case "int":
> > $theValue = ($theValue != "") ? intval($theValue) : "NULL";
> > break;
> > case "double":
> > $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
> > break;
> > case "date":
> > $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> > break;
> > case "defined":
> > $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
> > break;
> > }
> > return $theValue;
> > }
> > }
> > ?>
> > <?php
> > // *** Redirect if username exists
> > $MM_flag="MM_insert";
> > if (isset($_POST[$MM_flag])) {
> > $MM_dupKeyRedirect="";
> > $loginUsername = $_POST['id'];
> > $LoginRS__query = "SELECT id FROM family WHERE id='" . $loginUsername .
> > "'";
> > mysql_select_db($database_local, $local);
> > $LoginRS=mysql_query($LoginRS__query, $local) or die(mysql_error());
> > $loginFoundUser = mysql_num_rows($LoginRS);
> >
> > //if there is a row in the database, the username was found - can not add
> > the requested username
> > if($loginFoundUser){
> > $MM_qsChar = "?";
> > //append the username to the redirect page
> > if (substr_count($MM_dupKeyRedirect,"?") >=1) $MM_qsChar = "&";
> > $MM_dupKeyRedirect = $MM_dupKeyRedirect . $MM_qsChar
> > ."requsername=".$loginUsername;
> > header ("Location: $MM_dupKeyRedirect");
> > exit;
> > }
> > }
> > ?>
> > <?php
> > $editFormAction = $_SERVER['PHP_SELF'];
> > if (isset($_SERVER['QUERY_STRING'])) {
> > $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
> > }
> >
> > ?>
> > <?php
> > if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] ==
> > "WAATKRegistrationForm")) {
> > $insertSQL = sprintf("INSERT INTO family (firstname, lastname, email,
> > password, relationship, story, image, ip, submitted) VALUES (%s, %s, %s,
> > %s,
> > %s, %s, %s, %s, %s)",
> > GetSQLValueString($_POST['firstname'], "text"),
> > GetSQLValueString($_POST['lastname'], "text"),
> > GetSQLValueString($_POST['email'], "text"),
> > GetSQLValueString($_POST['password'], "text"),
> > GetSQLValueString($_POST['relationship'], "text"),
> > GetSQLValueString($_POST['story'], "text"),
> > GetSQLValueString($_POST['image'], ""), GetSQLValueString($_POST['ip'],
> > "text"), GetSQLValueString($_POST['submitted'], "date"));
> >
> > mysql_select_db($database_local, $local);
> > $Result1 = mysql_query($insertSQL, $local) or die(mysql_error());
> >
> > $insertGoTo = "family_LogIn.php";
> > if (isset($_SERVER['QUERY_STRING'])) {
> > $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
> > $insertGoTo .= $_SERVER['QUERY_STRING'];
> > }
> > header(sprintf("Location: %s", $insertGoTo));
> > }
> > ?>
> >
> > Thanks again for the help.
> >
> > Gary
> >
> >
> >
> > __________ Information from ESET Smart Security, version of virus signature
> > database 5499 (20101003) __________
> >
> > The message was checked by ESET Smart Security.
> >
> > http://www.eset.com
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> MySQL is not liking a query.  It looks to be this one:
> 
> $insertSQL = sprintf("INSERT INTO family (firstname, lastname, email,
> password, relationship, story, image, ip, submitted) VALUES (%s, %s, %s, %s,
> %s, %s, %s, %s, %s)",
> 
> I would echo or log $insertSQL just before you pass it to mysql_query() and
> see if the SQL syntax looks right.
> 
> 
> Chris.


Does sprintf enclose the replacement strings in single quotes, as I
don't believe it does, so it could be that it is choking on.

Try running the SQL through something like phpMyAdmin, or a dedicated
tool like MySQL Workbench, which should be able to pin-point the issue
if it's not immediately obvious.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
As pointed out echo $insertSQl should help you locate many trivial
problems. But using PDO will avoid these kind of problems

--- End Message ---
--- Begin Message ---
Hi to the list.

Trying to test php upload i used a very simple scrip.
I managed to upload files but i dont understand why the dont
stay in the /tmp dir where the initialy are put even if i dont move them
to another dir.

alex.

--- End Message ---
--- Begin Message ---
On Sun, 2010-10-03 at 20:53 +0300, Prekates Alexandros wrote:

> Hi to the list.
> 
> Trying to test php upload i used a very simple scrip.
> I managed to upload files but i dont understand why the dont
> stay in the /tmp dir where the initialy are put even if i dont move them
> to another dir.
> 
> alex.
> 


Files are put into the /tmp directory by Apache, before PHP is even
aware of them. Unless you create a copy of the file, then Apache will
clean it up after your script has run (or at least it's supposed to, but
sometimes /tmp becomes a little cluttered with crud)

The best thing to do is to use move_uploaded_file to move the file to
someplace, and give the file a new name (or keep the same one and add an
extension if you want to ensure the file is given a unique name in the
directory you're putting it into)

There are lots of different scripts on the manual page for
move_uploaded_file if you're feeling a little stuck. As a safety
precaution, it's considered good practice to copy the file to a location
outside of your document root. So if your document root
is /var/www/html/ then maybe put the file in /var/www/user_files/ . This
means that people can't use your website to upload their own scripts and
gain access to your server, although it does mean you need to find an
alternative way to serve up that file if you need, but that is quite
easy, and there are lots of example scripts about for that if you need;
many people on the list have written their own, and Tedd most likely has
an example somewhere too!

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---

Reply via email to