This is one of my first OOP programs in normal PHP, without any framework. This combines all .css files into one and all .js files into one, and it works. Are there any suggestion on what I can make better in terms of OOP or anything else?This is how it works:I run this: http://localhost/folderName/css/styleindex.cssI have .htaccess that passes everything to index.php.I extract the type as CSS and page as styleindex by exploding styleindex.css.I get the array of files that needs to be combined for this page and join them.I display this on the browser with the correct MIME type and cache header.<?php    define('DEBUGMODE',01);     class ResourceHandler    {    /**     *  @var $FilesToParse files that needs to be parsed       */        private $FilesToParse = array();    /**     *  @var $type weather js or css      */         private $type;    /**     *  @var $page name/category of the page     */        private $page;    /**     *  @var $AllowedTypes array of allowed types js or css      */        private $AllowedTypes = array('css','js');    /**     *  @var $CacheTime time for which cache is valid     */        private $CacheTime = 610000;        function __construct($type, $page)        {            $this->setType($type);            $this->setPage($page);            header('ETag: Ei07072012745');            //header('Content-type: text/'.$this->type. charset: UTF-8);            if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))            {                 //ob_start(ob_gzhandler);             }            else            {                ob_start();            }                       header (Vary: negotiate,accept-language,accept-charset);            header (Cache-control: public);            header('Content-Disposition: attachment; filename='.$this->page.'.'.$this->type.'');            if(DEBUGMODE ==0)            {                $expire = expires:  . gmdate(D, d M Y H:i:s, time() + $this->CacheTime) .  GMT;                header ($expire);            }        }        function setPage($PageName)        {            $Resource   = explode('.',$PageName);            $this->page = $Resource[0];        }        function setType($type)        {            $type = strtolower($type);            /*type needs to be js or css else dont proceed further*/            if(!in_array($type,$this->AllowedTypes))            {                exit;            }            $this->type = $type;        }    /**     * Function to minify data     * @return $FileContent  Minified file data      */         private function minifyFiles($data)        {            /* remove comments */            $data = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $data);            /* remove tabs, spaces, newlines, etc. */            $data = str_replace(array(\r\n, \r, \n, \t, '  ', '    ', '    '), '', $data);            return $data;        }    /**     * Function to parse file and merge into one variable     * @return $FileContent  Merged file data      */         private function parseFiles()        {            $FileContent = '' ;            foreach($this->FilesToParse as $File)            {                $FileContent = file_get_contents($File);            }            return $FileContent;        }        function __destruct()        {            ob_end_flush();        }    /**     * Function to display  css file     * @return $output returns the combined, compresssed and gzipped data     */         private function css()        {            switch($this->page)            {                case 'index' :  $this->FilesToParse = array('style12.css','jquery.autocomplete.css');                                break;                DEFAULT      :  header($_SERVER[SERVER_PROTOCOL]. 404 Not Found);                                 exit;            }            $data =  $this->parseFiles('css');              if(DEBUGMODE ==0)            {                $data = $this->minifyFiles($data);            }            return $data;        }     /**     * Function to display js file     * @return $output returns the combined and gzipped data     */             private function js()        {            switch($this->page)            {                case 'index' :  $this->FilesToParse = array('jquery-1.6.2.js','jquery.autocomplete.js','facebox.js');                                break;                default      :  header($_SERVER[SERVER_PROTOCOL]. 404 Not Found);                                 exit;            }               $data =  $this->parseFiles('js');            return $data;        }        function load()        {            $type = $this->type;            $cwd  = getcwd();            chdir($type);            echo $this->$type();             chdir($cwd);        }    }      $request  = explode(/resources/, $_SERVER['REQUEST_URI']);       $params   = array_filter(explode(/, $request[1]));        if(isset($params[0]) && isset($params[1]))      {        $resource = new ResourceHandler($params[0],$params[1]);        $resource->load();      }      else       {          header($_SERVER[SERVER_PROTOCOL]. 404 Not Found);       }    ?> 
Combining .css and .js files
php;object oriented