[PHP] Double method access (Hi everyone! :))

2011-03-04 Thread Paola Alvarez
Hi there!,
I have been reading this list before but this is my first post.
Reading some code from Symfony I got this: $this-getTable()-getColumns()
...when you can use this double method access?, I used before the
regular $this-getTable(), but two?. I mean I have been trying but I got an
error*

* Fatal error: Call to a member function ... on a non-object in ...

Thanks!

Paola

PS: BTW, sorry my english isnt really good


Re: [PHP] Double method access (Hi everyone! :))

2011-03-04 Thread Paola Alvarez
Hi, thanks a lot Alex and Larry for your very clear answer!

Paola,

On Fri, Mar 4, 2011 at 4:33 PM, la...@garfieldtech.com 
la...@garfieldtech.com wrote:

 That's called method chaining.  -getColumns() will get called on the
 object returned by -getTable().  That is, getTable() returns an object
 (presumably representing an SQL table, I guess), and that object has a
 getColumns() method, which you call.

 This is an extremely common style in Javascript code that has been gaining
 widespread use in PHP OO circles in recent years.  If leveraged properly it
 can create very compact, very readable, very powerful code.  (And if done
 stupidly can lead to a horrid mess, but that's true of any coding style.)

 --Larry Garfield


 On 3/4/11 1:25 PM, Paola Alvarez wrote:

 Hi there!,
 I have been reading this list before but this is my first post.
 Reading some code from Symfony I got this: $this-getTable()-getColumns()
 ...when you can use this double method access?, I used before the
 regular $this-getTable(), but two?. I mean I have been trying but I got
 an
 error*

 * Fatal error: Call to a member function ... on a non-object in ...

 Thanks!

 Paola

 PS: BTW, sorry my english isnt really good


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Text Editor for Windows?

2007-02-08 Thread Juan Felipe Alvarez Saldarriaga

Stephen wrote:

I am finding that notepad is lacking when correcting syntax errors in my php 
code. No line numbers.

What can people recommend for use under Windows?

Thanks
Stephen

  

Hey, well, actually I use gVim on windows + WinSCP :)

http://wiki.freaks-unidos.net/gvim_on_steroids_(windoze)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Calculate string width using some font.

2007-02-05 Thread Juan Felipe Alvarez Saldarriaga

Hey list! :)

I've got a problem trying to calculate a string width using an X font 
with some Y font size to use in an svg-to-pdf conversion.


This is what I try to do:
1. Create a dummy image.
2. Set the text there using font X and the font size Y (it seems that 
when I create the image it renders it at 72dpi so I need to reduce it at 
300dpi)


I'm  not sure what the imagettftext() function returns, are those values 
measured in pixels ? I read in some page that the proportion to reduce 
the image at 300dpi  is reduce the size to 24% of its original size.


http://www.printingforless.com/resolution.html

That's the code:

***

// Create dummy image.
$rsc_image = imagecreate( 1, 1 );

// Set image.
$arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, 
./fonts/{$str_font_file}, $str_variable_value );

// Destroy dummy image.
imagedestroy( $rsc_image );

// Set structure of widths.
// TODO: Magik numbers.
$arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 );

***

Thx for any help.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calculate string width using some font.

2007-02-05 Thread Juan Felipe Alvarez Saldarriaga

Jochem Maas wrote:

Juan Felipe Alvarez Saldarriaga wrote:
  

Hey list! :)



my name's not list but what the heck:

take a look at these function, they should light the way:

http://php.net/manual/en/function.imageftbbox.php
http://php.net/manual/en/function.imagepsbbox.php
http://php.net/manual/en/function.imagettfbbox.php
http://php.net/imageloadfont

everything is pixels.

there is no dpi - your screen  printer has a certain dpi and that determine
how big the image displays on either.

okay not much help - I had brain freeze half thru.

  


K, np, Ill try use imagettfbbox() function instead.

Thx.

I've got a problem trying to calculate a string width using an X font
with some Y font size to use in an svg-to-pdf conversion.

This is what I try to do:
1. Create a dummy image.
2. Set the text there using font X and the font size Y (it seems that
when I create the image it renders it at 72dpi so I need to reduce it at
300dpi)

