Jelajahi Sumber

bundle FTTH. vendors

Guillermo Espinoza 8 tahun lalu
induk
melakukan
cf7908647f

+ 23 - 0
.drone.yml

@@ -0,0 +1,23 @@
+services:
+  database:
+    image: mysql:5.5
+    environment:
+      - MYSQL_ROOT_PASSWORD=
+      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
+pipeline:
+  build:
+    image: debian:8.0
+    commands:
+      - echo 'Acquire::http { Proxy "http://200.50.168.30:3142"; };' > /etc/apt/apt.conf.d/01proxy
+      - apt-get update && apt-get install -yq build-essential git unzip php5-cli php5-mysql wget mysql-client
+
+      - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
+      - php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer
+      - php -r "unlink('composer-setup.php');"
+      - echo 'client = Flowdat3-FTTH-Drone-Test' | tee /etc/flowdat.conf
+      - echo 'date.timezone="America/Argentina/Buenos_Aires"' >> /etc/php5/cli/php.ini
+      - yes | mysqladmin -h 127.0.0.1 create flowdat_ftth
+      - composer install
+      - chmod 0777 -R var/logs var/cache var/sessions
+      - php bin/console doctrine:schema:update --force -vvv --env=test
+      - vendor/phpunit/phpunit/phpunit --tap

+ 1 - 1
app/AppKernel.php

@@ -15,7 +15,7 @@ class AppKernel extends Kernel
             new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
             new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
             new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
