Inserts an applied migration into the database.

@param string $class migration name

@return bool TRUE on success, FALSE on failure
504728
private function _addMigrationRecord( $class )
    {
        $name = $this->db->prepareString( $class );
        $tm   = new \DateTime();
        $tm   = $tm->getTimestamp();
        
        // update migrations table with the new applied migration
        $query = "INSERT INTO $this->migrationTable 
                 ( migration_name, migration_date_applied ) VALUES ( ";
        
        $query .= "'$name', ";
        $query .= "$tm";
        
        $query .= " )";
        
        $this->db->lockTables( $this->migrationTable );
        
        $id = $this->db->insert( $query );
        
        if ( $this->verbose )
        {
            echo 'Migrating: ' . $class . PHP_EOL;
        }
        
        $this->db->unlockTables();
        
        return FALSE !== $id;
    }
406473
private function createMigrationFile($connection, $class)
    {
        // Interate the database file.
        $next_interation = $this->getNextInteration();

        // Create an extension of this migration script in the database/migrations folder.
        $alias_file_name = sprintf('%s_%s_create_%s_table', date('Y_m_d'), str_pad($next_interation, 3, '0', STR_PAD_LEFT), $this->argument('dataset'));
        $alias_file = sprintf('%s/%s.php', base_path('database/migrations'), $alias_file_name);
        $alias_class = sprintf('Create%sTable', studly_case($this->argument('dataset')));

        $class_name = preg_replace('/.*\\\\/', '', $class);

        // Generate contents for database file.
        $contents = sprintf("<?php\n\nuse %s as SourceTable;\n\nclass %s extends SourceTable\n{\n\tprotected $connection = '%s';\n\n}\n", $class, $class_name, $connection);

        // Add the migration to the tracking table.
        file_put_contents($alias_file, $contents);

        // Update the migrations table.
        DB::connection(config('database.default'))->unprepared(sprintf("INSERT INTO migrations SET migration='%s',batch=(SELECT max(batch)+1 FROM (SELECT batch FROM migrations) AS source_batch)", $alias_file_name));
    }
34180
private function _deleteMigrationRecord( $class )
    {
        $name = $this->db->prepareString( $class );
        
        $query = "DELETE FROM $this->migrationTable WHERE migration_name = '$name'";
        
        $this->db->lockTables( $this->migrationTable );
        
        $result = $this->db->execute( $query );
        
        if ( $this->verbose )
        {
            echo 'Deleting: ' . $class . PHP_EOL;
        }
        
        $this->db->unlockTables();
        
        return $result === 1;
    }
353728
public static function autoload($class)
    {
        if (0 === strpos($class, 'Bitpay\\')) {
            $classname = substr($class, 7);

            $file = __DIR__.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $classname).'.php';

            if (is_file($file) && is_readable($file)) {
                require_once $file;

                return true;
            }

            throw new \Exception(sprintf('Class "%s" Not Found', $class));
        }
    }
1087818
public function addClass($class)
    {
        if (isset($this->attr['class'])) {
            $classes = explode(' ', $this->attr['class']);
            if (!in_array($class, $classes)) {
                $classes[] = $class;
            }

            $this->attr['class'] = implode(' ', $classes);
        } else {
            $this->attr['class'] = $class;
        }
    }
116618
public function autoload($class)
    {
        if ($this->_collectClasses) {
            $this->_arrLoadedClasses[self::$_scope][] = $class;
        }

	    $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class)));

	    if ($this->_isIncludePathDefined) {
            $classFile =  COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class;
        }

        $classFile.= '.php';

        if (stream_resolve_include_path($classFile)) {
            return include $classFile;
        }

        $classFile = ltrim($this->classToFile($class) . '.php', '\\/');
	    if (stream_resolve_include_path($classFile)) {
		    return include $classFile;
	    }

        return false;
    }
1214412
public function patchable($class)
    {
        $args = func_get_args();
        $self = isset($this) ? $this : get_called_class();
        if ($pointcut = Pointcut::before(__METHOD__, $self, $args)) {
            return $pointcut($args, $self);
        }
        return true;
    }
21263
public function loadClass( $class ) {

		if ( ! isset( $this->class_map[ $class ] ) )
			return FALSE;

		return $this->loader->loadFile( $this->class_map[ $class ] );
	}
1122284
protected function activateGroupAction($class)
    {
        $users = $class::whereIn('id', $this->request->id)->get();
        foreach($users as $user) {
            $this->setModel($user);
            $this->activationComplete();
        }
        return true;
    }
761272
public function addClass($class)
    {
        if (is_array($class)) {
            foreach ($class as $c) {
                $this->addClass($class);
            }

            return $this;
        }
        $this->template->append('class', ' '.$class);

        return $this;
    }
671268
protected function createMigration($class)
    {
        // since Yii 2.0.12 includeMigrationFile() exists, which replaced the code below
        // remove this construct when composer requirement raises above 2.0.12
        if (method_exists($this, 'includeMigrationFile')) {
            $this->includeMigrationFile($class);
        } else {
            $class = trim($class, '\\');
            if (strpos($class, '\\') === false) {
                $file = $this->migrationPath . DIRECTORY_SEPARATOR . $class . '.php';
                require_once($file);
            }
        }

        return new $class(['db' => $this->db, 'compact' => isset($this->compact) ? $this->compact : false]);
    }
1168840
private function loadAssetsManager($class)
    {
        if (isset($this->assetsMergerInstances[$class])) {
            return true;
        }

        $merger = $this->objectsFactory->buildAssetsMerger($class, $this->loadedConfigurator);

        if ($merger === false) {
            $this->loadedLogger->warning('Could not load ' . $class . ' merger.');

            return false;
        }

        $this->assetsMergerInstances[$class] = $merger;
        $this->loadedLogger->debug('Assets merger ' . $class . ' found & loaded.');

        return true;
    }
180599
public function loadClass($class)
    {
        foreach (spl_autoload_functions() as $func) {
            if (is_array($func) && $func[0] === $this) {
                continue;
            }
            $this->classList->push($class);
            if (call_user_func($func, $class)) {
                break;
            }
        }

        $this->classList->next();

        return true;
    }
642408
public function loadClass($class)
    {
        if (strpos($class, self::ANNOTATION_NAMESPACE) === 0) {
            $class = str_replace(self::ANNOTATION_NAMESPACE, '', $class);

            $file = __DIR__ . '/' . $class . '.php';
            if (file_exists($file)) {
                require_once $file;

                return true;
            }
        }
    }
39241
public static function autoload($class)
  {
    if(substr($class, 0, strlen(__CLASS__)) != __CLASS__) return;

    try
    {
      self::loadClass($class);

      return TRUE;
    }
    catch(Exception $e)
    {
      return FALSE;
    }
  }
256095
public function addClass($class)
    {
        if (! $this->hasClass($class)) {
            $this->set('class', trim((string) $this->get('class') . ' ' . $class));
        }

        return $this;
    }
793392
public function loadClass(string $class): ?bool
    {
        if ($file = $this->findFile($class)) {
            _includeClassFile($file);
            return true;
        }

        return null;
    }