[PHP] Get recursive array

2006-02-06 Thread Bruno B B Magalhães
Hi guys.. well I have a little problem, I succeeded on retrieving a value by it's key, but I want a clean and faster method... Let me explain: I have the following function which I use to set variables in my framework like (configs, requests, etc)...

[PHP] Get recursive array

2006-02-06 Thread Bruno B B Magalhães
Hi guys.. well I have a little problem, I succeeded on retrieving a value by it's key, but I want a clean and faster method... Let me explain: I have the following function which I use to set variables in my framework like (configs, requests, etc)...

[PHP] Re: Get recursive array

2006-02-06 Thread Bruno B B Magalhães
Hi Jochem, well, thanks for the code... it's working perfect, but it seams a little bit slow as it's using while... doesn't? Now, abusing of you, how can I unset a variable the same recursive way? :D Maybe like this? /

Re: [PHP] Re: How to read PHP variables.

2005-07-15 Thread Bruno B B Magalhães
and write the strings.. Best Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to read PHP variables.

2005-07-12 Thread Bruno B B Magalhães
Hi you all! That's my problem: I have a configuration files with the following structure... $vars['varname'] = 'varvalue'; And I would like to have a module to change those parameters, but I don't know how to write a pattern to match it... Thanks in advance... Best Regards, Bruno B B

Re: [PHP] Formating

2005-07-07 Thread Bruno B B Magalhães
Hi Richard, On Jul 5, 2005, at 6:20 PM, Richard Lynch wrote: On Mon, July 4, 2005 6:48 pm, Bruno B B Magalhães said: For example I have a brazilian zipcode witch is stored in database as Is she a Good Witch, or a Bad Witch? :-) Ups, hehehehe! 22252970 and must be formatted as N-NNN

[PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Well, I've read the manual, and the ADOdb Date package functions, and I am not using this because I want to keep my framework simple, flexible, and fast. Well, I just want a simple way to translate dates (I know what is the input format) to unix timestamp, with ability to do this with

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Hi Richard, Well, I took a look at, and I think it is TOO complex to handler a simple thing.. Well, that's my little contribution: function str2time($input = '12/31/1969') { $year= substr($input, -4); $input= substr_replace($input, 1976 , -4);

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Hi Folks, Well I think I got it, at least it's working more or less to me now... I really would appreciate any comments or suggestions. function str2time($input = '12/31/1969') { if(($output = strtotime($input)) !== -1) { return $output; }

Re: [PHP] TimeStamp BEFORE 1970

2005-07-07 Thread Bruno B B Magalhães
Hi Edward, thanks for replying! On Jul 7, 2005, at 10:44 PM, Edward Vermillion wrote: One problem is that there's no accounting for leap years, but I don't know if that's gonna cause you any problems or not. Course it have, when we multiply the year offset by 31557376.189582 we are using

Re: [PHP] TimeStamp BEFORE 1970 AND AFTER 2035

2005-07-07 Thread Bruno B B Magalhães
Just a quick fix, as now I've tested in a real environment, with a real application, and now it's working 100%, well, I think so. / * * Stritotime workaround for dates before 1970 and after 2038

[PHP] Formating

2005-07-05 Thread Bruno B B Magalhães
Hi everybody, I've searched the docs for a generic way to format strings and numbers... For example I have a brazilian zipcode witch is stored in database as 22252970 and must be formatted as N-NNN, where N is a number. Also I have a tax id with is also stored as numeric value only,

Re: [PHP] Re: class calling script

2005-04-12 Thread Bruno B B Magalhães
Well, I have a framework class witch loads and stores all classes in it. I can´t post the all code, but some I cam: Loading a core class like a database class: --- function loadcore($handler, $class_name = '') {

Re: [PHP] Simple Licensing System

2005-04-09 Thread Bruno B B Magalhães
Hi Richard, And how do I generate this, and how would I check it?!?! Thanks, Bruno B B Magalhaes On Apr 8, 2005, at 11:48 PM, Richard Lynch wrote: On Fri, April 8, 2005 1:06 pm, Bruno B B Magalhães said: I need a help with a licensing system, I want something very simple, for example a simple var

[PHP] Simple Licensing System

2005-04-08 Thread Bruno B B Magalhães
Hi Guys! I need a help with a licensing system, I want something very simple, for example a simple var store into the configuration file, and witch is sent to a server called licenses.hostname.com.br, and this one returns true or false... I don't wanna use SOAP or XML. Does any body have a

[PHP] $GLOBALS, any probolems?

2005-02-09 Thread Bruno B B Magalhães
Hi guys, is there any problems using $GLOBALS superglobal to carry all my global classes instances? For example: $GLOBALS['myclass'] = new myclass(); Regards, Bruno B B Magalhaes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] URGENT: Break-lines disappearing.

2005-01-20 Thread Bruno B B Magalhães
Hi you all, I am having a very big problem... I have an article module in a system, when an user creates an article it's parsed (as everything else in the system) by an input class, after, it is checked for emptily and after is build an insert query... But the break-lines just disappear... I've

[PHP] Dates, times, timezones...

2005-01-19 Thread Bruno B B Magalhães
Hi everybody, How do you save the date and time in the database? Time stamp or date and time? GMT timezone or the server timezone, or maybe the configs timezone? And when displaying apply user timezone to the GMT date? I think it's easier to save in timestamp format, so it's easy to convert to

Re: [PHP] Checking if

2005-01-12 Thread Bruno B B Magalhães
Richard, my solution right know is: if(substr($url,-1) != '/') { $url = $url.'/'; } Simple and fast... :) Regards, Bruno B B Magalhaes On Jan 12, 2005, at 3:37 PM, Richard Lynch wrote: Bruno B B Magalhães wrote: how to determine if the last char of a string is a '/'... The problem

