[PHP] Facebook PHP compiler
Hello, Have you guys checked this PHP to C++ converter from the Facebook People? http://developers.facebook.com/news.php?blog=1&story=358 Regards, -- Cesar D. Rodas cro...@php.net http://crodas.org/ -- http://cesar.la/ Phone: +595-961-974165 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GSOC Idea, RPC Server
Hello folk, Let me introduce myself, my name is Cesar Rodas, a young guy from Paraguay who wants to propose an idea for the GSoC2009. The purpose of this project is to implement a pure PHP client and server API for distributing PHP applications over clusters of back-end servers that are called by front-end Web servers. The goal is to provide unlimited scalability to PHP transactional applications running on busy sites with too many simultaneous users to be handled by a single front-end Web server. Some concepts: - Master process: probably in PHP (with web interface), it will be responsible to distribute the PHP code to the worker (the "deploy"). - Worker process: in the first stage in PHP (with fork), but then a multi threaded version coded in C++ with PHPEmbed or in C with its own SAPI. This process listen a TCP port over TCP, and receive a function execution request, and execute it and returns its return. - The client: a PHP script that will exec an RPC, That is my idea so far, please I'd like to read feedbacks. -- Cesar D. Rodas http://cesar.la/ Phone: +595-961-974165 Samuel Beckett - "Birth was the death of him." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Threads PHP
Hello, Is there a way to have threads in PHP? -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
RE: [PHP] Which file called the function?
__FILE__ == "global.php" On 20/12/2007, Christoph Boget <[EMAIL PROTECTED]> wrote: > > Let's say I have the following 3 files > > global.php >function myFunc() { echo __FILE__; } > ?> > > one.php >include( 'global.php' ); > echo 'You are in file: '; > myFunc(); > ?> > > two.php >include( 'global.php' ); > echo 'You are in file: '; > myFunc(); > ?> > > In each case, what is echoed out for __FILE__ is global.php. Apart from > analyzing the debug_backtrace array, is there any way that myFunc() would > display "one.php" and "two.php" respectively? > > thnx, > Christoph > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] nested array...
$nestedarray[$i['id'] == 5 and $i is your array index On 17/12/2007, opo jal <[EMAIL PROTECTED]> wrote: > > hi, i have a nested array > ex: > print_r($nestedarray): > Array( > [0]=>Array([id]=>1 [name]=>name1 [etc]=>etc1) > [1]=>Array([id]=>2 [name]=>name2 [etc]=>etc2) > [3]=>Array([id]=>3 [name]=>name3 [etc]=>etc3) > ) > > if I want to check whether id=5 is in that $nestedarray, how to do > that?!?! > > i'd really appreciate the help.. > > thanks in advance.. > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] Session timeout
You can simulate that, because not always you'll be able to do "init_set" You can save in a session var the TTL (time to live) $_SESSION['TTL'] = time() + TIMEOUT; Then before do anything you see if the session is still valid if ( $_SESSION['TTL'] < time() ) close_session(); I hope this be helpful for you! On 13/12/2007, Richard Heyes <[EMAIL PROTECTED]> wrote: > > > I've read a bit about PHP session timeout. Is it configurable?? I mean, > > If i want user logged out after 10 minutes of innactivity... where i can > > to set it up?? Is it possible to expire session configuring php.ini. > > I know i will have to write code to do whatever when the session > expires... > > There are various configuration options for this (which you change in > the php.ini or by using the ini_set() function): > > session.gc_maxlifetime > session.cookie_lifetime > > Read all about sessions here: > > http://uk.php.net/manual/en/ref.session.php > > -- > Richard Heyes > http://www.websupportsolutions.co.uk > > Knowledge Base and HelpDesk software > that can cut the cost of online support > > ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
[PHP] A SESSION Problem
Estrange problem. On 11/12/2007, tedd <[EMAIL PROTECTED]> wrote: > > Hi gang: > > I just had this happen and wonder what the fix is for it. > > I am sending session data from a script in a http to another script > in https. However, sometimes the data gets through and sometimes it > don't. > > Any ideas or fixes? > > Both scripts are listed below > > > [1] > > $x = 'zzz'; > $_SESSION['x'] = $x; > ?> > > https://example.com/a-session2.php"; method="post"> > > > > > [2] > > print_r($_SESSION); > ?> > > http://example.com/a-session1.php"; method="post"> > > + Are those pages in same hostname? + Have you test with other browsers? + The index of you $_SESSION (in this example "x") is the same, the index couldn't be a number or start with a number. This i learn by experience.. :-) i don't know where this point is documented. + $_SESSION[1] = wrong + $_SESSION["1a"] = wrong -- > --- > 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 > > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] Incorporating a PHP/MySQL based search
Hello, This is quite simple, you need to have mysql table with "fulltext" index. The "hard work" is done by mysql, you need to learn a few of things about fulltext with mysql, for that you can google it. PHP is only used to send the query to mysql (in most of case but not always). Try to do something, and when you need help, only ask here... good luck :) On 08/12/2007, Steve Finkelstein <[EMAIL PROTECTED]> wrote: > Hey folks, > > One area I lack experience in is writting a solution to index/search on a > site. Would anyone be kind enough and point me in the right direction as far > as any books which discuss some simple solutions or articles/blogs on the > web? Clearly I'm not looking for anything as complex as Google's engine, ;-) > but would love just to be able to understand/incorporate a decent level of > search capabilities. > > Cheers all, > > - sf > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nested objects
No problem, Just ask your doubts, we're here to help and get help :-) On 07/12/2007, Victor Matherly <[EMAIL PROTECTED]> wrote: > > Thanks that fixed it. That was so simple no wonder I was banging my head > on the wall :-). > > > > > ----- Original Message - > From: "Cesar D. Rodas" <[EMAIL PROTECTED]> > To: "Victor Matherly" <[EMAIL PROTECTED]> > Sent: Friday, December 7, 2007 2:37:23 PM (GMT-0500) America/New_York > Subject: Re: [PHP] nested objects > > Hello > > I hope this help you! > > > On 07/12/2007, Victor Matherly < [EMAIL PROTECTED] > > wrote: > > > > Hello list, > > I want to create a new object and nest the objects variable in an array of > another object. I think I am going about it the correct way but the variable > is not being stored or retrieved correctly from the main function. I can't > figure out what I am doing wrong. Can anyone help? Here is an example of > what I am trying to do: > > > > > > $html = " \n"; > > $row = new htmlTableRow(); > > $cell1 = new htmlTableCell(); > $cell1->setContent("test1"); > $cell1->setName("Left test"); > $row->AddCell($cell1); > > $cell2 = new htmlTableCell(); > $cell2->setContent("test2"); > $cell2->setName("right test"); > $row->AddCell($cell2); > > > > $html .= $row->buildRow(); > > > $html .= "\n"; > > print << > > > $html > > > > > > > HERE; > > > > class htmlTableRow { > > var $class; > var $cell_arr; > var $the_row; > > function htmlTableRow(){ > $this->cell_arr = array(); > > }//end construct > > function AddCell($cell) { > $this->cell_arr = $cell; > > $this->cell_arr[] = $cell; > > > > } > > function buildRow(){ > $temp = "\n"; > > foreach($this->cell_arr as $rowdata){ > > $temp .= "\t" . $rowdata->cell_content . "\n"; > > }//end foreach > $temp .= "\n"; > return $temp; > }//end build row funtion > > }// end htmlTableRow class > > > > class htmlTableCell { > var $cell_width; > var $cell_height; > var $cell_colspan; > var $cell_rowspan; > var $css_class; > var $cell_content; > var $cell_name; > > > function __construct($content = " "){ > > $this->cell_content = $content; > > > }// end construct > > function setContent($content){ > $this->cell_content = $content; > > }//end setContent function > > function setName($name){ > $this->cell_name = $name; > > }//end setContent function > > > function getContent(){ > return $this->cell_content; > > }//end setContent function > > } //end TableCell class > > > > > > > ?> > > Best regards > > > > Victor J. Matherly > Technical Services > Wave Communications, Inc > http://www.wave-communications.com > > -- > PHP General Mailing List ( http://www.php.net/ ) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > > > Cesar D. Rodas > http://www.cesarodas.com > http://www.thyphp.com > http://www.phpajax.org > Phone: +595-961-974165 > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
[PHP] nested objects
Hello I hope this help you! On 07/12/2007, Victor Matherly <[EMAIL PROTECTED] > wrote: > > > > Hello list, > > I want to create a new object and nest the objects variable in an array of > another object. I think I am going about it the correct way but the > variable is not being stored or retrieved correctly from the main function. > I can't figure out what I am doing wrong. Can anyone help? Here is an > example of what I am trying to do: > > > > > > $html = " \n"; > >$row = new htmlTableRow(); > >$cell1 = new htmlTableCell(); >$cell1->setContent("test1"); >$cell1->setName("Left test"); >$row->AddCell($cell1); > >$cell2 = new htmlTableCell(); >$cell2->setContent("test2"); >$cell2->setName("right test"); >$row->AddCell($cell2); > > > > $html .= $row->buildRow(); > > > $html .= "\n"; > > print << > > > $html > > > > > > > HERE; > > > > class htmlTableRow { > > var $class; > var $cell_arr; > var $the_row; > > function htmlTableRow(){ > $this->cell_arr = array(); > > }//end construct > > function AddCell($cell) { > $this->cell_arr = $cell; $this->cell_arr[] = $cell; } > > function buildRow(){ > $temp = "\n"; > > foreach($this->cell_arr as $rowdata){ > > $temp .= "\t" . $rowdata->cell_content . "\n"; > > }//end foreach > $temp .= "\n"; > return $temp; > }//end build row funtion > > }// end htmlTableRow class > > > > class htmlTableCell { > var $cell_width; > var $cell_height; > var $cell_colspan; > var $cell_rowspan; > var $css_class; > var $cell_content; > var $cell_name; > > > function __construct($content = " "){ > > $this->cell_content = $content; > > > }// end construct > > function setContent($content){ > $this->cell_content = $content; > > }//end setContent function > > function setName($name){ > $this->cell_name = $name; > > }//end setContent function > > > function getContent(){ > return $this->cell_content; > > }//end setContent function > > } //end TableCell class > > > > > > > ?> Best regards Victor J. Matherly > Technical Services > Wave Communications, Inc > http://www.wave-communications.com > > -- > PHP General Mailing List ( http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] howto get .tar.gz content's filenames
On 05/12/2007, Per Jessen <[EMAIL PROTECTED]> wrote: > > Cesar D. Rodas wrote: > > > Call exec is not good, because you are executing other program, > > instead of that you should use some PHP program, take a look here > > > > http://www.phpclasses.org/search.html?words=tar&x=0&y=0&go_search=1 > > > > "The access to the internal site search engine is restricted to premium > users." Sorry for that :-) here is one links of a php class for create/read compressed files + http://www.phpclasses.org/browse/package/945.html /Per Jessen, Zürich > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] // ?>
On 04/12/2007, Kevin Schmeichel <[EMAIL PROTECTED]> wrote: > > Here's some unexpected behavior: > > // ?> what? > ?> > > This will output "what?" - I expected no output, as is the case if the > inline comment was a /* */ comment. Is this a bug? That is because the PHP parser stops the comment on the end of a php tag ("?>") or new line, that is not a bug. Kevin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] howto get .tar.gz content's filenames
Call exec is not good, because you are executing other program, instead of that you should use some PHP program, take a look here http://www.phpclasses.org/search.html?words=tar&x=0&y=0&go_search=1 On 04/12/2007, Daniel Brown < [EMAIL PROTECTED]> wrote: > > On Dec 3, 2007 10:05 PM, Shelley Shyan < [EMAIL PROTECTED]> > wrote: > > Hi all, > > > > It may not be a php question, but I want to get the filename lists that > a .tar.gz file contains and give it to an array. > > How can I manage that? > > > > Thank you very much for your consideration. > > > > Regards, > > Shelley > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > If you're on Linux/BSD/Unix/MacOS or Cygwin on Windows, this should > work: > > $tar_gz_file = " filename.tar.gz"; // Replace this with the actual > filename. > exec('tar -ztf '.$tar_gz_file,$ret); > print_r($ret); > ?> > > > -- > Daniel P. Brown > [office] (570-) 587-7080 Ext. 272 > [mobile] (570-) 766-8107 > > If at first you don't succeed, stick to what you know best so that you > can make enough money to pay someone else to do it for you. > > -- > PHP General Mailing List (http://www.php.net/ ) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Best Regards Cesar D. Rodas www.cesarodas.com www.thyphp.com www.phpajax.org Phone: +595-961-974165 -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
Re: [PHP] References to a variable and scope
On 04/12/2007, Cesar D. Rodas <[EMAIL PROTECTED]> wrote: > > Robert, > > On 04/12/2007, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > On Tue, 2007-12-04 at 16:58 -0400, Cesar D. Rodas wrote: > > > Hello, > > > > > > I know that PHP doesn't support pointers to a variable, instead of > > that > > > there is references to a variable which are similar to pointers, > > right? > > > > > > BTW, what I want to do is to save a references to a variable and read > > the > > > content when I need, similar to PDO "bindParam". I will try to explain > > > better in the following pseudo php code. > > > > > > function foo($a) { > > >$GLOBALS['references']['a'] = /*references to $a */ > > > } > > > > > > function bar() { > > > echo $GLOBALS['references']['a']; > > > } > > > > > > $var="hello" > > > foo($var); > > > $var = "hi"; > > > bar(); /* it should print "hi" instead of "hello" */ > > > > Your code is broken: > > > I knew that, that was a pseudo code. I've try something similar but > doesn't work. > > > > > function foo( &$a ) > > { > > $GLOBALS['references']['a'] = &$a; /*references to $a */ > > } > > > > function bar() > > { > > echo $GLOBALS['references']['a']; > > } > > > > $var="hello" > > foo($var); > > $var = "hi"; > > bar(); /* it should print "hi" instead of "hello" */ > > > > ?> > > > > Cheers, > > Rob. > > -- > > ... > > SwarmBuy.com - http://www.swarmbuy.com > > > > Leveraging the buying power of the masses! > > ... > > > > > What you code is working, I am so happy for that... the references of a > reference works, > thank you! :-) > > -- > Best Regards > > Cesar D. Rodas > http://www.cesarodas.com > http://www.thyphp.com > http://www.phpajax.org > Phone: +595-961-974165 -- Best Regards Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165
[PHP] References to a variable and scope
Hello, I know that PHP doesn't support pointers to a variable, instead of that there is references to a variable which are similar to pointers, right? BTW, what I want to do is to save a references to a variable and read the content when I need, similar to PDO "bindParam". I will try to explain better in the following pseudo php code. function foo($a) { $GLOBALS['references']['a'] = /*references to $a */ } function bar() { echo $GLOBALS['references']['a']; } $var="hello" foo($var); $var = "hi"; bar(); /* it should print "hi" instead of "hello" */ -- Best Regards Cesar D. Rodas www.cesarodas.com www.thyphp.com www.phpajax.org Phone: +595-961-974165