Save the manifest.

@return bool
162986
public function save()
    {
        if ($this->dirty)
        {
            $path = $this->manifestPath.'/collections.json';

            $this->dirty = false;

            return (bool) $this->files->put($path, $this->entries->toJson());
        }

        return false;
    }
716208
public function save()
    {
        if (true == file_exists($this->getFileName())) {
            unlink($this->getFileName());
        }
        touch($this->getFileName());
        $content = "";
        foreach ($this->getEnvironments() as $environment) {
            $content .= "{$environment}\n";
        }
        file_put_contents($this->getFileName(), $content);
        return $content;
    }
741748
public function save()
    {
        // Update time - now
        $updated = time();

        // Update timestamp
        $this->entries[$this->timestampKey] = $updated;

        // Update timestamp manager
        if ($this->timestampManager) {
            $this->timestampManager->update($updated);
        }

        return (bool) file_put_contents($this->path, json_encode($this->entries));
    }
814023
public function save()
    {
        $result = false;

        if ($this->isConnected())
        {
            if (!$this->isNew()) {
                $result = $this->getTable()->update($this);
            } else {
                $result = $this->getTable()->insert($this);
            }

            //Reset the modified array
            if ($result !== false)
            {
                if (((integer) $result) > 0) {
                    $this->_modified = array();
                }
            }
        }

        return (bool) $result;
    }
29474
public function save() {
        global $DB;

        $fordb = new stdClass();
        foreach (get_object_vars($this) as $k => $v) {
            $fordb->{$k} = $v;
        }
        unset($fordb->criteria);

        $fordb->timemodified = time();
        if ($DB->update_record_raw('badge', $fordb)) {
            // Trigger event, badge updated.
            $eventparams = array('objectid' => $this->id, 'context' => $this->get_context());
            $event = \core\event\badge_updated::create($eventparams);
            $event->trigger();
            return true;
        } else {
            throw new moodle_exception('error:save', 'badges');
            return false;
        }
    }
351275
public function save()
    {
        $this->triggerEvent('onBeforeSave');

        $result = $this->getFlexDirectory()->getStorage()->replaceRows([$this->getStorageKey() => $this->prepareStorage()]);

        $value = reset($result);
        $storageKey = key($result);
        if ($value && $storageKey) {
            $this->setStorageKey($storageKey);
            if (!$this->hasKey()) {
                $this->setKey($storageKey);
            }
        }

        if (method_exists($this, 'saveUpdatedMedia')) {
            $this->saveUpdatedMedia();
        }

        try {
            $this->getFlexDirectory()->clearCache();
            if (method_exists($this, 'clearMediaCache')) {
                $this->clearMediaCache();
            }
        } catch (InvalidArgumentException $e) {
            /** @var Debugger $debugger */
            $debugger = Grav::instance()['debugger'];
            $debugger->addException($e);

            // Caching failed, but we can ignore that for now.
        }

        $this->triggerEvent('onAfterSave');

        return $this;
    }
1121114
public function save()
    {
        $path = $this->paths['customPath'];
        $currentLanguage = $this->getLanguage();

        $result = true;
        if (!empty($this->changedData)) {
            foreach ($this->changedData as $scope => $data) {
                if (!empty($data)) {
                    $result &= $this->getFileManager()->mergeContents(array($path, $currentLanguage, $scope.'.json'), $data, true);
                }
            }
        }

        if (!empty($this->deletedData)) {
            foreach ($this->deletedData as $scope => $unsetData) {
                if (!empty($unsetData)) {
                    $result &= $this->getFileManager()->unsetContents(array($path, $currentLanguage, $scope.'.json'), $unsetData, true);
                }
            }
        }

        $this->clearChanges();

        return (bool) $result;
    }
1155001
public function save() {
        try {
            $this->file->upload();

            $filename = $this->file->getNameWithExtension();

            if ($this->function) {
                $func = $this->function;
                $fileSource = $this->dest . '/' . $this->file->getNameWithExtension();
                $filename = $this->alternaiveName ? $this->alternaiveName . '.' . $this->file->getExtension() : $this->file->getNameWithExtension();

                $image = new ImageResize($fileSource);
                call_user_func_array(array($image, $func), $this->params);
                $image->save($this->dest . '/' . $filename);
            }
            return $filename;
        } catch (\Exception $e) {
            $this->errors = $e->getMessage();
            return false;
        }

        return true;
    }
