php-general Digest 21 Sep 2010 12:50:09 -0000 Issue 6952
Topics (messages 308229 through 308241):
Re: Building SoapClient as an extension
308229 by: Phpster
308230 by: Jon Drukman
Re: Auto-generating HTML
308231 by: Simcha Younger
308232 by: Benjamin Hawkes-Lewis
308233 by: Gary
308237 by: Richard Quadling
308240 by: Andy McKenzie
Database Administration
308234 by: Tom Barrett
308235 by: Peter Lind
308236 by: Jangita
308239 by: Jay Blanchard
Re: Invalid chars in XML
308238 by: Alejandro Michelin Salomon
Re: Sending Encrypted Email
308241 by: Erik L. Arneson
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
It's already done
http://wso2.com/products/web-services-framework/php/
Bastien
Sent from my iPod
On Sep 20, 2010, at 19:20, Jon Drukman <[email protected]> wrote:
> Is it possible to build SoapClient as a loadable extension? For various
> reasons, I don't want to have to recompile PHP from scratch. It would be much
> simpler to just distribute another .so and .ini file.
>
> How would I do that, if it's possible?
>
> -jsd-
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Phpster <phpster <at> gmail.com> writes:
>
> It's already done
>
> http://wso2.com/products/web-services-framework/php/
>
I don't know what that has to do with what I asked.
I found the answer on my own:
./configure --enable-soap=shared
Produces a modules/soap.so file that can be loaded in to php at run time.
--- End Message ---
--- Begin Message ---
On Sep 20, 2010, at 2:56 PM, Andy McKenzie wrote:
> Hey folks,
>
> Here's the problem. I'm writing a lot of pages, and I hate going in
> and out of PHP. At the same time, I want my HTML to be legible. When
> you look at it, that's kind of a problem, though... for instance
> (assume this had some PHP in the middle, and there was actually a
> reason not to just put this in HTML in the first place):
Unless you are looking at the HTML alot, you can just paste the source into an
editor which can auto-format the code, or look at the code in firebug (that is
the usual place where I look at my HTML.)
If there is a specific place you want to look at in the html, just change the
lines there to look like this:
echo '<html>
';
but this will make your PHP quite messy if you do it alot.
I would go with templating, as many here suggested.
--
Simcha Younger <[email protected]>
--- End Message ---
--- Begin Message ---
On 20 Sep 2010, at 22:02, Bastien Koert wrote:
> The standard suggests that double quotes are to be used for HTML
> attributes.
Where?
--
Benjamin Hawkes-Lewis
--- End Message ---
--- Begin Message ---
Andy McKenzie wrote:
> I have the feeling this is a stupid question, but I can't even find
> anything about it. Maybe I'm just not searching for the right things.
>
> Here's the problem. I'm writing a lot of pages, and I hate going in
> and out of PHP. At the same time, I want my HTML to be legible.
Without knowing *why* you "hate going in and out of php"...
You could use some kind of text preprocessor before putting the files on
the webserver. There's a nice example for html at
http://www.linuxjournal.com/article/5594 (starting about a third of the
way down the page). Nothing specific about php of course.
Just an alternative you might not have thought of.
--
Gary Please do NOT send me 'courtesy' replies off-list.
PHP 5.2.12 (cli) (built: Jan 14 2010 14:54:11)
1.7.7(0.230/5/3) 2010-08-31 09:58 Cygwin
--- End Message ---
--- Begin Message ---
On 20 September 2010 19:56, Andy McKenzie <[email protected]> wrote:
> Hey folks,
>
> I have the feeling this is a stupid question, but I can't even find
> anything about it. Maybe I'm just not searching for the right things.
>
> Here's the problem. I'm writing a lot of pages, and I hate going in
> and out of PHP. At the same time, I want my HTML to be legible. When
> you look at it, that's kind of a problem, though... for instance
> (assume this had some PHP in the middle, and there was actually a
> reason not to just put this in HTML in the first place):
>
> Simple PHP:
> <?php
>
> echo '<html>';
> echo '<head>';
> echo ' <title>Page Title</title>';
> echo '</head>';
> echo '<body>';
> echo '<p>This is the page body</p>';
> echo '</body>';
> echo '</html>';
>
> ?>
>
>
> Output page source:
> <html><head> <title>Page Title</title></head><body><p>This is the
> page body</p></body></html>
>
>
> Now, I can go through and add a newline to the end of each line (echo
> '<html>' . "\n"; and so on), but it adds a lot of typing. Is there a
> way to make this happen automatically? I thought about just building
> a simple function, but I run into problem with quotes -- either I
> can't use single quotes, or I can't use double quotes. Historically,
> I've dealt with the issue by just having ugly output code, but I'd
> like to stop doing that. How do other people deal with this?
>
> Thanks,
> Alex
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
There is also the tidy extension which will take your badly formatted
html tag soup and create formatted html, xhtml, etc.
But really, why bother?
Whenever I need to view the source I use the browsers viewsource
option or firebug/console/etc. Essentially, client side.
But using templates with heredoc ...
<?php
// Template to display a username row.
// Requires a $a_User array
return <<< END_HTML
<tr>
<th>{$a_User['Name']}</th>
</tr>
END_HTML;
sort of thing is easy enough to build. And in a loop ...
$s_Users = '';
foreach($a_Users as $a_User) {
$s_Users .= include '../templates/users.tmpl';
}
Now, $s_Users contains the rows to display the users and you could do
something to it if you wanted to.
Of course, rolling your own system is fine, but there are other
templating systems available, though, of course, PHP _IS_ the
templating system, so why learn another one.
If you are using a designer to structure the HTML and then adding your
code to build the pages, then a templating system compatible with the
designer's tools would be a good option.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
On Tue, Sep 21, 2010 at 3:32 AM, Simcha Younger
<[email protected]> wrote:
> On Sep 20, 2010, at 2:56 PM, Andy McKenzie wrote:
>
>
>> Hey folks,
>>
>> Here's the problem. I'm writing a lot of pages, and I hate going in
>> and out of PHP. At the same time, I want my HTML to be legible. When
>> you look at it, that's kind of a problem, though... for instance
>> (assume this had some PHP in the middle, and there was actually a
>> reason not to just put this in HTML in the first place):
>
> Unless you are looking at the HTML alot, you can just paste the source into
> an editor which can auto-format the code, or look at the code in firebug
> (that is the usual place where I look at my HTML.)
>
> If there is a specific place you want to look at in the html, just change the
> lines there to look like this:
> echo '<html>
> ';
> but this will make your PHP quite messy if you do it alot.
>
> I would go with templating, as many here suggested.
>
> --
> Simcha Younger <[email protected]>
>
That's actually why this came up -- for the first time I AM looking at
the generated HTML a lot. I'm building a frontend for a set of DBs we
use (for various reasons none of the pre-built ones I could find would
work for us), and I'm spending a fair amount of time trying to figure
out whether I messed up the code, or the output just doesn't display
as I expected. I've never done anything quite this complex, and have
therefore never needed to look at the output html a lot. I've also
just gotten tired of having my output completely unreadable... I'd
like to have this project done right, and to me that means the source
and the output should both be reasonably easy to parse, in addition to
other things (paying a lot more attention to security than I usually
do, for instance...).
-Alex
--- End Message ---
--- Begin Message ---
Hi
I need to build a custom client management app, which will build and manage
a database per client. This means that on top of the usual sql crud, it
needs to be able to create databases, add/edit/delete database users, create
tables.
Is there a way for me to do this nicely as PHP solution? am I better off
incorporating non PHP pieces into this (e.g. shell)? or should I leave the
admin tasks (e.g. database creation) as a 'normal' administrative task
(commandline/webmin/watever)?
--- End Message ---
--- Begin Message ---
On 21 September 2010 11:48, Tom Barrett <[email protected]> wrote:
> Hi
>
> I need to build a custom client management app, which will build and manage
> a database per client. This means that on top of the usual sql crud, it
> needs to be able to create databases, add/edit/delete database users, create
> tables.
>
> Is there a way for me to do this nicely as PHP solution? am I better off
> incorporating non PHP pieces into this (e.g. shell)? or should I leave the
> admin tasks (e.g. database creation) as a 'normal' administrative task
> (commandline/webmin/watever)?
>
Seeing as all the "extra" stuff you need is just plain sql commands, I
don't see the problem as such. You just need to make sure access to
the tool is done right (i.e. a user that can create/destroy databases
needs to be aware of this and you need to restrict the access to those
specific persons).
Regards
Peter
--
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>
--- End Message ---
--- Begin Message ---
Possible. Google phpmyadmin I believe it is completely written in PHP and
does complete database administration (has some weaknesses on stored
procedures though in my view)
Jangita | +254 76 918383 | MSN & Y!: [email protected]
Skype: jangita | GTalk: [email protected]
-----Original Message-----
From: Tom Barrett [mailto:[email protected]]
Sent: 21 September 2010 11:48 AM
To: PHP General List
Subject: [PHP] Database Administration
Hi
I need to build a custom client management app, which will build and manage
a database per client. This means that on top of the usual sql crud, it
needs to be able to create databases, add/edit/delete database users, create
tables.
Is there a way for me to do this nicely as PHP solution? am I better off
incorporating non PHP pieces into this (e.g. shell)? or should I leave the
admin tasks (e.g. database creation) as a 'normal' administrative task
(commandline/webmin/watever)?
--- End Message ---
--- Begin Message ---
[snip]
I need to build a custom client management app, which will build and
manage
a database per client. This means that on top of the usual sql crud, it
needs to be able to create databases, add/edit/delete database users,
create
tables.
Is there a way for me to do this nicely as PHP solution? am I better off
incorporating non PHP pieces into this (e.g. shell)? or should I leave
the
admin tasks (e.g. database creation) as a 'normal' administrative task
(commandline/webmin/watever)?
[/snip]
Have you thought about using phpMyAdmin?
http://www.phpmyadmin.net/home_page/index.php
--- End Message ---
--- Begin Message ---
Hi
I am working with xml, in portuguese, and i have many problems with special
characters.
I find this code to work with this problem...
When create xml ExpandEntities :
function ExpandEntities( $sText )
{
$trans = array('&' => '&',
"'" => ''',
'"' => '"',
'<' => '<',
'>' => '>' );
return strtr( $sText, $trans );
}
When read xml CompEntities
function CompEntities( $sText )
{
$trans = array('&' => '&',
''' => "'",
'"' => '"',
'<' => '<',
'>' => '>' );
return strtr( $sText, $trans );
}
Alejandro M.S.
-----Mensagem original-----
De: robert mena [mailto:[email protected]]
Enviada em: segunda-feira, 20 de setembro de 2010 17:08
Para: [email protected]
Assunto: [PHP] Invalid chars in XML
Hi,
I am trying to parse a XML file with simplexml_load but it gave me error.
While inspecting the contents I found a & inside the value of a tag.
<tag>something & something</tag>.
After I've removed the & everything went fine. So which chars I should not
put in my file? Should I use some conversion function like html_entities?
Does the receiver of the XML has to do anything to convert is back?
--- End Message ---
--- Begin Message ---
On Thu, 16 Sep 2010, Nathan Rixham wrote:
> Floyd Resler wrote:
>> I need to send encrypted email. Can I use our server's signed certificate we
>> use for Apache?
>
> Yes you can use the servers certificate, you can use any x509
> certificate you like - however, I'd recommend checking out
> startssl.org who will give you a free smime certificate.
But that is probably just for *signing* the email. If you'd like to
encrypt email, you will need a public key or shared secret from the
email recipient.
--
Erik Arneson <[email protected]>
GPG Key ID : 1024D/62DA1D25 BitCoin : 1LqvuGUqJ4ZUSoE7YE9ngETjwp4yZ2uSdP
Office : +1.541.291.9776 Skype : callto://pymander
http://www.leisurenouveau.com/
--- End Message ---