I'm  not sure what the imagettftext() function returns, are those values
measured in pixels ?



yes.

  

I read in some page that the proportion to reduce
the image at 300dpi  is reduce the size to 24% of its original size.

http://www.printingforless.com/resolution.html

That's the code:

***

// Create dummy image.
$rsc_image = imagecreate( 1, 1 );

// Set image.
$arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1,
./fonts/{$str_font_file}, $str_variable_value );
// Destroy dummy image.
imagedestroy( $rsc_image );

// Set structure of widths.
// TODO: Magik numbers.
$arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 );

***

Thx for any help.





  


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Calculate string width using some font.

2007-02-05 Thread Juan Felipe Alvarez Saldarriaga

setcookie wrote:

pdf_stringwidth() may help you

regards fra*


  


Yea I saw that too but you know, pdflib is not free.


Hey list! :)



my name's not list but what the heck:

take a look at these function, they should light the way:

http://php.net/manual/en/function.imageftbbox.php
http://php.net/manual/en/function.imagepsbbox.php
http://php.net/manual/en/function.imagettfbbox.php
http://php.net/imageloadfont

everything is pixels.

there is no dpi - your screen  printer has a certain dpi and that
  

determine
  

how big the image displays on either.

okay not much help - I had brain freeze half thru.


  

K, np, Ill try use imagettfbbox() function instead.

Thx.


I've got a problem trying to calculate a string width using an X font
with some Y font size to use in an svg-to-pdf conversion.

This is what I try to do:
1. Create a dummy image.
2. Set the text there using font X and the font size Y (it seems that
when I create the image it renders it at 72dpi so I need to reduce it


at
  

300dpi)

I'm  not sure what the imagettftext() function returns, are those


values
  

measured in pixels ?



yes.


  

I read in some page that the proportion to reduce
the image at 300dpi  is reduce the size to 24% of its original size.

http://www.printingforless.com/resolution.html

That's the code:

***

// Create dummy image.
$rsc_image = imagecreate( 1, 1 );

// Set image.
$arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1,
./fonts/{$str_font_file}, $str_variable_value );
// Destroy dummy image.
imagedestroy( $rsc_image );

// Set structure of widths.
// TODO: Magik numbers.
$arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) /


100 );
  

***

Thx for any help.





  


  


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem returning private member array variables

2005-10-20 Thread Fernando Alvarez
Hi to all,

I was wondering if someone out there has had the same
problem as I have; fetching from an object a private array variable
through a get method. And instead of getting a copy of
the array, you get access to the original array, being able to access
the object's internal data!

I have tried my test script on a Linux 2.6.5 running PHP 5.0.4 and
on a FreeBSD 5.4 running PHP 5.0.5. Bellow is the test script:

?php
class Atom {
}


?


[PHP] Problem returning private member array variables

2005-10-20 Thread Fernando Alvarez
Hi to all,

I was wondering if someone out there has had the same
problem as I have; fetching from an object a private array variable
through a get method. And instead of getting a copy of
the array, you get access to the original array, being able to access
the object's internal data!

I have tried my test script on a Linux 2.6.5 running PHP 5.0.4 and
on a FreeBSD 5.4 running PHP 5.0.5 obtaining the same results
on both systems. Bellow is the test script:

==
#!/usr/local/bin/php
?php
class Atom {
private $x=0;

public function __construct($x) {
$this-x = $x;
}
public function setX($x) {
$this-x = $x;
}
public function getX() {
return $this-x;
}
}

class Element {
private $atoms = array();

public function __construct($NMAX) {
for ($i = 0; $i  $NMAX; ++$i)
$this-atoms[] = new Atom($i);
}
public function setAtoms($atoms) {
$this-atoms = $atoms;
}
public function getAtoms() {
return $this-atoms;
}
}

echo Starting testing on returning private member array variables\n;
echo System details: PHP .PHP_VERSION. on .PHP_OS.\n;

$element = new Element(3);

$v = $element-getAtoms();
print_r($v);

$v[0]-setX(79);
print_r($v);

$w = $element-getAtoms();
print_r($w);

echo Testing finished\n;
?
==

