src/Controller/PlatformSchemeController.php
private function getSchemeFolder()
    {
        $uriPath = '/media/platform-scheme/';
        $config  = $this->getServiceLocator()->get('MelisCoreConfig');
        $path    = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme');

        if($path) {
            $uriPath = isset($path['datas']['platform_scheme_dir']) ? $path['datas']['platform_scheme_dir'] : '/media/platform-scheme/';
        }

        $docRoot      = $_SERVER['DOCUMENT_ROOT'] . '';
        $schemeFolder = $docRoot.$uriPath;

        // check if the folder exists
        if(!file_exists($schemeFolder)) {
            mkdir($schemeFolder, self::SCHEME_FOLDER_PERMISSION,true);
        }
        else {
            // check writable permission
            if(!is_writable($schemeFolder)) {
                chmod($schemeFolder, self::SCHEME_FOLDER_PERMISSION);
            }
        }

        return $uriPath;
    }
private function getSchemeFolder()
    {
        $uriPath = '/media/platform-scheme/';
        $config  = $this->getServiceLocator()->get('MelisCoreConfig');
        $path    = $config->getItem('meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme');

        if($path) {
            $uriPath = isset($path['datas']['platform_scheme_dir']) ? $path['datas']['platform_scheme_dir'] : '/media/platform-scheme/';
        }

        $docRoot      = $_SERVER['DOCUMENT_ROOT'] . '';
        $schemeFolder = $docRoot.$uriPath;

        // check if the folder exists
        if(!file_exists($schemeFolder)) {
            mkdir($schemeFolder, self::SCHEME_FOLDER_PERMISSION,true);
        }
        else {
            // check writable permission
            if(!is_writable($schemeFolder)) {
                chmod($schemeFolder, self::SCHEME_FOLDER_PERMISSION);
            }
        }

        return $uriPath;
    }
private function getSchemeFolder ( ) { $ uriPath = '/media/platform-scheme/' ; $ config = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreConfig' ) ; $ path = $ config -> getItem ( 'meliscore/interface/meliscore_leftmenu/interface/meliscore_toolstree_section/interface/meliscore_tool_system_config/interface/meliscore_tool_platform_scheme' ) ; if ( $ path ) { $ uriPath = isset ( $ path [ 'datas' ] [ 'platform_scheme_dir' ] ) ? $ path [ 'datas' ] [ 'platform_scheme_dir' ] : '/media/platform-scheme/' ; } $ docRoot = $ _SERVER [ 'DOCUMENT_ROOT' ] . '' ; $ schemeFolder = $ docRoot . $ uriPath ; // check if the folder exists if ( ! file_exists ( $ schemeFolder ) ) { mkdir ( $ schemeFolder , self :: SCHEME_FOLDER_PERMISSION , true ) ; } else { // check writable permission if ( ! is_writable ( $ schemeFolder ) ) { chmod ( $ schemeFolder , self :: SCHEME_FOLDER_PERMISSION ) ; } } return $ uriPath ; }
Returns the URI path of the platform scheme folder inside media folder
@return string
Returns the URI path of the platform scheme folder inside media folder