Skip to content

Commit

Permalink
Automaticaly script for replacing index.php files
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtProg committed Jan 29, 2018
1 parent fb450bc commit 8db2f3f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cliscripts/changeindex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php

/**
* Automaticaly replace include path and class name to gitmodx in index.php files
*/

include dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/'.'config.core.php';
include MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';

$files = array(
MODX_BASE_PATH.'index.php',
MODX_CONNECTORS_PATH.'index.php',
MODX_MANAGER_PATH.'index.php'
);

foreach($files as $file){
$content = file_get_contents($file);
$content = str_replace('model/modx/modx.class.php','components/gitmodx/model/gitmodx/gitmodx.class.php',$content);
$content = str_replace('new modX(','new gitModx(',$content);
file_put_contents($file,$content);
}

0 comments on commit 8db2f3f

Please sign in to comment.