[PHP] UBB Code correct use

2005-01-11 Thread Bruno B B Magalhães
Hi people, I have a small class that encodes and decodes ubb code, no problem with this.. But.. My question is, what is the correct use of the translation routines in a CMS... I meam: When creating a new article: New article form --- UBB Encode --- Database

[PHP] Checking if

2005-01-11 Thread Bruno B B Magalhães
Hi people, how to determine if the last char of a string is a '/'... The problem, a webpage can be accessed by www.domain.com/page.php or www.domain.com/page.php/ Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Pagination Optimization

2005-01-08 Thread Bruno B B Magalhães
, Bruno B B Magalhães On Jan 7, 2005, at 10:09 PM, M. Sokolewicz wrote: first of all, you're running 4 queries here. 4 queries is a lot! Especially when you don't need more than 2 ;) the problem here is that your queries are pretty unknown to this function. Although it does a nice result

[PHP] Pagination Optimization

2005-01-07 Thread Bruno B B Magalhães
way to fetch paginated results quicker? I had a project list, without pagination, and when I added the pagination function, it slowed down up to 0.0125 secs. Before it was running at 0.0600 more or less, and now it´s running at 0.07 to 0.075... Best Regards, Bruno B B Magalhães -- PHP General

[PHP] GMT

2005-01-04 Thread Bruno B B Magalhães
to the hour. Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] GMT

2005-01-04 Thread Bruno B B Magalhães
)) { $this-local_timezone_offset = $this-default_timezone_offset - $this-server_timezone_offset; return time()+3600*$this-local_timezone_offset; } else { return time(); } } = Nice regards to you all, Bruno B B Magalhães

[PHP] Frameworks

2004-12-22 Thread Bruno B B Magalhães
Hi everybody, well I was measuring my framework performance on a real production server... And the average execution time with 20 requests per second is 0.025 seconds. Course it will change according to the server hardware, but I am searching for a REALLY fast framework environment that can

Re: [PHP] Infinity and nested categories

2004-12-14 Thread Bruno B B Magalhães
Thanks Richard! Helped a lot! Regards, Bruno B B Magalhaes On Dec 13, 2004, at 4:16 PM, Richard Lynch wrote: Bruno B B Magalhães wrote: Hi again everybody, well, I've asked it before, but I couldn't work on this at all. As some knows I have a system witch has a category system. The generic part

[PHP] Slow Zend Optimizer

2004-12-14 Thread Bruno B B Magalhães
Hi guys, I've installed the zend Optimizer with my Mac OS X, Apache 1.2, PHP5. And guess what, it became about 40% slower!!! My framework was running for example in the modules administration (admin area) at 0.104ms, and now the average is 0.2ms - 0.24ms Does anybody have any idea of what hell

[PHP] Infinity and nested categories

2004-12-12 Thread Bruno B B Magalhães
Hi again everybody, well, I've asked it before, but I couldn't work on this at all. As some knows I have a system witch has a category system. The generic part of the site is handled by a generic module called contents... generic like products, services, company, etc. Where the content layout