376898
public function saveAction()
    {
        $success = 0;
        $message = 'tr_melis_cms_prospects_theme_failed';
        $errors  = [];
        $title   = 'tr_melis_cms_prospects_theme';
        $request = $this->getRequest();
        $id      = null;
        if($request->isPost()) {

            $allowSave = false;


            $data = $this->tool()->sanitizeRecursive(get_object_vars($request->getPost()), ["'",'"'], false);
            $id   = isset($data['pros_theme_id']) ? (int) $data['pros_theme_id'] : null; // changed to 1
            
            $melisCoreConfig = $this->serviceLocator->get('MelisCoreConfig');
            $appConfigForm = $melisCoreConfig->getFormMergedAndOrdered('melistoolprospects/tools/melistoolprospects_tool_prospects_themes/forms/prospects_theme_form','prospects_theme_form');
            $factory = new \Zend\Form\Factory();
            $formElements = $this->serviceLocator->get('FormElementManager');
            $factory->setFormElementManager($formElements);
            $form = $factory->createForm($appConfigForm);
            
            $form->setData($data);
            
            if($form->isValid()) {
                $checkData = $this->themeTable()->getEntryByField('pros_theme_name', $data['pros_theme_name'])->current();
                unset($data['pros_theme_id']);

                if(!$checkData && !$id) {
                    $allowSave = true;
                }
                elseif($id && $checkData) {
                    $currentCode = $this->themeTable()->getEntryById($id)->current()->pros_theme_code;
                    if($currentCode != $data['pros_theme_code']) {
                        // recheck if the code exists
                        $checkData = $this->themeTable()->getEntryByField('pros_theme_code', $data['pros_theme_code'])->current();
                        if(empty($checkData)) {
                            $allowSave = true;
                        }
                        else {
                            $message = 'tr_melis_cms_prospects_theme_code_exists';
                        }
                    }
                    else {
                        $allowSave = true;
                    }
                }
                else {
                    $allowSave = true;
                }

                if($allowSave) {
                    $this->themeTable()->save($data, $id);
                    $success = 1;
                    $message = 'tr_melis_cms_prospects_theme_success';
                }
            }
            else {
                $errors = $form->getMessages();
                foreach ($errors as $keyError => $valueError)
                {
                    foreach ($appConfigForm as $keyForm => $valueForm)
                    {
                        if(isset($valueForm['spec']['name']))
                        {
                            if ($valueForm['spec']['name'] == $keyError &&
                                !empty($valueForm['spec']['options']['label'])
                            )
                                $errors[$keyError]['label'] = $valueForm['spec']['options']['label'];
                        }
                    }
                }
            }

        }

        $response = [
            'success'     => $success,
            'errors'      => $errors,
            'textMessage' => $this->tool()->getTranslation($message),
            'textTitle'   => $this->tool()->getTranslation($title)
        ];

        $this->getEventManager()->trigger('meliscmsprospects_theme_save_end', $this, array_merge($response, array('typeCode' => 'CMS_PROSPECTS_THEME_SAVE', 'itemId' => $id)));

        return new JsonModel($response);
    }
1178875
public function save() {
		if ($this->installTasks === null) {
			return;
		}
		
		// Let's grab all install tasks and save them according to their scope.
		// If no scope is provided, we default to global scope.
		
		$localInstalls = array();
		$globalInstalls = array();
		
		foreach ($this->installTasks as $task) {
			switch ($task->getScope()) {
				case AbstractInstallTask::SCOPE_GLOBAL:
				case '':
					$globalInstalls[] = $task->toArray();
					break;
				case AbstractInstallTask::SCOPE_LOCAL:
					$localInstalls[] = $task->toArray();
					break;
				default:
					throw new MoufException("Unknown install task scope '".$task->getScope()."'.");
			}
		}
		
		$this->ensureWritable($this->globalInstallFile);
		$this->ensureWritable($this->localInstallFile);
		
		$fp = fopen($this->globalInstallFile, "w");
		fwrite($fp, "<?php\n");
		fwrite($fp, "/**\n");
		fwrite($fp, " * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.\n");
		fwrite($fp, " * This file contains the status of all Mouf global installation processes for packages you have installed.\n");
		fwrite($fp, " * If you are working with a source repository, this file should be commited.\n");
		fwrite($fp, " */\n");
		fwrite($fp, "return ".var_export($globalInstalls, true).";");
		fclose($fp);		
		
		$fp = fopen($this->localInstallFile, "w");
		fwrite($fp, "<?php\n");
		fwrite($fp, "/**\n");
		fwrite($fp, " * This is a file automatically generated by the Mouf framework. Do not modify it, as it could be overwritten.\n");
		fwrite($fp, " * This file contains the status of all Mouf local installation processes for packages you have installed.\n");
		fwrite($fp, " * If you are working with a source repository, this file should NOT be commited.\n");
		fwrite($fp, " */\n");
		fwrite($fp, "return ".var_export($localInstalls, true).";");
		fclose($fp);

		@chmod($this->globalInstallFile, 0664);
		@chmod($this->localInstallFile, 0664);
        if (function_exists("opcache_invalidate")) {
            opcache_invalidate($this->globalInstallFile);
            opcache_invalidate($this->localInstallFile);
        }
    }
