Dosyayı taşır

@return bool
776878
public function transport(){

            $target = ($this->target === "") ? "":$this->target."/";
            $targetFileName = sprintf('%s%s.%s', $target, $this->newName, $this->ext);

            // eğer dosya varsa siler
            if(file_exists($targetFileName)){
                unlink($targetFileName);
            }


            if(move_uploaded_file($this->file['tmp_name'], $targetFileName)){
                chmod($targetFileName, 0777);
                return $targetFileName;
            }else{
                return false;
            }
        }
386904
public function ejecutar()
    {
        // Validamos la sentencia a ejecutar
        if (empty($this->sentencia)) {
            if ($this->arrojarExcepciones) {
                throw new \InvalidArgumentException('La sentencia a ejecutar se encuentra vacia.');
            }

            return false;
        }

        // Ejecutamos la sentencia
        $resultado = $this->pdo->exec($this->sentencia);

        if ($resultado === false) {
            if ($this->arrojarExcepciones) {
                $error_info = $this->pdo->errorInfo();
                throw new Excepcion($error_info[2], [
                    'sentencia' => $this->sentencia,
                    'error_codigo' => $error_info[0],
                ], $error_info[1]);
            }

            return false;
        }

        return $resultado;
    }
30071
protected function _checkParents()
	{
		//pierwszy rodzic
		$parent = $this->_category->getParentRecord();
		//gdy jest rodzic
		while ($parent !== null) {
			//jeśli nie ma dostępu do tego rodzica
			if (!$this->_checkAccess($parent->id)) {
				return false;
			}
			//pobieramy kolejnego rodzica
			$parent = $parent->getParentRecord();
		}
		return true;
	}
892327
public function check()
    {
        $pdoResult = extension_loaded('PDO');
        $pdoMySqlResult = extension_loaded('pdo_mysql');

        $result = ($pdoResult === true && $pdoMySqlResult === true);

        if ($pdoResult === true) {
            $this->pdoVersion = phpversion('PDO');
        }

        if ($pdoMySqlResult === true) {
            $this->pdoMySqlVersion = phpversion('pdo_mysql');
        }

        return $result;
    }
378938
private function comprobarIntegridadAtributos(){
        foreach ($this->attrObligatorios as $obligatorios) {
            if (!array_key_exists($obligatorios, $this->entrada)) {
                $this->configurarErrorLdap('Creacion', 'No se ha configurado el atributo ' . $obligatorios );
                return false;
            }
        }
        return true;
    }
1211128
public function IsAvailable()
    {
        $bIsValid = true;
        $bIsValid = ($bIsValid && $this->IsActive());
        $bIsValid = ($bIsValid && $this->isValidForCurrentPortal());
        $bIsValid = ($bIsValid && $this->IsValidForCurrentUser());
        $bIsValid = ($bIsValid && $this->IsValidForBasket());

        return $bIsValid;
    }
1212808
public function isOK(){
        $boolReturn = false;
        
        if( ((!is_null($this->api_key))&&($this->api_key!="")) && ((!is_null($this->domaine))&&($this->domaine!="")) ){
            $boolReturn = true;
        }
        
        return $boolReturn;
    }
1011625
public function beforeSave()
    {
        //brak loginu lub hasła
        if (!$this->getElement('username')->getValue() || !$this->getElement('password')->getValue()) {
            return false;
        }
        //autoryzacja
        $auth = \App\Registry::$auth;
        \App\Registry::$auth->setIdentity($this->getElement('username')->getValue());
        \App\Registry::$auth->setCredential($this->getElement('password')->getValue());
        return \App\Registry::$auth->authenticate();
    }
232220
public function check() {
    foreach( $this->dictionary as $word ):
      $rule = "alone";
      if( is_array($word) ) {
        $rule = isset($word[1]) ? $word[1] : $rule;
        $word = $word[0];
      }
      $word = preg_replace("/([^\w ]*)/iu", "", $word);
      if( "among" === $rule ) {
        if( preg_match("/(" . $word . ")/iu", $this->text ) ) return true;
      } else {
        if( preg_match("/(\b)+(" . $word . ")+(\b)/iu", $this->text ) ) return true;
      }
    endforeach;
    return false;
  }
