protected function getGlobPattern($fileToRotate, $fileExtension = '')
    {

        // load the file information
        $dirname = pathinfo($fileToRotate, PATHINFO_DIRNAME);
        $filename = pathinfo($fileToRotate, PATHINFO_FILENAME);

        // create a glob expression to find all log files
        $glob = str_replace(
            array(LogrotateScanner::FILENAME_FORMAT_PLACEHOLDER, LogrotateScanner::SIZE_FORMAT_PLACEHOLDER),
            array($filename, '[0-9]'),
            $dirname . '/' . $this->getFilenameFormat()
        );

        // append the file extension if available
        if (empty($fileExtension) === false) {
            $glob .= '.' . $fileExtension;
        }

        // return the glob expression
        return $glob;
    }
protected function getGlobPattern($fileToRotate, $fileExtension = '')
    {

        // load the file information
        $dirname = pathinfo($fileToRotate, PATHINFO_DIRNAME);
        $filename = pathinfo($fileToRotate, PATHINFO_FILENAME);

        // create a glob expression to find all log files
        $glob = str_replace(
            array(LogrotateScanner::FILENAME_FORMAT_PLACEHOLDER, LogrotateScanner::SIZE_FORMAT_PLACEHOLDER),
            array($filename, '[0-9]'),
            $dirname . '/' . $this->getFilenameFormat()
        );

        // append the file extension if available
        if (empty($fileExtension) === false) {
            $glob .= '.' . $fileExtension;
        }

        // return the glob expression
        return $glob;
    }
protected function getGlobPattern ( $ fileToRotate , $ fileExtension = '' ) { // load the file information $ dirname = pathinfo ( $ fileToRotate , PATHINFO_DIRNAME ) ; $ filename = pathinfo ( $ fileToRotate , PATHINFO_FILENAME ) ; // create a glob expression to find all log files $ glob = str_replace ( array ( LogrotateScanner :: FILENAME_FORMAT_PLACEHOLDER , LogrotateScanner :: SIZE_FORMAT_PLACEHOLDER ) , array ( $ filename , '[0-9]' ) , $ dirname . '/' . $ this -> getFilenameFormat ( ) ) ; // append the file extension if available if ( empty ( $ fileExtension ) === false ) { $ glob .= '.' . $ fileExtension ; } // return the glob expression return $ glob ; }
Will return a glob pattern with which log files belonging to the currently rotated
file can be found.

@param string $fileToRotate  The file to be rotated
@param string $fileExtension The file extension

@return string
Will return a glob pattern with which log files belonging to the currently rotated file can be found .