Re: [PHP] Friendly URL

2004-12-11 Thread Bruno B B Magalhães
'] or ... It's all in there, though you might have to tear it apart a bit to get exactly what you want. Bruno B B Magalhães wrote: Hi Richard, well but I want also the file it self to be included in it... Regards, Bruno B B Magalhaes But I need On Dec 10, 2004, at 8:20 PM, Richard Lynch wrote: Bruno B B

[PHP] Friendly URL

2004-12-10 Thread Bruno B B Magalhães
Hi guys, As part of my framework I have a URI decoder so it explode, remove unnecessary data (as GET query) amd put it into an array... Is there any better way of doing this (faster?), just wondering. if(isset($_SERVER['REQUEST_URI']) === true) {

[PHP] Not quite PHP, but related...

2004-12-10 Thread Bruno B B Magalhães
Hi you all, is that possible using .htaccess to redirect every request to a specified script? for example if you have: http://www.yoursite.com/en/articles/blab.html where there isn't a en dir., so it would be redirected to public_html/site I could use error page, but it won't receive post, get,

[PHP] Implementing database cache.

2004-12-08 Thread Bruno B B Magalhães
Hi again guys, does anybody have am idea of witch are the required functions to implement a database query cache? I have a very nice and fast database layer, witch I use in all my projects (about 19 sites and a lot of others hot-sites and systems like intranet and extranets). Here is my idea

Re: [PHP] Implementing database cache.

2004-12-08 Thread Bruno B B Magalhães
I am using mysql with cache results enable, but as every addicted I want more and more... course I have to benchmark it to see if its worth... Regards, Bruno B B Magalhes On Dec 8, 2004, at 8:34 PM, John Holmes wrote: Bruno B B Magalhes wrote: Hi again guys, does anybody have am idea of witch

[PHP] Lazy anwsers (WAS: mysql_connect vs mysql_pconnect)

2004-11-27 Thread Bruno B B Magalhães
believe that others do too. So I think that this is the worst kind of comment or suggestion someone can receive. Sorry everybody. Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] identifying the country of the people who connect to web site / portal

2004-11-27 Thread Bruno B B Magalhães
Hi, course you can, you should search harder for it, but I will facilitate for you! :o) http://www.phpclasses.org/browse/package/1477.html Best Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Comment Speed

2004-11-27 Thread Bruno B B Magalhães
Does anyone has a solid benchmark about comments speed.. I mean, too many comments will decrease speed of the PHP scripts... I've tried without success using a class, and also a simple micro-time operation... Well, cause the file is evaluated before it is executed, I didn't had success. Any

Re: [PHP] How to $_POST from a grid

2004-11-24 Thread Bruno B B Magalhães
as foreach($modules as $module) { } our also a faster one for($i=0; $i $t; $i++) { } where $t = count($modules)-1;. Best Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Is it a good idea?

2004-11-20 Thread Bruno B B Magalhães
Hi guys, In my framework I have some classes that depends from others (like authentication depends of database)... So I wrote is method inside the framework class, and I would like to know if is it an intelligent solution or not: class dependent { function dependent ($framework)

[PHP] Auto Class loading

2004-11-17 Thread Bruno B B Magalhães
Continuing the classes questions... I have a class loader called 'load_core_class($class=''), but if $class equals to all I would like to load all classes in the core directory, include then AND start then this way: $this-$loadedclassname = new $loadedclassname; Is it possible? Regards, Bruno B

[PHP] Authentication Class

2004-11-16 Thread Bruno B B Magalhães
Hi guys, well, I wrote a class for a big project (a framework), and here it is, I was wondering if someone have any suggestions regarding flexibility and security. Course it uses specific framework classes but it's quite understable..

[PHP] Array unset

2004-11-16 Thread Bruno B B Magalhães
Hi, I my system can handle invisible modules, so they can't show in the menu but stills works... here is the code: $c = count($modules)-1; for($i = 0; $i = $c; $i++) { if($modules[$i]['moduleVisibility'] == 0) {

[PHP] Auto-load class if it doesn't exists!

2004-11-16 Thread Bruno B B Magalhães
Hi people, is it possible to have a solution that works like an autoloader... for example: $myclass = new class(); but if this class wasn't loaded yet, it loads by itself... egg: if(class_exists(class)) { $myclass = new class(); } else { require_once(PATH_DIR.'class.class.php');

Re: [PHP] Authentication Class

2004-11-16 Thread Bruno B B Magalhães
Is this good or bad? heheh! Regards, Bruno B B Magalhaes On Nov 16, 2004, at 3:31 PM, raditha dissanayake wrote: Bruno B B Magalhães wrote: Hi guys, well, I wrote a class for a big project (a framework), and here it is, I was wondering if someone have any suggestions regarding flexibility

[PHP] Re: [PHP-DB] OOP vs Functions and includes

2004-11-16 Thread Bruno B B Magalhães
Pablo, This is a very complex discussion... But generalizing, a LOT, OO is more appropriated for big systems due to its extensibility and easy maintenance, while procedural approach works best for small applications that don't require to much updates and aren't too complex. Here is a

Re: [PHP] Javascript and php

2004-11-07 Thread Bruno B B Magalhães
. Regards, Bruno B B Magalhães On Nov 7, 2004, at 8:44 AM, Reinhart Viane wrote: Hey all, Hope some of you also work on sundays :) I have a little javascript which displays a images (with previous / next thing) Now, i populate the javascript array with an php array: SCRIPT LANGUAGE=JavaScript !-- Begin

