[PHP] Simple open source CMS as a starting point
I need simple CMS sistem that I could use as a staring point (to save some time in setting up the structure) in developing my own CMS. The code should be simple to understand so that I can easily get on and start building on it. It would be of great help if it already had features like statistics, rss feeds, and multi-language support (visitors can click on the flag at the top of the page and have the pages display the content in that particular language), but if it doesn't it's okay I would build them. For example Joomla seems to be too powerfull, and pretty diffucult to understand at the coding level in order to customize it to serve my specific needs. Does anyone know of any promising open source CMS project that I could use in this respect? Thanks, Dzenan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOMDocument help
I'm using php 5.2.5 with the php-xml module. I need to split a string of html into elements. IE - this is a string that has some bold words in it. I need to be able to take that string and split it up into textNodes for the parts that are not in bold text, and bold nodes containing the bold elements. I've tried creating a new DOMDocument object and inputing the line into it - $tmpNode = new DOMDocument; $tmpNode->loadHTML($string); but I can't figure out how to get the the useful nodes out of it to then append as children in the document I'm creating. Any tips on how to do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
dzenan.cause...@wise-t.com wrote: I need simple CMS sistem that I could use as a staring point (to save some time in setting up the structure) in developing my own CMS. The code should be simple to understand so that I can easily get on and start building on it. It would be of great help if it already had features like statistics, rss feeds, and multi-language support (visitors can click on the flag at the top of the page and have the pages display the content in that particular language), but if it doesn't it's okay I would build them. For example Joomla seems to be too powerfull, and pretty diffucult to understand at the coding level in order to customize it to serve my specific needs. Does anyone know of any promising open source CMS project that I could use in this respect? bitweaver ... http://bitweaver.org Just select the packages you want when you install, and add other facilities latter as you need them ... -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
Wordpress Att, Jean Pimentel Museu da Infância - www.museudainfancia.com On Thu, Feb 12, 2009 at 7:01 AM, Lester Caine wrote: > dzenan.cause...@wise-t.com wrote: > >> I need simple CMS sistem that I could use as a staring point (to save some >> time in setting up the structure) in developing my own CMS. The code >> should be simple to understand so that I can easily get on and start >> building on it. It would be of great help if it already had features like >> statistics, rss feeds, and multi-language support (visitors can click on >> the flag at the top of the page and have the pages display the content in >> that particular language), but if it doesn't it's okay I would build them. >> >> For example Joomla seems to be too powerfull, and pretty diffucult to >> understand at the coding level in order to customize it to serve my >> specific needs. >> >> Does anyone know of any promising open source CMS project that I could use >> in this respect? >> > > bitweaver ... > http://bitweaver.org > Just select the packages you want when you install, and add other > facilities latter as you need them ... > > -- > Lester Caine - G8HFL > - > Contact - http://lsces.co.uk/lsces/wiki/?page=contact > L.S.Caine Electronic Services - http://lsces.co.uk > EnquirySolve - http://enquirysolve.com/ > Model Engineers Digital Workshop - http://medw.co.uk// > Firebird - http://www.firebirdsql.org/index.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
[PHP] How can an elephant count for nothing?
While PHP has a lot of nice features, it also has some traps which I am forever falling into. One which I find particularly hard to understand is how mixed mode comparisons work. For instance $string = 'elephant'; If($string == 0) returns true; If($string != 0) returns false; If($string === 0) returns false; I know that in this case I should use 'If($string == '')', but I still manage to forget. Can anyone explain clearly why comparing a string with zero gives this apparently anomalous result? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can an elephant count for nothing?
Clancy wrote: > While PHP has a lot of nice features, it also has some traps which I > am forever falling into. One which I find particularly hard to > understand is how mixed mode comparisons work. For instance > > $string = 'elephant'; > If($string == 0) returns true; > If($string != 0) returns false; > If($string === 0) returns false; > > I know that in this case I should use 'If($string == '')', but I still > manage to forget. Can anyone explain clearly why comparing a string > with zero gives this apparently anomalous result? I'm not certain, but I suspect it's because the interpreter attempts to convert "elephant" to an integer first. /Per -- Per Jessen, Zürich (-0.6°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can an elephant count for nothing?
Clancy schreef: > While PHP has a lot of nice features, it also has some traps which I am > forever falling > into. One which I find particularly hard to understand is how mixed mode > comparisons work. > For instance > > $string = 'elephant'; > If($string == 0) returns true; > If($string != 0) returns false; > If($string === 0) returns false; > > I know that in this case I should use 'If($string == '')', but I still manage > to forget. > Can anyone explain clearly why comparing a string with zero gives this > apparently > anomalous result? it's called auto-casting (or auto-typecasting) and it's 'by design' ... welcome to the world of dynamic typing. try this to see it working: php -r ' var_dump((integer)"elephant"); var_dump((float)"elephant"); var_dump((bool)"elephant"); var_dump((array)"elephant"); var_dump((object)"elephant"); var_dump((bool)(integer)"elephant"); ' you can avoid auto-casting if needed, in a variety of ways: php -r ' $foo = "elephant"; if (!empty($foo)) echo "$foo found!\n"; if (strlen($foo)) echo "$foo found!\n"; if (is_string($foo) && strlen($foo)) echo "$foo found!\n"; if ($foo !== "") echo "$foo found!\n"; if ($foo === "elephant") echo "$foo found!\n"; ' those last 2 show how to use 'type-checked' equality testing. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can an elephant count for nothing?
> Can anyone explain clearly why comparing a string > with zero gives this apparently anomalous result? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can an elephant count for nothing?
Have you tried with a mouse? -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
[PHP] spl_object_hash not hashing unqiue objects BUG
I am having a problem with spl_object_hash() creating non unique hashes. I understand with MD5 it is possible to have the same hash for different strings but this doesn't seem like that problem. I have created a simple test below, should I report this as a bug or am I doing something wrong. PHP 5.2.8 (extensions all disabled) Win XP SP3 Apache 2.2.11 '; class a2 {} $obi = new a2(); echo get_class($obi).': '.spl_object_hash($obi).''; class a3 {} $obi = new a3(); echo get_class($obi).': '.spl_object_hash($obi).''; unset($obi); class a4 {} $obi = new a4(); echo get_class($obi).': '.spl_object_hash($obi).''; ?> Outputs: a1: 09d264fcececf51c822c9382b40e3edf a2: 45701af64172cbc2a33069dfed73fd07 a3: 09d264fcececf51c822c9382b40e3edf a4: 09d264fcececf51c822c9382b40e3edf Thanks let me know how I should proceed with this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] spl_object_hash not hashing unqiue objects BUG
Nick Cooper schreef: > I am having a problem with spl_object_hash() creating non unique hashes. > > I understand with MD5 it is possible to have the same hash for > different strings but this doesn't seem like that problem. > > I have created a simple test below, should I report this as a bug or > am I doing something wrong. your making an incorrect assumption about spl_object_hash(), using unset($obi) tells the engine that there are no more references to the given object that was stored in it ... this implies the relevant internal object pointer is free to be reused. > PHP 5.2.8 (extensions all disabled) > Win XP SP3 > Apache 2.2.11 > > class a1 {} > $obi = new a1(); > echo get_class($obi).': '.spl_object_hash($obi).''; > class a2 {} > $obi = new a2(); > echo get_class($obi).': '.spl_object_hash($obi).''; > class a3 {} > $obi = new a3(); > echo get_class($obi).': '.spl_object_hash($obi).''; > unset($obi); > class a4 {} > $obi = new a4(); > echo get_class($obi).': '.spl_object_hash($obi).''; > ?> > > Outputs: > > a1: 09d264fcececf51c822c9382b40e3edf > a2: 45701af64172cbc2a33069dfed73fd07 > a3: 09d264fcececf51c822c9382b40e3edf > a4: 09d264fcececf51c822c9382b40e3edf > > Thanks let me know how I should proceed with this. to quote the user notes in the manual: "This is sufficient to guarantee that any two objects simultaneously co-residing in memory will have different hashes. Uniqueness is not guaranteed between objects that did not reside in memory simultaneously," note also that the hash given is only valid for the life of the request, the hash is not unique accross concurrent requests and the hash value is dependent on the order the objects were created. php -r 'class Test {}; $t1 = new Test; $t2 = new Test; var_dump(spl_object_hash($t1), spl_object_hash($t2));' php -r 'class Test {}; $t1 = new Test; $t2 = new Test; var_dump(spl_object_hash($t2), spl_object_hash($t1));' php -r 'class Test {}; $t2 = new Test; $t1 = new Test; var_dump(spl_object_hash($t1), spl_object_hash($t2));' php -r 'class Test {}; $t0 = new Test; $t1 = new Test; $t2 = new Test; var_dump(spl_object_hash($t1), spl_object_hash($t2));' use something else if you need unique hashes for objects not simultaneously existing. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
Drupal is probably not the easiest at first, but has a good API and buckets full of modules, themes and all that stuff. If a framework would be what you are looking for, i would recommend Symfony. Also heard good things about eZ Publish, Textpattern, Typo3, Website Baker and WordPress. You can find an extensive list at http://php.opensourcecms.com/scripts/show.php?catid=all&cat=All%20Scripts . Good luck finding the right one for you. I know quite a bit about Symfony, Joomla/Virtuemart and Drupal but nothing about the others. If you want support with the ones i know, i might be able to help... regards, Tim Tim-Hinnerk Heuer http://www.ihostnz.com Marlene Dietrich - "Most women set out to try to change a man, and when they have changed him they do not like h... 2009/2/12 Jean Pimentel > Wordpress > > Att, > Jean Pimentel > Museu da Infância - www.museudainfancia.com > > On Thu, Feb 12, 2009 at 7:01 AM, Lester Caine wrote: > > > dzenan.cause...@wise-t.com wrote: > > > >> I need simple CMS sistem that I could use as a staring point (to save > some > >> time in setting up the structure) in developing my own CMS. The code > >> should be simple to understand so that I can easily get on and start > >> building on it. It would be of great help if it already had features > like > >> statistics, rss feeds, and multi-language support (visitors can click on > >> the flag at the top of the page and have the pages display the content > in > >> that particular language), but if it doesn't it's okay I would build > them. > >> > >> For example Joomla seems to be too powerfull, and pretty diffucult to > >> understand at the coding level in order to customize it to serve my > >> specific needs. > >> > >> Does anyone know of any promising open source CMS project that I could > use > >> in this respect? > >> > > > > bitweaver ... > > http://bitweaver.org > > Just select the packages you want when you install, and add other > > facilities latter as you need them ... > > > > -- > > Lester Caine - G8HFL > > - > > Contact - http://lsces.co.uk/lsces/wiki/?page=contact > > L.S.Caine Electronic Services - http://lsces.co.uk > > EnquirySolve - http://enquirysolve.com/ > > Model Engineers Digital Workshop - http://medw.co.uk// > > Firebird - http://www.firebirdsql.org/index.php > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >
[PHP] Re: spl_object_hash not hashing unqiue objects BUG
'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble: Outputs: a1: 09d264fcececf51c822c9382b40e3edf a2: 45701af64172cbc2a33069dfed73fd07 a3: 09d264fcececf51c822c9382b40e3edf a4: 09d264fcececf51c822c9382b40e3edf Thanks let me know how I should proceed with this. Confirmed here. I get different hashes, but the same pattern: a1: 79eff28a9757f1a526882d82fe01d0f3 a2: 4cec55f17563fe4436164f438de7a88c a3: 79eff28a9757f1a526882d82fe01d0f3 a4: 79eff28a9757f1a526882d82fe01d0f3 PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb 9 2009 16:00:42) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies You should report the bug: http://bugs.php.net/ Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: spl_object_hash not hashing unqiue objects BUG
Colin Guthrie schreef: > 'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble: >> Outputs: >> >> a1: 09d264fcececf51c822c9382b40e3edf >> a2: 45701af64172cbc2a33069dfed73fd07 >> a3: 09d264fcececf51c822c9382b40e3edf >> a4: 09d264fcececf51c822c9382b40e3edf >> >> Thanks let me know how I should proceed with this. > > Confirmed here. I get different hashes, but the same pattern: > > a1: 79eff28a9757f1a526882d82fe01d0f3 > a2: 4cec55f17563fe4436164f438de7a88c > a3: 79eff28a9757f1a526882d82fe01d0f3 > a4: 79eff28a9757f1a526882d82fe01d0f3 > > PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb 9 2009 16:00:42) > Copyright (c) 1997-2009 The PHP Group > Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies > > You should report the bug: > http://bugs.php.net/ it's not a bug. RTFM > > Col > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: spl_object_hash not hashing unqiue objects BUG
'Twas brillig, and Jochem Maas at 12/02/09 12:47 did gyre and gimble: Colin Guthrie schreef: 'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble: Outputs: a1: 09d264fcececf51c822c9382b40e3edf a2: 45701af64172cbc2a33069dfed73fd07 a3: 09d264fcececf51c822c9382b40e3edf a4: 09d264fcececf51c822c9382b40e3edf Thanks let me know how I should proceed with this. Confirmed here. I get different hashes, but the same pattern: a1: 79eff28a9757f1a526882d82fe01d0f3 a2: 4cec55f17563fe4436164f438de7a88c a3: 79eff28a9757f1a526882d82fe01d0f3 a4: 79eff28a9757f1a526882d82fe01d0f3 PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb 9 2009 16:00:42) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies You should report the bug: http://bugs.php.net/ it's not a bug. RTFM Yup I meant to retract my statement after reading your reply but my message hadn't come through yet to the list and I then got distracted by something or other. In fairness tho' I did RTFM for the function itself and the stuff you quoted wasn't listed there, so the docu could do with a little clarification on that point. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
dzenan.cause...@wise-t.com wrote: I need simple CMS sistem that I could use as a staring point (to save some time in setting up the structure) in developing my own CMS. The code should be simple to understand so that I can easily get on and start building on it. It would be of great help if it already had features like statistics, rss feeds, and multi-language support (visitors can click on the flag at the top of the page and have the pages display the content in that particular language), but if it doesn't it's okay I would build them. For example Joomla seems to be too powerfull, and pretty diffucult to understand at the coding level in order to customize it to serve my specific needs. Does anyone know of any promising open source CMS project that I could use in this respect? Thanks, Dzenan I have a rather low opinion of most CMS apps out there. I can't recommend one - but I would recommend whatever you do, if you are starting from scratch, use the php xml DOMDocument class to build your pages. So many of the content management systems out there have XSS exploit after XSS exploit after XSS exploit. By using DOMDocument, a script node can not be created unless you create it in your code, making insertion of XSS code into your site a lot more difficult. Also, I highly recommend you use a server that has php hardened by suhosin. http://www.hardened-php.net/suhosin/ A lot of the exploits (IE from sloppiness with globals) that are found in php apps would not work on servers that are protected by suhosin. Speaking of globals, there seems to be a bad habit amongst many developers to overuse them. IE with DOMDocument, they will set their document as a global for use in functions when what they should do is simply add the document as the first parameter to the function thus avoiding the need to use a global. For example - function spanText($document,$class,$string) { $span = $document->createElement("span",$string); $span->setAttribute("class",$class); return($span); } If my DOMDocument is, say, $myxhtml - to create a bit of text I want to apply my red class to - $someNode = spanText($myxhtml,"red","This string will be in the red span"); Another thing the common CMS tools frequently do - they want a configuration file that the web server has write permission to that is parsed as php by almost every page the app displays. Big mistake - if you want a web interface to change settings, store the settings in a database table, don't have the web app write them to a file that other pages include. Finally, another thing they often do is to have a directory the web server has write permission to in the web root. Big mistake, you don't want apache to have write permission to any directories (or files) that it serves, you want to keep those outside the web root and use php to grab what needs to grabbed (IE a php wrapper to fetch images that users have uploaded). Have fun, but if looking at other apps to figure out how to do things, just remember that many of the webapps out there are not examples of good code and remember that most php books are not written by security gurus (I'm not a security guru, and even I've found insecure practices in several books). Unfortunately a lot of jerks exist who want to own your server and use it to spam the world (or attack other servers). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] error on using jar:http://localhost/clients/js/signedJar.jar!/editGrid.js
Hi, We are using PHP 5.0, Java Script and Apace HTTP Server. For Mozilla security reason, we have created a signed jar of all the js files being used in our application. We have put this jar in the js folder itself. We have successfully installed the certificate. Now from one of the php page, we are using the following code - http://localhost/clients/js/signedJar.jar!/editGrid.js";> var ClipboardText=getClipboard(); getClipboard() method is in editGrid.js file. But I get an exception telling getClipboard() method is not defined. Please help.I think I am missing out on something important. Thanks, Manu -- View this message in context: http://www.nabble.com/error-on-using-jar%3Ahttp%3A--localhost-clients-js-signedJar.jar%21-editGrid.js-tp21976510p21976510.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: spl_object_hash not hashing unqiue objects BUG
Colin Guthrie schreef: > 'Twas brillig, and Jochem Maas at 12/02/09 12:47 did gyre and gimble: >> Colin Guthrie schreef: >>> 'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble: Outputs: a1: 09d264fcececf51c822c9382b40e3edf a2: 45701af64172cbc2a33069dfed73fd07 a3: 09d264fcececf51c822c9382b40e3edf a4: 09d264fcececf51c822c9382b40e3edf Thanks let me know how I should proceed with this. >>> Confirmed here. I get different hashes, but the same pattern: >>> >>> a1: 79eff28a9757f1a526882d82fe01d0f3 >>> a2: 4cec55f17563fe4436164f438de7a88c >>> a3: 79eff28a9757f1a526882d82fe01d0f3 >>> a4: 79eff28a9757f1a526882d82fe01d0f3 >>> >>> PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb 9 2009 >>> 16:00:42) >>> Copyright (c) 1997-2009 The PHP Group >>> Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies >>> >>> You should report the bug: >>> http://bugs.php.net/ >> >> it's not a bug. RTFM > > Yup I meant to retract my statement after reading your reply but my > message hadn't come through yet to the list and I then got distracted by > something or other. ah. that could have been me :-) > > In fairness tho' I did RTFM for the function itself and the stuff you > quoted wasn't listed there, so the docu could do with a little > clarification on that point. granted. the user notes contain the relevant info, the actual docs do indeed lack detail. Quite a bit of detail regarding this issue actually cropped up on the internals mailinglist which is where I picked up on it. -- does a bear shit in the woods? is G.W.Bush a socialist? (given that all the gun-toting Bush supporters have killed all the bears that rhetoric may actually make sense) > Col > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
Thanks for your advice, Dzenan > dzenan.cause...@wise-t.com wrote: >> I need simple CMS sistem that I could use as a staring point (to save >> some >> time in setting up the structure) in developing my own CMS. The code >> should be simple to understand so that I can easily get on and start >> building on it. It would be of great help if it already had features >> like >> statistics, rss feeds, and multi-language support (visitors can click on >> the flag at the top of the page and have the pages display the content >> in >> that particular language), but if it doesn't it's okay I would build >> them. >> >> For example Joomla seems to be too powerfull, and pretty diffucult to >> understand at the coding level in order to customize it to serve my >> specific needs. >> >> Does anyone know of any promising open source CMS project that I could >> use >> in this respect? >> >> Thanks, >> Dzenan >> >> > > I have a rather low opinion of most CMS apps out there. > > I can't recommend one - but I would recommend whatever you do, if you > are starting from scratch, use the php xml DOMDocument class to build > your pages. > > So many of the content management systems out there have XSS exploit > after XSS exploit after XSS exploit. > > By using DOMDocument, a script node can not be created unless you create > it in your code, making insertion of XSS code into your site a lot more > difficult. > > Also, I highly recommend you use a server that has php hardened by > suhosin. > > http://www.hardened-php.net/suhosin/ > > A lot of the exploits (IE from sloppiness with globals) that are found > in php apps would not work on servers that are protected by suhosin. > > Speaking of globals, there seems to be a bad habit amongst many > developers to overuse them. > > IE with DOMDocument, they will set their document as a global for use in > functions when what they should do is simply add the document as the > first parameter to the function thus avoiding the need to use a global. > For example - > > function spanText($document,$class,$string) { > $span = $document->createElement("span",$string); > $span->setAttribute("class",$class); > return($span); > } > > If my DOMDocument is, say, $myxhtml - to create a bit of text I want to > apply my red class to - > > $someNode = spanText($myxhtml,"red","This string will be in the red > span"); > > Another thing the common CMS tools frequently do - they want a > configuration file that the web server has write permission to that is > parsed as php by almost every page the app displays. Big mistake - if > you want a web interface to change settings, store the settings in a > database table, don't have the web app write them to a file that other > pages include. > > Finally, another thing they often do is to have a directory the web > server has write permission to in the web root. Big mistake, you don't > want apache to have write permission to any directories (or files) that > it serves, you want to keep those outside the web root and use php to > grab what needs to grabbed (IE a php wrapper to fetch images that users > have uploaded). > > Have fun, but if looking at other apps to figure out how to do things, > just remember that many of the webapps out there are not examples of > good code and remember that most php books are not written by security > gurus (I'm not a security guru, and even I've found insecure practices > in several books). > > Unfortunately a lot of jerks exist who want to own your server and use > it to spam the world (or attack other servers). > > -- > 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] Simple open source CMS as a starting point
I will take a look at the ones you mentioned below. Drupal is too complex, just like Joomla, I have seen it. I am looking pretty much for something very basic that I could build on Dzenan > Drupal is probably not the easiest at first, but has a good API and > buckets > full of modules, themes and all that stuff. If a framework would be what > you > are looking for, i would recommend Symfony. Also heard good things about > eZ > Publish, Textpattern, Typo3, Website Baker and WordPress. You can find an > extensive list at > > http://php.opensourcecms.com/scripts/show.php?catid=all&cat=All%20Scripts > . > > Good luck finding the right one for you. I know quite a bit about Symfony, > Joomla/Virtuemart and Drupal but nothing about the others. If you want > support with the ones i know, i might be able to help... > > regards, > Tim > > Tim-Hinnerk Heuer > > http://www.ihostnz.com > Marlene Dietrich - "Most women set out to try to change a man, and when > they have changed him they do not like h... > > 2009/2/12 Jean Pimentel > >> Wordpress >> >> Att, >> Jean Pimentel >> Museu da Infância - www.museudainfancia.com >> >> On Thu, Feb 12, 2009 at 7:01 AM, Lester Caine >> wrote: >> >> > dzenan.cause...@wise-t.com wrote: >> > >> >> I need simple CMS sistem that I could use as a staring point (to save >> some >> >> time in setting up the structure) in developing my own CMS. The code >> >> should be simple to understand so that I can easily get on and start >> >> building on it. It would be of great help if it already had features >> like >> >> statistics, rss feeds, and multi-language support (visitors can click >> on >> >> the flag at the top of the page and have the pages display the >> content >> in >> >> that particular language), but if it doesn't it's okay I would build >> them. >> >> >> >> For example Joomla seems to be too powerfull, and pretty diffucult to >> >> understand at the coding level in order to customize it to serve my >> >> specific needs. >> >> >> >> Does anyone know of any promising open source CMS project that I >> could >> use >> >> in this respect? >> >> >> > >> > bitweaver ... >> > http://bitweaver.org >> > Just select the packages you want when you install, and add other >> > facilities latter as you need them ... >> > >> > -- >> > Lester Caine - G8HFL >> > - >> > Contact - http://lsces.co.uk/lsces/wiki/?page=contact >> > L.S.Caine Electronic Services - http://lsces.co.uk >> > EnquirySolve - http://enquirysolve.com/ >> > Model Engineers Digital Workshop - http://medw.co.uk// >> > Firebird - http://www.firebirdsql.org/index.php >> > >> > >> > >> > -- >> > 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] Re: spl_object_hash not hashing unqiue objects BUG
Thank you, I am now understanding this much better. Could you explain this though, if my understanding is correct the same hash is used if the object no longer exists in memory. In that case the following should all have the same hash, but they don't see output. class a1 {} $obi = new a1(); echo get_class($obi).': '.spl_object_hash($obi).''; class a2 {} $obi = new a2(); echo get_class($obi).': '.spl_object_hash($obi).''; class a3 {} $obi = new a3(); echo get_class($obi).': '.spl_object_hash($obi).''; class a4 {} $obi = new a4(); echo get_class($obi).': '.spl_object_hash($obi).''; class a5 {} $obi = new a5(); echo get_class($obi).': '.spl_object_hash($obi).''; Outputs: a1: 09d264fcececf51c822c9382b40e3edf a2: 45701af64172cbc2a33069dfed73fd07 a3: 09d264fcececf51c822c9382b40e3edf a4: 45701af64172cbc2a33069dfed73fd07 a5: 09d264fcececf51c822c9382b40e3edf 2009/2/12 Jochem Maas : > Colin Guthrie schreef: >> 'Twas brillig, and Jochem Maas at 12/02/09 12:47 did gyre and gimble: >>> Colin Guthrie schreef: 'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble: > Outputs: > > a1: 09d264fcececf51c822c9382b40e3edf > a2: 45701af64172cbc2a33069dfed73fd07 > a3: 09d264fcececf51c822c9382b40e3edf > a4: 09d264fcececf51c822c9382b40e3edf > > Thanks let me know how I should proceed with this. Confirmed here. I get different hashes, but the same pattern: a1: 79eff28a9757f1a526882d82fe01d0f3 a2: 4cec55f17563fe4436164f438de7a88c a3: 79eff28a9757f1a526882d82fe01d0f3 a4: 79eff28a9757f1a526882d82fe01d0f3 PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb 9 2009 16:00:42) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies You should report the bug: http://bugs.php.net/ >>> >>> it's not a bug. RTFM >> >> Yup I meant to retract my statement after reading your reply but my >> message hadn't come through yet to the list and I then got distracted by >> something or other. > > ah. that could have been me :-) > >> >> In fairness tho' I did RTFM for the function itself and the stuff you >> quoted wasn't listed there, so the docu could do with a little >> clarification on that point. > > granted. the user notes contain the relevant info, the actual docs do indeed > lack > detail. Quite a bit of detail regarding this issue actually cropped up on > the internals mailinglist which is where I picked up on it. > > -- > does a bear shit in the woods? is G.W.Bush a socialist? > (given that all the gun-toting Bush supporters have killed all > the bears that rhetoric may actually make sense) > >> Col >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Nick Cooper JDI Solutions www.jdi-solutions.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini not loaded?
2009/2/11 brian : > > hi nathan thanks for the response... > > looks like the rx is where it should be. That doesn't sound like you're cocksure - check it again: ls -ld /apps /apps/local /apps/local/php5 /apps/local/php5/lib /apps/local/php5/lib/php.ini Everything readable (r-x) *for the www-daemon-user*? Regards, Jan >> you may also need to check the perms on /apps/local/php5 to ensure the >> webserver user has rx on that dir as well. >> >> -nathan >> > > > -- > 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] Re: spl_object_hash not hashing unqiue objects BUG
Nick Cooper schreef: > Thank you, I am now understanding this much better. > > Could you explain this though, if my understanding is correct the same > hash is used if the object no longer exists in memory. > > In that case the following should all have the same hash, but they > don't see output. not really because creating a second object and stuffing it in a variablwe is not an atomic action. > class a1 {} > $obi = new a1(); > echo get_class($obi).': '.spl_object_hash($obi).''; > class a2 {} > $obi = new a2(); 1. the object is created in the engine 2. the object has a pointer assigned to it 3. the variable $obi is assigned, the engine hangs the pointer to the newly created object to the zval that represents $obi 4. the previous contents of $obi (internally a zval marked as 'object' with a pointer to an object of class 'a1') is now no longer referenced by anything in your code, hence the object in question can be garbage-collected and it's pointer re-used. (that's my interpretation of what happens, technically I'm sure I got something wrong ... I don't have any real understanding of the engines internals) which is why you see two alternating hashes. the engine has no way of knowing that you are about to overwrite the contents of $obi and that as a consequence there will be no more references to it current contents when it's creating the object for you: this does what you thought you example should do: class A {}; class B {}; class C {}; class D {}; var_dump( spl_object_hash(new A), spl_object_hash(new B), spl_object_hash(new C), spl_object_hash(new D) ); > echo get_class($obi).': '.spl_object_hash($obi).''; > class a3 {} > $obi = new a3(); > echo get_class($obi).': '.spl_object_hash($obi).''; > class a4 {} > $obi = new a4(); > echo get_class($obi).': '.spl_object_hash($obi).''; > class a5 {} > $obi = new a5(); > echo get_class($obi).': '.spl_object_hash($obi).''; > > Outputs: > a1: 09d264fcececf51c822c9382b40e3edf > a2: 45701af64172cbc2a33069dfed73fd07 > a3: 09d264fcececf51c822c9382b40e3edf > a4: 45701af64172cbc2a33069dfed73fd07 > a5: 09d264fcececf51c822c9382b40e3edf > > 2009/2/12 Jochem Maas : >> Colin Guthrie schreef: >>> 'Twas brillig, and Jochem Maas at 12/02/09 12:47 did gyre and gimble: Colin Guthrie schreef: > 'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble: >> Outputs: >> >> a1: 09d264fcececf51c822c9382b40e3edf >> a2: 45701af64172cbc2a33069dfed73fd07 >> a3: 09d264fcececf51c822c9382b40e3edf >> a4: 09d264fcececf51c822c9382b40e3edf >> >> Thanks let me know how I should proceed with this. > Confirmed here. I get different hashes, but the same pattern: > > a1: 79eff28a9757f1a526882d82fe01d0f3 > a2: 4cec55f17563fe4436164f438de7a88c > a3: 79eff28a9757f1a526882d82fe01d0f3 > a4: 79eff28a9757f1a526882d82fe01d0f3 > > PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb 9 2009 > 16:00:42) > Copyright (c) 1997-2009 The PHP Group > Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies > > You should report the bug: > http://bugs.php.net/ it's not a bug. RTFM >>> Yup I meant to retract my statement after reading your reply but my >>> message hadn't come through yet to the list and I then got distracted by >>> something or other. >> ah. that could have been me :-) >> >>> In fairness tho' I did RTFM for the function itself and the stuff you >>> quoted wasn't listed there, so the docu could do with a little >>> clarification on that point. >> granted. the user notes contain the relevant info, the actual docs do indeed >> lack >> detail. Quite a bit of detail regarding this issue actually cropped up on >> the internals mailinglist which is where I picked up on it. >> >> -- >> does a bear shit in the woods? is G.W.Bush a socialist? >> (given that all the gun-toting Bush supporters have killed all >> the bears that rhetoric may actually make sense) >> >>> Col >>> >> >> -- >> 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] How can an elephant count for nothing?
Jochem Maas wrote: Clancy schreef: While PHP has a lot of nice features, it also has some traps which I am forever falling into. One which I find particularly hard to understand is how mixed mode comparisons work. For instance $string = 'elephant'; If($string == 0) returns true; If($string != 0) returns false; If($string === 0) returns false; I know that in this case I should use 'If($string == '')', but I still manage to forget. Can anyone explain clearly why comparing a string with zero gives this apparently anomalous result? it's called auto-casting (or auto-typecasting) and it's 'by design' ... welcome to the world of dynamic typing. try this to see it working: php -r ' var_dump((integer)"elephant"); var_dump((float)"elephant"); var_dump((bool)"elephant"); var_dump((array)"elephant"); var_dump((object)"elephant"); var_dump((bool)(integer)"elephant"); ' you can avoid auto-casting if needed, in a variety of ways: php -r ' $foo = "elephant"; if (!empty($foo)) echo "$foo found!\n"; if (strlen($foo)) echo "$foo found!\n"; if (is_string($foo) && strlen($foo)) echo "$foo found!\n"; if ($foo !== "") echo "$foo found!\n"; if ($foo === "elephant") echo "$foo found!\n"; ' those last 2 show how to use 'type-checked' equality testing. because intval("elephant") == 0; intval will convert the string into integer , Strings will most likely return 0 although this depends on the leftmost characters of the string. -- Laruence's Signature 惠 新宸 xinchen.hui | SYS | (+8610)82602112-7974 | :laruence
Re: [PHP] PHP OOP
On Mon, Feb 9, 2009 at 11:12 AM, Yannick Mortier wrote: > 2009/2/9 tedd : > > > > Yes C++ is not bad for this, but it has also got some flaws. What language doesn't have flaws, dude? Out of all the OOP C++ and java are probably the most solid. And I _hate_ java... > > > > > However, while I don't know PHP OOP, I am open to considering it because > of > > the proliferation of web based applications. My personal opinion is > that's > > where all programming is headed anyway, but that's just my opinion. > > > > With that said, what's the differences and advantages/disadvantages > between > > C++ and PHP OOP? > > > > Cheers, > > > > tedd > > > > Both of them have got the disadvantage that they also support > procedural programming. Some of your students will for sure not > understand OOP immediately and they'll avoid using it this way. > > I guess Java is really a good idea, there are some great Editors > around for it (Netbeans...) It's completely OOP and there are many > great tutorials for it in the net, so a willing student can easily go > on after the class is over. > > I really didn't like Java some months ago, but I have to learn it at > school myself now and I think it's great to learn. It avoids most of > the errors that come from C++'s pointers etc. so you can really focus > on teaching OOP and not why you must always reserve memory etc. > > Later on it'll sure be easy to switch to other languages (though I > can't really tell this because I started with C++ when I was ten years > old and discovered PHP later and get to know Java know) > > So: My vote goes to Java, or if you want a decision between C++ and > PHP it's C++. > > > -- > Currently developing a browsergame... > http://www.p-game.de > Trade - Expand - Fight > > Follow me at twitter! > http://twitter.com/moortier > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Kyle Terry | www.kyleterry.com Help kick start VOOM (Very Open Object Model) for a library of PHP classes. http://www.voom.me | IRC EFNet #voom
Re: [PHP] How can an elephant count for nothing?
惠新宸 wrote: > Jochem Maas wrote: >> Clancy schreef: >> >>> While PHP has a lot of nice features, it also has some traps which I am >>> forever falling >>> into. One which I find particularly hard to understand is how mixed mode >>> comparisons work. >>> For instance >>> >>> $string = 'elephant'; >>> If($string == 0) returns true; >>> If($string != 0) returns false; >>> If($string === 0) returns false; >>> >>> I know that in this case I should use 'If($string == '')', but I still >>> manage to forget. >>> Can anyone explain clearly why comparing a string with zero gives this >>> apparently >>> anomalous result? >>> >> >> it's called auto-casting (or auto-typecasting) and it's 'by design' >> ... welcome to the world of dynamic typing. >> >> try this to see it working: >> >> php -r ' >> var_dump((integer)"elephant"); >> var_dump((float)"elephant"); >> var_dump((bool)"elephant"); >> var_dump((array)"elephant"); >> var_dump((object)"elephant"); >> var_dump((bool)(integer)"elephant"); >> ' >> >> you can avoid auto-casting if needed, in a variety of ways: >> >> php -r ' >> $foo = "elephant"; >> if (!empty($foo)) >> echo "$foo found!\n"; >> if (strlen($foo)) >> echo "$foo found!\n"; >> if (is_string($foo) && strlen($foo)) >> echo "$foo found!\n"; >> if ($foo !== "") >> echo "$foo found!\n"; >> if ($foo === "elephant") >> echo "$foo found!\n"; >> ' >> >> those last 2 show how to use 'type-checked' equality >> testing. >> >> >> >> >> > because intval("elephant") == 0; > intval will convert the string into integer , Strings will most likely > return 0 although this depends on the leftmost characters of the string. > > -- > > Baidu惠新宸 xinchen.hui* | * SYS *| * (+8610)82602112-7974 *|* Hi:laruence > '2 elephants' != 0 -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
Michael A. Peters wrote: > > Another thing the common CMS tools frequently do - they want a > configuration file that the web server has write permission to that is > parsed as php by almost every page the app displays. Big mistake - if > you want a web interface to change settings, store the settings in a > database table, don't have the web app write them to a file that other > pages include. > > Finally, another thing they often do is to have a directory the web > server has write permission to in the web root. Big mistake, you don't > want apache to have write permission to any directories (or files) that > it serves, you want to keep those outside the web root and use php to > grab what needs to grabbed (IE a php wrapper to fetch images that users > have uploaded). > > Have fun, but if looking at other apps to figure out how to do things, > just remember that many of the webapps out there are not examples of > good code and remember that most php books are not written by security > gurus (I'm not a security guru, and even I've found insecure practices > in several books). > > Unfortunately a lot of jerks exist who want to own your server and use > it to spam the world (or attack other servers). Some good advice, however I have never been able to retrieve my db type, db name, db user name and db password from the database without first using these to connect to the database ;-) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] error on usingjar:http://localhost/clients/js/signedJar.jar!/editGrid.js
Manupriya wrote: > Hi, > > We are using PHP 5.0, Java Script and Apace HTTP Server. > > For Mozilla security reason, we have created a signed jar of all the js > files being used in our application. We have put this jar in the js folder > itself. > > We have successfully installed the certificate. Now from one of the php > page, we are using the following code - > > src="jar:http://localhost/clients/js/signedJar.jar!/editGrid.js";> > var ClipboardText=getClipboard(); > > getClipboard() method is in editGrid.js file. But I get an exception telling > getClipboard() method is not defined. > > Please help.I think I am missing out on something important. > > Thanks, > Manu > > O.K. so what is the PHP error? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
Shawn McKenzie wrote: Michael A. Peters wrote: Another thing the common CMS tools frequently do - they want a configuration file that the web server has write permission to that is parsed as php by almost every page the app displays. Big mistake - if you want a web interface to change settings, store the settings in a database table, don't have the web app write them to a file that other pages include. Some good advice, however I have never been able to retrieve my db type, db name, db user name and db password from the database without first using these to connect to the database ;-) Since the database user used by the script shouldn't have db admin privileges, it doesn't make sense to be able to change those from a webapp admin interface anyway, changing those should require shell login. Yes, I saw the wink, but restricting the privileges of the DB user is worth mentioning anyway. I suppose they could be changed via phpMyAdmin if you run it (I don't, but if I did, it would have to be from an SSL served directory with mod_auth protection) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
On Thu, Feb 12, 2009 at 4:38 PM, wrote: > I need simple CMS sistem that I could use as a staring point (to save some > time in setting up the structure) in developing my own CMS. The code > should be simple to understand so that I can easily get on and start > building on it. It would be of great help if it already had features like > statistics, rss feeds, and multi-language support (visitors can click on > the flag at the top of the page and have the pages display the content in > that particular language), but if it doesn't it's okay I would build them. > > For example Joomla seems to be too powerfull, and pretty diffucult to > understand at the coding level in order to customize it to serve my > specific needs. > > Does anyone know of any promising open source CMS project that I could use > in this respect? > > Thanks, > Dzenan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > wordpress -- blog : ragsagar.wordpress.com site : ragsagar.freehostia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: DOMDocument help
is a string that has some bold words'; $doc = new DOMDocument; $doc->loadHTML($string); $items = $doc->getElementsByTagName('b'); for( $i = 0; $i < $items->length; $i++ ){ echo $items->item($i)->nodeValue . "\n"; } ?> ""Michael A. Peters"" wrote in message news:4993f090.9090...@mac.com... > I'm using php 5.2.5 with the php-xml module. > > I need to split a string of html into elements. > > IE - > > this is a string that has some bold words in it. > > I need to be able to take that string and split it up into textNodes for > the parts that are not in bold text, and bold nodes containing the bold > elements. > > I've tried creating a new DOMDocument object and inputing the line into > it - > > $tmpNode = new DOMDocument; > $tmpNode->loadHTML($string); > > but I can't figure out how to get the the useful nodes out of it to then > append as children in the document I'm creating. > > Any tips on how to do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] error on usingjar:http://localhost/clients/js/signedJar.jar!/editGrid.js
Actually there is no PHP error as such. But we get an error that java script method is not defined. So we think that we have either not correctly specified the url or we are not putting the jar file at the correct location. Our question is how to call a js in jar from php file? Thanks, Manu Shawn McKenzie wrote: > > Manupriya wrote: >> Hi, >> >> We are using PHP 5.0, Java Script and Apace HTTP Server. >> >> For Mozilla security reason, we have created a signed jar of all the js >> files being used in our application. We have put this jar in the js >> folder >> itself. >> >> We have successfully installed the certificate. Now from one of the php >> page, we are using the following code - >> >> > src="jar:http://localhost/clients/js/signedJar.jar!/editGrid.js";> >> var ClipboardText=getClipboard(); >> >> getClipboard() method is in editGrid.js file. But I get an exception >> telling >> getClipboard() method is not defined. >> >> Please help.I think I am missing out on something important. >> >> Thanks, >> Manu >> >> > O.K. so what is the PHP error? > > -- > Thanks! > -Shawn > http://www.spidean.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- View this message in context: http://www.nabble.com/error-on-using-jar%3Ahttp%3A--localhost-clients-js-signedJar.jar%21-editGrid.js-tp21976510p21981106.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] error onusingjar:http://localhost/clients/js/signedJar.jar!/editGrid.js
Manupriya wrote: > Actually there is no PHP error as such. But we get an error that java script > method is not defined. So we think that we have either not correctly > specified the url or we are not putting the jar file at the correct > location. > > Our question is how to call a js in jar from php file? > > Thanks, > Manu > > > Shawn McKenzie wrote: >> Manupriya wrote: >>> Hi, >>> >>> We are using PHP 5.0, Java Script and Apace HTTP Server. >>> >>> For Mozilla security reason, we have created a signed jar of all the js >>> files being used in our application. We have put this jar in the js >>> folder >>> itself. >>> >>> We have successfully installed the certificate. Now from one of the php >>> page, we are using the following code - >>> >>> >> src="jar:http://localhost/clients/js/signedJar.jar!/editGrid.js";> >>> var ClipboardText=getClipboard(); >>> >>> getClipboard() method is in editGrid.js file. But I get an exception >>> telling >>> getClipboard() method is not defined. >>> >>> Please help.I think I am missing out on something important. >>> >>> Thanks, >>> Manu >>> >>> >> O.K. so what is the PHP error? >> >> -- >> Thanks! >> -Shawn >> http://www.spidean.com >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> > My point was that just because you generate it from PHP code, it has nothing at all to do with PHP. It has everything to do with js/HTML. I would assume that you need the full URL or path to the js file, just like if you didn't use the jar, like one of the following: src="jar:http://localhost/clients/js/signedJar.jar!clients/js/editGrid.js"; or src="jar:http://localhost/clients/js/signedJar.jar!/clients/js/editGrid.js"; or src="jar:http://localhost/clients/js/signedJar.jar!http://localhost/clients/js/editGrid.js"; -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Module Structure ideas
On Wednesday 11 February 2009 21:42:24 Ashley Sheridan wrote: > On Wed, 2009-02-11 at 21:20 +0800, Virgilio Quilario wrote: > > > Last year I began to sepearte my module files to many files for their > > > purposes. > > > > > > Last time use use lots of dirs for their types > > > > > > someting like > > > > > > controllers > > > a.cont.php > > > b.cont.php > > > definition > > > a.def.php > > > b.def.php > > > models > > > a.model.php > > > b.model.php > > > views > > > a.view.php > > > b.view.php > > > > > > Then I realize this model creates confusion when you start to debug a > > > module. > > > > > > My next step was putting module files in one dir, > > > also I want to load them into text editor with spesific order > > > (same to including order). > > > > > > and I came up some ting like this > > > > > > a.test.def.php > > > c.test.mdl.php > > > e.test.cnt.php > > > g.test.rtr.php > > > i.test.view.php > > > k.test.dr.js > > > m.test.m.js > > > o.test.css > > > > > > test_app.a.def.php > > > test_app.c.mdl.php > > > test_app.e.cnt.php > > > test_app.g.rtr.php > > > test_app.i.view.php > > > test_app.k.dr.js > > > test_app.m.js > > > test_app.o.css > > > > > > test.adef.php > > > test.cmdl.php > > > test.ecnt.php > > > test.grtr.php > > > test.iview.php > > > test.kdr.js > > > test.m.js > > > test.o.css > > > > > > My point of view the 3. option is good for me. > > > > > > So I want to ask this > > > > > > (beacause I'm using very closed working model. Just KDE and KATE) > > > > > > is kind of file structure may lead any kind of problems in future or > > > diffrerent situation ? > > > > > > also is there any suggestion to using different methot to archive > > > similar goals. > > > > option #3 works for me too small projects without using frameworks. > > for big projects, i prefer to organize my script files by type: > > /models > > /controllers > > /views > > > > i don't have problems with jumping around folder to folder because i > > keep files open in separate windows. > > > > Virgil > > http://www.jampmark.com > > Number 3 looks good. but I would tend to keep .js and .css files in > their own directories respectively, as for most projects, I'll have lots > of different .js files for differents tasks, and several .css files > (screen, print, internet explorer, etc.) It makes it a lot easier for > me, as usually (unless I'm doing AJAX work) the php and javascript won't > overlap, and css is almost always completely separate. > > > Ash > www.ashleysheridan.co.uk Thanks lot. Using dirs for css and jss look more favorable. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opinions needed
I'm scripting a light-weight, low volume signup registry for a running club. Folks sign up to volunteer for events and the like. There will generally be a handful of signup registries at any one time. A typical registry will only contain 50 to 100 names. Each registry is only in existence for a month or so. I really don't see the advantage of using a real DB [e.g., mySQL,] for this. Don't need any special searching, etc. Am thinking of using a simple serialized array file for each registry; or, using Pear Cache_lite. Cache_lite has several nice functions I can take advantage of. In spite of its name, it can be configured to be permanent. I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a Pear package for fear it may not be updated for for future php releases, etc. I aways aim to keep maintenance to a minimum. Anyone had experience with Cache_Lite? Anyone have an opinion on the alternatives or maybe another storage approach? Thanks, Al -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Extract result from a https remote server response
Hi all, Example : https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123 The MB server response displayed is : Illegal operation. We would like to put the result below in a php variable and process it . An idea ? PS: The server is secured. The php functions like file(), file_get_contents(), readfile(), fopen() has been tested. Thanks, Markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinions needed
On Thu, 2009-02-12 at 15:26 -0500, Al wrote: > I'm scripting a light-weight, low volume signup registry for a running club. > Folks sign up to volunteer for events and the like. There will generally be > a > handful of signup registries at any one time. A typical registry will only > contain 50 to 100 names. Each registry is only in existence for a month or > so. > > I really don't see the advantage of using a real DB [e.g., mySQL,] for this. > Don't need any special searching, etc. > > Am thinking of using a simple serialized array file for each registry; or, > using > Pear Cache_lite. Cache_lite has several nice functions I can take advantage > of. > In spite of its name, it can be configured to be permanent. > > I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a Pear > package for fear it may not be updated for for future php releases, etc. I > aways > aim to keep maintenance to a minimum. > > Anyone had experience with Cache_Lite? Anyone have an opinion on the > alternatives or maybe another storage approach? By writing this email you've already spent about as much time as it would take to set up an SQL database and just start coding. 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
Re: [PHP] Opinions needed
At 3:26 PM -0500 2/12/09, Al wrote: I'm scripting a light-weight, low volume signup registry for a running club. Folks sign up to volunteer for events and the like. There will generally be a handful of signup registries at any one time. A typical registry will only contain 50 to 100 names. Each registry is only in existence for a month or so. I really don't see the advantage of using a real DB [e.g., mySQL,] for this. Don't need any special searching, etc. Am thinking of using a simple serialized array file for each registry; or, using Pear Cache_lite. Cache_lite has several nice functions I can take advantage of. In spite of its name, it can be configured to be permanent. I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a Pear package for fear it may not be updated for for future php releases, etc. I aways aim to keep maintenance to a minimum. Anyone had experience with Cache_Lite? Anyone have an opinion on the alternatives or maybe another storage approach? Thanks, Al Personally, I find working with files more difficult than using a database. Sure, the searching functions are an overkill for what you're doing, but you don't have to use them either. Think of a dB as just a filing system where you don't have to keep track of paths. Plus, at some future date, you may want people to logon to their accounts and register for any events without having to fill in the forms again and again with their name and address. Make it easy for both you and your users. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinions needed
Robert Cummings wrote: On Thu, 2009-02-12 at 15:26 -0500, Al wrote: I'm scripting a light-weight, low volume signup registry for a running club. Folks sign up to volunteer for events and the like. There will generally be a handful of signup registries at any one time. A typical registry will only contain 50 to 100 names. Each registry is only in existence for a month or so. I really don't see the advantage of using a real DB [e.g., mySQL,] for this. Don't need any special searching, etc. Am thinking of using a simple serialized array file for each registry; or, using Pear Cache_lite. Cache_lite has several nice functions I can take advantage of. In spite of its name, it can be configured to be permanent. I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a Pear package for fear it may not be updated for for future php releases, etc. I aways aim to keep maintenance to a minimum. Anyone had experience with Cache_Lite? Anyone have an opinion on the alternatives or maybe another storage approach? By writing this email you've already spent about as much time as it would take to set up an SQL database and just start coding. Cheers, Rob. True, but, the website is on a shared host which means someone must setup and maintain the DB and my code has to create and remove tables, as needed. Plus, someone must keep the login parms in sync between the DB and my code. Al -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinions needed
On Thu, 2009-02-12 at 15:45 -0500, Al wrote: > > Robert Cummings wrote: > > On Thu, 2009-02-12 at 15:26 -0500, Al wrote: > >> I'm scripting a light-weight, low volume signup registry for a running > >> club. > >> Folks sign up to volunteer for events and the like. There will generally > >> be a > >> handful of signup registries at any one time. A typical registry will only > >> contain 50 to 100 names. Each registry is only in existence for a month > >> or so. > >> > >> I really don't see the advantage of using a real DB [e.g., mySQL,] for > >> this. > >> Don't need any special searching, etc. > >> > >> Am thinking of using a simple serialized array file for each registry; or, > >> using > >> Pear Cache_lite. Cache_lite has several nice functions I can take > >> advantage of. > >> In spite of its name, it can be configured to be permanent. > >> > >> I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a > >> Pear > >> package for fear it may not be updated for for future php releases, etc. I > >> aways > >> aim to keep maintenance to a minimum. > >> > >> Anyone had experience with Cache_Lite? Anyone have an opinion on the > >> alternatives or maybe another storage approach? > > > > By writing this email you've already spent about as much time as it > > would take to set up an SQL database and just start coding. > > > > Cheers, > > Rob. > > True, but, the website is on a shared host which means someone must setup and > maintain the DB and my code has to create and remove tables, as needed. Plus, > someone must keep the login parms in sync between the DB and my code. Check if sqllite is available. 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
Re: [PHP] Opinions needed
> True, but, the website is on a shared host which means someone must setup > and maintain the DB and my code has to create and remove tables, as needed. > Plus, someone must keep the login parms in sync between the DB and my code. > > Al > Sound more like a hosting problem than a database problem. Guess what my suggestion will be... -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
[PHP] Re: Extract result from a https remote server response
m a r k u s wrote: > Hi all, > > Example : > https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123 > The MB server response displayed is : Illegal operation. > We would like to put the result below in a php variable and process it . > An idea ? > > PS: The server is secured. The php functions like file(), > file_get_contents(), readfile(), fopen() has been tested. > Regards > > -- > > m a r k u s > > > Well, I don't know how you tested, but if fopen_wrappers are enabled in php.ini, then this: echo file_get_contents('https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123'); displays this: Illegal operation Seems to work for me. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Extract result from a https remote server response
Shawn McKenzie wrote: > m a r k u s wrote: >> Hi all, >> >> Example : >> https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123 >> The MB server response displayed is : Illegal operation. >> We would like to put the result below in a php variable and process it . >> An idea ? >> >> PS: The server is secured. The php functions like file(), >> file_get_contents(), readfile(), fopen() has been tested. >> Regards >> >> -- >> >> m a r k u s >> >> >> > Well, I don't know how you tested, but if fopen_wrappers are enabled in > php.ini, then this: > > echo > file_get_contents('https://www.moneybookers.com/app/email_check.pl?email=t...@toto.com&cust_id=123546&password=123'); > > displays this: > > Illegal operation > > > Seems to work for me. > allow_url_fopen = On -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can an elephant count for nothing?
On Thu, 2009-02-12 at 13:12 +0200, Dotan Cohen wrote: > Have you tried with a mouse? > Non-strings equate to a boolean value of 1 when they are converted to a boolean value automatically (in the case of comparison queries) when they contain a value. Strings of 0 length are converted to a 0. In useful terms, 1 is true and 0 is false in the PHP world. As PHP is a loose-typed language you should really use the === operator if you need to compare variable mathc and type match. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need to hire some PHP help...
I need probably no more than an hour of two of help from someone better than me at PHP, but have money sitting here ready to pay you. My project is way behind schedule and I'm burning too much time and making no progress trying to solve two problems. (1) Submitting some XML to a web service via curl. I posted some questions on this yesterday, but can't get it to work. This is not something new to me, so whatever the problem is has got to be really obscure. (2) Using FPDF and am unable to solve the "FPDF error: Could not include font definition file". So I'm looking for someone familiar with using makefont with FPDF. If you can help with the above, and feel confident that you're familiar enough with the technologies that you can probably resolve the issues in not too much time, please email me directly ASAP. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinions needed
At 3:45 PM -0500 2/12/09, Al wrote: Robert Cummings wrote: By writing this email you've already spent about as much time as it would take to set up an SQL database and just start coding. Cheers, Rob. True, but, the website is on a shared host which means someone must setup and maintain the DB and my code has to create and remove tables, as needed. Plus, someone must keep the login parms in sync between the DB and my code. Al Al: ??? Once you have the tables set, which is easier than setting up a file system, there is no maintenance and you don't have to create and remove tables -- why would one do that? As for login parameters, what's to keep up with? Set a configuration file and it's done. Sounds like you think it's more trouble than it actually is. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple open source CMS as a starting point
Michael A. Peters wrote: Shawn McKenzie wrote: Michael A. Peters wrote: Another thing the common CMS tools frequently do - they want a configuration file that the web server has write permission to that is parsed as php by almost every page the app displays. Big mistake - if you want a web interface to change settings, store the settings in a database table, don't have the web app write them to a file that other pages include. Some good advice, however I have never been able to retrieve my db type, db name, db user name and db password from the database without first using these to connect to the database ;-) Since the database user used by the script shouldn't have db admin privileges, it doesn't make sense to be able to change those from a webapp admin interface anyway, changing those should require shell login. Yes, I saw the wink, but restricting the privileges of the DB user is worth mentioning anyway. I suppose they could be changed via phpMyAdmin if you run it (I don't, but if I did, it would have to be from an SSL served directory with mod_auth protection) You missed the point. How can you connect to the db to get the rest of the settings if the database connection details are not stored somewhere? Without a conf file of some sort, how do you suggest getting those details? I agree the conf file doesn't need to be writeable. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Don't Forget to Punch the Clock, Shorty!
Anyone care to try this out? Feedback welcome. http://dftpcs.com Thanks -- Richard Whitney phpmy...@gmail.com http://phpmydev.com 602-288-5340 310-943-6498 "You come up with ideas, I come up with solutions."
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
> Anyone care to try this out? Feedback welcome. > > http://dftpcs.com > No. What is it? -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
It's what I use for tracking my time and payments. Should've been more specific about it. Sorry! On Thu, Feb 12, 2009 at 4:05 PM, Dotan Cohen wrote: > > Anyone care to try this out? Feedback welcome. > > > > http://dftpcs.com > > > > No. What is it? > > -- > Dotan Cohen > > http://what-is-what.com > http://gibberish.co.il > > א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת > ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي > А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я > а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я > ä-ö-ü-ß-Ä-Ö-Ü > -- Richard Whitney phpmy...@gmail.com http://phpmydev.com 602-288-5340 310-943-6498 "You come up with ideas, I come up with solutions."
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
it's written in PHP and uses AJAX. Sorry for my fragmented thoughts! On Thu, Feb 12, 2009 at 4:06 PM, Richard Whitney wrote: > It's what I use for tracking my time and payments. > Should've been more specific about it. Sorry! > > > > On Thu, Feb 12, 2009 at 4:05 PM, Dotan Cohen wrote: > >> > Anyone care to try this out? Feedback welcome. >> > >> > http://dftpcs.com >> > >> >> No. What is it? >> >> -- >> Dotan Cohen >> >> http://what-is-what.com >> http://gibberish.co.il >> >> א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת >> ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي >> А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я >> а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я >> ä-ö-ü-ß-Ä-Ö-Ü >> > > > > -- > Richard Whitney > phpmy...@gmail.com > http://phpmydev.com > 602-288-5340 > 310-943-6498 > > "You come up with ideas, I come up with solutions." > -- Richard Whitney phpmy...@gmail.com http://phpmydev.com 602-288-5340 310-943-6498 "You come up with ideas, I come up with solutions."
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
> Sorry for my fragmented thoughts! > In light of this [1] you are forgiven! I think that you will find most list members a bit too jaded to go to a new domain name, suggested by a new poster who's name does not turn up anything php related on Google. I'm not doubting you, just letting you know why many list members won't visit that site. [1] http://en.wikipedia.org/wiki/Richard_Whitney_(financier) -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
On Thu, Feb 12, 2009 at 4:24 PM, Dotan Cohen wrote: > > Sorry for my fragmented thoughts! > > > > In light of this [1] you are forgiven! > > I think that you will find most list members a bit too jaded to go to > a new domain name, suggested by a new poster who's name does not turn > up anything php related on Google. I'm not doubting you, just letting > you know why many list members won't visit that site. > Well I appreciate that. The domain name is not new - just new to the list. It hadn't occurred to me that I was a new poster - but it's true - an avid reader though! Thanks! Richard Whitney phpmy...@gmail.com http://phpmydev.com 602-288-5340 310-943-6498 "You come up with ideas, I come up with solutions."
Re: [PHP] Opinions needed
Robert Cummings wrote: On Thu, 2009-02-12 at 15:45 -0500, Al wrote: Robert Cummings wrote: On Thu, 2009-02-12 at 15:26 -0500, Al wrote: I'm scripting a light-weight, low volume signup registry for a running club. Folks sign up to volunteer for events and the like. There will generally be a handful of signup registries at any one time. A typical registry will only contain 50 to 100 names. Each registry is only in existence for a month or so. I really don't see the advantage of using a real DB [e.g., mySQL,] for this. Don't need any special searching, etc. Am thinking of using a simple serialized array file for each registry; or, using Pear Cache_lite. Cache_lite has several nice functions I can take advantage of. In spite of its name, it can be configured to be permanent. I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a Pear package for fear it may not be updated for for future php releases, etc. I aways aim to keep maintenance to a minimum. Anyone had experience with Cache_Lite? Anyone have an opinion on the alternatives or maybe another storage approach? By writing this email you've already spent about as much time as it would take to set up an SQL database and just start coding. Cheers, Rob. True, but, the website is on a shared host which means someone must setup and maintain the DB and my code has to create and remove tables, as needed. Plus, someone must keep the login parms in sync between the DB and my code. Check if sqllite is available. Cheers, Rob. It is still available and I've got it on my consideration list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
On Thu, 2009-02-12 at 15:58 -0700, Richard Whitney wrote: > Anyone care to try this out? Feedback welcome. > > http://dftpcs.com > > Thanks Also, given that this was formatted and sounded as vague as a spam email, I simply dismissed it and moved on. Even the URL is very cryptic (although I realize NOW that it's an acronym, at the time it looked random letters as phishers use). I have no interest in registering and giving you my email, etc. just to try a SaaS that i have ZERO idea how it works or what it does. There is no description. No screenshots. no anything. Why not provide a 'test/test123' account if you want people to try it out. Not to mention the time it would take for me to populate your tool with data to be useful enough to evaluate. http://daevid.com
[PHP] fork/spawnzombie question
Hi Nathan/Torok... Hey guys... got a bit of a question. I'm playing around with the php/for/pcntl_exec functions and I've got a process that spawns off a bunch of child processes. Unfortunately, I'm getting to where I have 100's of zombie child processes that I can see from the linux/processTBL. I don't want to have my master loop do a waitpid() call, as it would block on the wait for one of the child processes to exit. I recognize that the zombie/child process is essentially a placeholder in the processTBL slt, and really doesn't take up any system resources, but I'd still like to have the zombie processes removed. I'm wondering. Is it possible to fork off a process, and have it essentially do the wait on all the zombie/shild processes from the parent app? Or would this be a peer process, waiting on it's peers? Thanks -bruce bedoug...@earthlink.net 925-249-1844 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opinions needed
tedd wrote: At 3:26 PM -0500 2/12/09, Al wrote: I'm scripting a light-weight, low volume signup registry for a running club. Folks sign up to volunteer for events and the like. There will generally be a handful of signup registries at any one time. A typical registry will only contain 50 to 100 names. Each registry is only in existence for a month or so. I really don't see the advantage of using a real DB [e.g., mySQL,] for this. Don't need any special searching, etc. Am thinking of using a simple serialized array file for each registry; or, using Pear Cache_lite. Cache_lite has several nice functions I can take advantage of. In spite of its name, it can be configured to be permanent. I'd just go ahead and use Cache_lite; but, I'm always reluctant to use a Pear package for fear it may not be updated for for future php releases, etc. I aways aim to keep maintenance to a minimum. Anyone had experience with Cache_Lite? Anyone have an opinion on the alternatives or maybe another storage approach? Thanks, Al Personally, I find working with files more difficult than using a database. Sure, the searching functions are an overkill for what you're doing, but you don't have to use them either. Think of a dB as just a filing system where you don't have to keep track of paths. Plus, at some future date, you may want people to logon to their accounts and register for any events without having to fill in the forms again and again with their name and address. Make it easy for both you and your users. Cheers, tedd Part of the problem is that in my attempt to keep my request brief, I skimped on describing the big picture. The site's architecture is highly compartmentalized into dozens of topics and applications http://www.restonrunners.org. Each has it's own content managers, who are not technical. I chose, early on, to use directories as a means to control and maintain the compartmentalization. It has worked well; we can add, change and remove whole topics with ease. It is easy for our content managers to comprehend and work with. Applications like the one described here simply use a calling file in the topic directory that consists of a single line of code. require_once $_SERVER['DOCUMENT_ROOT'] . '/signups/commonReg.php'; commonReg.php takes care of everything and the signup's ID is simply the /dir/callingFilename. Signups are quite fluid, we have dozens per year and all have different fields. One page has 9 individual signups and these will only be posted for less than 1 month. There is never any need for a common perpetual DB. There are no personal accounts per se. Thanks for everyones help in getting me to think about alternatives. Al -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
On Thu, Feb 12, 2009 at 5:05 PM, Daevid Vincent wrote: > On Thu, 2009-02-12 at 15:58 -0700, Richard Whitney wrote: > > Anyone care to try this out? Feedback welcome. > http://dftpcs.com > > Thanks > > > Also, given that this was formatted and sounded as vague as a spam email, I > simply dismissed it and moved on. Even the URL is very cryptic (although I > realize NOW that it's an acronym, at the time it looked random letters as > phishers use). > > I have no interest in registering and giving you my email, etc. just to try > a SaaS that i have ZERO idea how it works or what it does. There is no > description. No screenshots. no anything. Why not provide a 'test/test123' > account if you want people to try it out. Not to mention the time it would > take for me to populate your tool with data to be useful enough to evaluate. > > http://daevid.com > good idea Daevid! Thanks! http://dftpcs.com u: testing p: testing123 -- Richard Whitney phpmy...@gmail.com http://phpmydev.com 602-288-5340 310-943-6498 "You come up with ideas, I come up with solutions."
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
On Thu, Feb 12, 2009 at 5:03 PM, Richard Whitney wrote: > On Thu, Feb 12, 2009 at 5:05 PM, Daevid Vincent wrote: > > > On Thu, 2009-02-12 at 15:58 -0700, Richard Whitney wrote: > > > > Anyone care to try this out? Feedback welcome. > > http://dftpcs.com > > > > Thanks > > > > > > Also, given that this was formatted and sounded as vague as a spam email, > I > > simply dismissed it and moved on. Even the URL is very cryptic (although > I > > realize NOW that it's an acronym, at the time it looked random letters as > > phishers use). > > > > I have no interest in registering and giving you my email, etc. just to > try > > a SaaS that i have ZERO idea how it works or what it does. There is no > > description. No screenshots. no anything. Why not provide a > 'test/test123' > > account if you want people to try it out. Not to mention the time it > would > > take for me to populate your tool with data to be useful enough to > evaluate. > > > > http://daevid.com > > > > > good idea Daevid! > Thanks! > > http://dftpcs.com > u: testing > p: testing123 > > > > -- > Richard Whitney > phpmy...@gmail.com > http://phpmydev.com > 602-288-5340 > 310-943-6498 > > "You come up with ideas, I come up with solutions." > Haha...Information management and timesheets... That's what I write for a living. -- Kyle Terry | www.kyleterry.com Help kick start VOOM (Very Open Object Model) for a library of PHP classes. http://www.voom.me | IRC EFNet #voom
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
On 12-Feb-09, at 8:55 PM, Kyle Terry wrote: On Thu, 2009-02-12 at 15:58 -0700, Richard Whitney wrote: Anyone care to try this out? Feedback welcome. http://dftpcs.com Thanks -- Hi there! The right panel is not always refreshing correctly in my Mac Safari 3.2.1 Sometimes is leaving lines through the various elements, or not drawing them at all. This is occurring mostly when I click a "Submit" or other button in the right panel, but also when I click an item in the left panel. It does seem to be fine until after I have added a new company to the list, and then it starts having problems. Don't know if something in your code, or just my machine acting up! But may be worth testing somewhere else. HTH. George Langley Multimedia Developer, Audio/Video Editor, Musician, Arranger, Composer http://www.georgelangley.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP OOP
Java is really awesome at OOP and it is great for teaching OOP or, shall we say "illustrating OOP". OOP is a programming technique in general without any bias towards any programming language. Good background on OOP concepts is essential in learning language specific OOP implementation. So don't worry about languages. The important thing is, you know what OOP means. Also you can't compare PHP to other programming languages. PHP is new and mainly built for the web. With its raw power, it is simply incomparable. virgil http://www.jampmark.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can an elephant count for nothing?
On Thu, 12 Feb 2009 23:47:31 +0800, huixinc...@baidu.com (???) wrote: >Jochem Maas wrote: >> Clancy schreef: >> >>> While PHP has a lot of nice features, it also has some traps which I am >>> forever falling >>> into. One which I find particularly hard to understand is how mixed mode >>> comparisons work. . >> you can avoid auto-casting if needed, in a variety of ways: >> >> php -r ' >> $foo = "elephant"; >> if (!empty($foo)) >> echo "$foo found!\n"; >> if (strlen($foo)) >> echo "$foo found!\n"; >> if (is_string($foo) && strlen($foo)) >> echo "$foo found!\n"; >> if ($foo !== "") >> echo "$foo found!\n"; >> if ($foo === "elephant") >> echo "$foo found!\n"; >> ' >> >> those last 2 show how to use 'type-checked' equality >> testing. >> >because intval("elephant") == 0; >intval will convert the string into integer , Strings will most likely >return 0 although this depends on the leftmost characters of the string. This seems to be the nearest to the correct answer. In fact it appears that if you compare a string with an integer the effective value of the string is the value of the first character(s), if it/they are integers, or zero. elephant == 0; true an elephant == 0; true 1 elephant == 0; false 0 elephants == 0; true a herd of elephants == 0; true 7 elephants == 7; true elephants == ; true The next question is ' how is the order of conversion determined?' I thought it might have converted the second element to the same type as the first element, so I reversed the comparison, but I got exactly the same results, so perhaps it converts from the more complex type to the simpler type. Clearly the lesson is to be learnt is not to compare disparate types, unless you really have to. One situation where this is unavoidable is if you are searching an arbitrary set of strings for a given word. In this case it is essential to do the exact comparison, or you will get erroneous results. Thank you all for your suggestions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php