php-general Digest 1 Oct 2011 16:07:28 -0000 Issue 7500

Topics (messages 315088 through 315096):

Re: Generate CMS based on database schema
        315088 by: Ashley Sheridan
        315090 by: Marc Guay
        315092 by: Lars Nielsen
        315093 by: Ashley Sheridan
        315094 by: Marc Guay
        315095 by: Lester Caine

Re: RSS Feed Accented Characters
        315089 by: Richard Quadling
        315091 by: Ron Piggott

php.ini setting
        315096 by: Jim Giner

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Fri, 2011-09-30 at 14:35 -0400, Marc Guay wrote:

> Howdy,
> 
> I'm looking for a FOSS equivalent to PHPMaker, or at least something
> which comes close to it.  For those who don't know the program, it
> syncs with your database and allows you to generate an entire CMS
> system based on it.  To be clear, I am not looking for a CRUD code
> generator, I'm looking for something that can generate the whole
> shabang so I can get on with it.
> 
> Perhaps someone could sassily tell me why I don't need this tool or
> propose another method, that would be good too.  I really enjoy
> building sites up from the DB schema but hate creating web interfaces
> for editing them.  I've also taken a stab at Drupal, which is like
> doing it the other way around, using the CMS to create the schema, but
> a lot of the time it seems ass backwards and I'm not in the mood to
> get another hand cramp from clicking through the interface for 6 hours
> setting everything up.
> 
> Marc
> 


It sounds like what you're looking is an ORM system. We're trying out
using a plugin for the CodeIgniter framework at the moment called
Bonfire (http://cibonfire.com/) which aims to build a basic CMS around
the DB model. I've not used it myself, but a colleague is. He's said
that it's basic, and only in alpha at the moment, but to me it does look
potentially promising.

The Cake framework does revolve around its DB schema, and enforces
certain rules for relations between the tables (without having to create
foreign keys, it simulates a kind of 'soft' foreign key through the
code). That said, Cake is pretty huge and slow compared to CodeIgniter.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Hi Ashley,

That's an interesting looking project, but wouldn't it require me to
switch to CodeIgniter?  I'm not interested in changing my entire
working method for this.

Marc

--- End Message ---
--- Begin Message ---
If you like Drupal, you should definitely take a look at Drush. Its a
shell for Drupal which allows you to install, configure and manage
drupal from the commandline. Secondly you could make Drupal
installprofiles which is you own custom drupal configuration. Last you
can look at Aegir which is a webinterface build on top of drush to
provide a gui to manage installations and configurations.

Regards Lars

fre, 30 09 2011 kl. 14:35 -0400, skrev Marc Guay:
> Howdy,
> 
> I'm looking for a FOSS equivalent to PHPMaker, or at least something
> which comes close to it.  For those who don't know the program, it
> syncs with your database and allows you to generate an entire CMS
> system based on it.  To be clear, I am not looking for a CRUD code
> generator, I'm looking for something that can generate the whole
> shabang so I can get on with it.
> 
> Perhaps someone could sassily tell me why I don't need this tool or
> propose another method, that would be good too.  I really enjoy
> building sites up from the DB schema but hate creating web interfaces
> for editing them.  I've also taken a stab at Drupal, which is like
> doing it the other way around, using the CMS to create the schema, but
> a lot of the time it seems ass backwards and I'm not in the mood to
> get another hand cramp from clicking through the interface for 6 hours
> setting everything up.
> 
> Marc
> 




--- End Message ---
--- Begin Message ---
On Fri, 2011-09-30 at 15:03 -0400, Marc Guay wrote:

> Hi Ashley,
> 
> That's an interesting looking project, but wouldn't it require me to
> switch to CodeIgniter?  I'm not interested in changing my entire
> working method for this.
> 
> Marc


CodeIgniter is just a framework written in PHP, and arguably the easiest
to use. There's plenty of documentation online for all sorts of level of
expertise, and as it's PHP, it's easy for a PHP developer to modify as
you see fit.

I assumed that as you'd mentioned trying Drupal that you would be OK
with trying out various PHP-based solutions?

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
> I assumed that as you'd mentioned trying Drupal that you would be OK with 
> trying out various PHP-based solutions?

True enough.  Maybe I'll sharpen the focus then and ask if anyone
knows of a solution that does not require a reworking of method; a
stand-alone CMS generator similar to PHPMaker but FOSS...?

--- End Message ---
--- Begin Message ---
Marc Guay wrote:
I assumed that as you'd mentioned trying Drupal that you would be OK with 
trying out various PHP-based solutions?
True enough.  Maybe I'll sharpen the focus then and ask if anyone
knows of a solution that does not require a reworking of method; a
stand-alone CMS generator similar to PHPMaker but FOSS...?

I presume that you are looking for something that will create complex data pages which can be edited and viewed but purely from the database schema? I have yet to find anything which will provide the flexibility required to handle the sort of business functionality that one can create in a good database engine. So I prefer to stop just a little short of that, but with a framework that allows managing the database structure and creating upgrade scripts to add development work to the live sites. bitweaver gives me all the user management, themeing, and database management and allows me to add the sort of complex data pages I need for the target application.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/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

--- End Message ---
--- Begin Message ---
On 30 September 2011 18:22, Ron Piggott <ron....@actsministries.org> wrote:
>
> -----Original Message----- From: Richard Quadling
> Sent: Friday, September 30, 2011 12:31 PM
> To: Ron Piggott
> Cc: php-gene...@lists.php.net
> Subject: Re: [PHP] RSS Feed Accented Characters
>
> On 30 September 2011 17:26, Ron Piggott <ron....@actsministries.org> wrote:
>>
>> I am trying to set up an RSS Feed in the Spanish language using a PHP cron
>> job.  I am unsure of how to deal with accented letters.
>>
>> An example:
>>
>> This syntax:
>>
>> <?php
>>
>> $rss_content .= "<description>" . htmlentities("El Versículo del Día") .
>> "</description>\r\n";
>>
>> ?>
>>
>> Outputs:
>>
>>
>> <description>El Vers&iacute;culo del D&iacute;a</description>
>>
>>
>> When I use an RSS Feed validator I receive the error message
>>
>> This feed does not validate.
>>
>>  a.. line 24, column 20: XML parsing error: <unknown>:24:20: undefined
>> entity
>>
>> I suspect the “;” is the issue, although it is needed for the accented
>> letters.  If I don’t use htmlentities() the accented characters can’t be
>> viewed, they become a “?”  How should I proceed?
>>
>> Ron
>
> Make sure you have ...
>
> <?xml version="1.0" encode="UTF-8"?>
>
> as the first line of the output. That tells the reader that the file
> is a UTF-8 encoded file. Also, if you ejecting HTTP headers, make sure
> that they say the encoding is UTF-8 and not a codepage.
>
> Go UTF-8 everywhere.
>
>
> --
> Richard Quadling
> Twitter : EE : Zend : PHPDoc
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea
>
>
>
>
> Hi Richard:
>
> Having "     <?xml version="1.0" encoding="UTF-8"?>     " as the starting
> line didn't correct the problem.
>
> The RSS Feed is @
> http://www.elversiculodeldia.info/peticiones-de-rezo-rss.xml
>
> There are a variety of errors related to accented characters while using a
> feed valuator
> http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.elversiculodeldia.info%2Fpeticiones-de-rezo-rss.xml
>
> - Also While viewing the feed in Firefox once the first accented character
> is displayed none of the rest of the feed is visible, except by right
> clicking and "view source"
>
> The RSS Feed content will be populated by a database query.  The database
> columns are set to utf8_unicode_ci
>
> How should I proceed?
> Ron
>

The byte sequence that is being received is just 0xED.

php -r "file_put_contents('a.rss',
file_get_contents('http://www.elversiculodeldia.info/peticiones-de-rezo-rss.xml'));"

