maximebf / atomik

Micro framework for PHP 5.3+ [UNMAINTAINED]
MIT License
46 stars 18 forks source link

Issues with short_open_tag = Off #6

Closed alorence closed 11 years ago

alorence commented 11 years ago

I started to work with Atomik by folowing commands found on http://atomikframework.com/

I generated a skeleton from 3.0.0 version, with composer. Everything works on my online server (linux). But I want to develop my app locally, and I am under Windows.

I had some errors I resolved applying manually 9945f131550ecbb3 and patch given in #3. Now I still an issue I can't resolve by myself :

Parse error: syntax error, unexpected end of file in D:\Dev\web\atomik.tagyourmusic.org\htdocs\vendor\atomik\atomik\src\Atomik.php(1764) : eval()'d code on line 44

The problems seems to come from (Atomic.php, l. 1761)

if ($__allowShortTags) {
    // from CodeIgniter (https://github.com/EllisLab/CodeIgniter)
    eval('?>' . preg_replace("/;*\s*\?>/", "; ?>", 
        str_replace('<?=', '<?php echo ', file_get_contents($__filename))));
} else {
    include($__filename);
}

I have the same issue when running with wamp 2.2E (Apache 2.4 / PHP 5.4.3) and with UwAmp (Apache 2.2.17 / PHP 5.3.5).

Can you help me to run Atomik on a wamp config ?

maximebf commented 11 years ago

I just pushed some code on master that may resolve your problem. If not, could you send me the content of your template?

alorence commented 11 years ago

I applied manually e11d852126775 The new error is :

Parse error: syntax error, unexpected end of file in D:\Dev\web\atomik.tagyourmusic.org\htdocs\app\views_layout.phtml on line 44

I fixed it by myself changing line 36 of app/views/_layout.phtml from <? endif ?> to <?php endif ?>. It works like a charm ! So the problem was the PHP short_open_tags config, which need to be On by default to run Atomik. I enabled locally it since my online server is configured like this. Thank you very much

maximebf commented 11 years ago

Good catch. I will fix this in the repo ASAP