lib/Pico.php
public function getPageId($path)
    {
        $contentDir = $this->getConfig('content_dir');
        $contentDirLength = strlen($contentDir);

        if (substr($path, 0, $contentDirLength) !== $contentDir) {
            return null;
        }

        $contentExt = $this->getConfig('content_ext');
        $contentExtLength = strlen($contentExt);

        if (substr($path, -$contentExtLength) !== $contentExt) {
            return null;
        }

        return substr($path, $contentDirLength, -$contentExtLength) ?: null;
    }
public function getPageId($path)
    {
        $contentDir = $this->getConfig('content_dir');
        $contentDirLength = strlen($contentDir);

        if (substr($path, 0, $contentDirLength) !== $contentDir) {
            return null;
        }

        $contentExt = $this->getConfig('content_ext');
        $contentExtLength = strlen($contentExt);

        if (substr($path, -$contentExtLength) !== $contentExt) {
            return null;
        }

        return substr($path, $contentDirLength, -$contentExtLength) ?: null;
    }
public function getPageId ( $ path ) { $ contentDir = $ this -> getConfig ( 'content_dir' ) ; $ contentDirLength = strlen ( $ contentDir ) ; if ( substr ( $ path , 0 , $ contentDirLength ) !== $ contentDir ) { return null ; } $ contentExt = $ this -> getConfig ( 'content_ext' ) ; $ contentExtLength = strlen ( $ contentExt ) ; if ( substr ( $ path , - $ contentExtLength ) !== $ contentExt ) { return null ; } return substr ( $ path , $ contentDirLength , - $ contentExtLength ) ? : null ; }
Returns the page ID of a given content file

@param string $path path to the content file

@return string|null either the corresponding page ID or NULL
Returns the page ID of a given content file