The results are :
==
Starting testing on returning private member array variables
System details: PHP 5.0.4 on Linux
Array
(
[0] = Atom Object
(
[x:private] = 0
)

[1] = Atom Object
(
[x:private] = 1
)

[2] = Atom Object
(
[x:private] = 2
)

)
Array
(
[0] = Atom Object
(
[x:private] = 79
)

[1] = Atom Object
(
[x:private] = 1
)

[2] = Atom Object
(
[x:private] = 2
)

)
Array
(
[0] = Atom Object
(
[x:private] = 79
)

[1] = Atom Object
(
[x:private] = 1
)

[2] = Atom Object
(
[x:private] = 2
)

)
Testing finished
==

Is this expected behavior, or shouldn't the third Array print-out
have also a zero in its first objects's x variable? Thanks to everyone for
their time.

--Best regards
FNanDO


[PHP] wsdl cache?

2005-08-15 Thread Victor Alvarez
Hello,
 I am experiencing a lot of difficulties working with Apache 5.0.4 and wsdl. I 
can publish a wsdl and work with it, but as soon as I want to add a new method 
to the wsdl, I have to change the directory to be able to use it. In some way, 
Apache kept the information for the wsdl and I am not able to update it! Could 
anybody explain me why and how could I avoid this problem?

Thanks.
Kind Regards,
 Victor.

[PHP] how to install phpize and php-config?

2005-07-25 Thread Victor Alvarez
Hi,
 I'm afraid I'm not sure about how to install phpize and php-config. 
 I used to install php using rpms, but this time I downloaded php5 from php.net 
and configure it with the following options:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-soap 


The installation runs fine but phpize and php-config are required to install 
eaccelerator and now I don't know if I should add the pear module to the above 
line or It should be done another way.
 

locate phpize returns:
/usr/src/php-5.0.4/scripts/phpize.m4
/usr/src/php-5.0.4/scripts/phpize.in
/usr/src/php-5.0.4/scripts/phpize


locate php-config returns:
/usr/src/php-5.0.4/scripts/php-config.in
/usr/src/php-5.0.4/scripts/php-config


but I don't have the executables in  /usr/local/bin, as usual. What should I do?

What about php from the command line? What can I do to install the usual 
/usr/local/bin/php?



Thanks in advance,

  Victor.


[PHP] php5 built-in soap - apache performance wsdl generation

2005-07-14 Thread Victor Alvarez
Hello,
 
 I'm successfully playing with php 5 and Its built-in soap but I still have a 
couple of questions.

 The most important one is regarding the performance. It is something I also 
found using php 4 and nusoap. Most of the time for a call is being spend on 
loading the code. Aprox 0.25 sec per code line. This could be a problem if 
you have a lot of code for your server. Why Apache is loading all the code for 
each call? Is It possible to configure Apache to load the Soap Server just once?

 Second one is regarding wsdl generation. I unsuccessfully tried to find a tool 
to do it. I gave a try to Webservice Helper (jool.nl) and I didn't find the 
result convenient for my purpose. Is there any simple and useful tool to 
automatic generate the wsdl? I finally did it manually from scratch.

Thank you very much in advance.
Kind regards,
 Victor.


Re: [PHP] how to execute a remote command from php [done]

2004-09-28 Thread Victor Alvarez

- Original Message - 
From: Sethi, Samir (IDS DMDS) [EMAIL PROTECTED]
To: Victor Alvarez [EMAIL PROTECTED]
Sent: Monday, September 27, 2004 5:47 PM
Subject: RE: [PHP] how to execute a remote command from php



Exactly, I had to generate keys for nobody and now I am able to execute
remote commands.

Thank you so much.
 Victor.




I think when you execute the command it is run as user nobody. You may
need to generate keys for the
nobody account and update the authorized keys on the remote system.

Samir.


