Re[8]: [SMARTY-DEV] More accurate compiled file names

From: Date: Mon, 31 May 2004 14:59:23 +0000
Subject: Re[8]: [SMARTY-DEV] More accurate compiled file names
References: 1 2 3 4 5 6 7 8  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2344@lists.php.net to get a copy of this message
>> Why should I pay for something if I can get the same on the next >> street corner? I don't understand. AD> Because Smarty is not intended for parsing PHP-code. Sorry, you have not answered the straight question. You just say something like this: "if Bill Gates do not like ice-cream, you should not intend to eat an appricot." >> + $_filename = $auto_source; >> + $_filename = preg_replace("{[/\\\\]}s", "^", >> $_filename); >> + $_filename = >> preg_replace("{[^a-z0-9~!_=.^-]}si", "_", $_filename); >> + $_return .= $_filename; AD> Well, the most bad thing imho - it's to make developer AD> to look into compiled templates. AD> That's what I'm talking about. Agree. But WHO makes (makes!) developer to look into compiled code? Please stick a finger to them. >> (Maybe with concatenating crc32() result in addition, no matter). >> Why not? Can you motivate that? AD> Just because compiled template is generated by machine and for AD> machine. User/developer should look into it's code. Again, i's not an answer to the question. Seems you do not understand the roots of the problem totally. Sorry if I am wrong. 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? >> >> What about {$spoon+1}, where $spoon is undefined? Smarty does not >> >> handle at all situations like this! >> AD> Just turn E_NOTICE off, in this case it doesn't matter, of course >> AD> if you know what you're doing. >> Oh, good advice - "just turn E_ERROR off and enjoy debugging hell >> forever - it is so masochistical!". It is NOT a solution, it is >> true crutch. I love E_ALL, PHP developers - too; it makes >> debugging process much easier. AD> Please, don't juggle with my words. I didn't say that. But I did say. (-; AD> If you're so masochistical - you may continue to dig AD> machine-generated code, thinking it's the best solution. I do not like to dig the "machine code" (apropos, people in the neighbor topic in this conference say that they want to dig it). But I do not like to cry tearing my hears when I cannot find the buggy template much more. So I choose to dig instead of tear. (-; AD> But I'm sure, THAT is the real crutch. And I'm believe that AD> E_NOTICE in templates it's not the same as E_NOTICE in the AD> code. Maybe, maybe. AD> Just think about it - your templates with lots of empty() & AD> isset() will be really pain in the ass. Agree. But E_NOTICE is not just a lot of isset(). You are mixing three independent entities in your mind - the error itself, the error diagnostic message and tools to handle errors. No good. And one more. E_NOTICE is not the only message which is handled at runtime. We also have E_WARNING. Do you offer to disable it too? What about code which is called from inside the template (for example, user-defined functions)? If I disable E_NOTICE, it would be disabled in these functions too. Sorry of my question, but how long do your programming in PHP and use Smarty (approximately)? >> AD> And I'm trying to say that Smarty just should prevent all >> AD> fatal errors like mismatched tags, using non-existent methods >> AD> and functions etc. >> It is impossible, I have said it before. How do you plan to >> handle such situation, for example? >> >> {math equation="($a + spoon())*20"} AD> As I've already said, we CAN'T handle all situations, I have said the same. Consensus! (-; AD> but we can TRY to handle most of them. AD> Btw, why you're changing examples all the time? To motivate why do we need human-readable NAMES for compiled template filenames. >> Again: my solution does not make our to pay something for it. It >> only simplifies debugging in critical cases, no more, no less. I >> don't understand why don't you want to use it. AD> Because you're trying to make easier the process I don't want at all. AD> When your C program fails - are you digging the machine AD> code or maybe starting up a debugger? If somebody would write a debugger for Smarty, I will use it, of course. (-; And - why are you talking about "machine code"? Where is it? I have only said about FILENAMES - to simplify detection of buggy SOURCE template, NOT machine code. I must not to open compiled template at all - I will be satisfied only for its name in PHP fatal error message. Then I will go directly to SOURCE template and correct it (line number I already have - see neighbour thread). Seems we are talking about completely different things. AD> I'd choose a debugger and you're trying to make the machine AD> code more readable. Noone can choose non-existed tool to use it. (-;

« previous php.smarty.dev (#2344) next »