RUN Once

@return array
350027
public function runOnce()
    {
        $this->startProfiling();

        $result = parent::run(true);

        $this->endProfiling('selectOnce', $result);
        $this->clearParams();

        return $result;
    }
915664
public function run()
	{
		if ( $this->description )
			touch( $this->mutexPath() );

		try
		{
			UniversalBuilder::call( $this->callback, $this->parameters )
		}
		finally
		{
			$this->removeMutex();
		}

		parent::callAfterCallbacks();

		return $response;
	}
1175251
def run_once():
    
    if _debug: run_once._debug("run_once")
    global taskManager, deferredFns

    # reference the task manager (a singleton)
    taskManager = TaskManager()

    try:
        delta = 0.0
        while delta == 0.0:
            # get the next task
            task, delta = taskManager.get_next_task()
            if _debug: run_once._debug("    - task, delta: %r, %r", task, delta)

            # if there is a task to process, do it
            if task:
                taskManager.process_task(task)

            # check for deferred functions
            while deferredFns:
                # get a reference to the list
                fnlist = deferredFns
                deferredFns = []

                # call the functions
                for fn, args, kwargs in fnlist:
                    if _debug: run_once._debug("    - call: %r %r %r", fn, args, kwargs)
                    fn(*args, **kwargs)

                # done with this list
                del fnlist

    except KeyboardInterrupt:
        if _debug: run_once._info("keyboard interrupt")
    except Exception as err:
        if _debug: run_once._exception("an error has occurred: %s", err)
200356
protected function runSeeds()
	{
		foreach($this->getSeeders() as $file) {
			require_once $file;
			$className = basename($file, '.php');
			$this->runSeed($className);
		}
	}
1035439
public function run()
    {
        if (isset(\Yii::$app->cmsMarketplace) && \Yii::$app->cmsMarketplace) {
            \Yii::$app->cmsMarketplace->info;
        }

        if ($this->_isRunning === false && $this->_checkAccess()) {
            $this->_isRunning = true;
            static::$_runningBakcend = $this;

            $event = new Event();
            $this->trigger(self::EVENT_BEFORE_RUN, $event);

            $this->_run();

            $event = new Event();
            $this->trigger(self::EVENT_RUN, $event);
        }

        return $this;
    }
613356
public function run()
    {
        $error = $this->error;
        $output = $this->output;

        return $this->builder->getProcess()->run(
            function ($type, $buffer) use ($error, $output) {
                if ('err' === $type) {
                    if ($error) {
                        $error($buffer);
                    }
                } elseif ($output) {
                    $output($buffer);
                }
            }
        );
    }
1101870
public function run()
    {
        if (request()->ajax()) {
            return $this;
        }
        if (!isset($_SESSION) && php_sapi_name() !== 'cli') {
            session_start();
        }
        $interval = array_get($this->config, 'interval', 5);
        if (isset($_SESSION['last_request_count']) && $_SESSION['last_session_request'] > (time() - $interval)) {
            if (empty($_SESSION['last_request_count'])) {
                $_SESSION['last_request_count'] = 1;
            } elseif ($_SESSION['last_request_count'] < $interval) {
                $_SESSION['last_request_count'] = $_SESSION['last_request_count'] + 1;
            } elseif ($_SESSION['last_request_count'] >= $interval) {
                $this->ban();
                echo response('', 302)->header('Location', array_get($this->config, 'redirect', '/index.html'))->send();
                return app()->abort(302);
            }
        } else {
            $_SESSION['last_request_count'] = 1;
        }
        $_SESSION['last_session_request'] = time();
        return $this;
    }
341938
public function run()
    {
        $documents = $this->repo->findAll();

        if ($predicates = $this->predicate->getAll()) {
            $documents = $this->filter($documents, $predicates);
        }

        if ($this->orderBy) {
            $sorts = array();
            foreach ($this->orderBy as $order) {
                $parts = explode(' ', $order, 2);
                // TODO - validate parts
                $sorts[] = array(
                    $parts[0],
                    isset($parts[1]) && $parts[1] == 'DESC' ? SORT_DESC : SORT_ASC
                );
            }

            $documents = $this->sort($documents, $sorts);
        }

        $totalCount = count($documents);

        if ($this->limit) {
            list($count, $offset) = $this->limit;
            $documents = array_slice($documents, $offset, $count);
        }

        return new Result(array_values($documents), $totalCount);
    }
