public function addDirectory($directory)
    {
        $directories = $this->getDirectory(true);

        if (is_string($directory)) {
            $directory = explode(',', $directory);
        } else if (!is_array($directory)) {
            require_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception ('Invalid options to validator provided');
        }

        foreach ($directory as $content) {
            if (empty($content) || !is_string($content)) {
                continue;
            }

            $directories[] = trim($content);
        }
        $directories = array_unique($directories);

        // Sanity check to ensure no empty values
        foreach ($directories as $key => $dir) {
            if (empty($dir)) {
                unset($directories[$key]);
            }
        }

        $this->_directory = implode(',', $directories);

        return $this;
    }
public function addDirectory($directory)
    {
        $directories = $this->getDirectory(true);

        if (is_string($directory)) {
            $directory = explode(',', $directory);
        } else if (!is_array($directory)) {
            require_once 'Zend/Validate/Exception.php';
            throw new Zend_Validate_Exception ('Invalid options to validator provided');
        }

        foreach ($directory as $content) {
            if (empty($content) || !is_string($content)) {
                continue;
            }

            $directories[] = trim($content);
        }
        $directories = array_unique($directories);

        // Sanity check to ensure no empty values
        foreach ($directories as $key => $dir) {
            if (empty($dir)) {
                unset($directories[$key]);
            }
        }

        $this->_directory = implode(',', $directories);

        return $this;
    }
public function addDirectory ( $ directory ) { $ directories = $ this -> getDirectory ( true ) ; if ( is_string ( $ directory ) ) { $ directory = explode ( ',' , $ directory ) ; } else if ( ! is_array ( $ directory ) ) { require_once 'Zend/Validate/Exception.php' ; throw new Zend_Validate_Exception ( 'Invalid options to validator provided' ) ; } foreach ( $ directory as $ content ) { if ( empty ( $ content ) || ! is_string ( $ content ) ) { continue ; } $ directories [ ] = trim ( $ content ) ; } $ directories = array_unique ( $ directories ) ; // Sanity check to ensure no empty values foreach ( $ directories as $ key => $ dir ) { if ( empty ( $ dir ) ) { unset ( $ directories [ $ key ] ) ; } } $ this -> _directory = implode ( ',' , $ directories ) ; return $ this ; }
Adds the file directory which will be checked

@param  string|array $directory The directory to add for validation
@return Zend_Validate_File_Extension Provides a fluent interface
Adds the file directory which will be checked