-            new AppBundle\AppBundle(),
+            new FTTHBundle\FTTHBundle(),
         ];
 
         if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {

+ 1 - 0
app/config/config.yml

@@ -2,6 +2,7 @@ imports:
     - { resource: parameters.yml }
     - { resource: security.yml }
     - { resource: services.yml }
+    - { resource: "@FTTHBundle/Resources/config/services.yml" }
 
 # Put parameters here that don't need to change on each machine where the app is deployed
 # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration

+ 1 - 1
app/config/parameters.yml.dist

@@ -4,7 +4,7 @@
 parameters:
     database_host:     127.0.0.1
     database_port:     ~
-    database_name:     symfony
+    database_name:     flowdat_ftth
     database_user:     root
     database_password: ~
     # You should uncomment this if you want use pdo_sqlite

+ 4 - 3
app/config/routing.yml

@@ -1,3 +1,4 @@
-app:
-    resource: "@AppBundle/Controller/"
-    type:     annotation
+ftth:
+    resource: "@FTTHBundle/Resources/config/routing.yml"
+    prefix:   /
+

+ 6 - 1
composer.json

@@ -27,7 +27,12 @@
         "symfony/polyfill-apcu": "^1.0",
         "sensio/distribution-bundle": "^5.0",
         "sensio/framework-extra-bundle": "^3.0.2",
-        "incenteev/composer-parameter-handler": "^2.0"
+        "incenteev/composer-parameter-handler": "^2.0",
+        "sonata-project/admin-bundle": "^3.12",
+        "sonata-project/doctrine-orm-admin-bundle": "^3.1",
+        "jms/serializer-bundle": "^1.1",
+        "phpunit/phpunit": "5.5.*",
+        "stof/doctrine-extensions-bundle": "^1.2"
     },
     "require-dev": {
         "sensio/generator-bundle": "^3.0",

File diff ditekan karena terlalu besar
+ 2714 - 249
composer.lock


+ 0 - 21
src/AppBundle/Controller/DefaultController.php

@@ -1,21 +0,0 @@
-<?php
-
-namespace AppBundle\Controller;
-
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Symfony\Component\HttpFoundation\Request;
-
-class DefaultController extends Controller
-{
-    /**
-     * @Route("/", name="homepage")
-     */
-    public function indexAction(Request $request)
-    {
-        // replace this example code with whatever you need
-        return $this->render('default/index.html.twig', [
-            'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
-        ]);
-    }
-}

+ 190 - 0
src/FTTHBundle/Entity/ONU.php

@@ -0,0 +1,190 @@
+<?php
+
+namespace FTTHBundle\Entity;
+
+use Doctrine\ORM\Mapping as ORM;
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
+
+/**
+ * @ORM\Table
+ * @ORM\Entity
+ *  @UniqueEntity("ponSerialNumber")
+ */
+class ONU
+{
+    /**
+     * @var int
+     *
+     * @ORM\Column(name="id", type="integer")
+     * @ORM\Id
+     * @ORM\GeneratedValue(strategy="AUTO")
+     */
+    private $id;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(type="string", length=15, nullable=true)
+     */
+    private $ip;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(type="string", length=12, nullable=true)
+     */
+    private $mac;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(type="string", length=11, nullable=true)
+     */
+    private $serialNumber;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(type="string", length=12, nullable=true, unique=true)
+     */
+    private $ponSerialNumber;
+
+    /**
+     * @var int
+     *
+     * @ORM\Column(type="integer")
+     */
+    private $clientId;
+
+
+    /**
+     * Get id
+     *
+     * @return int
+     */
+    public function getId()
+    {
+        return $this->id;
+    }
+
+    /**
+     * Set ip
+     *
+     * @param string $ip
+     *
+     * @return ONU
+     */
+    public function setIp($ip)
+    {
+        $this->ip = $ip;
+
+        return $this;
+    }
+
+    /**
+     * Get ip
+     *
+     * @return string
+     */
+    public function getIp()
+    {
+        return $this->ip;
+    }
+
+    /**
+     * Set mac
+     *
+     * @param string $mac
+     *
+     * @return ONU
+     */
+    public function setMac($mac)
+    {
+        $this->mac = $mac;
+
+        return $this;
+    }
+
+    /**
+     * Get mac
+     *
+     * @return string
+     */
+    public function getMac()
+    {
+        return $this->mac;
+    }
+
+    /**
+     * Set serialNumber
+     *
+     * @param string $serialNumber
+     *
+     * @return ONU
+     */
+    public function setSerialNumber($serialNumber)
+    {
+        $this->serialNumber = $serialNumber;
+
+        return $this;
+    }
+
+    /**
+     * Get serialNumber
+     *
+     * @return string
+     */
+    public function getSerialNumber()
+    {
+        return $this->serialNumber;
+    }
+
+    /**
+     * Set ponSerialNumber
+     *
+     * @param string $ponSerialNumber
+     *
+     * @return ONU
+     */
+    public function setPonSerialNumber($ponSerialNumber)
+    {
+        $this->ponSerialNumber = $ponSerialNumber;
+
+        return $this;
+    }
+
+    /**
+     * Get ponSerialNumber
+     *
+     * @return string
+     */
+    public function getPonSerialNumber()
+    {
+        return $this->ponSerialNumber;
+    }
+
+    /**
+     * Set clientId
+     *
+     * @param integer $clientId
+     *
+     * @return ONU
+     */
+    public function setClientId($clientId)
+    {
+        $this->clientId = $clientId;
+
+        return $this;
+    }
+
+    /**
+     * Get clientId
+     *
+     * @return int
+     */
+    public function getClientId()
+    {
+        return $this->clientId;
+    }
+}
+

+ 2 - 2
src/AppBundle/AppBundle.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace AppBundle;
+namespace FTTHBundle;
 
 use Symfony\Component\HttpKernel\Bundle\Bundle;
 
-class AppBundle extends Bundle
+class FTTHBundle extends Bundle
 {
 }

+ 13 - 0
src/FTTHBundle/Repository/ONURepository.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace FTTHBundle\Repository;
+
+/**
+ * ONURepository
+ *
+ * This class was generated by the Doctrine ORM. Add your own custom
+ * repository methods below.
+ */
+class ONURepository extends \Doctrine\ORM\EntityRepository
+{
+}

+ 3 - 0
src/FTTHBundle/Resources/config/routing.yml

@@ -0,0 +1,3 @@
+ftth_homepage:
+    path:     /
+    defaults: { _controller: FTTHBundle:Default:index }

+ 4 - 0
src/FTTHBundle/Resources/config/services.yml

@@ -0,0 +1,4 @@
+services:
+#    ftth.example:
+#        class: FTTHBundle\Example
+#        arguments: ["@service_id", "plain_value", "%parameter%"]

+ 0 - 18
tests/AppBundle/Controller/DefaultControllerTest.php

@@ -1,18 +0,0 @@
-<?php
-
-namespace Tests\AppBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
-
-class DefaultControllerTest extends WebTestCase
-{
-    public function testIndex()
-    {
-        $client = static::createClient();
-
-        $crawler = $client->request('GET', '/');
-
-        $this->assertEquals(200, $client->getResponse()->getStatusCode());
-        $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
-    }
-}

+ 0 - 0
var/cache/.gitkeep


+ 0 - 0
var/logs/.gitkeep


+ 0 - 0
var/sessions/.gitkeep