Re: [PHP] Open source project management tool - PHP
OK one more the list http://dotproject.net/ Its a nice one with all project management features. Easy to use. Just checkout the website. Gaurav Kumar blog.oswebstudio.com On Fri, Dec 18, 2009 at 12:16 AM, Robert Cummings wrote: > Angelo Zanetti wrote: > >> Hi guys >> I would like to know what open source project management tools you use for >> your projects. >> >> We are looking at installing one that is PHP based and is easy to use. >> >> We have found: >> http://www.projectpier.org/ >> >> and >> >> http://trac.edgewall.org/ >> >> >> Has anyone used the above and how did you find them? Also are there any >> others you would recommend or not recommend and why? >> > > I use Mantis for most bug tracking needs. However, I've recently rolled out > OpenGoo for a couple of different clients. > > http://fengoffice.com/web/community/community_index.php > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] PHP to answer HEAD requests
Is it possible to use PHP to answer HEAD http requests? Is it as simple as doing something like: header('blah') exit; I'd expect PHP to produce a full page rather than just a header though. -- Dan FieldFfôn/Tel. +44 1970 632 582 Peiriannydd Meddalwedd Senior Software Engineer Llyfrgell Genedlaethol Cymru National Library of Wales
Re: [PHP] PHP to answer HEAD requests
2009/12/18 Dan Field : > Is it possible to use PHP to answer HEAD http requests? Is it as simple as > doing something like: > > header('blah') > exit; > > I'd expect PHP to produce a full page rather than just a header though. > > -- > Dan Field Ffôn/Tel. +44 1970 632 582 > Peiriannydd Meddalwedd Senior Software Engineer > Llyfrgell Genedlaethol Cymru National Library of Wales > > > > > $_SERVER['REQUEST_METHOD'] will/should contain the request type. Documented as ... "Which request method was used to access the page; i.e. 'GET', 'HEAD', 'POST', 'PUT'. Note: PHP script is terminated after sending headers (it means after producing any output without output buffering) if the request method was HEAD." See http://docs.php.net/manual/en/reserved.variables.server.php -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Logic of conditionals and the ( ) operators
In a nutshell: Will this work? if ($perm == (11 || 12)) Explanation: I am laying the groundwork for a photo viewing system with a private and public mode, and additionally if an admin is logged in, there is an additional level of permission. I came up with a number system to make it easier (and is calcualted by a class) so now, instead of checking against the $mode variable, if the user is logged in, and then what their user level is if they are logged in, I just check against some numbers (the class evaluates all those conditions and assigns the appropriate number a single permission variable, $perm.
Re: [PHP] Logic of conditionals and the ( ) operators
On Fri, 2009-12-18 at 10:21 -0800, Allen McCabe wrote: > In a nutshell: > > Will this work? > > if ($perm == (11 || 12)) > > > Explanation: > > I am laying the groundwork for a photo viewing system with a private and > public mode, and additionally if an admin is logged in, there is an > additional level of permission. I came up with a number system to make it > easier (and is calcualted by a class) so now, instead of checking against > the $mode variable, if the user is logged in, and then what their user level > is if they are logged in, I just check against some numbers (the class > evaluates all those conditions and assigns the appropriate number a single > permission variable, $perm. That equates to if($perm == true) as 11 in this case translates to true (being a positive integer) The code never needs to figure out the || part, as the first part is true. I think what you'd want to do is possibly: if($perm == 11 || $perm == 12) Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Logic of conditionals and the ( ) operators (RESOLVED)
Thank you Ashley, it makes perfect sense. I don't know why I didn't just set up some tests like Shiplu suggested! I've rewritten all my code BACK to the correct way. (I thought it looked cooler, oh well). On Fri, Dec 18, 2009 at 10:47 AM, Ashley Sheridan wrote: > On Fri, 2009-12-18 at 10:21 -0800, Allen McCabe wrote: > > In a nutshell: > > Will this work? > > if ($perm == (11 || 12)) > > > Explanation: > > I am laying the groundwork for a photo viewing system with a private and > public mode, and additionally if an admin is logged in, there is an > additional level of permission. I came up with a number system to make it > easier (and is calcualted by a class) so now, instead of checking against > the $mode variable, if the user is logged in, and then what their user level > is if they are logged in, I just check against some numbers (the class > evaluates all those conditions and assigns the appropriate number a single > permission variable, $perm. > > > That equates to if($perm == true) as 11 in this case translates to true > (being a positive integer) The code never needs to figure out the || part, > as the first part is true. > > I think what you'd want to do is possibly: > > if($perm == 11 || $perm == 12) > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > >
Re: [PHP] Logic of conditionals and the ( ) operators
Hi, Yes, what Ashley said is correct. Also, if you want to avoid writing $perm several times in the if, or if you have a lot of permissions you can do: if (in_array($perm, array(11, 22))) And you can put in that array all the permissions you need to. Regards, Jonathan On Fri, Dec 18, 2009 at 3:47 PM, Ashley Sheridan wrote: > On Fri, 2009-12-18 at 10:21 -0800, Allen McCabe wrote: > >> In a nutshell: >> >> Will this work? >> >> if ($perm == (11 || 12)) >> >> >> Explanation: >> >> I am laying the groundwork for a photo viewing system with a private and >> public mode, and additionally if an admin is logged in, there is an >> additional level of permission. I came up with a number system to make it >> easier (and is calcualted by a class) so now, instead of checking against >> the $mode variable, if the user is logged in, and then what their user level >> is if they are logged in, I just check against some numbers (the class >> evaluates all those conditions and assigns the appropriate number a single >> permission variable, $perm. > > > That equates to if($perm == true) as 11 in this case translates to true > (being a positive integer) The code never needs to figure out the || > part, as the first part is true. > > I think what you'd want to do is possibly: > > if($perm == 11 || $perm == 12) > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class not functioning (RESOLVED)
I looked into registries (singleton registries), and while I can see the advantage they provide, most every article I read advised AGAINST using singleton registries because it creates extra dependencies (ie. a file needs the database class AND the registry class instead of just the database class). The disadvantage to me about this is having to keep everything straight; my projects as of late have been expanding rapidly and I can barely keep track of everything. As it stands, it takes me about 30 minutes to get back into my projects each day. Wouter; I ended up going with the static option and it works nicely :) I am thrilled at how it just works! Coupled with some nicely styled DIV layers and some onclick=this.style.display='none'; to make it go away I have a fantastic user notification system. On Wed, Dec 16, 2009 at 3:59 AM, Wouter van Vliet / Interpotential < pub...@interpotential.com> wrote: > Allen, > > Before you go with my static-approach, please do consider Shawn's registry > pattern suggestion. That's pretty sweet too ;-). > > A little response to your long text, before I help you fix the bug. A > static property is basically the same as a regular property on an object. > Only difference is that they are not reset when the class is instantiated > into an object. They are just there. > > Now, about your bug. The syntax for referencing a static property is a bit > weird - which has to do with the existence of class constants, which might > have set you off. > > Notifier::notifyQueue would reference a class constant. The [] syntax is > not valid here, since a constant is - you got it: constant. And thus cannot > be changed. > Notifier::$notifyQ[] = ' ... '; references the static property. > > But... since notifyQ is a proptected static property, it is very unlikealy > that you'll ever actually write Notifier::$notifyQ. You add to this queue > from within the class itself, so therefore self::$notifyQ is a lot better. > > Does that answer your question? > > Btw; Shawn; Assuming that your Registry class holds objects, there is no > need have the ampersand in front of the get method or $object argument. > Objects are *always* references. And you might want to look at the __get, > __set and __isset magic. > > Wouter > > > 2009/12/16 Allen McCabe > > Wouter, >> >> Implementing your static idea was pretty easy, I was already referencing >> Notifier with the :: operator in my other methods, however I am running into >> trouble assigning new values to the static array. >> >> I am getting a "syntax error, unexpected '[' " on this line of my Notifier >> class: >> >> Notifier::notifyQ[] = ' > > Date: Tuesday, December 15, 2009, 6:17 AM > > Hey everyone, I just delved into > > classes recently and have been having > > moderate success so far. > > > > I have a puzzler though. > > > > I have the following class decalred and instantiated: > > > > class Notify { > > var $q = array(); > > > > public function addtoQ($string, $class) > > { > > $message = ''. > > $string .''; > > $this->q[] = $message; > > } > > > > public function printQ() > > { > > if (isset($q)) > > { > >echo '>>> > > class="notification">'; > >foreach($this->q as $msg) > >{ > > echo $msg ."\n"; > >} > >echo ''; > > } > > > > return; > > } > > > > function __destruct() > > { > > if (isset($q)) > > { > >unset($this->q); > > } > > } > > } // END CLASS Notify > > > > > > And in my script, I call it like so: > > $Notif = new Notify; > > > > I have run other statements in other classes that should be > > adding to the $q > > array (ie. Notify::addtoQ('ERROR! There Was An Error > > Updating The > > Database!', 'error');) > > > > However, when I try to get my webpage to display them > > using: > > > > $Notify->printQ(); > > > > it does not seem to want to loop through this array (and > > print the > > messages). I am getting NO error message, in fact > > everything 'looks' fine, > > I'm just not seeing the appropriate message. > > > > Any help would be appreicated! > > > > Allen, > You have made a small typing mistake in function printQ() where you would > like to checked the array for its existence. By mistake you have wrote "if > (isset($q))". But your array variable is not an freely accessible array,the > array is embedded into an object. So, you have to write the like "if > (isset($this->q))". > > Another point, you can't add a message into the array by calling the > member function addtoQ() using scope resolution operator "::". If you really > want to add message into the array, you have to c