Re[12]: More accurate compiled file names

Dmitry Koteroff <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
>> AD> We should give deleloper possibility to forget about compiled
>> AD> templates  at all.
>> Unfortunately it is impossible (at least before PHP's eval is not
>> grown up from the baby pants).
AD> I really don't see any need in "advanced eval()".
"There is no spoon", eh. (-;

Perl:

eval("
#line 25 "/path/to/file"
nonExistent();
");
if ($@) {
  print "Error in template: $@";
}

Prints  "Error  in  template:  ...  at  /path/to/file  line  25".
Whatever  error has been generated - compiler error, warning - no
matter.

Still don't see anything? (-;

AD> 2)
>> I am writing there about line number synchronization.
AD> hmmm... =)
AD> there's something wrong with these phrases.
Maybe - English is great, English is hard.
"There" means "in that letter".

>> >> Text "generated for machine and for machine" could be readable by
>> >> human  too.  And  if  I should not pay for that and even must not
>> >> loot at them more often than before, why not?
>> AD> Could != Should 
>> AD> I could jump off the roof, but should I ?
>> But  what  would  you  say  if  the  President  modify the law to
>> prohibit roofjumping for all the people in the world? It's silly.
>> (-;
AD> Well, nobody prohibits you to do it.
AD> It's just not recommended and seems rather silly to me to make roofs
AD> more comfortable for jumping =)
A-ha! Respect. (-;
Well, it was not so good analogy. (-;

Appositely, Messju Mohr have written today:

> yes. FWIW: Smarty-2.5.0 behaves differently than 2.6.2 does: with
> use_sub_dirs=true it behaves like 2.6.2, but with use_sub_dirs=false
> it behaves as you propose: no crc32-numbers in the
> compiled-template-name, but something like ^full^path^to^template.tpl .
>
> I like the behaviour of 2.5.0 more than it is now and would like to
> see it reverted.


>> No.  But  there  is REAL need to detect full source template name
>> (no  any  words  about  compiled  code at all, eh?) on unexpected
>> fatal error.
AD> ok, no compiled code.
AD> readable filenames are good.
What did you say? GOOD? And what do we argueing about? (-;
It this thread I am just talking about filenames.
 
>> AD> no error -> no message -> no need to handle
>> "Every program has at least one error."
>> (seems, Knuth).
AD> Knuth is using Smarty? wow =)
He is using his head. (-;

>> You may disable message, but you cannot disable error.
AD> yep, you should handle it.
AD> that's right. that was the main my idea.
AD> let's improve error handling in Smarty Compiler.
Bodhichitta.
 
>> Smarty  should  make  all  the people in the world happy! Please,
>> modify its code to achieve this. (-;
AD> ok, I'll offer $smarty->makeHappy() method shortly =)
What  about  low error_reporting level while calling user-defined
plugins?  It  must  be raised before calling, or plugin will work
with too low error level.

>> Not  satisfied - just astonished. (-; And all this four years you
>> programming  without  E_NOTICE  and do not differ error and error
>> message? Strange.
AD> Strange and sad, that you've totally misunderstood me.
Sorry. It is temporary, I hope.

>> Maybe  I  don't  know that I want, but I have a patch which works
>> and which is very useful in practical situations. (-;
AD> I'm proposing you to write a patch, that will be even more useful, 'cos
AD> your current patch seems to be not so popular, as you thought.
"My  current  patch"  was  default  Smarty  behaviour in previous
versions, as said by Messju Mohr. (-;

"Even  more"  here  is  not  applicable  -  it  solves completely
different thing.

AD> Of course, we can do it together, if you don't mind.
To  me,  line number synchronization is more important think than
filename mangling.

>> AD> Maybe you need to read this:
>> AD>
>> http://smarty.php.net/manual/en/chapter.debugging.console.php
>> How  do you plan to use debugging console on E_ERROR raising?
>> I can use C debugger (gdb, for example) to debug crushed program.
AD> Do you know, that E_ERROR is not the only error type in PHP? =)
AD> I believe you do.
There  are  a  little  lot  :-)  of  other errors which cannot be
handled. I am takling about all of them.

>> AD> So, this letter was just my imagination:
>> AD>
>> http://lists.php.net/article.php?group=php.smarty.dev&article=2319
>> AD> ?
>> And?  Working  with  source  template,  not compiled, when we got
>> error  message  (E_ERROR or E_WARNING - no matter). The letter is
>> about that. (Glad to see that you have read this.)
AD> I thought we agreed to forget about compiled templates.
Yes.

AD> BTW, you can help us to translate Smarty docs to Russian, if
AD> you want. I suppose it could be quite useful for your new book.
AD> Feel free to contact me about it.
I  want  to  help  to  correct most serious bugs, but not only to
translate    text.   (-;   Appositely,   I   have   heared   that
http://phpclub.ru has almost translated the documentation.

To me, the most serious lacks are:
1. Not synchronized line numbers in template and in compiled code
   (fixed).
2. Unreadable   compiled   code   filenames,  which  is shown in
   unexpected fatal errors (also fixed).

The only thing is to talk to Smarty developers and listen what do
they  thing  about  all that. Nowadays it seems to me they do not
notedly  want  to  correct  all  this  in  new  version. I do not
understand, why...

-- 
Best regards,
  Dmitry Koteroff.

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.