phpmv / ubiquity Goto Github PK
View Code? Open in Web Editor NEWUbiquity framework
Home Page: https://ubiquity.kobject.net
License: Apache License 2.0
Ubiquity framework
Home Page: https://ubiquity.kobject.net
License: Apache License 2.0
Hello ,I encountered the following problem when i test scafolding->Auth
https://micro-framework.readthedocs.io/en/latest/scaffolding/auth.html
Fatal error: Uncaught Error: Class 'controllers\DAO' not found in C:...\app\controllers\BaseAuthController.php:24 Stack trace: #0
MyBaseAuthController.php
getOriginalURL(); USession::set($this->_getUserSessionKey(), $connected); if(isset($urlParts)){ Startup::forward(implode("/",$urlParts)); }else{ Startup::forward("admin"); } } protected function _connect() { if(URequest::isPost()){ $email=URequest::post($this->_getLoginInputName()); $password=URequest::post($this->_getPasswordInputName()); return DAO::uGetOne(User::class, "email=? and password= ?",false,[$email,$password]); } return; } /** * {@inheritdoc} * @see \Ubiquity\controllers\auth\AuthController::isValidUser() */ public function _isValidUser($action = null) { return USession::exists($this->_getUserSessionKey()); } public function _getBaseRoute() { return 'BaseAuthController'; } /** * {@inheritdoc} * @see \Ubiquity\controllers\auth\AuthController::_getLoginInputName() */ public function _getLoginInputName() { return "email"; } } Admin.phpubiquity is very good framework. but not famous because:
1- The name "Ubiquity" is Not Unique and cute name.
2- The document and guide of it is not enough. we need Video in YouTube and more article.
.
Using the following Nginx conf:
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm;
server_name uniquity.local;
# From the docs: https://micro-framework.readthedocs.io/en/latest/confproject.html
location / {
try_files $uri $uri/ /index.php?c=$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Go to the web root ("/") and $_GET['c'] will not be set causing an error on line \Ubiquity\controllers\Startup:73
If the $_GET['c'] variable is not set, it defaults to '_default'.
Throws a notice error.
Got error when creating a new project with semantic theme only
C:\wamp64\www\ubiquity>Ubiquity new html -a -themes=semantic -b=dsv_ubiquity -s=192.168.0.70 -u=ubiquity -w=ubiquity The html folder already exists ! Would you like to continue ? (y/n) y Files copy... Config files creation... command line arguments : siteUrl='http://127.0.0.1/html/', projectName='html', injections='', cssFiles='', jsFiles='', dbName='dsv_ubiquity', dbType='1', serverName='192.168.0.70', port='3306', user='ubiquity', password='ubiquity', all-models='1', phpmv='', admin='1'
■ warning : Themes installation · The theme 1 does not exists!
Error!: could not find driver<br/> ■ error · Message : Call to a member function query() on null · File : C:\wamp64\www\ubiquity\html\vendor\phpmv\ubiquity\src\Ubiquity\orm\creator\database\DbModelsCreator.php · Line : 34
Creation of new project with semantic theme only
Fatal error
14.04.2019 06.34.23;Object (file) detected;C:\Users\aapav\AppData\Local\Composer\files\phpmv\ubiquity\dc3f6a6ecf8fcd5ed70d65848d49e9f2a2d14023.zip//phpMv-ubiquity-7079bf9/src/tests/files/.travis-copie.yml;C:\Users\aapav\AppData\Local\Composer\files\phpmv\ubiquity\dc3f6a6ecf8fcd5ed70d65848d49e9f2a2d14023.zip//phpMv-ubiquity-7079bf9/src/tests/files/.travis-copie.yml;HEUR:Trojan.Script.Miner.gen
tomorrow August 1
Version 2.3.0 will support connection to multiple databases, in a transparent way (thanks @gildonei for its RFC)
No more need to start the database in the app/config/services.php
file with DAO::startDatabase($config)
.
//The connection is automatically made at the first request to the database.
$user=DAO::getById(User::class,1);
With several databases, the services.php
file must include the instruction DAO::start()
, to allow the framework to determine which base is requested for each model.
A model is defined for a database, using the @database
annotation:
namespace models\accounting;
/**
* @database('accounting')
*/
class Products{
}
You don't have to do it manually since models can be generated automatically, from webtools or devtools, for a specific connection to a database
Database connections are defined in app/config/config.php
:
return array(
"siteUrl"=>"http://127.0.0.1:8090/",
"database"=>array(
"default"=>array(
"type"=>"mysql",
"dbName"=>"uguide",
"serverName"=>"127.0.0.1",
"port"=>3306,
"user"=>"root",
"password"=>"",
"options"=>array(),
"cache"=>false
),
"accounting"=>array(
"type"=>"mysql",
"dbName"=>"accounts",
"serverName"=>"127.0.0.1",
"port"=>3306,
"options"=>array(),
"user"=>"root",
"password"=>"",
"cache"=>false
)
),
Connections can be managed from webtools, without having to directly modify the configuration file:
It is then possible to request the models, without worrying about the connections to the database:
In app/config/services.php
:
DAO::start();
In controllers:
//The connection is automatically made at the first request to the default database.
$user=DAO::getById(User::class,1);
...
//The connection is automatically made at the first request to the accounting database.
$products=DAO::getAll(Products::class);
Classes used only in development (and not in production), such as webtools and devtools, have been moved to the new phpmv/ubiquity-dev repository.
This moving is transparent for the developer.
Attention, in case of optimization of the autoloader for production:
composer install --optimize-autoloader --classmap-authoritative --no-dev
the removal of packages declared in -dev
(of which ubiquity-dev is a part) then prohibits the use of webtools or devtools.
The efficiency of the framework startup has been improved (especially in the Startup
class)
The benchmarks achieved (bench used: Techempower multiple queries x20) show the improvements:
All the database fields mapped as Date / DateTime / Timestamp be converted to PHP DateTime object and all set also require this fields to be a DateTime object
This will take advantage of Localizations, native PHP functions and padronize the variables
Indicate compatibility or improvements in:
A clear and precise use of datetime database fields.
Simply setup a project with a database name that doesn't exist.
An exception be thrown.
A message gets echo'ed and program continues. (See \Ubiquity\db\Database::connect)
Either the following 2 controllers defining the routes bar1, bar2 and bar3:
namespace controllers;
/**
* Controller AController
*/
class AController extends ControllerBase {
public function index() {}
/**
* @route("bar3")
*/
public function bar3() {
echo "bar3";
}
}
namespace controllers;
/**
* Controller BController
*/
class BController extends ControllerBase {
public function index() {}
/**
* @route("bar1","priority"=>500)
*/
public function bar1() {
echo "bar1";
}
/**
* @route("bar2","priority"=>1000)
*/
public function bar2() {
echo "bar2";
}
}
Taking into account the prority, these routes must be registered in order:
The priority applies only within each controller.
Access /Admin/showModel/model.ModelName -> edit a record and all DateTime fields are empty, when it should be field with it's values
DateTime fields to be restored with values
DateTime fields are empty
In the Auth scaffolding section of the guide,
https://micro-framework.readthedocs.io/en/latest/scaffolding/auth.html#id2
Modifying the BaseAuthController controller generates the error:
Declaration of controllers\BaseAuthController::_isValidUser() must be compatible with Ubiquity\controllers\auth\AuthController::_isValidUser($action = NULL)
Developers are not graphic designers, at least not me.
And design is important too.
The current graphic charter is limited to the use of 3 colours:
#4DA0B0
#D39D38
#333333
The Ubiquity title uses the font family Righteous
:
The subtitle: Poiret One
However, Ubiquity does not have a logo,
other than this simple U found on the Internet, which acts as a favicon:
This U should invoke the fundamentals of the framework, performance and ease of use, or simply be esthetic and identifiable.
I therefore appeal to all those of good will who feel like the soul of a graphic designer, to those who have the skills, and to all those who have ideas.
This current U
is pathetic!
PHP Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /Users/ekscrypto/dev/ubiquityProject/vendor/phpmv/php-mv-ui/Ajax/service/JString.php on line 6
Ubiquity serve
a new project
Use any of the UbiquityMyAdmin pages, check the console logs
No deprecation warning visible
strpos warning shown, see above
in webtools:
Same problem with a CRUDController
Clicking on the validate button closes the modal window and submit the form =>database update or add
Clicking on the validate button closes the modal window, without any form submission.
SimpleRestController
Create a native integration with PHP Phinx to generate database sync and throught developement, tests and production servers
Almost all developers have to maintain code and database up-to-date and it includes deploy databases fixes and new features through those different servers.
Indicate compatibility or improvements in:
A easy way to deploy database modifications through different servers
Project on Github - https://github.com/cakephp/phinx
Docs - https://book.cakephp.org/3.0/en/phinx.html
Hi,
I followed the steps to implement the AuthController to the admin interface using the guide.
All is working fine until I saw an error in display.
I did no changes at core files.
In front of the "Logout" button should be the email of currently logged in user.
In my case the password is shown instead ?!
Kind regards,
ndL-1990
Model class:
class User{
/**
* @id
* @column("name"=>"id","nullable"=>false,"dbType"=>"int(11)")
* @validator("id","constraints"=>array("autoinc"=>true))
**/
private $id;
/**
* @column("name"=>"firstname","nullable"=>false,"dbType"=>"varchar(65)")
* @validator("length","constraints"=>array("max"=>65,"notNull"=>true))
**/
private $firstname;
/**
* @column("name"=>"lastname","nullable"=>false,"dbType"=>"varchar(65)")
* @validator("length","constraints"=>array("max"=>65,"notNull"=>true))
**/
private $lastname;
/**
* @manyToOne
* @joinColumn("className"=>"models\\Organization","name"=>"idOrganization","nullable"=>false)
**/
private $organization;
}
Rest controller:
namespace controllers;
/**
* Rest Controller RestUsers
* @route("/rest/users","inherited"=>true,"automated"=>true)
* @rest("resource"=>"models\\User")
*/
class RestUsers extends \Ubiquity\controllers\rest\RestController {
}
installed Ubiquity as stated in guide:
composer global require phpmv/ubiquity-devtools
Expected that command Ubiquity will be globally available
Ubiquity installed to location:
$HOME/.composer/vendor/phpmv/ubiquity-devtools/src/
but it is not added to $PATH so it is not available as in guide.
When specifying full path everything works fine.
Consulting the guide is a good thing to better apprehend a feature. It is also sometimes useful to search in the API.
But nothing is better than a good example directly implemented in a project.
This is the purpose of the repository Ubiquity-demos.
A demo is a project, in which a feature or group of features has been implemented.
If you have started testing Ubiquity, you can also share your examples of code by contributing to Ubiquity-demos
I faithfully followed the quick start of the documentation. Installation occurred smoothly. The server runs smoothly using the "Ubiquity serve" command. But when trying to access the site the console prints this error:
PHP Fatal error: Uncaught Error: Class 'Ajax\php\ubiquity\JsUtils' not found in /home/eduilson/Documents/als/ubiquity/vendor/phpmv/ubiquity/src/Ubiquity/core/Framework.php:87
Ubiquity version output:
PHP 7.2.4-1+b1
Ubiquity devtools (1.2.0)
Ubiquity 2.1.0
I am getting error on Ubiquity Admin, Admin/Model
section
but i have this folder
Maybe need to separate paths, ROOT
with APP_ROOT
inside index.php
file
ROOT
must be document root
APP_ROOT
must be application root
Must find it
Couldn't find it
In URequest.php method getContentType the header field "Content-Type" must be written in lowercase
follow this step by https://micro-framework.readthedocs.io/en/latest/controller/di/index.html#service-injection, but in controller var_dump($this->serviceToInit) is null, so what mistake i make?
yes it's a very good framework, i like it and symfony!
Use the format: [part] Element Should Do X
i.e. [Router] Route requirement should allow to set an integer url parameter
[part] is one of [Views,Controllers,ORM,Router,REST,Config,Git,SEO,UbiquityMyAdmin]
Ubiquity framework x.y.z
Ubiquity devtools x.y.z
php x.y.z
I contacted you by mail with the mail that you put in description of your Github profile.
The next version of ubiquity will introduce some breaking changes.
Some classes have been relocated.
CodeUtils
->Ubiquity\utils\base\CodeUtils
HasModelViewerInterface
->Ubiquity\controllers\crud\interfaces\HasModelViewerInterface
ModelViewer
->Ubiquity\controllers\crud\viewers\ModelViewer
The webtools will no longer be part of the main repository but will be in their own repository:
phpmv/ubiquity-webtools
The purpose of this separation is to optimize Composer autoloading. In production, webtools are not necessarily useful.
This version will therefore be a minor version 2.2.0
and not a patch version 2.1.5
.
Navigate to an inexisting Url
http://127.0.0.1:8090/notExists
a 404 not found error
Fatal error: Uncaught Error: Call to a member function header() on null in ...\vendor\phpmv\ubiquity\src\Ubiquity\controllers\Startup.php on line 32
I would like to suggest the inclusion of new parameters for project creation that will allow to specify siteUrl in config.php and RewriteBase in .htaccess
I always use apache vHosts for all projects, this way I can simulate the real host/domain and rewrite rules properly.
Indicate compatibility or improvements in:
Inclusion of new project creation parâmeters
1 - Define a route with a name and a specific method:
class FooController extends Controller {
/**
*
*@get("foo/bar","name"=>"foo.bar")
*/
public function bar() {}
}
2 - Init router cache
3 - Get the route with its name
Router::getRouteByName('foo.bar')
returns false
In twig:
{{ path('foo.bar') }}
returns an empty string
The associated route
false or an empty string
public function __construct(){
if(!$this->isValid())
$this->onInvalidControl();
$this->view=new View();
}
public function loadView($viewName,$pData=NULL,$asString=false){
if(isset($pData))
$this->view->setVars($pData);
return $this->view->render($viewName,$asString);
}
Enable twig view caching in config.php
"templateEngineOptions"=>array(
"cache"=>true
)
Caching Twig views works!
Fatal error: Uncaught LogicException: Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation. in \ubiquity\vendor\twig\twig\src\Environment.php:274
Allow developers to execute Controller actions on shell, without renders
Shell tasks are a very commom need on projects that need to run routines to update status, reports, consolidate datas, and other stuff.
Indicate compatibility or improvements in:
Be possible to run controller actions through shell or command line without renders and keeping framework funcionalities like ACL and others.
Framework should be able to re-use models actions and framework actions almost like it was being executed on a web broser.
A sample case could be send a Birthday mail for Customers from an e-commerce
in the Ubiquity quick-start project, Index
Controller ct
action
I found the ThemesManager::saveActiveTheme
method will write $activeTheme into config.php
directly, without any filter and check the theme is exist or not.
it will cause error when I send request as http://127.0.0.1:8000/IndexController/ct/bootstrap"
or http://127.0.0.1:8000/IndexController/ct/bootstrap'
or http://127.0.0.1:8000/IndexController/ct/SomeErrorString
ThemesManager::saveActiveTheme
maybe have to filtered the invalid ThemeName string before write into config.php
the config.php
got wrong value of activeTheme
such like :
"templateEngineOptions"=>array(
"cache"=>false,
"activeTheme"=>"bootstrap""
),
or
"templateEngineOptions"=>array(
"cache"=>false,
"activeTheme"=>"bootstrap'"
),
PHP Parse error: syntax error, unexpected '"' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in /app/config/config.php on line 21
or
"templateEngineOptions"=>array(
"cache"=>false,
"activeTheme"=>"SomeErrorString"
),
Tue May 7 07:56:28 2019] PHP Fatal error: Uncaught Exception: View @activeTheme/main/vHeader.html not found! in /vendor/phpmv/ubiquity/src/Ubiquity/views/View.php:75
Stack trace:
#0 /vendor/phpmv/ubiquity/src/Ubiquity/controllers/Controller.php(67): Ubiquity\views\View->render('@activeTheme/ma...', false)
#1 /app/controllers/ControllerBase.php(16): Ubiquity\controllers\Controller->loadView('@activeTheme/ma...')
#2 /vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(143): controllers\ControllerBase->initialize()
#3 /vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(30): Ubiquity\controllers\Startup::runAction(Array, true, true)
#4 /vendor/phpmv/ubiquity/src/Ubiquity/controllers/Startup.php(98): Ubiquity\control in /vendor/phpmv/ubiquity/src/Ubiquity/views/View.php on line 75
· PHP 7.1.27-1+ubuntu18.04.1+deb.sury.org+1
· Ubiquity devtools (1.2.3)
· Ubiquity 2.1.2
Theme support
Reading the docs, I didn't found anything indicating that Ubiquity supports theme layouts, like CakePHP as a sample, Where I can have multiples themes and set the theme to be used on controller and It will render specified view with specific theme.
Indicate compatibility or improvements in:
With theme support, we could develop projects and control design versions or create CMSs where users could choose his own theme to apply to his websites
CakePHP theme support is a good refer to this feature
requirements to add on route annotations : regex for variables
Configuration in app/config/config.php:
<?php
return array(
"siteUrl"=>"http://127.0.0.1/mySite/",
...
In client-side HTML source code, base href should contain siteUrl value
<!DOCTYPE html>
<html>
<head>
<base href="http://127.0.0.1/mySite/">
<meta charset="UTF-8">
base href is blank
<!DOCTYPE html>
<html>
<head>
<base href="">
<meta charset="UTF-8">
in app/config/config.php
, debug mode is deactivated:
"debug"=> false
Logging is initialized in app/config/services.php
:
\Ubiquity\log\Logger::init($config);
Logging is disabled.
The following error is generated
Fatal error: Uncaught Error: Call to a member function _warn() on null in ...\vendor\phpmv\ubiquity\src\Ubiquity\log\Logger.php on line 64
$ Ubiquity new ubiquityProject -a -q=semantic
$ cd ubiquityProject
$ Ubiquity serve
...
· Starting php server at 127.0.0.1:8090...
Using a browser open http://127.0.0.1:8090
In the footer of the page, there should be a link "UbiquityMyAdmin" link that points to: http://127.0.0.1:8090/Admin
In the footer of the page, there is a "UbiquityMyAdmin" link that points to: http://127.0.0.1/ubiquityProject/Admin
These are the business rules:
projects
that are created by developers
(owners).stories
, each assigned to a developer
This corresponds to the following UML diagram:
I want to get the list of projects linked to a developer:
I can get the result in 2 times:
public function created($dev='Evan YOU'){
$projects=DAO::uGetAll(Project::class,'developer.identity= ?',false, [$dev]);
$this->loadDefaultView(compact('projects','dev'));
}
public function created($dev='Evan YOU'){
$projects=DAO::uGetAll(Project::class,'storys.developer.identity= ?',false, [$dev]);
$this->loadDefaultView(compact('projects','dev'));
}
But if I try to get the result in a single query:
public function allParticipations($dev='Evan YOU'){
$projects=DAO::uGetAll(Project::class,'developer.identity= ? OR storys.developer.identity= ?',false,[$dev,$dev]);
$this->loadDefaultView(compact('projects','dev'));
}
I get the following error:
Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'storys.Developer_P5d4315266036b.identity' in 'where clause' in \vendor\phpmv\ubiquity\src\Ubiquity\db\traits\DatabaseOperationsTrait.php on line 79
Module to send authenticated e-mail using SMTP
Almost all if not all websites or web systems have at least one contact form or a feature that needs to send an e-mail to someone.
Indicate compatibility or improvements in:
Be possible to configure (maybe in config.php) e-mail accounts (sender name, sender e-mail, smtp, port, host, encryption method, encoding, other info) and use it to send authenticated e-mails, trying to avoid span and server errors.
Framework could use PHPMailer (https://github.com/PHPMailer/PHPMailer) or have a list of Mailer sender pre-built were developers could choose on framework installation just like they can choose theme and jslib to install on framework
Ability to add support for Tarantool database support. Tarantool is a NoSQL database with support of SQL syntaxes.
Tarantool is both in memory based database as well as in disc memory database. It is also blazing fast and beats Redis in many of the compared benchmarks.
The aim of Ubiquity is to be fast and Ubiquity together with support of Tarantool database would be awesome !
Indicate compatibility or improvements in:
Tarantool has a very high RPS and will boost the performance additionally.
There is a package , https://github.com/tarantool-php/client, which makes it easy to connect to Tarantool and is able to make both NoSQL as well as SQL requests out of the box.
There is also another php package for Tarantool php-mapper which is awesome and supports object models, like Eloquent models, for Tarantool database which could be awesome to use as well.
Regards
In webtools (/Admin)
a click on an element in the page does not activate the corresponding link in main menu:
In a part (/Admin/Controller), reloading the page (F5 key on the keyboard) causes the active menu item to be lost
PHP has long suffered from the lack of standardization and shared standards. PHP-Fig has fixed this, it's a chance!
But the PHP community now tends to move towards the opposite excess, probably traumatized by the previous period.
Any project that does not comply with the PSRs is poorly considered and must be corrected accordingly.
I think that the standards are a guide (a bit like the code for pirates?), providing more flexibility to developers using a project, but that it is allowed, in certain particular cases, not to respect them, under conditions:
What is dangerous is not the choice not to meet a specific standard, but to have none.
A development team working on a project, whether private or even public, always has the right to adopt its own standards!
Ubiquity does not comply with all standards, so it is important to explain the reasons:
see PSR-1: Basic Coding Standard and PSR-2: Coding Style Guide
Ubiquity makes two exceptions to PSR-2:
This choice is not decisive, and it depends on the habits of each one. But it is always possible to visualize the beginning of a class or a method, without seeing the opening brace.
It's easy to put an unnecessary space and not realize it. It's harder not to see a tab.
Tabs allows each developer to adjust the size of the indentation on his workbench.
It is important to remember that compliance with PSR-2 does not make the quality of the code.
see PSR-3: Logger Interface
Ubiquity does not respect the implementation of LoggerInterface
.
This defect will have to be fixed in the future, to allow third party libraries to use the application's Log system.
see PSR-4: Autoloading
Ubiquity complies with PSR-4 specifications for class autoloading:
Ubiquity
namespace corresponds to the src/Ubiquity
folderapp/
see PSR-6: Caching Interface
Ubiquity does not comply with the specifications related to the cache system. This deficiency will probably have to be fixed in the future.
Given the nature and role of the cache system, its compliance with PSR-6 would be discontinued if it had a negative impact on performances.
see PSR-7: Http messages
This is not a non-compliance with the specifications related to HTTP messages interfaces.
It's more of a design choice.
PHP does not have native HTTP Response and Request objects but gives access to the super global $_POST
, $_GET
, $_SERVER
, $_FILES
...
Ubiquity keeps this simplification of PHP, and simply allows easier handling of super globals via URequest
, UResponse
, UCookie
, USession
utility classes.
These classes do not represent Request, Response objects...and only have static methods.
PSR-7 does not have to apply in this case.
Ubiquity derives part of its performance from this compliance with PHP.
If the evolution of PHP led it to provide such objects, Ubiquity would certainly follow it in this direction.
Ubiquity does not have the maturity of other frameworks and there is still a lot to do.
All choices can be discussed,
all contributions are always welcome!
Succefull message
Message : Uncaught mindplay\annotations\AnnotationException: Ubiquity\annotations\TableAnnotation::$0 is not a valid property name in C:\wamp64\www\ubiquity\html\vendor\mindplay\annotations\src\annotations\Annotation.php:29 Stack trace: #0 C:\wamp64\www\ubiquity\html\vendor\phpmv\ubiquity\src\Ubiquity\annotations\BaseAnnotation.php(41): mindplay\annotations\Annotation->__get('0') #1 C:\wamp64\www\ubiquity\html\vendor\mindplay\annotations\src\annotations\AnnotationManager.php(296): Ubiquity\annotations\BaseAnnotation->initAnnotation(Array) #2 C:\wamp64\www\ubiquity\html\vendor\mindplay\annotations\src\annotations\AnnotationManager.php(263): mindplay\annotations\AnnotationManager->getAnnotations('models\\Pessoas', 'class') #3 C:\wamp64\www\ubiquity\html\vendor\mindplay\annotations\src\annotations\AnnotationManager.php(594): mindplay\annotations\AnnotationManager->getAnnotations('models\\Pessoas', 'property', '$id') #4 C:\wamp64\www\ubiquity\html\vendor\mindplay\annotations\src\annotations\Annotations.php(90): mindplay\an
File : C:\wamp64\www\ubiquity\html\vendor\mindplay\annotations\src\annotations\Annotation.php
Line : 29
<?php
namespace controllers;
use Ubiquity\orm\DAO;
/**
* Controller Pessoas
**/
class Pessoas extends ControllerBase
{
property to add on route annotation
to use annotations on the parent class or not
Hello ,
ref as [part] ORM Table annotation #14
I got the
@table("db_table_name")
work for me, but
@table("name"=>"db_table_name")
is not work.
then i found that the TableAnnotation
L22 only check & take the array $properties[0] as annotation name. but missing to check map $properties['name']
when i patch with below it work fine for me
/**
* Initialize the annotation.
*/
public function initAnnotation(array $properties) {
error_log(var_export($properties, true));
/*
array (
'name' => 'db_table_name',
)
*/
if (isset ( $properties [0] )) {
$this->name = $properties [0];
unset ( $properties [0] );
} else if (isset ( $properties ['name'] )) {
$this->name = $properties ['name'];
unset ( $properties ['name'] );
} else {
throw new \Exception ( 'Table annotation must have a name' );
}
}
PHP Fatal error: Uncaught Exception: Table annotation must have a name in /vendor/phpmv/ubiquity/src/Ubiquity/annotations/TableAnnotation.php:27
Stack trace:
#0 /vendor/mindplay/annotations/src/annotations/AnnotationManager.php(296): Ubiquity\annotations\TableAnnotation->initAnnotation(Array)
#1 /vendor/mindplay/annotations/src/annotations/AnnotationManager.php(263): mindplay\annotations\AnnotationManager->getAnnotations('models\\Sys_logs', 'class')
#2 /vendor/mindplay/annotations/src/annotations/AnnotationManager.php(594): mindplay\annotations\AnnotationManager->getAnnotations('models\\Sys_logs', 'property', '$id')
#3 /vendor/mindplay/annotations/src/annotations/Annotations.php(90): mindplay\annotations\AnnotationManager->getPropertyAnnotations('models\\S in /vendor/phpmv/ubiquity/src/Ubiquity/annotations/TableAnnotation.php on line 27
· PHP 7.1.27-1+ubuntu18.04.1+deb.sury.org+1
· Ubiquity devtools (1.2.3)
· Ubiquity 2.1.2
I think would be nice if Ubiquity have a native maintenance mode, that could be activated in config through webadmin or devtools, and when in maitenance, it only allows backend access interface, and in front a page with a maintenance message or similar
All major CMS (WordPress, Joomla, Drupal) have a similar functionality, that allows properly config system without break the front, keeping a maintenance page and maybe an http respose
Indicate compatibility or improvements in:
Visitors of website developed with Ubiquity will see a maintenance page instead of the site while It is setted to be down.
Allow framework to use multiple databases.
Some projects may need to utilize different database connections on same project, so, Ubiquity should allow to configure a "default" database and extra connections.
Indicate compatibility or improvements in:
Be able to connect to different databases
Models must be able to specify wich database will be use. If none was specified, it uses default database connection
config.php
return array(
"siteUrl"=>"http://ubiquity.local",
"database"=>array(
"default" => array(
"type"=>"mysql",
"dbName"=>"database_name",
"serverName"=>"0.0.0.0",
"port"=>3306,
"user"=>"database_user",
"password"=>"database_pswd",
"options"=>array(),
"cache"=>false
),
"extra1" => array(
....
),
),
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.