Starts an event.

@param string      $name     The event name
@param string|null $category The event category

@return StopwatchEvent
501858
public function start($name, $category = null)
    {
        return end($this->activeSections)->startEvent($name, $category);
    }
199521
public function getNewActionEvent(string $name = null, $target = null, $params = null): ActionEvent
    {
        if ($name === null) {
            $name = 'action_event';
        }

        return new DefaultActionEvent($name, $target, $params);
    }
837314
public function set($scope, $category, $name, $value)
    {
        if (is_array($name)) {
            foreach ($name as $rowLabel => $rowValue) {
                $this->set($scope, $category, $rowLabel, $rowValue);
            }
            return;
        }

        $this->changedData[$scope][$category][$name] = $value;

        $currentLanguage = $this->getLanguage();
        if (!isset($this->data[$currentLanguage])) {
            $this->init();
        }
        $this->data[$currentLanguage][$scope][$category][$name] = $value;

        $this->undelete($scope, $category, $name);
    }
1182088
protected function beginBlock($name, $method = null)
    {
        $this->block_stack[] = [$name, $method ?: self::BLOCK_REPLACE];
        ob_start();
    }
398117
public function startMeasure($name, $label = null)
    {
        if ($this->hasCollector('time')) {
            /** @var \Songshenzong\Log\DataCollector\TimeDataCollector $collector */
            $collector = $this->getCollector('time');
            $collector->startMeasure($name, $label);
        }
    }
611742
public function start($name)
    {
        if (\in_array($name, $this->openSlots)) {
            throw new \InvalidArgumentException(sprintf('A slot named "%s" is already started.', $name));
        }

        $this->openSlots[] = $name;
        $this->slots[$name] = '';

        ob_start();
        ob_implicit_flush(0);
    }
1234278
public static function on($name, $callback, $priority = 0)
    {
        if (is_string($name) && is_callable($callback)) {
            if (isset(self::$events[$name]) === false) {
                self::$events[$name] = array();
            }

            self::$events[$name][] = array($callback, $priority);
        }
    }
1036063
public static void start(String name) {
    if (!active) return;

    TimerNode root = new TimerNode(name, System.currentTimeMillis());
    TimerStack stack = (TimerStack) curStack.get();
    if (null == stack) curStack.set(new TimerStack(root));
    else stack.push(root);
  }
663004
protected function transform( string $name, StopwatchEvent $event ): Stopwatch_Record {

		$description = '';

		if ( isset( $this->callbacks[ $name ] ) ) {
			$description = implode( '<br />', $this->formatter->format( $this->callbacks[ $name ] ) );
		}

		return new Stopwatch_Record( $name, $event, $description );
	}
836511
public static function profile($name, array $context = [], $category = 'application'): void
    {
        $data = [
            '_profile_stats' => [
                'startTime' => \microtime(true),
                'startMem'  => \memory_get_usage(),
            ],
            '_profile_start' => $context,
            '_profile_end'   => null,
            '_profile_msg'   => null,
        ];

        $profileKey = $category . '|' . $name;

        if (\in_array($profileKey, self::$keyQueue, 1)) {
            throw new \InvalidArgumentException("Your added profile name [$name] have been exists!");
        }

        self::$keyQueue[] = $profileKey;
        self::$profiles[$category][$name] = $data;
    }
100888
public function startTimer($name, $description = null)
    {
        if (strpos($name, '_') === 0 || $this->enabled()) {
            $this->debugbar['time']->startMeasure($name, $description);
            $this->timers[] = $name;
        }

        return $this;
    }
1166793
public static function on($name, callable $cb, $replace = false)
    {
        if ($replace || !isset(self::$_events[$name])) {
            self::$_events[$name] = $cb;
        }
    }
978384
public void startTimer(String name) {
        StopWatch sw = new StopWatch();
        sw.start();
        STOP_WATCHES.put(name, sw);
    }
181320
public function event($name, $payload = null) {
		$this->log->log("EVENT: $name",  Net_XMPP_XMPPHP_Log::LEVEL_DEBUG);
		foreach($this->eventhandlers as $handler) {
			if($name == $handler[0]) {
				if($handler[2] === null) {
					$handler[2] = $this;
				}
				$handler[2]->$handler[1]($payload);
			}
		}
		foreach($this->until as $key => $until) {
			if(is_array($until)) {
				if(in_array($name, $until)) {
					$this->until_payload[$key][] = array($name, $payload);
					if(!isset($this->until_count[$key])) {
						$this->until_count[$key] = 0;
					}
					$this->until_count[$key] += 1;
					#$this->until[$key] = false;
				}
			}
		}
	}
186664
public function start($name = null, $id = null, \SessionHandlerInterface $handler = null) {
        if (!$this->getId()) {
            if ($name !== null) {
                $this->setName($name);
            }

            if ($id !== null) {
                $this->setId($id);
            }

            if ($handler !== null) {
                $this->setHandler($handler);
            }

            return $this->startSession();
        }
    }
285636
public static function start($name = null) {
		if (! self::isStarted ()) {
			if (isset ( $name ) && $name !== "") {
				self::$name = $name;
			}
			if (isset ( self::$name )) {
				\session_name ( self::$name );
			}
			\session_start ();
		}
	}
624045
public function upload(File $file,$category,$name=""){
      return  $this->storage->upload($file,$category,$name);
    }