-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automaticaly script for replacing index.php files
- Loading branch information
ArtProg
committed
Jan 29, 2018
1 parent
fb450bc
commit 8db2f3f
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |