migrates item to current config version

@param string	name of the type (in case of app, it's 'default')
@param string	type (app, module or package)
961476
protected static function _current($name, $type)
	{
		// -v or --version
		if (\Cli::option('v', \Cli::option('version', '')) !== '')
		{
			\Cli::write('You can not define a version when using the "current" command.', 'red');
		}

		$migrations = \Migrate::current($name, $type);

		if ($migrations)
		{
			\Cli::write('Newly installed migrations for '.$type.':'.$name.':', 'green');
			foreach ($migrations as $migration)
			{
				\Cli::write('- '.$migration);
			}
		}
		else
		{
			// migration is already on current version
			\Cli::write('Already on the current migration version for '.$type.':'.$name.'.');
		}
	}
224981
public static function start($name, $type = '')
    {
        if (!self::isEnabled()) {
            return;
        }

        $currentPointer = 'timetracker_' . self::$uniqueCounter++;
        array_push(self::$currentPointerStack, $currentPointer);
        array_push(self::$stack, $name);

        self::$stackLevel++;
        self::$stackLevelMax[] = self::$stackLevel;

        self::$stackLog[$currentPointer] = array(
            'level' => self::$stackLevel,
            'stack' => self::$stack,
            'time_start' => microtime(true),
            'realmem_start' => memory_get_usage(true),
            // 'emalloc_start' => memory_get_usage(false),
            'type' => $type,
        );

        if ($name == '__EAV_LOAD_MODEL__' && !empty(self::getConfiguration()->captureModelInfo)) {
            $trace = debug_backtrace();
            $className = get_class($trace[1]['args'][0]);
            $entityId = isset($trace[1]['args'][1]) ? $trace[1]['args'][1] : 'not set';
            $attributes = isset($trace[1]['args'][2]) ? $trace[1]['args'][2] : null;
            self::$stackLog[$currentPointer]['detail'] = "$className, id: $entityId, attributes: " . var_export($attributes, true);
        }

        if (!empty(self::getConfiguration()->captureBacktraces)) {
            $trace = isset($trace) ? $trace : debug_backtrace();
            $fileAndLine = self::getFileAndLine($trace, $type, $name);
            self::$stackLog[$currentPointer]['file'] = $fileAndLine['file'];
            self::$stackLog[$currentPointer]['line'] = $fileAndLine['line'];
        }

    }
204967
public static function down($version = null, $name = 'default', $type = 'app')
	{
		// get the current version info from the config
		$current = \Config::get('migrations.version.'.$type.'.'.$name);

		// any migrations defined?
		if ( ! empty($current))
		{
			// get the last entry
			$current = end($current);

			// get the available migrations before the last current one
			$migrations = static::find_migrations($name, $type, $version, $current, 'down');

			// found any?
			if ( ! empty($migrations))
			{
				// if no version was given, only revert the last migration
				if (is_null($version))
				{
					$migrations = array_slice($migrations, -1, 1, true);
				}
				else
				{
					// we're going down, so reverse the order of migrations
					$migrations = array_reverse($migrations, true);
				}

				// revert the installed migrations
				return static::run($migrations, $name, $type, 'down');
			}
		}

		// nothing to migrate
		return array();
	}
1304405
public function morphTo($name = null, $type = null, $id = null)
    {
        // If no name is provided, we will use the backtrace to get the function name
        // since that is most likely the name of the polymorphic interface. We can
        // use that to get both the class and foreign key that will be utilized.
        $name = $name ?: $this->guessBelongsToRelation();

        list($type, $id) = $this->getMorphs(
            Str::snake($name),
            $type,
            $id
        );

        // If the type value is null it is probably safe to assume we're eager loading
        // the relationship. In this case we'll just pass in a dummy query where we
        // need to remove any eager loads that may already be defined on a model.
        return empty($class = $this->{$type})
            ? $this->morphEagerTo($name, $type, $id)
            : $this->morphInstanceTo($class, $name, $type, $id);
    }
724264
protected function install($name, $version = 'dev-master', $type = 'composer', $tree = false)
    {
        $installer = new Installer(
            $name,
            $version,
            $type ?: $this->option('type'),
            $tree ?: $this->option('tree')
        );

        $installer->setRepository($this->laravel['components']);

        $installer->setConsole($this);

        if ($timeout = $this->option('timeout')) {
            $installer->setTimeout($timeout);
        }

        if ($path = $this->option('path')) {
            $installer->setPath($path);
        }

        $installer->run();

        if (!$this->option('no-update')) {
            $this->call('component:update', [
                'component' => $installer->getComponentName(),
            ]);
        }
    }
300532
public function addType(Type $type, $name = '')
    {
        if (!$name) {
            $name = (string)$type;
        }

        $this->types[$name] = $type;
    }
96601
public function createConstant($name, $type = NULL, $default = self::UNDEFINED, $modifiers = GConstant::MODIFIER_PROTECTED) {
    $gConstant = GConstant::create($name, $type, $default, $modifiers);
    
    $this->addConstant($gConstant);
    return $gConstant;
  }
260333
public function restore($type, $name)
    {
        if (!is_string($type) || !isset($this->algos[$type])) {
            throw new \InvalidArgumentException();
        }
        if (isset($this->savedAlgos[$type][$name])) {
            $this->algos[$type][$name] = $this->savedAlgos[$type][$name];
        }
        return $this;
    }
1028946
public void updateUpdate(String type, String location) throws SecurityException {
	checkWriteAccess();

	if (!(config instanceof ConfigServer)) {
	    throw new SecurityException("can't change update setting from this context, access is denied");
	}
	Element update = _getRootElement("update");
	update.setAttribute("type", type);
	try {
	    location = HTTPUtil.toURL(location, true).toString();
	}
	catch (Throwable e) {
	    ExceptionUtil.rethrowIfNecessary(e);
	}
	update.setAttribute("location", location);
    }
787946
public function requestField(string $type, string $name): void
    {
        $this->fields[$type][] = $name;
        $this->updateUriQuery();
    }
334476
public function typeExist($name)
    {
        $type = $this->type->findOneBy(['name' => $name]);

        if (is_object($type)) {
            return true;
        }

        return false;
    }
161519
public void setType(Type type) {
        Type actual = Type.preserveType(this.getType(), type);

        mConversions.clear();
        mExceptionPossible = false;
        if (actual != null) {
            // Prefer cast for initial type for correct operation of
            // setInitialType if a conversion needs to be inserted at the
            // beginning.
            mConversions.add(new Conversion(null, actual, true));
        }
    }
959223
protected static function init(string $type = 'string', string $key = null, string $name = null)
    {
        $instance = new static();

        $instance->key($key);
        $instance->field['type'] = $type;

        if ($name) $instance->field['name'] = $name;

        return $instance;
    }
1106157
private function createOption($name, $type)
    {
        if (isset($this->mapping[$type][$name])) {
            $class = $this->mapping[$type][$name];
            $option = new $class();
        } elseif (class_exists($name)) {
            $option = new $name();
        } else {
            throw new OptionNotFoundException($name, $type);
        }

        if ($option instanceof OptionRegistryAwareInterface) {
            $option->setOptionRegistry($this);
        }

        return $option;
    }
998070
public function begin($name, $type = 'replace')
    {
        $stacks = [$name, $type];
        if (!isset($this->opens[$name])) {
            $stacks[] = $this->placeholder($name);
        } elseif ($this->opens[$name]) {
            throw new BlockException($name, 'is opened');
        }

        $this->opens[$name] = true;
        $this->stacks[] = $stacks;
        ob_start();
    }
978603
public static function up($version = null, $name = 'default', $type = 'app')
	{
		// get the current version info from the config
		$current = \Config::get('migrations.version.'.$type.'.'.$name);

		// get the last migration installed
		$current = empty($current) ? null : end($current);

		// get the available migrations after the current one
		$migrations = static::find_migrations($name, $type, $current, $version);

		// found any?
		if ( ! empty($migrations))
		{
			// if no version was given, only install the next migration
			is_null($version) and $migrations = array(reset($migrations));

			// install migrations found
			return static::run($migrations, $name, $type, 'up');
		}

		// nothing to migrate
		return array();
	}
984566
public function renameType($type, $name)
    {
        $type->setName($name);
        $this->manager->persist($type);
        $this->manager->flush();

        return $type;
    }