Skip to content

Commit

Permalink
Moved into directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jari Kanerva committed Dec 13, 2009
0 parents commit f30ac61
Show file tree
Hide file tree
Showing 12 changed files with 3,356 additions and 0 deletions.
340 changes: 340 additions & 0 deletions COPYING

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions README
@@ -0,0 +1,15 @@
"Phiff" is a MODX generator that attempts to run a diff and then generate a MODX file with inline edits.

Do note that this is early beta. Read the issues file.

Authors: Jari Kanerva (tumba25)

USAGE:
php modx_diff.php -o path/to/unchanged/dir (or file) -n path/to/changed/dir (or file)

The parameters to modx_diff.php needs to be after "php modx_diff.php".
-o, --old = The original files, with path from / or the current dir.
-n, --new = The modified files, with path from / or the current dir.
Both old and new need to be either files or dirs.
-f, --outfile = path and name of file to generate. Defautls to ./install_mod.xml
-v, --verbose = Tell what happens.
43 changes: 43 additions & 0 deletions config.php
@@ -0,0 +1,43 @@
<?php
/**
*
* @package MODX Generator
* @version $Id$
* @copyright (c) tumba25
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/

/**
* modx_diff configuration file.
*/

/**
* The ignore array contains files and directories to ignore.
*/
$ignore = array(
'Thumbs.db',
'cache',
'install',
'config.php',
'store',
'docs',
);

/**
* File extensions ignore while diffing
* Images and other binary file types.
*/
$ignore_ext = array(
'jpg',
'jpeg',
'gif',
'png',
'zip',
'tar',
'rar',
);

// Ignore version strings like @version $Id$
// This setting is ignored for now.
$ignore_file_version = true;
36 changes: 36 additions & 0 deletions constants.php
@@ -0,0 +1,36 @@
<?php
/**
*
* @package MODX Generator
* @version $Id$
* @copyright (c) tumba25
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/

// Some deafults
// Search rows needs to be high to avoid identical finds.
define('SEARCH_ROWS', 10);

// Diff options.
define('DIFF_BASIC', 0);
define('DIFF_CUSTOM', 1);

// Type definitions (type)
//define('NOP', 0);
define('INLINE', 1);
define('EDIT', 2);

// Edit definitions (add-type)
define('DO_NOTHING', 0);
define('ADD_BEFORE', 1);
define('ADD_AFTER', 2);
define('REPLACE', 3);
define('INLINE_ADD_AFTER', 4);
define('INLINE_ADD_BEFORE', 5);
define('INLINE_REPLACE', 6);

// Error messages from gen_find()
define('MOVE_UP', 7);
define('MOVE_DOWN', 8);
define('NO_FIND', 8);

0 comments on commit f30ac61

Please sign in to comment.