Set transfer mode

@param   integer  $mode  Integer representation of data transfer mode [1:Binary|0:Ascii]
Defined constants can also be used [FTP_BINARY|FTP_ASCII]

@return  boolean  True if successful

@since   1.0
348306
protected function _mode($mode)
	{
		if ($mode == FTP_BINARY)
		{
			if (!$this->_putCmd("TYPE I", 200))
			{
				Log::add(
					sprintf('%1$s: Bad response. Server response: %2$s [Expected: 200]. Mode sent: Binary', __METHOD__, $this->response),
					Log::WARNING, 'jerror'
				);

				return false;
			}
		}
		else
		{
			if (!$this->_putCmd("TYPE A", 200))
			{
				Log::add(
					sprintf('%1$s: Bad response. Server response: %2$s [Expected: 200]. Mode sent: ASCII', __METHOD__, $this->response),
					Log::WARNING, 'jerror'
				);

				return false;
			}
		}

		return true;
	}
740257
public function setFetchMode($mode)
    {
        //check for PDO extension
        if (!extension_loaded('pdo')) {
            /**
             * @see Zend_Db_Adapter_Exception
             */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception('The PDO extension is required for this adapter but the extension is not loaded');
        }
        switch ($mode) {
            case PDO::FETCH_LAZY:
            case PDO::FETCH_ASSOC:
            case PDO::FETCH_NUM:
            case PDO::FETCH_BOTH:
            case PDO::FETCH_NAMED:
            case PDO::FETCH_OBJ:
                $this->_fetchMode = $mode;
                break;
            default:
                /**
                 * @see Zend_Db_Adapter_Exception
                 */
                // require_once 'Zend/Db/Adapter/Exception.php';
                throw new Zend_Db_Adapter_Exception("Invalid fetch mode '$mode' specified");
                break;
        }
    }
292394
public function setIterationMode($mode) {
		switch ($mode) {
			case self::ITERATION_STRAIGHT:
				$this->_map = array_keys($this->_data);
				break;
			
			case self::ITERATION_REVERSE:
				$this->_map = array_reverse(array_keys($this->_data));
				break;
			
			case self::ITERATION_EVEN:
				$this->_map = [];
				
				foreach (array_keys($this->_data) as $key => $value) {
					if ($key % 2 === 0) {
						$this->_map[] = $value;
					}
				}
				break;
				
			case self::ITERATION_ODD:
				$this->_map = [];
				
				foreach (array_keys($this->_data) as $key => $value) {
					if ($key % 2 !== 0) {
						$this->_map[] = $value;
					}
				}
				break;
		}
		
		return $this;
	}
991062
public static function setMode($mode = '')
    {
        static::$MODE = 0;
        if (empty($mode)) {
            return;
        }
        $mode = explode(',', $mode);
        foreach ($mode as $m) {
            static::$MODE |= constant('static::SQL_MODE_' . $m);
        }
    }
740520
protected function setConnectionPassiveMode()
    {
        if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) {
            ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress);
        }

        if ( ! ftp_pasv($this->connection, $this->passive)) {
            throw new RuntimeException(
                'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort()
            );
        }
    }
539190
public function setMode(string $mode)
    {
        if (self::VISUAL === $mode) {
            $this->find('css', '#content-tmce')->press();
        } else {
            $this->find('css', '#content-html')->press();
        }
    }
1320878
private final function setReadableWritable(string $mode)
   {
      if (self::MODE_R === $mode) {
          $this->meta["readable"] = true;
          $this->meta["writable"] = false;
      } else if (self::MODE_W === $mode
              || self::MODE_A === $mode
              || self::MODE_C === $mode
              || self::MODE_X === $mode) {
          $this->meta["readable"] = false;
          $this->meta["writable"] = true;
      } else if (self::MODE_R_MORE === $mode
              || self::MODE_W_MORE === $mode    
              || self::MODE_A_MORE === $mode
              || self::MODE_C_MORE === $mode
              || self::MODE_X_MORE === $mode) {
          $this->meta["readable"] = true;
          $this->meta["writable"] = true;
       }
   }
438163
public function copy($dst, $mode=null) {
		$dst = \Asgard\File\FileSystem::copy($this->src, $dst, $mode);
		if($dst) {
			$copy = clone $this;
			$copy->setSrc($dst);
			return $copy;
		}
		return false;
	}
