Making WordPress.org


Ignore:
Timestamp:
02/25/2016 05:03:19 AM (10 years ago)
Author:
dd32
Message:

Plugin Directory: Switch to using namespaces instead of implemeting them through classnames.
This change introduces an autoloader and relies upon it for most file inclusions, this should encourage us to keep a standard naming schema and writing more component classes going forward.
See #1584

File:
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-geopattern.php

    r2560 r2611  
    11<?php
     2namespace WordPressdotorg\Plugin_Directory;
    23
    34require __DIR__ . '/libs/geopattern-1.1.0/geopattern_loader.php';
    45
    5 class WPorg_Plugin_Geopattern extends \RedeyeVentures\GeoPattern\GeoPattern {
     6/**
     7 * Generates Geopattern icons for Plugins.
     8 *
     9 * @package WordPressdotorg_Plugin_Directory
     10 */
     11class Plugin_Geopattern extends \RedeyeVentures\GeoPattern\GeoPattern {
    612
    713    var $slug; // Hashed to generate pattern
     
    1925
    2026        // Replace the base SVG object with our own, so the dimensions are gettable.
    21         $this->svg = new WPorg_Plugin_Geopattern_SVG();
     27        $this->svg = new Plugin_Geopattern_SVG();
    2228    }
    2329
     
    3844
    3945    public function toSVG( $width = 128, $height = 128 ) {
    40         $this->svg = new WPorg_Plugin_Geopattern_SVG();
     46        $this->svg = new Plugin_Geopattern_SVG();
    4147        $this->generateBackground();
    4248
     
    6975
    7076// The base SVG class doesn't provide functions for getting dimensions, so..
    71 class WPorg_Plugin_Geopattern_SVG extends \RedeyeVentures\GeoPattern\SVG {
     77class Plugin_Geopattern_SVG extends \RedeyeVentures\GeoPattern\SVG {
    7278
    7379    protected $viewbox;
     
    8995
    9096    public function addText( $text, $x, $y, $text_anchor, $style, $args=array() ) {
    91         $element = new WPorg_Plugin_Geopattern_SVGText($text, $x, $y, $text_anchor, $style, $args);
     97        $element = new Plugin_Geopattern_SVGText($text, $x, $y, $text_anchor, $style, $args);
    9298        $this->svgString .= $element;
    9399        return $this;
     
    106112
    107113// Nor does it support text.
    108 class WPorg_Plugin_Geopattern_SVGText extends \RedeyeVentures\GeoPattern\SVGElements\Base {
     114class Plugin_Geopattern_SVGText extends \RedeyeVentures\GeoPattern\SVGElements\Base {
    109115    protected $tag = 'text';
    110116    protected $text;
Note: See TracChangeset for help on using the changeset viewer.