This is NOT UTF-8 encoded data, but is ISO-8859-1 Latin-1 (most likely).

So as I see it you have 1 choice.

Either use <?xml version="1.0" encoding="ISO-8859-1"?> as the XML tag
or convert the encoded data to UTF-8.

It also means that the data in the sql server is NOT UTF-8 and will
need to be converted also.

I would recommend doing that first.

That will mean reading the data as ISO-8859-1 and converting it to
UTF-8 and then saving it again.

I'd also be looking at the app that inputs the data into the DB initially.

To convert the text, here are 2 examples. I'm sure there are more ways.

<?php
$iso_text = 'El Versículo del Día: Pray For Others: Incoming Prayer Requests';

$utf_8_text = utf8_encode($iso_text);
var_dump($iso_text, $utf_8_text);

$utf_8_text = iconv('ISO-8859-1', 'UTF-8', $iso_text);
var_dump($iso_text, $utf_8_text);
?>

outputs ...

string(63) "El Vers퀀culo del D퀀a: Pray For Others: Incoming Prayer Requests"
string(65) "El Versículo del Día: Pray For Others: Incoming Prayer Requests"
string(63) "El Vers퀀culo del D퀀a: Pray For Others: Incoming Prayer Requests"
string(65) "El Versículo del Día: Pray For Others: Incoming Prayer Requests"

notice that the correct strings are 2 bytes longer?

The í is encoded as 0xC3AD or U+00ED.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

--- End Message ---
--- Begin Message ---








