Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CoffeeScript JavaScript PHP
branch: dev

This branch is 27 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tasks
test
.gitignore
MIT-LICENSE.txt
README.md
grunt.js
package.json

README.md

grunt-php-set-constant

Set a constant in a php file to the value indicated.

This is a multi task.

This supports single or double quotes. Heredoc and nowdoc within the define are not supported. String constants are supported.

Example usage within grunt init:

    setPHPConstant: {
        stage: {
            constant    : 'ENV',
            value       : 'staging',
            file        : 'temp/myfile.php'
        }
    }

The above would change the source of temp/myfile.php. It would change something like

define('ENV', 'blah');

to

define('ENV', 'staging');

To use this package put it as a dependency in your package.json, and then run npm install.

Then load the grunt task in your grunt.js

grunt.loadNpmTasks('grunt-php-set-constant');
  • TODO:
    • support constants other than strings
    • implement tests

NPM package

Something went wrong with that request. Please try again.