src/ScContent/Service/Dir.php
public function module($path = '', $checkIfExists = false)
    {
        $moduleDir = $this->moduleDir;
        if ($checkIfExists) {
            return realpath($moduleDir . DS . $path);
        }
        if (empty($path)) {
            return $moduleDir;
        }
        return $moduleDir . DS . $this->normalizePath($path);
    }
public function module($path = '', $checkIfExists = false)
    {
        $moduleDir = $this->moduleDir;
        if ($checkIfExists) {
            return realpath($moduleDir . DS . $path);
        }
        if (empty($path)) {
            return $moduleDir;
        }
        return $moduleDir . DS . $this->normalizePath($path);
    }
public function module ( $ path = '' , $ checkIfExists = false ) { $ moduleDir = $ this -> moduleDir ; if ( $ checkIfExists ) { return realpath ( $ moduleDir . DS . $ path ) ; } if ( empty ( $ path ) ) { return $ moduleDir ; } return $ moduleDir . DS . $ this -> normalizePath ( $ path ) ; }
Returns the path to the root directory of the module or any
child path.

The root directory of the module is calculated as the
directory, that contains the file of the Module class.
If the flag "checkIfExists" is set to TRUE, checks for the specified path
and if the path was not found, returns FALSE.

Usage:
<code>
$scDir = $serviceLocator->get('ScService.Dir');
$dir = clone($scDir);
$dir->setModule('MyModuleNamespace');
$myModuleConfigFile = $dir->module('/config/module.config.php');
$myModuleDataDir = $dir->module('/data');
</code>

@api

@param  string  $path optional
@param  boolean $checkIfExists optional default false
@return string|false
Returns the path to the root directory of the module or any child path .