Protected Write

@param string $name
@param string $type
@param string $controller

@return bool
493025
protected function write($name, $type, $controller) : Bool
    {
        if( ! empty($name) )
        {
            if( ! empty($this->settings['path']) )
            {
                $filePath = Base::suffix($this->settings['path'], '/') . $name;
            }
            else
            {
                $filePath = $name;
            }
    
            $file = $this->path($filePath, $type);
    
            if( ! is_file($file) )
            {
                if( file_put_contents($file, $controller) )
                {
                    return true;
                }
            }
        }
        
        return false;
    }
536538
public function grant(string $type, string $name,
                          int $mode = WebAclRule::READ) {
        $this->checkParam($type, $mode);
        $fedora = $this->res->getFedora();

        $curMode   = array(WebAclRule::NONE);
        $matches   = array();
        $modeMatch = null;
        foreach ($this->resRules as $i) {
            $iMode = $i->getMode();
            if ($i->hasRole($type, $name)) {
                $matches[] = $i;
                $curMode[] = $iMode;
            }
            if ($iMode === $mode) {
                $modeMatch = $i;
            }
        }
        $curMode = max($curMode);

        if ($mode > $curMode) {
            foreach ($matches as $i) {
                $i->deleteRole($type, $name);
            }
            if ($modeMatch) {
                $modeMatch->addRole($type, $name);
            } else {
                $rule = new WebAclRule($fedora);
                $rule->setMode($mode);
                $rule->addResource($this->res);
                $rule->addRole($type, $name);
                if (self::$autosave) {
                    $rule->save($this->res->getAclUrl());
                }
                $this->resRules[] = $rule;
            }
            if (self::$autosave) {
                foreach ($matches as $i) {
                    $rule->save($this->res->getAclUrl());
                }
            }
        }
    }
707226
public function delete($name, $type = '')
    {
        $legacyKernel = Eresus_Kernel::app()->getLegacyKernel();
        $filename = $legacyKernel->froot . 'templates/';
        if ($type)
        {
            $filename .= "$type/";
        }
        $filename .= "$name.html";
        $result = filedelete($filename);
        return $result;
    }
236502
public function add($name, $type = TextType::class, $args = [])
    {
        if ($this->getTypeClass($type) === RepeatedType::class || $type instanceof RepeatedType) {
            return $this->addRepeatedType($name, $type, $args);
        }

        $formControl = $this->getTypeObject($type, $args);

        if (!isset($args['name'])) {
            $formControl->setName($name);
        }

        if ($formControl->getLabel() === null) {
            $formControl->setLabel($formControl->getHumanName());
        }

        $this->getForm()->add($formControl);

        return $this;
    }
1240501
protected function writeFile($stub, $controller, $path)
	{
		if (str_contains($controller, '\\'))
		{
			$this->makeDirectory($controller, $path);
		}

		$controller = str_replace('\\', DIRECTORY_SEPARATOR, $controller);

		if ( ! $this->files->exists($fullPath = $path."/{$controller}.php"))
		{
			return $this->files->put($fullPath, $stub);
		}
	}
1333009
public function indexExists($type, $code, $name)
    {
        try {
            /** @var IndexEvent $event */
            $this->dispatch(DriverEvents::INDEX_EXISTS, new IndexEvent($type, $code, $name));
            $exists = true;
        } catch (IndexNotFoundException $e) {
            $exists = false;
        }

        return $exists;
    }
719154
public function hasRole(string $type, string $name): bool {
        self::checkRoleType($type);
        return isset($this->roles[$type][$name]);
    }
986085
private function createTypeMessage(string $type, string $name = null): string
    {
        return ((null !== $name) ? ($type . ' (named "' . $name . '")') : ($type));
    }
297969
public static function create($name, $type, $description = null)
    {
        $result = new static();
        $result->name = $name;
        $result->type = $type;
        $result->description = $description;

        return $result;
    }
354379
public function PhpWsdlParam($name,$type='string',$settings=null){
		PhpWsdl::Debug('New parameter '.$name);
		parent::PhpWsdlObject($name,$settings);
		$this->Type=$type;
	}
125704
public function writeMessageBegin($name, $type, $seqid)
    {
        $this->writeJSONArrayStart();
        $this->writeJSONInteger(self::VERSION);
        $this->writeJSONString($name);
        $this->writeJSONInteger($type);
        $this->writeJSONInteger($seqid);
    }
1306732
public function bind($name, \Closure $type)
    {
        $name = '\\'.ltrim($name, '\\');
        $this->bindings[$name] = $type;
    }
1233599
private static function createValidator($name, $type)
    {
        return \call_user_func_array([Validator::create(), ValidatorType::getMethod($type)], [$name]);
    }
572162
protected static function write_revert($name, $type, $file)
	{
		// remove the migration just run
		\DB::delete(static::$table)
			->where('name', $name)
			->where('type', $type)
			->where('migration', $file)
		->execute(static::$connection);

		// remove the file from the list of run migrations
		if (($key = array_search($file, static::$migrations[$type][$name])) !== false)
		{
			unset(static::$migrations[$type][$name][$key]);
		}

		// make sure the migrations are in the correct order
		sort(static::$migrations[$type][$name]);

		// and save the update to the config file
		\Config::set('migrations.version.'.$type.'.'.$name, static::$migrations[$type][$name]);
		\Config::save(\Fuel::$env.DS.'migrations', 'migrations');
	}
730452
protected function _write($name, $value)
    {
        $config = $this->configKey($name);
        $expires = new Time($config['expires']);

        $controller = $this->getController();

        $cookie = new Cookie(
            $name,
            $this->_encrypt($value, $config['encryption'], $config['key']),
            $expires,
            $config['path'],
            $config['domain'],
            (bool)$config['secure'],
            (bool)$config['httpOnly']
        );

        $controller->response = $controller->response->withCookie($cookie);
    }
32337
public function resource($name, $controller, array $options = [])
    {
        if ($this->container->bound(ResourceRegistrar::class)) {
            $registrar = $this->container->make(ResourceRegistrar::class);
        } else {
            $registrar = new ResourceRegistrar($this);
        }

        $registrar->register($name, $controller, $options);
    }
704808
public static function input($name, $type = INPUT_SERVER)
    {
        //====================================================================//
        // Standard Safe Reading
        $result = filter_input($type, $name);
        if (null !== $result) {
            return $result;
        }
        //====================================================================//
        // Fallback Reading
        if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        if ((INPUT_GET === $type) && isset($_GET[$name])) {
            return $_GET[$name];
        }

        return null;
    }