RE: [PHP] Vermis The Issue Tracking System
Looks great. Thanks. ***?imdi her yerde ?ubemiz var: http://www.anadolusigortaonline.com.tr a??ld?.-Original Message- From: Lukasz Cepowski [mailto:c...@freecode.pl] Sent: Tuesday, November 09, 2010 12:34 AM To: php-general@lists.php.net Subject: [PHP] Vermis The Issue Tracking System Hello, some time have past since the last release and some changes have been made. Vermis, the new open source issue tracker written in PHP, based on Zend Framework and Doctrine ORM is heading towards stable version 1.0. Today I would like to introduce the latest development version (r63-20101108) containing many bug fixes and some new features. What is new in the project: - Improved issues navigator, allows you to browse your issues in an easier way by breaking them by component, milestone, type, status and priority. - SMTP integration, you don't need to setup a mail service on your machine, use any mail account and send notification emails via SMTP. - IIS Support, even if you can't install Apache you can still enjoy using Vermis on your Windows box, finally Vermis is working under Microsoft IIS Web Server. - Lightbox, show your image attachments in a popup box. - Migration guard, you can safely upgrade Vermis to the latest version. You can try out the online demo at http://vermis.diabloware.com Feel free to test, download and use Vermis. Please let me know if everything is working as it should, any kind of feedback is much appreciated :) Home page: http://vermis.diabloware.com Forum: http://forum.diabloware.com Bugs: http://bugs.diabloware.com Thanks, Lukasz (cepa) Cepowski -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak ?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan, b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic question
why not search them with keywords "cli cgi diff"? they are all the Interface to PHP interpretor. one is Command Line I,another is Common Gateway I. Best regards, Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**) 2010/11/9 Tseveendorj Ochirlantuu : > Hello, > > I would like to know what is the difference between follows. > > PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46) > > > and > > PHP 5.1.6-pl6-gentoo (cgi-cgi) > > > > One is "cli" another is "cgi-cgi" . > > Sincerely, > > Tseveen. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
At 10:00 PM -0500 11/8/10, David McGlone wrote: On Mon, 2010-11-08 at 23:36 +0100, k...@bitflop.com wrote: > IMHO - If you have to jump in and out of HTML and template syntax you might as well jump in and out of HTML and PHP. There is truth to this, but for me, its helping me learn in a much clearer way. I can't explain how or why, but it make me feel like everything is neat and tidy and where it should be. Where PHP and HTML mixed and mingled gives me the feeling that everything is a disaster. -- Blessings, David M. It can be a disaster, but that's your choice -- and that's the point. You can dig as deep a hole as you like, or make it simple for yourself. I don't use template engines. I simply place php echo()s where I need them while maintaining a strict division between content and presentation using "best practices" between html and css. Additionally, I believe that one also has to consider how JavaScript fits into the needs of the application and thus adherence to progressive enhancement is also a must. Templates and DOM operations can become very involved and problematic. In all, you must consider content, presentation, function, and data. Granted those boundaries become blurred when viewing both client and server side operations, but I don't find any template engines that make it any easier in design and implementation. While a cursory review of smarty (et al) may appear to solve minor problems, the more involved an application becomes, the more I find templates don't fit and are often more trouble than they are worth. YMMV. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
At 10:24 PM -0500 11/8/10, Matt Giddings wrote: I have to agree with David here. Smarty may be an added layer to the whole mix, but it makes maintaining the template and application much simpler. Much better than mixing html/php all together in a single file. That and a single template is easily used in multiple applications if needed, ore in multiple files within the same application. IMHO the benefits far out way the negatives of using a template engine. -1 To each their own. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
At 12:20 AM -0500 11/9/10, Paul M Foster wrote: On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote: I really like the idea of using a templating engine. Which one do you use? Why? For those that don't use templating engines, why don't you use them? Here's why I don't use a templating engine. First, You're taking an embedded language and writing a templating engine in it. Seriously? Second, you're painting a single page, maybe 10-15K worth of information, and you're dragging 100K of code around just to paint a single page. Seriously? Third, you're creating a page on the fly, thrashing the server's CPU in order to generate a page which could be built statically, or at least with minimally embedded PHP. Seriously? Fourth, you could achieve the same end result with carefully crafted PHP embedded in your static HTML file, with actually very little more work. I know, everyone's heard this before. But just because you *can* do something doesn't mean you *should*. Paul +1 Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
At 12:23 AM -0500 11/9/10, Robert Cummings wrote: On 10-11-09 12:20 AM, Paul M Foster wrote: On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote: I really like the idea of using a templating engine. Which one do you use? Why? For those that don't use templating engines, why don't you use them? Here's why I don't use a templating engine. First, You're taking an embedded language and writing a templating engine in it. Seriously? Second, you're painting a single page, maybe 10-15K worth of information, and you're dragging 100K of code around just to paint a single page. Seriously? Third, you're creating a page on the fly, thrashing the server's CPU in order to generate a page which could be built statically, or at least with minimally embedded PHP. Seriously? Fourth, you could achieve the same end result with carefully crafted PHP embedded in your static HTML file, with actually very little more work. I know, everyone's heard this before. But just because you *can* do something doesn't mean you *should*. Aaaah, the great argument that uses a single brush to paint all template engines into one corner because if you've used one, you've used them all... Seriously? Cheers, Rob. I don't have to try them all, just the most popular. If the most popular doesn't work for me, then I don't need to try any others. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Chat
Hello there, I have to make chat for website that has around 10 000 users (small social network). So before I start, I would like to hear different opinions. Important thing is to have in mind that in one moment you can have over 1 000 users using chat. So, if you have time fill free to write you experience in this field, suggestions, etc. Thnx, Dusan -- Please consider the environment before printing this email. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie looking for a project
At 12:34 PM -0500 11/8/10, Daniel P. Brown wrote: On Mon, Nov 8, 2010 at 06:29, Ashim Kapoor wrote: Writing apps on my own is fun but it's fruit is only for me to benefit from,but yes if nothing else I should do that. Not at all, many others can benefit from it as well. Tedd's examples have been referenced on this list many times, and you can see them yourself: http://www.php1.net/ Just because you're developing the code to learn for yourself doesn't mean you can't put it in the public domain for others to do the same. -- Thanks for the plug, but let me add this. When you develop a demo for yourself, you can take liberties. However, when you release a demo for public/peer review, you had better know what you are doing and that makes you a better programmer. My advice, spend your time learning and helping others -- it will educate both. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
On 10-11-09 11:18 AM, tedd wrote: At 10:57 AM -0500 11/9/10, Robert Cummings wrote: On 10-11-09 10:42 AM, tedd wrote: I don't have to try them all, just the most popular. If the most popular doesn't work for me, then I don't need to try any others. That's all well and good, but the argument being used is a generalization which at best is wrong. I don't care what you use, but FUD doesn't help anything. Cheers, Rob. I disagree and what I said is not FUD. If we took the time to *not* generalize, then we would be up to our collective butts in evaluations of everything, while getting nothing accomplished. Generalization is a way to navigate the massive amounts of data we are bombarded with each day. Do I want to spend/waste time evaluating all templates to the nth degree? I think not. Instead, I research ideas and see if they meet with my way of doing things. If they do, then I incorporate them into my method -- if not, then I pass. I have changed my methods many times to accommodate new technologies and new ways of doing things, but that does not mean that I always incorporate everything that comes along. Templates are one of those things that do not fit in my way of doing things and I do not need to investigate all template systems to arrive at that conclusion. As such, there is nothing wrong with my evaluation method for it works for me. I think the key quote here is "your way". Others will certainly have different mileage (as has already been expressed), thus your generalization still rings false. It's only a generalization for you and others of like mind... which is terribly partisan :) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chat
On Tue, 2010-11-09 at 16:51 +0100, Dušan Novaković wrote: > Hello there, > > I have to make chat for website that has around 10 000 users (small > social network). So before I start, I would like to hear different > opinions. Important thing is to have in mind that in one moment you > can have over 1 000 users using chat. > So, if you have time fill free to write you experience in this field, > suggestions, etc. > > Thnx, > Dusan > > > > -- > > > Please consider the environment before printing this email. > I did that for a site for my buddy... i tried a few different ways, and the current way seems to work decently... but i've been thinking about altering it... what i did for that one, is it inserts into a database what the person wrote, then on eth other side, it pulls every x seconds from the db, and using ajax adds to the . it is a pain in the ass, but yeah, it works. I also had a flag for "typing" indicator. i am sure there are many different ways to do this, but posting to a db, and pulling from the db seemed to be the logical way to do it when i did that...my buddies old way of doing it, is at http://radiokaos.com it just posts to the db, and then refreshed the iframe every 20 seconds or something. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
At 10:57 AM -0500 11/9/10, Robert Cummings wrote: On 10-11-09 10:42 AM, tedd wrote: I don't have to try them all, just the most popular. If the most popular doesn't work for me, then I don't need to try any others. That's all well and good, but the argument being used is a generalization which at best is wrong. I don't care what you use, but FUD doesn't help anything. Cheers, Rob. I disagree and what I said is not FUD. If we took the time to *not* generalize, then we would be up to our collective butts in evaluations of everything, while getting nothing accomplished. Generalization is a way to navigate the massive amounts of data we are bombarded with each day. Do I want to spend/waste time evaluating all templates to the nth degree? I think not. Instead, I research ideas and see if they meet with my way of doing things. If they do, then I incorporate them into my method -- if not, then I pass. I have changed my methods many times to accommodate new technologies and new ways of doing things, but that does not mean that I always incorporate everything that comes along. Templates are one of those things that do not fit in my way of doing things and I do not need to investigate all template systems to arrive at that conclusion. As such, there is nothing wrong with my evaluation method for it works for me. Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic question
On Tue, Nov 9, 2010 at 02:55, Tseveendorj Ochirlantuu wrote: > Hello, > > I would like to know what is the difference between follows. > > PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46) > > > and > > PHP 5.1.6-pl6-gentoo (cgi-cgi) They are completely and totally different in almost every way. The first: * PHP 5.3.2 * Command Line Interface * Built for Ubuntu * Has the Suhosin patch applied The second: * PHP 5.1.6 * Common Gateway Interface * Built for Gentoo For further explanations, remember that Google is your friend. -- Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
On 10-11-09 10:42 AM, tedd wrote: At 12:23 AM -0500 11/9/10, Robert Cummings wrote: On 10-11-09 12:20 AM, Paul M Foster wrote: On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote: I really like the idea of using a templating engine. Which one do you use? Why? For those that don't use templating engines, why don't you use them? Here's why I don't use a templating engine. First, You're taking an embedded language and writing a templating engine in it. Seriously? Second, you're painting a single page, maybe 10-15K worth of information, and you're dragging 100K of code around just to paint a single page. Seriously? Third, you're creating a page on the fly, thrashing the server's CPU in order to generate a page which could be built statically, or at least with minimally embedded PHP. Seriously? Fourth, you could achieve the same end result with carefully crafted PHP embedded in your static HTML file, with actually very little more work. I know, everyone's heard this before. But just because you *can* do something doesn't mean you *should*. Aaaah, the great argument that uses a single brush to paint all template engines into one corner because if you've used one, you've used them all... Seriously? Cheers, Rob. I don't have to try them all, just the most popular. If the most popular doesn't work for me, then I don't need to try any others. That's all well and good, but the argument being used is a generalization which at best is wrong. I don't care what you use, but FUD doesn't help anything. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
On Tue, 9 Nov 2010 00:20:52 -0500 Paul M Foster wrote: > On Mon, Nov 08, 2010 at 02:41:12PM -0700, Hansen, Mike wrote: > > Here's why I don't use a templating engine. > > First, You're taking an embedded language and writing a templating > engine in it. Seriously? > > Second, you're painting a single page, maybe 10-15K worth of > information, and you're dragging 100K of code around just to paint a > single page. Seriously? > > Third, you're creating a page on the fly, thrashing the server's CPU > in order to generate a page which could be built statically, or at > least with minimally embedded PHP. Seriously? > > Fourth, you could achieve the same end result with carefully crafted > PHP embedded in your static HTML file, with actually very little more > work. > > I know, everyone's heard this before. But just because you *can* do > something doesn't mean you *should*. Beautiful put! --- Mange venlige hilsner/Best regards Kim N. Lesmer Programmer/Unix systemadministrator Web: www.bitflop.com E-mail : k...@bitflop.com > Paul > > -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
On Mon, Nov 8, 2010 at 4:41 PM, Hansen, Mike wrote: > I really like the idea of using a templating engine. Which one do you use? > Why? For those that don't use templating engines, why don't you use them? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I prefer using what essentially amounts to a templating engine, my web framework, Nephtali. It's markup conventions can be found at the link below: http://nephtaliproject.com/documentation/markup/ It helps me easily get things right, for example: 1. Appropriate escaping of output, automatically examining the context to determine the appropriate form of escaping (html, attribute, or url), or I can manually declare escaping in the markup to improve performance. 2. When an error occurs in one dynamic region of the page, I don't always want to show a generic error page (I'd rather just show an error message for that particular region that experienced an error and show the rest of the page normally.) 3. I like to progressively enhance pages, and sometimes this involves grabbing the content of one particular dynamic region of a page. Nephtali builds in a restful API that allows you to retrieve the content of a dynamic region instead of retrieving the whole page (the processing short-circuits to improve performance), for example: http://nephtaliproject.com/php53hosts/index.php?nmode=htmlfrag&npipe=hosts 4. I like to work on projects with many others of various skill levels and backgrounds, and the xml comments are easily understood and play nicely with a broad range of editors/IDE's. 5. Nephtali plays nicely with legacy PHP code, so you can add it to existing sites without issue (as long as turning on output buffering isn't an issue.) So, if you want to add some PHP to the page, no problem, you can have the best of both worlds. 6. Nephtali offers more features (input validation, PDO wrappers, etc.) and fits within one file, so I get a lot without much ado. Now, I framed this in terms of my web framework because it's what I know best. That said, my documentation isn't up to par yet, so it would likely be frustrating getting up to speed (I did build a code generator to help out, though.) Smarty, PHPTAL (I especially appreciate its syntax), and other templating engines are well documented and offer many of the same features and qualities, and those features are what compel me to use them as opposed to just using PHP. That doesn't mean I always use a templating engine/framework, but I use one much more frequently than not. Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com
Re: [PHP] Is session_start() using encrypted cookies with HTTPS
> > If the cookie needs to be encrypted, why not just encrypt it and worry less > about the transport layer? Or just down one hash value id cookie and pull > back the secure data for action just on the server? > > Bastien The issue highlighted in Yannick's question wouldn't be resolved by merely encrypting the cookie value. Encrypting a cookie value protects the value encrypted, and for some situations this is exactly what you want. Maybe you're storing preferences for your app, but want to make sure they aren't tampered with, etc. However, encrypting a cookie that's used as an auth token won't buy you anything if the transport layer doesn't provide encryption. That's because an auth token mere presence works to sufficiently identify an authenticated user. I don't have to know what the value in the cookie means in any way. Does this help clear up your question, or did I misunderstand you, Bastien? Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com
Re: [PHP] Is session_start() using encrypted cookies with HTTPS
On Tue, Nov 9, 2010 at 2:10 PM, Adam Richardson wrote: >> >> If the cookie needs to be encrypted, why not just encrypt it and worry less >> about the transport layer? Or just down one hash value id cookie and pull >> back the secure data for action just on the server? >> >> Bastien > > > The issue highlighted in Yannick's question wouldn't be resolved by merely > encrypting the cookie value. > > Encrypting a cookie value protects the value encrypted, and for some > situations this is exactly what you want. Maybe you're storing preferences > for your app, but want to make sure they aren't tampered with, etc. > > However, encrypting a cookie that's used as an auth token won't buy you > anything if the transport layer doesn't provide encryption. That's because > an auth token mere presence works to sufficiently identify an authenticated > user. I don't have to know what the value in the cookie means in any way. > > Does this help clear up your question, or did I misunderstand you, Bastien? > > Adam > > -- > Nephtali: PHP web framework that functions beautifully > http://nephtaliproject.com > Nope, makes sense, Adam. Thanks, -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Updating a GET variable
Hi folks, I'm sure this is an easy one that's standing right in front of me but I'm too blind to see. I have a page with an URL like this: index.php?name=value&this=that. I have a link on the bottom of the page which allows the user to switch languages. I need to hang onto the existing $name and $this get variables. I tried Flip and it loses all previous GET data. Then I tried ?&lang=en'>Flip And it continually appends more &lang=en's to the URL if the user keeps clicking on it (for whatever reason). Now I've put it in a form and it works as expected, but the display value and my under-the-hood value need to be different, so it's a fail. What's the best way to update the value of a GET var? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Updating a GET variable
Don't think about it in those terms and you'll see why it wasn't working. Http is stateless, so unless you use sessions, it will 'forget' everything from page to page. What's wrong with just putting the url parameters in the link that you know you need, one by one? If you have many, build a little function for it to reduce code repetition. Also, don't just output the values sent to the server, as that's an attack waiting to happen. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Marc Guay" Date: Tue, Nov 9, 2010 20:12 Subject: [PHP] Updating a GET variable To: "php-general" Hi folks, I'm sure this is an easy one that's standing right in front of me but I'm too blind to see. I have a page with an URL like this: index.php?name=value&this=that. I have a link on the bottom of the page which allows the user to switch languages. I need to hang onto the existing $name and $this get variables. I tried Flip and it loses all previous GET data. Then I tried ?&lang=en'>Flip And it continually appends more &lang=en's to the URL if the user keeps clicking on it (for whatever reason). Now I've put it in a form and it works as expected, but the display value and my under-the-hood value need to be different, so it's a fail. What's the best way to update the value of a GET var? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Updating a GET variable
> What's wrong with just putting the url parameters in the link that you know > you need, one by one? I have a footer that I include on every page and would like it to adapt to whatever situation it finds itself in. Is your suggestion, to do the following for the existing example: echo "Flip"; > Also, don't just output the values sent to the server, as that's an attack > waiting to happen. Are you referring to echoing the SCRIPT_NAME and QUERY STRING values into the href attribute? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Updating a GET variable
My working solution was to put it in a form with a hidden input with the correct name and value. But I'm still wondering what your advice is regarding best practice. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with variable variables not being set for a multi-dimensional array
I've used variable variables before but for some reason I can't figure this snippet out. Why doesn't $ini_file get set (or appended to). Is there a better more elegant solution to parsing these keys and splitting them into sub-array keys as you see what I'm trying to do. I was thinking some recursion, but it seems overkill for such a simple task. Given an .ini file like so: [production] agis_core.adapter = Mysqli agis_core.params.host = 10.10.10.46 agis_core.params.username = USERNAME agis_core.params.password = PASSWORD agis_core.params.dbname = agis_core agis_core.params.port = 3306 I'm writing a simple parser (to be semi-compatible with the Zend Framework one apparently but without the bloat of ZF) require_once $path.'/../classes/IniParser.class.php'; try { $config_ini = new IniParser($path.'/../config.ini', true, true); } catch (Exception $e) { echo 'Caught Exception parsing ini file.'.$e->getMessage()."\n"; } class IniParser { private $file; public $ini_array; function __construct($file, $process_sections=true, $explode=false) { $this->file = $file; $this->ini_array = parse_ini_file($file,$process_sections); if (!$this->ini_array) { //we only check this if we failed since Disk I/O is expensive if (!file_exists($file)) throw new Exception('File Not Found: '.$file); } if ($explode) $this->explode_ini(); } public function explode_ini() { $ini_array = array(); foreach($this->ini_array as $heading => $key_vals) { foreach ($key_vals as $k => $v) { $path = 'ini_array[\''.$heading.'\']'; $subsection = explode('.', $k); foreach ($subsection as $ss) $path .= '[\''.$ss.'\']'; //echo $path.' = '.$v.''; $$path = $v; var_dump($path, $$path, $ini_array); } } $this->ini_array = $ini_array; } } ?> But the $ini_array is not being set?!? Here is the output I get... string 'ini_array['production']['agis_core']['adapter']' (length=47) string 'Mysqli' (length=6) array empty string 'ini_array['production']['agis_core']['params']['host']' (length=54) string '10.10.10.46' (length=11) array empty string 'ini_array['production']['agis_core']['params']['username']' (length=58) string 'USERNAME' (length=7) array empty ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Updating a GET variable
No, Try this. ?&lang=en'>Flip Dear god, why would you butcher php like that? I, like many prefer short code or at least concat the string. Flip Richard L. Buskirk -Original Message- From: Marc Guay [mailto:marc.g...@gmail.com] Sent: Tuesday, November 09, 2010 3:48 PM To: a...@ashleysheridan.co.uk Cc: php-general Subject: Re: [PHP] Updating a GET variable > What's wrong with just putting the url parameters in the link that you know > you need, one by one? I have a footer that I include on every page and would like it to adapt to whatever situation it finds itself in. Is your suggestion, to do the following for the existing example: echo "Flip< /a>"; > Also, don't just output the values sent to the server, as that's an attack waiting to happen. Are you referring to echoing the SCRIPT_NAME and QUERY STRING values into the href attribute? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Help with variable variables not being set for a multi-dimensional array
> -Original Message- > From: Daevid Vincent [mailto:dae...@daevid.com] > Sent: Tuesday, November 09, 2010 6:55 PM > To: 'php-general@lists.php.net' > Subject: Help with variable variables not being set for a > multi-dimensional array > > I've used variable variables before but for some reason I > can't figure this snippet out. Why doesn't $ini_file get set > (or appended to). Is there a better more elegant solution to > parsing these keys and splitting them into sub-array keys as > you see what I'm trying to do. I was thinking some recursion, > but it seems overkill for such a simple task. > > Given an .ini file like so: > > [production] > agis_core.adapter = Mysqli > agis_core.params.host = 10.10.10.46 > agis_core.params.username = USERNAME > agis_core.params.password = PASSWORD > agis_core.params.dbname = agis_core > agis_core.params.port = 3306 > > I'm writing a simple parser (to be semi-compatible with the > Zend Framework one apparently but without the bloat of ZF) > > require_once $path.'/../classes/IniParser.class.php'; > try > { > $config_ini = new IniParser($path.'/../config.ini', true, true); > } > catch (Exception $e) > { > echo 'Caught Exception parsing ini > file.'.$e->getMessage()."\n"; > } > > > class IniParser > { > private $file; > public $ini_array; > > function __construct($file, $process_sections=true, > $explode=false) > { > $this->file = $file; > $this->ini_array = > parse_ini_file($file,$process_sections); > if (!$this->ini_array) > { > //we only check this if we failed since > Disk I/O is expensive > if (!file_exists($file)) throw new > Exception('File Not Found: '.$file); > } > > if ($explode) $this->explode_ini(); > } > > public function explode_ini() > { > $ini_array = array(); > > foreach($this->ini_array as $heading => $key_vals) > { > foreach ($key_vals as $k => $v) > { > $path = 'ini_array[\''.$heading.'\']'; > $subsection = explode('.', $k); > foreach ($subsection as $ss) > $path .= '[\''.$ss.'\']'; > //echo $path.' = '.$v.''; > $$path = $v; > var_dump($path, $$path, $ini_array); > } > } > > $this->ini_array = $ini_array; > } > } > ?> > > But the $ini_array is not being set?!? Here is the output I get... > > string 'ini_array['production']['agis_core']['adapter']' (length=47) > > string 'Mysqli' (length=6) > > array > empty > > string > 'ini_array['production']['agis_core']['params']['host']' (length=54) > > string '10.10.10.46' (length=11) > > array > empty > > string > 'ini_array['production']['agis_core']['params']['username']' > (length=58) > > string 'USERNAME' (length=7) > > array > empty > > ... > FYI, if I swap out the guts with this snippet: foreach ($key_vals as $k => $v) { $path = 'ini_array[\''.$heading.'\']'; $subsection = explode('.', $k); foreach ($subsection as $ss) $path .= '[\''.$ss.'\']'; $path = '$'.$path.' = \''.$v.'\';'; eval($path); //it's not elegant but it works! } It works. Not sure if it's any better or worse than the other hack though. I'd still like to know what is wrong with the initial version for future reference. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Template engines
I really like the idea of using a templating engine. Which one do you use? Why? For those that don't use templating engines, why don't you use them? Hi Mike I am still so new at PHP that i do not get a real valid vote here... (I have never used any templating engine).. BUT I know myself well enough to know that I am never satisfied in any coding situation unless I know just exactly what all is really going on under the hood. I am one of the slower meticulous coders as a result, but I always enjoy the feeling (as do my clients) that I can do whatever I want, ... whatever they need. I am looking forward to getting to this level with PHP in coming months/years. I would not bother with a templating engine or any framework until I could have written it myself, if I had wanted.. whether or not I actually do, in the end. -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Updating a GET variable
On Nov 9, 2010, at 2:47 PM, Marc Guay wrote: What's wrong with just putting the url parameters in the link that you know you need, one by one? I have a footer that I include on every page and would like it to adapt to whatever situation it finds itself in. Is your suggestion, to do the following for the existing example: echo "Flip"; Also, don't just output the values sent to the server, as that's an attack waiting to happen. Are you referring to echoing the SCRIPT_NAME and QUERY STRING values into the href attribute? I would add the parameter you want to $_GET ($_GET['lang']='en') and use http_build_query on $_GET if you really want to include the whole query string in the call: $_GET['lang']='en'; echo 'Flip"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Updating a GET variable
Begin forwarded message: From: Tamara Temple Date: November 10, 2010 12:05:32 AM CST To: PHP General Subject: Re: [PHP] Updating a GET variable On Nov 9, 2010, at 2:47 PM, Marc Guay wrote: What's wrong with just putting the url parameters in the link that you know you need, one by one? I have a footer that I include on every page and would like it to adapt to whatever situation it finds itself in. Is your suggestion, to do the following for the existing example: echo "Flip"; Also, don't just output the values sent to the server, as that's an attack waiting to happen. Are you referring to echoing the SCRIPT_NAME and QUERY STRING values into the href attribute? I would add the parameter you want to $_GET ($_GET['lang']='en') and use http_build_query on $_GET if you really want to include the whole query string in the call: $_GET['lang']='en'; echo 'Flip" Woops, just realized a problem with this. If the values in $_GET are URL encode, http_build_query will encode them again, so you have to decode them first: foreach($_GET as $k => $v) $qs[$k] = URLDecode($v); $qs['lang'] = 'en'; echo 'Flip'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chat
On 09/11/2010 18:32, Steve Staples wrote: On Tue, 2010-11-09 at 16:51 +0100, Dušan Novaković wrote: Hello there, I have to make chat for website that has around 10 000 users (small social network). So before I start, I would like to hear different opinions. Important thing is to have in mind that in one moment you can have over 1 000 users using chat. So, if you have time fill free to write you experience in this field, suggestions, etc. Thnx, Dusan -- Please consider the environment before printing this email. I did that for a site for my buddy... i tried a few different ways, and the current way seems to work decently... but i've been thinking about altering it... what i did for that one, is it inserts into a database what the person wrote, then on eth other side, it pulls every x seconds from the db, and using ajax adds to the. it is a pain in the ass, but yeah, it works. I also had a flag for "typing" indicator. i am sure there are many different ways to do this, but posting to a db, and pulling from the db seemed to be the logical way to do it when i did that...my buddies old way of doing it, is at http://radiokaos.com it just posts to the db, and then refreshed the iframe every 20 seconds or something. I use an Openfire server with the Smack client. Its really simple, well documented and works really well. Kind regards Warren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php