Runs the auth garbage collection.

@return array
499870
public function run()
    {
        $res1 = $this->gcPersistent();
        $res2 = $this->gcUserLinks();
        $res3 = $this->gcActive();

        return $res1 && $res2 && $res3;
    }
7821
public function getAuth()
    {
        if ($this->_disabledAuth) {
            return [];
        }
        if ($this->_auth instanceof Closure) {
            $this->_auth = call_user_func($this->_auth, $this);
        }

        return $this->_auth;
    }
944682
public function run() {
        $results = [
            $this->doDelete(),
            $this->doUpdate(),
            $this->doCreate()
        ];
        return array_search(false, $results, true) === false;
    }
460133
public static function permissions(): array
    {
        $aPermissions = parent::permissions();

        $aPermissions['object:browse']  = 'Can browse existing objects';
        $aPermissions['object:create']  = 'Can create new objects';
        $aPermissions['object:delete']  = 'Can delete existing objects';
        $aPermissions['object:restore'] = 'Can restore deleted objects';
        $aPermissions['object:purge']   = 'Can purge deleted objects';
        $aPermissions['bucket:create']  = 'Can create new buckets';

        return $aPermissions;
    }
1288531
public function run() {
    $result = $this->service->accounts->listAccounts();

    print '<h2>Listing of user associated accounts</h2>';
    foreach ($result['items'] as $account) {
      $this->printResult($account);
    }
  }
1197162
protected function _getAuth() {
		if ($this->auth) {
			return $this->auth;
		}

		$authAllow = Cache::read($this->getConfig('allowCacheKey'), $this->getConfig('cache'));
		if (!$authAllow) {
			//TOOD make refactor to collect data at runtime? Should not be necessary if AuthComponent is used properly.
			throw new Exception('Cache for Authentication data not found. This is required for `includeAuthentication` as true. Make sure you enabled TinyAuth.AuthComponent.');
		}

		$this->auth = $authAllow;

		return $authAllow;
	}
1069939
protected function _run()
        {
            $query = $this->_buildSelect();
            $caching_enabled = self::$_config[$this->_connection_name]['caching'];

            if ($caching_enabled) {
                $cache_key = self::_createCacheKey($query, $this->_values, $this->_table_name, $this->_connection_name);
                $cached_result = self::_checkQueryCache($cache_key, $this->_table_name, $this->_connection_name);

                if ($cached_result !== false) {
                    return $cached_result;
                }
            }

            self::_execute($query, $this->_values, $this->_connection_name);
            $statement = self::get_last_statement();

            $rows = [];

            while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
                $rows[] = $row;
            }

            if ($caching_enabled) {
                self::_cacheQueryResult($cache_key, $rows, $this->_table_name, $this->_connection_name);
            }

            // reset One after executing the query
            $this->_values = [];
            $this->_resultColumns = array('*');
            $this->_using_default_resultColumns = true;

            return $rows;
        }
989814
protected function garbageCollect()
	{
		$lifetime = $this->gc_lifetime*60*60;
		$Finder = new \RecursiveDirectoryIterator(dirname($this->dirname),
		      \FilesystemIterator::KEY_AS_FILENAME 
			| \FilesystemIterator::CURRENT_AS_FILEINFO
			| \FilesystemIterator::SKIP_DOTS);
		$now = time();
		/** @var \SplFileInfo $value */
		foreach ( $Finder as $key => $value ) {
			if ( pathinfo($key,PATHINFO_EXTENSION)=='json' && ( $value->getMtime() + $lifetime < $now) ) {
				@unlink($value->getRealPath());
			} elseif($value->isDir() && ( $value->getMtime() + $lifetime < $now)  ){
			    $path = $value->getRealPath();
			    $dir = dir($path);
			    while($f=$dir->read()){
			        if(!in_array($f,['.','..']) && is_file($path.'/'.$f)){
                        @unlink($path.'/'.$f);
                    }
                }
                $dir->close();
                @rmdir($value->getRealPath());
            }
		}
	}
533361
public function run() {
        $results = [
            $this->simulateDelete(),
            $this->simulateUpdate(),
            $this->simulateCreate()
        ];
        
        return array_search(false, $results, true) === false;
    }
805683
public function run()
    {
        Model::unguard();

        // Users
        $users = [
            [
                'first_name' => 'Su',
                'last_name' => 'Acl',
                'email' => 'su@acl.com',
                'password' => bcrypt('123'),
                'superuser' => TRUE,
                'remember_token' => str_random(10),
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s'),
            ],
        ];

        DB::table('users')->insert($users);

        // Roles
        $roles = [
            [
                'name' => 'Admin',
                'description' => 'Admin',
            ],
        ];

        DB::table('roles')->insert($roles);
    }