Re: [PHP] Syntax highlighting of odd language

2004-11-05 Thread Bruno B B Magalhães
($oddsyntax[$i],'spam class=highlighted'.$oddsyntax[$i].'/spam',$code); } return $code; } echo highlight_code($code); Regards, Bruno B B Magalhães On Nov 5, 2004, at 6:39 PM, Aaron Gould wrote: Could any of you privide some leads in regard to highlighting syntax of an odd language? I have a large

[PHP] keywords generation

2004-11-05 Thread Bruno B B Magalhães
Hi People, well, I am building a very sophisticated(?) CMS, and I am thinking to implement a keyword automatically generation function... I thought on the following structure: == $submited_text = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh

Re: [PHP] Re: keywords generation

2004-11-05 Thread Bruno B B Magalhães
as: $keywords = 'dolor,t,eu,te,in'; Got it? Thanks, Bruno B B Magalhaes On Nov 5, 2004, at 7:42 PM, M. Sokolewicz wrote: Bruno b b magalhães wrote: Hi People, well, I am building a very sophisticated(?) CMS, and I am thinking to implement a keyword automatically generation function... I thought

Re: [PHP] Re: keywords generation

2004-11-05 Thread Bruno B B Magalhães
delenit augue duis dolore te feugait nulla facilisi. '; echo generate_keywords($submited_text); Thanks to Tularis and Sokolewicz . Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net

Re: [PHP] Re: keywords generation (ANOTHER)

2004-11-05 Thread Bruno B B Magalhães
Hi, I am trying to categorize the keywords... for example, if a word shows at the begin probably its more important, but how many occurrences is also important... Does someone knows Googles formula? hehe This code is working more or less as expected! Many Thanks, Bruno

Re: [PHP] PHP framework

2004-10-23 Thread Bruno B B Magalhães
of then: http://www.zope.org http://www.fusebox.org http://www.mojavi.org http://www.binarycloud.com http://www.eZpublish.com http://amb.sourceforge.net http://www.phpmvc.net http://phrame.itsd.ttu.edu http://www.horde.org Best Regards, Bruno B B Magalhães On Oct 23, 2004, at 4:04 PM, Igor wrote: I need

Re: [PHP] enterprise php application automated testing

2004-10-23 Thread Bruno B B Magalhães
Well, we call it pre-testing, the only way, and the better one, is doing it with the future users of your system! Regards, Bruno B B Magalhães On Oct 23, 2004, at 10:00 PM, blackwater dev wrote: Hello all, I know I can use simpletest to test my application at the class level but I need a tool

Re: [PHP] Mixing classes

2004-10-20 Thread Bruno B B Magalhães
false; } } else { return false; } } } ? Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Mixing classes

2004-10-20 Thread Bruno B B Magalhães
false; } } else { return false; } } } ? Regards, Bruno B B Magalhães -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Reverse (or backward?) Infinity Loop

2004-10-19 Thread Bruno B B Magalhães
Hi guys, I have a normal categories table: catId catParentId catName catStatus But I want when a user enters on: http://hostname/site/products/catId1/catId7/catId13/../../contentId.html A listing should apear like that: Category 1 Category 7 Category 13 Category 2 Category 3