248547
public function setMode($mode)
    {
        if (in_array($mode, $this->availableModes)) {
            $this->mode = $mode;
        }

        throw new \Exception("$mode is not a available mode for this API.");
    }
137589
public function mode($mode)
    {
        if ($mode !== false) {
            $this->staging = true;
        } else {
            $this->staging = false;
        }
    }
941369
public function setFetchMode($mode)
    {
        switch ($mode) {
            case Zend_Db::FETCH_NUM:   // seq array
            case Zend_Db::FETCH_ASSOC: // assoc array
            case Zend_Db::FETCH_BOTH:  // seq+assoc array
            case Zend_Db::FETCH_OBJ:   // object
                $this->_fetchMode = $mode;
                break;
            case Zend_Db::FETCH_BOUND:   // bound to PHP variable
                /**
                 * @see Zend_Db_Adapter_Db2_Exception
                 */
                // require_once 'Zend/Db/Adapter/Db2/Exception.php';
                throw new Zend_Db_Adapter_Db2_Exception('FETCH_BOUND is not supported yet');
                break;
            default:
                /**
                 * @see Zend_Db_Adapter_Db2_Exception
                 */
                // require_once 'Zend/Db/Adapter/Db2/Exception.php';
                throw new Zend_Db_Adapter_Db2_Exception("Invalid fetch mode '$mode' specified");
                break;
        }
    }
550341
public function change_permission($mode)
    {

        if (empty($mode) || !is_int($mode)) return false;

        if (chmod($this->path . $this->filename, $mode)) {
            return $this->open($this->path . $this->filename);
        }

        return false;
    }
824163
public function lock($mode = true)
    {
        $this->shouldLock = $mode;

        if (!$handle = $this->resource()) {
            return false;
        }

        return $this->applyLock($handle);

    }
630992
public function chmod($remote_file, $mode)
    {
        $mode = octdec(str_pad($mode, 4, '0', STR_PAD_LEFT));
        $mode = (int) $mode;

        if (!@ftp_chmod($this->connection, $mode, $remote_file) !== false) {
            throw new \Exception("Could not change remote file to mode: " . $mode);
        }

        return true;
    }
193395
protected function setMode($mode) {
    $mode = strtolower($mode);

    // These are largely ignored, as the remote
    // object storage does not distinguish between
    // text and binary files. Per the PHP recommendation
    // files are treated as binary.
    $this->isBinary = strpos($mode, 'b') !== FALSE;
    $this->isText = strpos($mode, 't') !== FALSE;

    // Rewrite mode to remove b or t:
    $mode = preg_replace('/[bt]?/', '', $mode);

    switch ($mode) {
      case 'r+':
        $this->isWriting = TRUE;
      case 'r':
        $this->isReading = TRUE;
        $this->createIfNotFound = FALSE;
        break;


      case 'w+':
        $this->isReading = TRUE;
      case 'w':
        $this->isTruncating = TRUE;
        $this->isWriting = TRUE;
        break;


      case 'a+':
        $this->isReading = TRUE;
      case 'a':
        $this->isAppending = TRUE;
        $this->isWriting = TRUE;
        break;


      case 'x+':
        $this->isReading = TRUE;
      case 'x':
        $this->isWriting = TRUE;
        $this->noOverwrite = TRUE;
        break;

      case 'c+':
        $this->isReading = TRUE;
      case 'c':
        $this->isWriting = TRUE;
        break;

      // nope mode: Mock read/write support,
      // but never write to the remote server.
      // (This is accomplished by never marking
      // the stream as dirty.)
      case 'nope':
        $this->isReading = TRUE;
        $this->isWriting = TRUE;
        $this->isNeverDirty = TRUE;
        break;

      // Default case is read/write
      // like c+.
      default:
        $this->isReading = TRUE;
        $this->isWriting = TRUE;
        break;

    }

    return $this;
  }
395643
public function setWriteMode($mode)
    {
        if (!in_array($mode, $this->validWriteModes, true)) {
            throw new InvalidArgumentException("Invalid write mode specified: $mode");
        }

        $this->config["writeMode"] = $mode;
        $this->createFileHandler();
    }
262733
public function setMode($mode) {

		if(false === is_string($mode)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR);
		}

		$this -> mode = $mode;

		return $this;
	}