-Original Message-
From: Victor Alvarez [mailto:[EMAIL PROTECTED]
Sent: Monday, September 27, 2004 12:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to execute a remote command from php


Hello,
 Since last week I am trying  to execute a remote machine command from
php without success. Since ssh ask for a password, I managed to use ssh
with dsa authentication so it's possible to call the remote command
without password and only with one line: ssh -l victor 192.168.129.211
-i /root/.ssh/id_dsa whoami. It works perfectly from command line but
I have nothing if I try to do the same from php: exec(ssh -l victor
192.168.129.211 -i /root/.ssh/id_dsa \whoami\,$results); $results is
empty after the execution.

I wonder if somebody could answer this question. I have found no
solution googling it.

Thank you.
Regards,
 Victor.


If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain
or redistribute it. Click here for important additional terms relating to
this e-mail. http://www.ml.com/email_terms/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] ayuda mysql

2003-02-21 Thread Rot Alvarez
estoy tratando de programar un messenger en php y
sale este mensaje y no se como arreglarlo...no lo entiendo

Warning: MySQL Connection Failed: Unknown MySQL Server Host 'misitio.cl/' (2) in 
/../messengerphp/cabesera.php on line 87

Warning: Supplied argument is not a valid MySQL-Link resource in 
/../messengerphp/cabesera.php on line 88


_
Registra gratis tu cuenta email en http://www.exploraiquique.cl

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
POP  more! http://www.everyone.net/selectmail?campaign=tag

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] AYUDA..Actualizar txt

2003-02-06 Thread Rot Alvarez
Necesito saber como limpiar o actualizar txt . Resulta q he creado un chat en flash y 
php, pero almacena los user y los comentarios en txt, lo malo es que tengo q 
limpiarlos desde el server.q hago.

_
Registra gratis tu cuenta email en http://www.exploraiquique.cl

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
POP  more! http://www.everyone.net/selectmail?campaign=tag

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] ayuda help

2003-01-28 Thread Rot Alvarez

Tengo este herros y no se de q esWarning: MySQL Connection Failed: Access denied for 
user: 'fullweb@localhost' (Using password: YES) in 
/home/sites/site22/web/45/connect_database.php on line 8
Error in connecting to MySQL.



_
Registra gratis tu cuenta email en http://www.exploraiquique.cl

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
POP  more! http://www.everyone.net/selectmail?campaign=tag

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] ayuda...solo se ve el cdigo cuando ejecuto los script

2003-01-20 Thread Rot Alvarez

Subo los script y solo veo código...q puedo hacer ayuda 

_
Registra gratis tu cuenta email en http://www.exploraiquique.cl

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
POP  more! http://www.everyone.net/selectmail?campaign=tag

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] problemas con php y pws..solo veo cdigo

2003-01-20 Thread Rot Alvarez
Gracias a los q me han respondido.
 Si cacho los ?...pero tambien el server me arroja esto con los forms
y sigo biendo código en mi pc y el server
The requested method POST is not allowed for the URL /chat/index.php.

_
Registra gratis tu cuenta email en http://www.exploraiquique.cl

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
POP  more! http://www.everyone.net/selectmail?campaign=tag

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] sophisticated debugging idea. suggestions?

2001-10-03 Thread alvarez


I want to alternate between different operation modes without having
to introduce additional control structures into a piece of software.

This could be archieved by setting an optional parameter to a function
that does not affect the programs state. It should accept an arbitrary
number of mixed-type arguments while not causing significant overhead
at runtime. Then you would call the parameter each time the code runs.

Assuming debugging is what you want to be done, the use would be like

   function f ($arg, $mode = 'array') {

 function debug () { echo $arg };
 $mode ($arg);

 compute ();
   }
.

array () suffices but introduces to overhead when large chunks of data
(e.g. pieces of code) are passed to it. Any suggestions on this?


  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parsing a CSV file

2001-10-03 Thread alvarez

sure.  explode (',', $yourdata) is what you are looking for.
use file () to read in the file and use foreach () to iterate
over the lines.

 D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File extension inc?

2001-10-03 Thread alvarez

Use the '.inc' extension only for files that are not directly accessible to the client.
For example, database configuration files do not need to be php and you can mark them
as '.inc' for increased code legibility. AFAIK a client's request to one of these files
won't be served at all.

D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parsing a CSV file

2001-10-03 Thread alvarez

 Re: [PHP] Parsing a CSV file
 
there is no need to special-case here, for empty statements would also be handled by
repeated calls to explode (). quoted expressions can be joined by preg_matches then.
 
