Giter VIP home page Giter VIP logo

php-crud-admin's Introduction

PHP-CRUD-ADMIN

A database admin interface for MySQL, PostgreSQL or SQL Server in a single file PHP script.

PHP-CRUD-ADMIN screenshot

Requirements

  • PHP 7.0 or higher with PDO drivers for MySQL, PgSQL or SqlSrv enabled

Installation

This is a single file application! Upload "admin.php" somewhere and enjoy!

For local development you may run PHP's built-in web server:

php -S localhost:8080

Test the script by opening the following URL:

http://localhost:8080/admin.php/

Don't forget to modify the configuration at the bottom of the file.

Configuration

Use the 'api' config parameter to configure the embedded PHP-CRUD-API.

These are the most important 'api' configuration options and their default value between brackets:

  • "driver": mysql, pgsql or sqlsrv (mysql)
  • "address": Hostname of the database server (localhost)
  • "port": TCP port of the database server (defaults to driver default)
  • "username": Username of the user connecting to the database (no default)
  • "password": Password of the user connecting to the database (no default)
  • "database": Database the connecting is made to (no default)

For more information check out the PHP-CRUD-API documentation.

Compilation

You can install all dependencies of this project using the following command:

php install.php

You can compile all files into a single "ui.php" file using:

php build.php

NB: The install script will patch the dependencies in the vendor directory for PHP 7.0 compatibility.

Development

You can access the non-compiled code at the URL:

http://localhost:8080/src/admin/column/posts/list

The non-compiled code resides in the "src" and "vendor" directories. The "vendor" directory contains the dependencies.

Updating dependencies

You can update all dependencies of this project using the following command:

php update.php

This script will install and run Composer to update the dependencies.

NB: The update script will patch the dependencies in the vendor directory for PHP 7.0 compatibility.

Local or remote API

This script is powered by PHP-CRUD-API and embeds this project. Alternatively, it can run against a remote (live) installation.

If you want to run this against a remote installation, then replace the 'api' config parameter with one called 'url' that holds the base URL of your PHP-CRUD-API installation.

php-crud-admin's People

Contributors

mevdschee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-crud-admin's Issues

BUG or entry error?

Created a 13 digit integer field and it appears as having 11 digit (length) inside phpmyadmin

Any reasons why?

Regards

A way to automatic create pivotal table.

First, thanks in advance for your hard work and dedication you on these project, I'm in love with it. I was looking for a way that's we can create relationship like hasMany or belongsToMany and then automatically on background create pivotal table for such relations. It's not an issue but a request, Please can you assist me to achieve such functionality?

Not aligned with latest changes

I get:

[Wed Oct 05 17:45:05.680250 2022] [proxy_fcgi:error] [pid 42355] [client 127.0.0.1:34326] AH01071: Got error 'PHP message: PHP Fatal error:  Declaration of Tqdev\\PhpCrudApi\\Database\\LazyPdo::query(string $statement): PDOStatement must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false in /home/www/php-crud-admin/admin.php on line 6660', referer: http://localhost/php-crud-admin/

Looking at the code the componets and the build aren't updated with the latest changes of the original project.

Error when $_SERVER['PATH_INFO'] is not set

I get the
error code: 1000 message: Route '' not found
after debuging I found that the error happens when $_SERVER['PATH_INFO'] is not set.
On my shared hoster (1und1) it's that case. I have a $_SERVER['ORIG_PATH_INFO'] instead.
So I can only fix it if I set the config option 'basePath' => '/admin.php'
I have the feeling this is a bug - or at least it should be mentioned in blinking red in the documentation that you should set the basePath

Rewrite required

Looking at what is printed the urls in the admin ui:

<li><a href="{{base}}/admin/table/list">home</a></li>

But the readme doesn't mention that is required a URL rewriting for the file and that will ignore the folder where the project is.

Example:

http://localhost/php-crud-admin/admin.php/table/list

Generate:

error
code:

1000
message:

Route '/table/list' not found

But http://localhost/php-crud-admin/admin.php/ I get the list of tables but the links are http://localhost/admin/column/mytable/list.

Fatal Error, must be array

Hi,

It's been a long time I didn't touch php. Please bear with me :)
When I run php build.php or access it with browser I always get:

Fatal error: Uncaught TypeError: Argument 1 passed to Tqdev\PhpCrudAdmin\Column\DefinitionService::makeNamed() must be of the type array, null given, called in /var/www/html/admin.php on line 11372 and defined in /var/www/html/admin.php:11379 Stack trace: #0 /var/www/html/admin.php(11372): Tqdev\PhpCrudAdmin\Column\DefinitionService->makeNamed(NULL) #1 /var/www/html/admin.php(11338): Tqdev\PhpCrudAdmin\Column\DefinitionService->optimizeDatabase(Array) #2 /var/www/html/admin.php(12277): Tqdev\PhpCrudAdmin\Column\DefinitionService->__construct(Object(Tqdev\PhpCrudAdmin\Client\CrudApi)) #3 /var/www/html/admin.php(12429): Tqdev\PhpCrudAdmin\Admin->__construct(Object(Tqdev\PhpCrudAdmin\Config)) #4 {main} thrown in /var/www/html/admin.php on line 11379

While php install.php worked fine:

php install.php
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 8 installs, 0 updates, 0 removals
  - Downloading psr/http-message (1.0.1)
  - Downloading psr/http-server-handler (1.0.1)
  - Downloading psr/http-server-middleware (1.0.1)
  - Downloading psr/http-factory (1.0.1)
  - Downloading nyholm/psr7-server (0.3.0)
  - Downloading php-http/message-factory (v1.0.2)
  - Downloading nyholm/psr7 (1.2.1)
  - Downloading mevdschee/php-crud-api (v2.5.4)
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing psr/http-server-handler (1.0.1): Extracting archive
  - Installing psr/http-server-middleware (1.0.1): Extracting archive
  - Installing psr/http-factory (1.0.1): Extracting archive
  - Installing nyholm/psr7-server (0.3.0): Extracting archive
  - Installing php-http/message-factory (v1.0.2): Extracting archive
  - Installing nyholm/psr7 (1.2.1): Extracting archive
  - Installing mevdschee/php-crud-api (v2.5.4): Extracting archive
Generating autoload files
6 files patched in 7 ms

I have
PHP 7.2.27 (cli) (built: Feb 1 2020 21:06:44) ( NTS )
running within a container (debian 10.2).
A MariaDB is running in another container.
Adminer container accesses it fine.

Any idea?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.