1096789
protected function doIt()
    {

        $request = Craft::$app->getRequest();

        if ($request->getIsAjax()) {

            if (!$request->getIsPost()) {
                return false;
            }

            $segments = $request->segments;
            $actionSegment = $segments[count($segments) - 1];

            if ($actionSegment !== 'get-editor-html') {
                return false;
            }

            Craft::$app->getView()->registerJs('Craft.CpFieldInspectPlugin.initElementEditor();');

        } else {

            $data = array(
                'redirectUrl' => Craft::$app->getSecurity()->hashData(implode('/', $request->segments)),
                'fields' => array(),
                'entryTypeIds' => array(),
                'baseEditFieldUrl' => rtrim(UrlHelper::cpUrl('settings/fields/edit'), '/'),
                'baseEditEntryTypeUrl' => rtrim(UrlHelper::cpUrl('settings/sections/sectionId/entrytypes'), '/'),
                'baseEditGlobalSetUrl' => rtrim(UrlHelper::cpUrl('settings/globals'), '/'),
                'baseEditCategoryGroupUrl' => rtrim(UrlHelper::cpUrl('settings/categories'), '/'),
                'baseEditCommerceProductTypeUrl' => rtrim(UrlHelper::cpUrl('commerce/settings/producttypes'), '/'),
            );

            $sectionIds = Craft::$app->getSections()->getAllSectionIds();
            foreach ($sectionIds as $sectionId)
            {
                $entryTypes = Craft::$app->getSections()->getEntryTypesBySectionId($sectionId);
                $data['entryTypeIds']['' . $sectionId] = array();
                foreach ($entryTypes as $entryType)
                {
                    $data['entryTypeIds']['' . $sectionId][] = $entryType->id;
                }
            }


            $fields = Craft::$app->getFields()->getAllFields();

            foreach ($fields as $field)
            {

                $data['fields'][$field->handle] = array(
                    'id' => $field->id,
                    'handle' => $field->handle,
                );
            }

            Craft::$app->getView()->registerAssetBundle(CpFieldInspectBundle::class);
            Craft::$app->getView()->registerJs('Craft.CpFieldInspectPlugin.init('.json_encode($data).');');
        }
    }
151649
public function isBoolean()
    {
        return $this->data_type === PDO::PARAM_BOOL ||
            $this->data_type === (PDO::PARAM_BOOL | PDO::PARAM_INPUT_OUTPUT);
    }
387566
public function isSuccessful()
    {
        $successful = false;

        $errorCode = $this->getErrorCode();
        if ($errorCode === 200 || $errorCode === 0) {
            $successful = true;
        }

        return $successful;
    }
1045364
public function blockUser(): bool
    {
        $this->deactivate();
        if (!$this->save()) {
            print_r($this->getErrors());
            throw new Exception(\Yii::t('app', 'Ошибка при блокировании пользователя'));
        }
        return true;
    }
426532
protected function checkForAol()
    {
        $this->setAol(false);
        $this->setAolVersion(self::VERSION_UNKNOWN);

        if (stripos($this->_agent, 'aol') !== false) {
            $aversion = explode(' ', stristr($this->_agent, 'AOL'));
            if (isset($aversion[1])) {
                $this->setAol(true);
                $this->setAolVersion(preg_replace('/[^0-9\.a-z]/i', '', $aversion[1]));
                return true;
            }
        }
        return false;
    }
574422
public function isScalar()
    {
        return in_array($this->group(), [self::NUMBER, self::STRING, self::BOOL]);
    }
142505
public function accept()
	{
		if( $this->isDot() )
			return FALSE;

		$isDir	= $this->isDir();
		if( !$this->showFiles && !$isDir )
			return FALSE;

		if( $this->stripDotEntries )
		{
			if( preg_match( "@^\.\w@", $this->getFilename() ) )
				return FALSE;
			$pathName	= str_replace( "\\", "/", "/".$this->getPath() );
			if( preg_match( "@/\.\w@", $pathName ) )
				return FALSE;
		}

		return preg_match( $this->pattern, $this->getFilename() );
	}
872966
public function checkIfReady()
    {
        if (!$this->attrs->paramsDone || !$this->attrs->inputDone) {
            return false;
        }
        if (isset($this->appInstance->passphrase)) {
            if (!isset($this->attrs->server['PASSPHRASE'])
                || ($this->appInstance->passphrase !== $this->attrs->server['PASSPHRASE'])
            ) {
                $this->finish();
            }

            return false;
        }

        if ($this->attrs->input->isFrozen()) {
            return false;
        }

        if ($this->sleepTime === 0) {
            $this->wakeup();
        }

        return true;
    }