public function GetRegisterConstantTemplate($name, $namespace="", $type="")
    {
        if($namespace)
        {
            $namespace = str_replace(
                array("\\", "::"),
                "_",
                $namespace
            ) . "_";
        }

        $override = $this->templates_path
            . "constants/overrides/"
            . "define_{$name}"
            . ".php"
        ;

        if(file_exists($override))
        {
            return $override;
        }

        return $this->templates_path
            . "constants/"
            . "integer.php"
        ;
    }
public function GetRegisterConstantTemplate($name, $namespace="", $type="")
    {
        if($namespace)
        {
            $namespace = str_replace(
                array("\\", "::"),
                "_",
                $namespace
            ) . "_";
        }

        $override = $this->templates_path
            . "constants/overrides/"
            . "define_{$name}"
            . ".php"
        ;

        if(file_exists($override))
        {
            return $override;
        }

        return $this->templates_path
            . "constants/"
            . "integer.php"
        ;
    }
public function GetRegisterConstantTemplate ( $ name , $ namespace = "" , $ type = "" ) { if ( $ namespace ) { $ namespace = str_replace ( array ( "\\" , "::" ) , "_" , $ namespace ) . "_" ; } $ override = $ this -> templates_path . "constants/overrides/" . "define_{$name}" . ".php" ; if ( file_exists ( $ override ) ) { return $ override ; } return $ this -> templates_path . "constants/" . "integer.php" ; }
Retrieve the template path for registering constants, also checks
if a valid override exists and returns that instead.
@todo Improve this to handle various types.
@param string $name Name of constant.
@param string $namespace Namespace where resides the constant.
@param string $type
@return string Path to template file.
Retrieve the template path for registering constants also checks if a valid override exists and returns that instead .