public static function getClassNameFromFile($file, $classesDir)
    {
        $className = substr($file, strlen($classesDir)); // get path after the model directory
        $className = preg_replace("/^\//", '', $className); // remove any forward slash at the begining
        $className = preg_replace("/\//", '\\', $className); // change forward slash to backslash slash

        $className = preg_replace('/.php$/', '', $className); // remove extension.

        return $className;
    }
public static function getClassNameFromFile($file, $classesDir)
    {
        $className = substr($file, strlen($classesDir)); // get path after the model directory
        $className = preg_replace("/^\//", '', $className); // remove any forward slash at the begining
        $className = preg_replace("/\//", '\\', $className); // change forward slash to backslash slash

        $className = preg_replace('/.php$/', '', $className); // remove extension.

        return $className;
    }
public static function getClassNameFromFile ( $ file , $ classesDir ) { $ className = substr ( $ file , strlen ( $ classesDir ) ) ; // get path after the model directory $ className = preg_replace ( "/^\//" , '' , $ className ) ; // remove any forward slash at the begining $ className = preg_replace ( "/\//" , '\\' , $ className ) ; // change forward slash to backslash slash $ className = preg_replace ( '/.php$/' , '' , $ className ) ; // remove extension. return $ className ; }
Gets the class name of a class defined in a file.

@param $file

@return string
Gets the class name of a class defined in a file .