profile
viewpoint
Mauro Bonfietti maurobonfietti Argentina

maurobonfietti/rest-api-slim-php 142

Example of REST API with Slim PHP Framework.

maurobonfietti/slim4-api-skeleton 48

Useful skeleton for RESTful API development with PHP and Slim 4.

maurobonfietti/slim4-api-skeleton-crud-generator 9

CRUD Generator for Slim 4 - Api Skeleton. WorkInProgress :-)

maurobonfietti/slim4-soccer-api-demo 8

RESTful API demo that allow you to manage soccer teams and players.

maurobonfietti/social 7

A simple social media using MEAN Stack. Frontend: Angular 6.

maurobonfietti/rest-api-slim-php-web-app 2

To-Do List WebApp. Frontend: Angular. WorkInProgress :-)

maurobonfietti/social-back 2

A simple social media using MEAN Stack. Backend: MongoDB, Express and Node.js.

maurobonfietti/soccer-player-api 1

Tiny RESTful API using Node.js: allows you to manage soccer players.

maurobonfietti/SQL-training-advanced 1

SQL-training-advanced

startedmaurobonfietti/rest-api-slim-php

started time in 3 days

created repositoryunclebob/covid_analysis

created time in 3 days

startedmaurobonfietti/rest-api-slim-php

started time in 4 days

startedmaurobonfietti/slim4-api-skeleton

started time in 4 days

fork rodolf0/notecalc3

NoteCalc is a handy calculator trying to bring the advantages of Soulver to the web.

https://bbodi.github.io/notecalc3/

fork in 5 days

startedbbodi/notecalc3

started time in 5 days

fork yyx990803/postcss-modules

PostCSS plugin to use CSS Modules everywhere

fork in 6 days

fork yyx990803/postcss

Transforming styles with JS plugins

https://postcss.org

fork in 6 days

MemberEvent

issue openedmaurobonfietti/rest-api-slim-php

Adding Port Setting

Hi, This is an awesome job, thank you so much. In my case the mysql server isn't running on the default port, I had to tweak the code a bit to allow for an additional setting.

in .env: DB_PORT='3308'

in extras/bin/restart-db.php: $dsn = "mysql:host=${hostname};port=${port};charset=utf8"; $pdo = new PDO($dsn, $username, $password);

in src/app/dependencies.php: $port = $db['port']; $dsn = sprintf('mysql:host=%s;dbname=%s;port=%s;charset=utf8', $db['hostname'], $db['database'], $db['port']);

Thanks again for this great project.

created time in 9 days

startedmaurobonfietti/rest-api-slim-php

started time in 9 days

fork Coboy16/rest-api-slim-php

Example of REST API with Slim PHP Framework.

http://bit.ly/2DdwKkd

fork in 10 days

startedvueComponent/ant-design-vue

started time in 10 days

startedservo/servo

started time in 11 days

fork fabpot/symfony-docker

A Docker-based installer and runtime for Symfony. Install: download and `docker-compose up`.

https://dunglas.fr

fork in 11 days

fork vbuterin/eth2-das

Eth2 data availability sampling - Testground plan

fork in 14 days

startedmaurobonfietti/rest-api-slim-php

started time in 15 days

issue closedmaurobonfietti/slim4-api-skeleton

How to handle with exceptions?

Hello do you have any example for exceptions?

im using this code buts its not catching the ReportsException its catching the pdo exception on the first $statement->execute(); when i force a SQLSTATE[23000]: Integrity constraint violation error

 public function create(object $boletins)
    {
        try {
            $this->getDb()->beginTransaction();

            $query = 'INSERT INTO `reports` (`id`) VALUES (:id)';
            $statement = $this->getDb()->prepare($query);
            $statement->bindParam('id', $reports->id);
   	
            $statement->execute(); //fails here SQLSTATE[23000]: Integrity constraint violation error

            $id_report = $this->getDb()->lastInsertId();

            foreach ($reports->votes as $vote) {
                $query = 'INSERT INTO `votes` (`id`, id_report) VALUES (:id, :id_report)';
                $statement = $this->getDb()->prepare($query);
                $statement->bindParam('id', $vote->id);
                $statement->bindParam('id', $id_report );
            	$statement->execute();
            }

            $this->getDb()->commit();
            return $this->checkAndGet((int) $id_report);

        } catch(PDOException $e) {
            $this->getDb()->rollBack();
            throw new ReportsException('Error custom',  401);
        }
    }

closed time in 15 days

allandiego

issue commentmaurobonfietti/slim4-api-skeleton

How to handle with exceptions?

Oh true! what a tricky slash thankyou!!

allandiego

comment created time in 15 days

issue openedmaurobonfietti/slim4-api-skeleton

How to handle with exceptions?

Hello do you have any example for exceptions?

im using this code buts its catching the ReportsException its catching the pdo excetion on the first $statement->execute();

 public function create(object $boletins)
    {
        try {
            $this->getDb()->beginTransaction();

            $query = 'INSERT INTO `reports` (`id`) VALUES (:id)';
            $statement = $this->getDb()->prepare($query);
            $statement->bindParam('id', $reports->id);
   	
            $statement->execute();

            $id_report = $this->getDb()->lastInsertId();

            foreach ($reports->votes as $vote) {
                $query = 'INSERT INTO `votes` (`id`, id_report) VALUES (:id, :id_report)';
                $statement = $this->getDb()->prepare($query);
                $statement->bindParam('id', $vote->id);
                $statement->bindParam('id', $id_report );
            	$statement->execute();
            }

            $this->getDb()->commit();
            return $this->checkAndGet((int) $id_report);

        } catch(PDOException $e) {
            $this->getDb()->rollBack();
            throw new ReportsException('Error custom',  401);
        }
    }

created time in 15 days

startedmaurobonfietti/slim4-api-skeleton-crud-generator

started time in 15 days

startedmaurobonfietti/slim4-api-skeleton

started time in 15 days

startedelement-plus/element-plus

started time in 16 days

startedmaurobonfietti/slim4-api-skeleton

started time in 17 days

startedmaurobonfietti/rest-api-slim-php

started time in 17 days

fork laanwj/winit

Window handling library in pure Rust

fork in 18 days

startedpop-os/shell

started time in 19 days

fork larohndale/social

A simple social media using MEAN Stack. Frontend: Angular 6.

fork in 20 days

more