/**
  * Parse route parameters in order to populate ApiDoc.
  *
  * @param \Nelmio\ApiDocBundle\Annotation\ApiDoc $annotation
  * @param array $annotations
  * @param \Symfony\Component\Routing\Route $route
  * @param \ReflectionMethod $method
  */
 public function handle(ApiDoc $annotation, array $annotations, Route $route, \ReflectionMethod $method)
 {
     if (!$annotation instanceof \Itkg\ApiDocBundle\Annotation\ApiDoc) {
         return;
     }
     $content = '';
     foreach ($annotation->getResources() as $resource) {
         if (!file_exists($file = sprintf('%s/%s', $this->rootPath, $resource))) {
             throw new NotFoundHttpException(sprintf('Resources file %s does not exist', $file));
         }
         $content .= $this->parser->text(file_get_contents($file));
     }
     $annotation->setResourcesContent($content);
 }
 /**
  * Push in plugin version information to display in the details lightbox
  *
  * @param $false
  * @param $action
  * @param $response
  * @return mixed
  */
 public function setPluginInfo($false, $action, $response)
 {
     // Get plugin & GitHub release information
     $this->initPluginData();
     $this->getRepoReleaseInfo();
     // If nothing is found, do nothing
     if (empty($response->slug) || $response->slug != $this->slug) {
         return false;
     }
     // Add our plugin information
     $response->last_updated = $this->githubAPIResult->published_at;
     $response->slug = $this->slug;
     $response->plugin_name = $this->pluginData["Name"];
     $response->version = $this->githubAPIResult->tag_name;
     $response->author = $this->pluginData["AuthorName"];
     $response->homepage = $this->pluginData["PluginURI"];
     // This is our release download zip file
     $downloadLink = $this->githubAPIResult->zipball_url;
     // Include the access token for private GitHub repos
     if (!empty($this->accessToken)) {
         $downloadLink = add_query_arg(array("access_token" => $this->accessToken), $downloadLink);
     }
     $response->download_link = $downloadLink;
     // We're going to parse the GitHub markdown release notes, include the parser
     require_once plugin_dir_path(__FILE__) . "ParseDown.php";
     // Create tabs in the lightbox
     $response->sections = array('description' => $this->pluginData["Description"], 'changelog' => class_exists("ParseDown") ? ParseDown::instance()->parse($this->githubAPIResult->body) : $this->githubAPIResult->body);
     // Gets the required version of WP if available
     $matches = null;
     preg_match("/requires:\\s([\\d\\.]+)/i", $this->githubAPIResult->body, $matches);
     if (!empty($matches)) {
         if (is_array($matches)) {
             if (count($matches) > 1) {
                 $response->requires = $matches[1];
             }
         }
     }
     // Gets the tested version of WP if available
     $matches = null;
     preg_match("/tested:\\s([\\d\\.]+)/i", $this->githubAPIResult->body, $matches);
     if (!empty($matches)) {
         if (is_array($matches)) {
             if (count($matches) > 1) {
                 $response->tested = $matches[1];
             }
         }
     }
     return $response;
 }
Example #3
0
            echo comment_id();
            ?>
">
                    <div class="wrap">
                        <h2><?php 
            echo comment_name();
            ?>
</h2>
                        <time><?php 
            echo relative_time(comment_time());
            ?>
</time>

                        <div class="content">
                            <?php 
            $Parsedown = new ParseDown();
            ?>
                            <?php 
            echo $Parsedown->text(html_entity_decode(comment_text()));
            ?>
                        </div>

                        <span class="counter"><?php 
            echo $i;
            ?>
</span>
                    </div>
                </li>
                <?php 
        }
        ?>