D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] urgent. need posix-style regexp expert

2001-09-04 Thread alvarez


what is the correct POSIX-regexp to match a range of characters
between two parantheses, while ensuring that it is the largest
match possible? need fast reply. thanks.

Running against

   (foo (bar (baaz) quux( fred woody) wang))

it should return

   foo (bar (baaz) quux( fred woody) wang)



 D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] potential preg_replace bug; unsure however

2001-09-01 Thread alvarez


I built a Perl-style regex to match function calls in C-like
languages where $name is the functions name. The functions
are assumed to accept a single string as parameter.

Here it is.

   /$name\s*\(\s*\(.*)\\s*\)\s*;/s

The expression is successfully preg_match'ed on a stream
of code, but when preg_replace is passed the same expression
it does not return. The piece of code I tested this with was
fairly small so that an increased demand of computation time
is unlikely be the reason for this behaviour.

Substituting the subexpression (.*) by ([^\]*) remedies this.

The version of the PHP install is 4.05.


Any ideas?


  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: bugroff licensed tree converter

2001-08-29 Thread alvarez

 Correction to the code submitted

s/example/xml_open (script, *language* *JavaScript*);

I had snipped it from prior debugging code - sorry for that.

  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] script preprocessor?

2001-08-29 Thread alvarez


 Is there a macro preprocessor that can be used to substitute arbitrary
 sections of code with different code? define is documented as working
 for rvals only and my attempts to produce something more meaty lead to
 parse errors.

   Any advice?


  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] strange linefeed effect

2001-08-29 Thread alvarez


 How can I prevent PHP from outputting additional linefeeds when
 data are echoed from different files (eg. using require).

 This phenomenon is fucking up my document structures.

   Any advice?


  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: Re: [PHP] Sorry, i need HTML help

2001-08-29 Thread alvarez


 Sorry to post here but i need to know this info fast!

 How do i make a scrolling marquee in HTML without using javascript
 
You use the MARQUEEInsert scrolling text here/MARQUEE tags.   

   Unsupported by several Navigator Releases.


  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] real optional parameters

2001-08-29 Thread alvarez


  How can I declare optional parameters as used by strpos, substr, etc.
  to specify the offset? I do not want to have to preceed some functions
  with the @-operator, and preceeding all for consistency wouldn't be an
  option, I think. Is it possible at with user-defined functions?

 quick help is appreciated. thanks.

  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: Re: [PHP] script preprocessor?

2001-08-29 Thread alvarez


I do not need a cmd-line utility but something I can use _in_ a PHP4
script without the need to apply changes to the interpreter or weird
system interfaces. Something similiar to the #define preprocessing
instructions of cc (or hopefully more flexible) would suit my needs.

If your programm can substitute script parts during a page request
it'd be nice if you could pass me a source copy.

Personally I've no idea how such a facility could be implemented if
not being part of the PHP core.

  D. Alvarez Arribas [EMAIL PROTECTED]

I've written one for my personal needs. Supports replacement of constants
({{$ foobar }}) with arbitrary text, conditionals
({{%if foobar == 42 }} ... {{%else }} ... {{%endif }}), comment
removal, removal of unneccessary whitespace, removal of assertions and
replacement of an error handler function (sgError ($Msg) = MyError
(__FILE__, __LINE__, $Msg)) 


  How can I declare optional parameters as used by strpos, substr, etc.
  to specify the offset? I do not want to have to preceed some functions
  with the @-operator, and preceeding all for consistency wouldn't be an
  option, I think. Is it possible at with user-defined functions?

 quick help is appreciated. thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] cancellation cleanup handlers in PHP4?

2001-08-28 Thread alvarez


Is it possible to register functions to be executed at program termination
as in unix's onexit() and pthread_cleanup_push facilities ?

  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] haX0Ring exercise :)

2001-08-28 Thread alvarez