483005
public function save()
    {

        $ok = $this->dataConnector->saveToolConsumer($this);
        if ($ok) {
            $this->settingsChanged = false;
        }

        return $ok;

    }
1370617
public function save()
    {
        if ($this->validate()) {
            $this->user->scenario = User::SCENARIO_PASSWORD;
            $this->user->password = $this->new_password;
            return $this->user->save();
        }
        return false;
    }
156485
public function save()
	{
		$result=true;
		foreach($this->files as $file)
		{
			if($this->confirmed($file))
				$result=$file->save() && $result;
		}
		return $result;
	}
12629
public function save()
    {
        if ($this->validate() && (bool)$this->getUser()->updateAttributes(['nickname' => $this->nickname])) {
            return $this->getUser();
        }
        return false;
    }
568330
public function save(){

        foreach ($this->cols as $table => $prkey){

            foreach($prkey as $prkey_){

                if(strlen($prkey_)<3){continue;}

            $this->writedb($table, $prkey_);
            }
        //more table records
        $this->rows[$table]['index'] = $this->indexData[$table];

            try{
            $this->writedb($table, 'index');
            }
            catch(Exception $aa){
              return false;
            }

        }
    return true;
    }
769747
public function save()
    {
        $appname = $this->name;
        $temp = "no";
        $temdirbase = FEnv::get("framework.root").
            "vendor/iumio-framework/Core/Additional/Manager/Module/App/AppTemplate";
        $tempdir = ($temp == "no")? $temdirbase.'/notemplate/{appname}/' : $temdirbase.'/template/{appname}/';
        Server::copy($tempdir, FEnv::get("framework.root")."apps/".$appname, 'directory');
        $napp = FEnv::get("framework.root")."apps/".$appname;

        // APP
        $f = file_get_contents($napp."/{appname}.php.local");
        $str = str_replace("{appname}", $appname, $f);
        file_put_contents($napp."/{appname}.php.local", $str);
        rename($napp."/{appname}.php.local", $napp."/$appname.php");

        // Mercure
        $f = file_get_contents($napp."/Routing/default.merc");
        $str = str_replace("{appname}", $appname, $f);
        file_put_contents($napp."/Routing/default.merc", $str);

        // MASTER
        $f = file_get_contents($napp."/Masters/DefaultMaster.php.local");
        $str = str_replace("{appname}", $appname, $f);
        file_put_contents($napp."/Masters/DefaultMaster.php.local", $str);
        rename($napp."/Masters/DefaultMaster.php.local", $napp."/Masters/DefaultMaster.php");

        // REGISTER TO APP CORE
        $f = json_decode(file_get_contents(FEnv::get("framework.root").
            "elements/config_files/core/apps.json"));
        $lastapp = 0;
        foreach ($f as $one => $val) {
            $lastapp++;
        }
        if ($this->params['isdefault'] == "yes") {
            foreach ($f as $one => $val) {
                if ($val->isdefault == "yes") {
                    $val->isdefault = "no";
                    break;
                }
            }
        }
        $f->$lastapp = new \stdClass();
        $f->$lastapp->name = $this->params['appname'];
        $f->$lastapp->isdefault = $this->params['isdefault'];
        $f->$lastapp->class = "\\".$this->params['appname']."\\".$this->params['appname'];
        $f = json_encode($f, JSON_PRETTY_PRINT);
        file_put_contents(FEnv::get("framework.root")."elements/config_files/core/apps.json", $f);
        if ($this->params['template'] == "yes") {
            new AM(array("core/manager", "assets-manager", "--copy", "--appname=". $this->params['appname'],
                "--symlink", "--noexit"));
        }
        Output::outputAsSuccess("\n Your app is ready to use. To test your app go to project location on your
         browser with parameter /hello. Enjoy ! \n", "none");
    }
914341
private function _save() {
    unlink($this->path);
    file_put_contents($this->path,join('\n',$this->htpwd));
  }