Changeset 3168 for trunk/modules

Show
Ignore:
Timestamp:
07/20/2008 08:34:36 PM (4 months ago)
Author:
Shadowhand
Message:

Replacing file_exists calls with is_file and is_dir, where possible.

Location:
trunk/modules
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/archive/libraries/Archive.php

    r3163 r3168  
    6262                empty($name) and $name = $path; 
    6363 
    64                 if (file_exists($path) AND is_dir($path)) 
     64                if (is_dir($path)) 
    6565                { 
    6666                        // Force directories to end with a slash 
     
    109109                        throw new Kohana_Exception('archive.directory_unwritable', $directory); 
    110110 
    111                 if (file_exists($filename)) 
     111                if (is_file($filename)) 
    112112                { 
    113113                        // Unable to write to the file 
  • trunk/modules/payment/libraries/drivers/Payment/Yourpay.php

    r3163 r3168  
    5656        { 
    5757                // Check to make sure the certificate is valid 
    58                 $this->certificate = (file_exists($config['certificate'])) ? $config['certificate'] : FALSE; 
     58                $this->certificate = is_file($config['certificate']) ? $config['certificate'] : FALSE; 
    5959 
    6060                if (!$this->certificate) 
  • trunk/modules/smarty/controllers/smarty_demo.php

    r2532 r3168  
    66        const ALLOW_PRODUCTION = FALSE;     
    77 
    8     public function index() 
    9     { 
    10         $welcome = new View('demo'); 
    11         $welcome->message = "Welcome to the Kohana!"; 
     8        public function index() 
     9        { 
     10                $welcome = new View('demo'); 
     11                $welcome->message = "Welcome to the Kohana!"; 
    1212 
    13         $welcome->render(TRUE); 
    14     } 
     13                $welcome->render(TRUE); 
     14        } 
    1515} 
  • trunk/modules/smarty/libraries/MY_Smarty.php

    r3163 r3168  
    6060        public function checkDirectory($directory) 
    6161        { 
    62                 if ((! file_exists($directory) AND ! @mkdir($directory, 0755)) OR ! is_writeable($directory) OR !is_executable($directory))  
     62                if ((! file_exists($directory) AND ! @mkdir($directory, 0755)) OR ! is_writable($directory) OR !is_executable($directory))  
    6363                { 
    6464                        $error = 'Compile/Cache directory "%s" is not writeable/executable';