I want a function or macro to return executable code yielding syntax
preprocessing of binary trees. Because the Macro Processor seems to be
somewhat messy I though a regular function might be capable of doing the job.

  e.g.

   btree ('((a, b)(c, d))')

   should be expanded to

   array (array (a, b)
  array (c, d)


  How can I archieve this? 

  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Re: cancellation cleanup handler

2001-08-28 Thread alvarez


Hello,
From the manual:
http://www.php.net/manual/en/function.register-shutdown-function.php
 
py 

   Thanks (but)...

  I was referring to functions that are executed in a fully functional
  PHP environment including output using echo. The crippled shutdown
  thing does not serve for my purposes. set_error_handler () is
  functionally appropriate, but I do not know of an error event being
  raised on regular program termination.


  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] javascript code beautification

2001-08-28 Thread alvarez


Does someone know of a PHP-function to reformat Sources of C-like langs?
I need to generate syntactically uniform Javascripts independent of the
specific user input.

  Thanks,

  D. Alvarez Arribas [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] someone please explain weird getforeignkeys

2001-08-22 Thread alvarez



I need to look up a table's foreign keys using the unified ODBC-functions.
'odbc_foreignkeys()' requires me to pass seven parameters, each of them being
mandatory, to archive this.

Because the approach is not intuitive anyhow and there is no documentation
available except of the PHP-manual's prototype, neither me nor my co-workers
have any idea of how to apply the function.

The manual states that three of the arguments are superfluous, depending on
the application; but the prototype contradicts this, declaring them mandatory.

Can anyone please point me to a working code example or provide one?

   Thanks,  D. Alvarez Arribas [EMAIL PROTECTED]


Btw, how are the inter-table relationships defined at all? I cannot think of
a way to determine foreign keys without complete knowledge of all joins and
subqueries potentially run against the database.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Export to Excel

2001-07-13 Thread Jorge Alvarez

One of my clients is requesting me to export some data from PHP-generated
pages to MS Excel files. I have no clue on how to do such export with PHP.
I'm using PHP/Apache/Linux Mandrake.

What options do I have?

Your help is very appreciated.

Regards,

Jorge Alvarez
--
Let your screen saver contribute to cancer research.
http://members.ud.com/vypc/cancer/
A new way to help. Sponsored by Intel.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php3 and php-4.0.5

2001-07-04 Thread Ramón Alvarez Rayo

I had some sites that uses php3 but i did a upgrade to php-4.0.5, after 
that my web server doesn´t works with files .php3, how can i make to 
recognize .php3

please i need your help.

thanks.


Saludos fraternos,

***
Ramón Alvarez Rayo  Contacto Tecnico - Telematix
Telefono: (505) 2785523 Fax: (505) 2784012



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Controlling just size with regular expressions

2001-04-09 Thread Jorge Alvarez

Hi there,

I need a regular expression that accepts *anything* without restrictions,
only that the size of the string should be between (for instance) 0 and 9
characters. I know the {0,9} trick, but how do I accept *anything* in a form
field?

TIA,

Jorge





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Undefined Variable

2001-03-17 Thread Jorge Alvarez

Hi there,

I get this error every time I try to use a variable that has not been
declared. Is this new to PHP4? I do not recall this error in the past, echo
$MYVAR echoed nothing if $MYVAR was not set but no error was raised.

How can I revert PHP behavior to 'no-error' with undeclared variables?

Many thanks in advance,

Jorge Alvarez
PHP4 new user





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Change POST for GET

2001-03-16 Thread Jorge Alvarez

Hi there,

I was using POST method on all my forms but I had to change them to GET
because of "expired page" errors (I noticed this as soon as I began using
PHP4 sessions).

It seems that GET works well so far, but I wonder if there's something else
I should be aware of. Are both methods equivalent?

TIA,

Jorge Alvarez



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Parse all .htm files?

2001-03-14 Thread Jorge Alvarez

Hi there,

I'm using PHP and Personal Web Server in a Windows 98 PC.
What should I do to make PHP parse all .htm files and not only those with
the .php extension?

Many thanks in advance,

Jorge Alvarez




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Download PHP from Linux machine?

2001-02-23 Thread Jorge Alvarez

Hi there,

I want to download PHP from my Linux server, but I can't just type "lynx
http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gzsource_
site=www.php.net"

This is the link in the PHP downloads page, but the shell gets confused by
the  character.

What should I do?

Best Regards,

Jorge.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]