Welcome Guest, Not a member yet? Register   Sign In
CamelCase Legacy code and using "<?" instead of "<?php"
#1

[eluser]coldfire82[/eluser]
Hi,

What quick solution do we have, if the legacy code is written in camelcase and the codebase is quite large?

The code also uses
Code:
<?
instead of
Code:
<?php
, which is not good. I can change the php.ini but then its php version specific.

Any comments
#2

[eluser]Eric Barnes[/eluser]
A lot of finding and replacing Or a manual rewrite. Smile
#3

[eluser]Fireclave[/eluser]
CI 2.0 -> config.php

/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;

Set True
#4

[eluser]coldfire82[/eluser]
[quote author="Fireclave" date="1296830186"]CI 2.0 -> config.php

/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = FALSE;

Set True[/quote]

On setting the config option: $config['rewrite_short_tags'] = TRUE;

It still doesnt work. It dumps the whole php code on that particular page.

I still have to manually change <? ?> & <?= ?> to <?php ?>
#5

[eluser]Philipp Gérard[/eluser]
Find & Replace should do the job in about ... 5 seconds?
#6

[eluser]coldfire82[/eluser]
[quote author="Philipp Gérard" date="1296842737"]Find & Replace should do the job in about ... 5 seconds?[/quote]

I wish it was that simple
#7

[eluser]thomas.ernest[/eluser]
[quote author="coldfire82" date="1296844303"][quote author="Philipp Gérard" date="1296842737"]Find & Replace should do the job in about ... 5 seconds?[/quote]

I wish it was that simple[/quote]

With some tools like grep and sed, the execution time is about 5sec. Even if you don't know these tools very well, you must need less than 1 hour to write the command line.

Good luck !




Theme © iAndrew 2016 - Forum software by © MyBB