547293
public static function run()
    {
        if (! isset(self::$instance)) {
            self::$instance = new self();

            self::$instance->setup();
            self::$instance->execute();
            self::$instance->hooks();
            self::$instance->ajax();
        }

        return self::$instance;
    }
10244
public function run()
    {
        $users = [
            [
                'name'     => 'admin',
                'email'    => 'admin@admin.com',
                'password' => 'vercingetorige',
                'role'     => 'admin',
                'enabled'  => 1,
            ],
        ];

        $um = new UserManager();

        foreach ($users as $user) {
            $um->createOrFail($user);
        }

        return 1;
    }
1052992
public function run()
    {
        $running = null;
        do {
            curl_multi_exec($this->_mh, $running);
            $this->_updated = false;
            while ($info = curl_multi_info_read($this->_mh)) {
                $index = false;
                foreach ($this->_requests as $i => $item) {
                    if ($item->curl === $info['handle']) {
                        $index = $i;
                        break;
                    }
                }
                if ($index === false) {
                    throw new \Exception('Curl request not founded in list');
                }
                $request = $this->_requests[$index];
                unset($this->_requests[$index]);

                $content  = curl_multi_getcontent($request->curl);
                $response = curl_getinfo($request->curl);

                curl_multi_remove_handle($this->_mh, $info['handle']);

                if ($info['result'] === CURLE_OK) {
                    $this->onSuccess($request, $response, $content);
                } else {
                    $errCode = $info['result'];
                    $errMsg  = function_exists('curl_strerror') ? curl_strerror($errCode) : "cURL error {$errCode}";
                    $this->onError($request, $response, $content, $errCode, $errMsg);
                }
                $this->onAlways($request, $response, $content);
            }
            curl_multi_select($this->_mh, 1);
        } while ($running>0 || $this->_updated);
    }
51755
def run_once(binding)
      @ivars.clear
      before = binding.instance_variables
      binding.instance_eval(&@block)
      (binding.instance_variables - before).each do |ivar|
        @ivars[ivar] = binding.instance_variable_get(ivar)
      end
    end
106633
public function run()
  {
    while ($this->attempt()) {
      try {
        return call_user_func_array($this->action, $this->arguments);
      } catch (Google_Task_Retryable $exception) {
        $allowedRetries = $exception->allowedRetries();

        if (!$this->canAttmpt() || !$allowedRetries) {
          throw $exception;
        }

        if ($allowedRetries > 0) {
          $this->maxAttempts = min(
              $this->maxAttempts,
              $this->attempts + $allowedRetries
          );
        }
      }
    }
  }
1215267
public function run()
	{
		$this->resultset = $this->connection->select($this->query);
		$this->numFound = $this->resultset->getNumFound();
		$this->results = $this->getResults();
		$this->resultsFacetSet = $this->resultset->getFacetSet();
		return $this;
	}
516913
public function run()
    {
        // check if cron instances is defined
        if (!isset($this->configs['instances']) || !Any::isArray($this->configs['instances'])) {
            return null;
        }

        // get timestamp
        $time = time();
        $log = [];

        // each every one instance
        foreach ($this->configs['instances'] as $callback => $delay) {
            if (((int)$this->configs['log'][$callback] + $delay) <= $time) {
                // prepare cron initializing
                list($class, $method) = explode('::', $callback);
                if (class_exists($class) && method_exists($class, $method)) {
                    // make static callback
                    forward_static_call([$class, $method]);
                    $log[] = $callback;
                }
                // update log information
                $this->configs['log'][$callback] = $time + $delay;
            }
        }

        // write updated configs
        App::$Properties->writeConfig('Cron', $this->configs);
        return $log;
    }
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;
        }
1206674
public function run()
    {
        
        if (!empty($this->request)) {
            foreach ($this->request as $key => $value) {
                $this->_iterate($key, $value);
            }
        }
         
        return $this->getReport();
    }