Skip to content

Commit

Permalink
Fixed string escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktorsner committed Jan 3, 2013
1 parent f715bf4 commit 5218979
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions phpactiverecord.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ $cmd = "mv php-activerecord $ci_folder/application/third_party";
echo "Enable hooks in application/config/config.php\n";
$target_file = "$ci_folder/application/config/config.php";
$config_file = file_get_contents($target_file);
$needle = "$config['enable_hooks'] = FALSE;";
$newneedle = "$config['enable_hooks'] = TRUE;";
$needle = "\$config['enable_hooks'] = FALSE;";
$newneedle = "\$config['enable_hooks'] = TRUE;";
$config_file = str_replace($needle, $newneedle, $config_file);
file_put_contents($target_file, $config_file);

echo "Add hook in application/config/hooks.php\n";
$hook_code = <<<EOD
$hook['pre_controller'][] = array(

\$hook['pre_controller'][] = array(
'class' => '',
'function' => 'initialize_php_activerecord',
'filename' => 'CI_ActiveRecord.php',
Expand Down

0 comments on commit 5218979

Please sign in to comment.