www.TheVerseOfTheDay.info

-----Original Message----- From: Richard Quadling
Sent: Friday, September 30, 2011 2:53 PM
To: Ron Piggott
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] RSS Feed Accented Characters

On 30 September 2011 18:22, Ron Piggott <ron....@actsministries.org> wrote:

-----Original Message----- From: Richard Quadling
Sent: Friday, September 30, 2011 12:31 PM
To: Ron Piggott
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] RSS Feed Accented Characters

On 30 September 2011 17:26, Ron Piggott <ron....@actsministries.org> wrote:

I am trying to set up an RSS Feed in the Spanish language using a PHP cron
job.  I am unsure of how to deal with accented letters.

An example:

This syntax:

<?php

$rss_content .= "<description>" . htmlentities("El Versículo del Día") .
"</description>\r\n";

?>

Outputs:


<description>El Vers&iacute;culo del D&iacute;a</description>


When I use an RSS Feed validator I receive the error message

This feed does not validate.

 a.. line 24, column 20: XML parsing error: <unknown>:24:20: undefined
entity

I suspect the “;” is the issue, although it is needed for the accented
letters.  If I don’t use htmlentities() the accented characters can’t be
viewed, they become a “?”  How should I proceed?

Ron

Make sure you have ...

<?xml version="1.0" encode="UTF-8"?>

as the first line of the output. That tells the reader that the file
is a UTF-8 encoded file. Also, if you ejecting HTTP headers, make sure
that they say the encoding is UTF-8 and not a codepage.

Go UTF-8 everywhere.


--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea




Hi Richard:

Having "     <?xml version="1.0" encoding="UTF-8"?>     " as the starting
line didn't correct the problem.

The RSS Feed is @
http://www.elversiculodeldia.info/peticiones-de-rezo-rss.xml

There are a variety of errors related to accented characters while using a
feed valuator
http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.elversiculodeldia.info%2Fpeticiones-de-rezo-rss.xml

- Also While viewing the feed in Firefox once the first accented character
is displayed none of the rest of the feed is visible, except by right
clicking and "view source"

The RSS Feed content will be populated by a database query.  The database
columns are set to utf8_unicode_ci

How should I proceed?
Ron


The byte sequence that is being received is just 0xED.

php -r "file_put_contents('a.rss',
file_get_contents('http://www.elversiculodeldia.info/peticiones-de-rezo-rss.xml'));"

This is NOT UTF-8 encoded data, but is ISO-8859-1 Latin-1 (most likely).

So as I see it you have 1 choice.

Either use <?xml version="1.0" encoding="ISO-8859-1"?> as the XML tag
or convert the encoded data to UTF-8.

It also means that the data in the sql server is NOT UTF-8 and will
need to be converted also.

I would recommend doing that first.

That will mean reading the data as ISO-8859-1 and converting it to
UTF-8 and then saving it again.

I'd also be looking at the app that inputs the data into the DB initially.

To convert the text, here are 2 examples. I'm sure there are more ways.

<?php
$iso_text = 'El Versículo del Día: Pray For Others: Incoming Prayer Requests';

$utf_8_text = utf8_encode($iso_text);
var_dump($iso_text, $utf_8_text);

$utf_8_text = iconv('ISO-8859-1', 'UTF-8', $iso_text);
var_dump($iso_text, $utf_8_text);
?>

outputs ...

string(63) "El Vers퀀culo del D퀀a: Pray For Others: Incoming Prayer Requests"
string(65) "El Versículo del Día: Pray For Others: Incoming Prayer Requests"
string(63) "El Vers퀀culo del D퀀a: Pray For Others: Incoming Prayer Requests"
string(65) "El Versículo del Día: Pray For Others: Incoming Prayer Requests"

notice that the correct strings are 2 bytes longer?

The í is encoded as 0xC3AD or U+00ED.

--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea


Richard I was unaware of the

utf8_encode

command. Thank you very much --- this now works. Now I may continue with the translation into Spanish.

Ron
--- End Message ---
--- Begin Message ---
I'm trying to set magic quotes Off as my reading tells me that it's not good 
to have it defaulted to On.

My ISP has this setting (from PHPINFO call):

    magic_quotes_gpc on

>From reading the php.net manual I found this line

    php_flag magic_quotes_gpc on

which it says to place in the .htaccess file.

I downloaded that file from my server's public_html folder, edited it to put 
in the above line (which now says "Off") and re-uploaded it.  Boom! My 
server no longer works - I get "Internal Server Error" "The server 
encountered an internal error or misconfiguration....."

If I re-edit my .htaccess, remove the line and re-upload, everything works 
fine.

So - what am I mis-interpreting about how to accomplish this task? 



--- End Message ---

Reply via email to