TheSeer\phpDox\Version::getVersion PHP Method

getVersion() public method

public getVersion ( ) : string
return string
    public function getVersion()
    {
        if ($this->version == NULL) {
            $this->version = $this->initialize();
        }
        return $this->version;
    }

Usage Example

Exemplo n.º 1
0
 private function getGeneralBuildInfo()
 {
     if ($this->buildInfo != NULL) {
         return $this->buildInfo;
     }
     $dom = new fDOMDocument();
     $this->buildInfo = $dom->createDocumentFragment();
     $dateNode = $dom->createElementNS(self::XMLNS, 'date');
     $this->buildInfo->appendChild($dateNode);
     $date = new \DateTime('now');
     $dateNode->setAttribute('unix', $date->getTimestamp());
     $dateNode->setAttribute('date', $date->format('d-m-Y'));
     $dateNode->setAttribute('time', $date->format('H:i:s'));
     $dateNode->setAttribute('iso', $date->format('c'));
     $dateNode->setAttribute('rfc', $date->format('r'));
     $phpdoxNode = $dom->createElementNS(self::XMLNS, 'phpdox');
     $this->buildInfo->appendChild($phpdoxNode);
     $phpdoxNode->setAttribute('version', $this->version->getVersion());
     $phpdoxNode->setAttribute('info', $this->version->getInfoString());
     $phpdoxNode->setAttribute('generated', $this->version->getGeneratedByString());
     $phpdoxNode->setAttribute('phar', defined('PHPDOX_PHAR') ? 'yes' : 'no');
     foreach ($this->enrichers as $enricher) {
         $enricherNode = $phpdoxNode->appendElementNS(self::XMLNS, 'enricher');
         $enricherNode->setAttribute('type', $enricher);
     }
     $phpNode = $dom->createElementNS(self::XMLNS, 'php');
     $this->buildInfo->appendChild($phpNode);
     $phpNode->setAttribute('version', PHP_VERSION);
     $phpNode->setAttribute('os', PHP_OS);
     foreach (get_loaded_extensions(true) as $extension) {
         $extNode = $dom->createElementNS(self::XMLNS, 'zendextension');
         $extNode->setAttribute('name', $extension);
         $phpNode->appendChild($extNode);
     }
     foreach (get_loaded_extensions(false) as $extension) {
         $extNode = $dom->createElementNS(self::XMLNS, 'extension');
         $extNode->setAttribute('name', $extension);
         $phpNode->appendChild($extNode);
     }
     return $this->buildInfo;
 }
All Usage Examples Of TheSeer\phpDox\Version::getVersion