832651
public function garbageCollect() {
        // Flush cache
        $this->_cellCollection->getCacheData('A1');
        // Build a reference table from images
//        $imageCoordinates = array();
//        $iterator = $this->getDrawingCollection()->getIterator();
//        while ($iterator->valid()) {
//            $imageCoordinates[$iterator->current()->getCoordinates()] = true;
//
//            $iterator->next();
//        }
//
        // Lookup highest column and highest row if cells are cleaned
        $colRow = $this->_cellCollection->getHighestRowAndColumn();
        $highestRow = $colRow['row'];
        $highestColumn = PHPExcel_Cell::columnIndexFromString($colRow['column']);

        // Loop through column dimensions
        foreach ($this->_columnDimensions as $dimension) {
            $highestColumn = max($highestColumn,PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex()));
        }

        // Loop through row dimensions
        foreach ($this->_rowDimensions as $dimension) {
            $highestRow = max($highestRow,$dimension->getRowIndex());
        }

        // Cache values
        if ($highestColumn < 0) {
            $this->_cachedHighestColumn = 'A';
        } else {
            $this->_cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn);
        }
        $this->_cachedHighestRow = $highestRow;

        // Return
        return $this;
    }
74867
public function run()
    {
        $user = $this->getUser(User::STATUS_REGISTERED);
        if (empty($user)) {
            return [
                true,
                Yii::t('podium/flash', 'Sorry! We can not find the account with that user name or e-mail address.'),
                false
            ];
        }
        $user->scenario = 'token';
        $user->generateActivationToken();
        if (!$user->save()) {
            return [true, null, false];
        }
        if (empty($user->email)) {
            return [
                true,
                Yii::t('podium/flash', 'Sorry! There is no e-mail address saved with your account. Contact administrator about reactivating.'),
                true
            ];
        }
        if (!$this->sendReactivationEmail($user)) {
            return [
                true,
                Yii::t('podium/flash', 'Sorry! There was some error while sending you the account activation link. Contact administrator about this problem.'),
                true
            ];
        }
        return [
            false,
            Yii::t('podium/flash', 'The account activation link has been sent to your e-mail address.'),
            true
        ];
    }
1003557
public function localSync()
    {
        $users = Cache::rememberForever('google_app_users', function () {
            return $this->allUsers();
        });

        try {
            foreach ($users as $user) {
                $user = GoogleUser::firstOrCreate([
                    'customerId' => $user->customerId,
                    'kind' => $user->kind,
                    'google_id'=> $user->id,
                    'etag'=> $user->etag,
                    'primaryEmail'=> $user->primaryEmail,
                    'givenName'=> $user->name->givenName,
                    'familyName'=> $user->name->familyName,
                    'fullName'=> $user->name->fullName,
                    'orgUnitPath'=> $user->orgUnitPath,
                    'organizations'=> json_decode($user->organizations),
                    'isAdmin'=> $user->isAdmin,
                    'isDelegatedAdmin'=> $user->isDelegatedAdmin,
                    'lastLoginTime'=> $user->lastLoginTime,
                    'creationTime'=> $user->creationTime,
                    'deletionTime'=> $user->deletionTime,
                    'agreedToTerms'=> $user->agreedToTerms,
                    'password'=> $user->password,
                    'hashFunction'=> $user->hashFunction,
                    'suspended'=> $user->suspended,
                    'suspensionReason'=> $user->suspensionReason,
                    'changePasswordAtNextLogin'=> $user->changePasswordAtNextLogin,
                    'emails'=> json_encode($user->emails),
                ]);
            }
        } catch (\Exception $e) {
            return [
                'completed' => 'false',
                'message' => $e->getMessage()
            ];
        }

        return [
            'completed' => 'true'
        ];
    }
905358
public function run()
    {
        if (User::count() == 0) {
            $role = Role::where('name', 'admin')->firstOrFail();

            User::create([
                'name'           => 'Admin',
                'email'          => 'admin@admin.com',
                'password'       => bcrypt('password'),
                'remember_token' => str_random(60),
                'role_id'        => $role->id,
            ]);
        }
    }
86316
public function run()
    {
        $data = [];

        if ($this->term) {
            $data = $this->query->asArray()->all();
        }

        Yii::$app->response->format = Response::FORMAT_JSON;
        return $data;
    }
451846
public function getDatabaseAuths()
    {
        // define response structure of array
        $data = [
            'routes' => [],
            'apis' => [],
        ];
        // get all auth data
        foreach ((new Query())->select('*')->from('{{%admin_auth}}')->all() as $item) {
            // allocate if its an api or route. More differences?
            if (empty($item['api'])) {
                $data['routes'][] = $item;
            } else {
                $data['apis'][] = $item;
            }
        }

        return $data;
    }
1144236
public function collectGarbage()
    {

        // counter to store the number of removed sessions
        $sessionRemovalCount = 0;

        // iterate over the found session items
        foreach (new \ApcIterator(ApcSessionHandler::APCU_CACHE_TYPE_USER) as $item) {
            // initialize the key
            $key = null;
            // explode the APC item
            extract($item);
            // unpersist the session
            $session = $this->unpersist($key);

            // query whether or not the session has been expired
            if ($this->sessionTimedOut($session)) {
                // if yes, delete the file + raise the session removal count
                $this->delete($key);
                $sessionRemovalCount++;
            }
        }

        // return the number of removed sessions
        return $sessionRemovalCount;
    }