Ok, the bad news is PHP 5.2 and PHP 5.3 behave differently. PHP 5.2
doesn't honour the double quote within a literal quoted string (PHP
5.3 does). So that really sucks. That really sinks any chance of
using the native method *sigh*
If you look in the comments, a guy did some tepid profiling of use the
JSON format and it yields comparable performance.
http://www.php.net/manual/en/function.parse-ini-file.php#93807
Upside is we could use any keys (meaning converting keys is not as
high a priority). Downside is both the keys and values need to be
quoted but the format is not radically dissimilar to what we'd need.
Could also profile JM's other suggestion using preg matching
Bummer.
Side note: we would anyway face the same issue with the function I quoted above, as the only practical difference is the single quote vs the double quote in the value.
JM, could you ask your Translation Teams to give this some thought,
particularly moving to a JSON format.
The difference would be something like:
JDISABLED=Disabled
JENABLED=Enabled
JNO=No
JYES=Yes
to
{
'JDISABLED': 'Disabled',
'JENABLED': 'Enabled',
'JNO': 'No',
'JYES': 'Yes'
}
Still human readable but keys don't have to be as strict.
Regards,
Andrew Eddie
http://www.theartofjoomla.com - the art of becoming a Joomla developer
--
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To post to this group, send an email to joomla-dev...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-frame...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-framework?hl=en-GB.
--
Please keep the Subject wording in your answers
1. Unhappily no one has proposed a script to port 1.5 lang files to 1.6 format, whichever it is, so TTs will anyway have to redo most of the work, string per string. As the tokens/keys will all be non-explicit as to the value given to them, it will be a tedious one.
--
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To post to this group, send an email to joomla-dev...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-frame...@googlegroups.com.
Sure... take a look at libraries/joomla/language/language.php in the jstring_16 branch.
1. Unhappily no one has proposed a script to port 1.5 lang files to 1.6 format, whichever it is, so TTs will anyway have to redo most of the work, string per string. As the tokens/keys will all be non-explicit as to the value given to them, it will be a tedious one.
Once we decide on a format, I will provide a script. I have one that I used for profiling with the new INI format, but it does not properly convert things in light of these rules. I left it at home unfortunately, but I can post the quick and dirty one tonight (proper use relies on the find command, which isn't available on Windows, but I can make a version that will work better on Windows as well).
And, this could actually be a part of the migration process, and would be a rather easy step. This is certainly a huge advantage of going with JSON rather than INI, because it doesn't require keys to be changed.
Ian
--
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To post to this group, send an email to joomla-dev...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-frame...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-framework?hl=en-GB.
Found this that could help overpass the value limitations:
http://mach13.com/loose-and-multiline-parse_ini_file-function-in-php
The above strings are OK (after adding the usual ENT_COMPAT, 'UTF-8'
in their test file.
That is actually fairly performant, although still slower than the native calls. That function takes about 4 times as long as the natives (likely JSON or INI wouldn't make much difference), but still saves us a lot of processing time.
Ian
On Sun, Dec 13, 2009 at 11:56 AM, infograf768 <infog...@gmail.com> wrote:
Found this that could help overpass the value limitations:
http://mach13.com/loose-and-multiline-parse_ini_file-function-in-php
The above strings are OK (after adding the usual ENT_COMPAT, 'UTF-8'in their test file.
--
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To post to this group, send an email to joomla-dev...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-frame...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-framework?hl=en-GB.
I want to make several remarks concerning this point.
1. language files (when seen by third party developers, joomla core
translators and third party translators) must be as simple as
possible. The actual Joomla ini format is actually well known and easy
to read by human
2. language files processing must be as fast as possible. The native
ini php format or the json format are probably the fastest way to read
them. My previous tests have shown that the native ini files have some
problems in the characters which are allowed in the key part of a key-
value pair. So the .json format is certainly the most accurate
We have to combine these two issues because we have to facilitate the
work done by translators and to speed up Joomla site.
Actually, administrator/language/**-**/ and language/**-**/ are
writable directories for allowing installation of languages files.
We could have
* a global option for a joomla site: "do you want to automatically
create compiled version of language files?" If this option is set to
TRUE by the administrator, then the administrator/language/**-**/ and
language/**-**/ directories have to be writable and json files could
be created on the fly when a language file (the ini joomla version) is
loaded for the first time or when it has been modified by hand.
* an ability for the administrator to create (or update) these .json
language files using the admin ui (a well chosen button in the
language manager). The administrator/language/**-**/ and
language/**-**/ directories have also to be writable but only when the
admin update or create language files.
* a way in the install manager to create these .json files when an
extension is installed (or updated)
I could provide a patch for these features (if they are asked by the
community) at the begining of january.
Ch.D
This means, that I don't want to have a system where we have to check if
a file is up-to-date and may get created on the fly by our system. This
has two reasons, the first and most important one is the usability, the
second one being the performance. In terms of usability, it is one more
folder that needs to be writable by PHP if we start creating files on
the fly and I just want to remind people of how difficult it still is to
just get people through the normal installation with writing the
configuration.php. This is also related to security. Even if there is no
security problem, people will feel uneasy about having a folder made
writable permanently for normal operations. (Yes, we are having the
folder writable now already, but from the users perspective this is
quite different. Explaining that the folder needs to be writable during
installation of an extension and explaining the complicated reasons for
this system, are two entirely different things.)
In terms of performance it is again a whole series of filesystem
lookups, where we also need checks if a file has been changed and that
needs to be done on each pageload. It might not eat up all of our
performance gain by using the native functions, but it will deminish the
achievable result by a great deal.
That said, I want us to find a solution that solves this issue without
such an intricate system. Maybe we could encode the problematic
characters in our INI-strings and then still use the INI-format.
Hannes
> On 16 d�c, 15:38, Ian MacLennan <ian.maclen...@joomla.org> wrote:
>
>> On 16/12/2009 1:20 AM, JM Simonet wrote:>> That is actually fairly performant, although still slower than the
>>
>>>> native calls. That function takes about 4 times as long as the
>>>> natives (likely JSON or INI wouldn't make much difference), but
>>>> still saves us a lot of processing time.
>>>>
>>
>>>> Ian
>>>>
>>
>>> Ian, could we have an idea on real-time differences and not percents?
>>> For example: loading a specific admin page with cache off with each
>>> solution in seconds.
>>>
>> I can do that, but it's a rather useless number because it is machine
>> dependent and thus isn't something I'd be too inclined to waste my time
>> on. A recent page run rendered in .161 seconds, so that would mean
>> currently language processing is taking about .04 seconds. With native
>> INI handling it would take about .12 seconds.
>>
>> Ian
>>
My proposal was designed for two problematic:
-using ini (joomla format) files for developers and translators
-using json files for dispaying site pages
I answer inline
On 30 déc, 01:02, Hannes Papenberg <hackwa...@googlemail.com> wrote:
> Hi Christophe,
> those points are valid and right. I want to make one other remark that
> is crucial to me: All extensions have to ship with the final files used
> by the system to translate strings.
The installation manager could create these "compiled" files when
installation is done (since "language" folders are writable when
installing an extension)
>
> This means, that I don't want to have a system where we have to check if
> a file is up-to-date and may get created on the fly by our system. This
> has two reasons, the first and most important one is the usability, the
> second one being the performance. In terms of usability, it is one more
> folder that needs to be writable by PHP if we start creating files on
> the fly and I just want to remind people of how difficult it still is to
> just get people through the normal installation with writing the
> configuration.php.
This is why I suggest to have a global parameter "do you want to
automatically
create/update compiled version of language files?" which can be set to
false by default. May be this solution is not adapted and may be we
have to replace this solution by loading the json file if it exists
and the ini file else. The json files will be always located in
administrator/language/**-** or language/**-** (since created by the
installer) and the ini files will be located in the same folders or in
the third party folder.
> This is also related to security. Even if there is no
> security problem, people will feel uneasy about having a folder made
> writable permanently for normal operations. (Yes, we are having the
> folder writable now already, but from the users perspective this is
> quite different. Explaining that the folder needs to be writable during
> installation of an extension and explaining the complicated reasons for
> this system, are two entirely different things.)
>
> In terms of performance it is again a whole series of filesystem
> lookups, where we also need checks if a file has been changed and that
> needs to be done on each pageload. It might not eat up all of our
> performance gain by using the native functions, but it will deminish the
> achievable result by a great deal.
see my remark about the global parameter
Erik
Christophe Demko schrieb: