#Configuração
- Criei o projeto laravel 5.3
- Adicionei o LDAP : https://github.com/Adldap2/Adldap2-Laravel
No arquivo config/app.php adicionei os providers e a facade necessárias:
Providers
| import { entry as Foo } from 'bar' | |
| function MyFoo (args..., someProp) { | |
| this.someProp = Object.assign({}, Foo.prototype.prop, someProp) | |
| return Foo.call(this, args...) | |
| } | |
| MyFoo.prototype = Foo.prototype |
| const EventListener = { | |
| /** | |
| * Listen to DOM events during the bubble phase. | |
| * | |
| * @param {DOMEventTarget} target DOM element to register listener on. | |
| * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. | |
| * @param {function} callback Callback function. | |
| * @return {object} Object with a `remove` method. | |
| */ | |
| listen (target, eventType, callback) { |
#Configuração
No arquivo config/app.php adicionei os providers e a facade necessárias:
Providers
| #### | |
| # ATENTION: | |
| # Replace all occurences of sandbox with your project's name | |
| # Credits: http://github.com/codecasts/ambientum | |
| #### | |
| # v2 sintax | |
| version: '2' | |
| # Named volumes |
| version: '2' | |
| services: | |
| #------------------------------------------------------------ | |
| # Web server - For live reload and development | |
| # This environment can be used to run npm and node | |
| # commands as well | |
| # Credits: http://github.com/codecasts/ambientum | |
| #------------------------------------------------------------ | |
| dev: |
| //*********************************************** | |
| // ESTABELECIMENTO MODEL | |
| //*********************************************** | |
| <?php | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; |
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: Jorge | |
| * Date: 27/03/2017 | |
| * Time: 13:31 | |
| */ | |
| require 'vendor/autoload.php'; |
| foreach ($tables as $table) | |
| { | |
| // $table->children(0) = primeiro TR | |
| // $table->children(0)->children(0) - primeiro TD | |
| if ($table->children(0)->children(0) != null) | |
| { | |
| // monta o array com as chaves para encontrar as tabelas | |
| // o nome do indice atrelado aos dados obtidos | |
| // e a função que é chamada para obter os dados de cada seção | |
| //---------------------------------------------------------------- |
| // metodo pra obter os dados do estabelecimento | |
| function getIdentificacao($table) | |
| { | |
| $table = $table->nextSibling(); | |
| $identificacao = []; | |
| foreach ($table->children() as $tr) { | |
| // monta as $keys de origem de dados | |
| $keys = [ |
| function getCooperativas($table) | |
| { | |
| $coopTable = $table->nextSibling(); | |
| //percorre até a próxima tabela | |
| do | |
| { | |
| $coopTable = $coopTable->nextSibling(); | |
| } while($coopTable->tag != "table"); |