solid-layer / framework Goto Github PK
View Code? Open in Web Editor NEWhttps://www.phalconslayer.com/docs
https://www.phalconslayer.com/docs
Hi, I am the current lead on Class Preloader, and I noticed you're currently using an older version. I'd recommend upgrading to 3.x. Let me know if you need any help with the upgrade. ;)
ErrorException in FlattenException.php line 76: Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\Exception\FlattenException::create() must be an instance of Exception, instance of Error given
This happens because of the changes on error handling that happened on php 7
Hi everyone, I have started used this framework for few weeks and I got an issue that when I use Model::create(), it doesn't auto assign id to my model
For example:
$user = new User();
$user->name = "My name";
$user->create();
echo $user->id; // Result always is "0"
I tried it with raw Phalcon, and got correct id (auto increment) after create
I searched it on google and found this solution, set persistent
=> true in config/database.php
'mysql' => [
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 3306),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'dbname' => env('DB_DATABASE', 'slayer'),
'persistent' => true,
'charset' => env('DB_CHARSET', 'utf8'),
'class' => Phalcon\Db\Adapter\Pdo\Mysql::class,
],
But I think this solution is not the correct approach. Could you please help to show me what I should do?
php brood optimize fails
Could this be fixed quickly ?
Since it's already generating routes with controllers and action, I think it'd be great if we could automatically generate SDK as well.
The way I'd propose is the following:
We know what the client is sending, and what the client will get through the docblocks, we could put in a limitation where people have to create some sort of interface or "model" (not relating to eloquent), which client either passes or gets.
Let's say we have a API for creating Users. We could generate a TypeScript SDK, and user won't have to write any URLs or anything. All user would do is:
import UsersApi from 'my-sdk';
UsersApi.create({
id: null,
first_name: 'Something',
last_name: 'anything but something',
email: '[email protected]'
}).then(data => {
console.info("User created: ", data);
}).catch(err => {
console.error("Something wrong:" , err);
})
We could let users to hook some sort of adapters so they can generate SDK for any language, not just for JavaScript/TypeScript
How I see the flow:
I want a User's creation endpoint:
I define what kind of data will be transferred, implement everything needed, then finally generate the SDK, use it in client's end.
I could send a PR with a rough POC for this one, since I'm not too much into these things, my way might not be the best, but we together can review and discuss about which way would be the best
Clarity\Support\Phalcon\Mvc\Controller
has broken logic for initialization
beforeExecuteRoute method try to call initialize()
but framework should calls this method only once, in your case it could be twice and more.
**The initialize() method is only called if the ‘beforeExecuteRoute’ event is executed with success. This avoid that application logic in the initializer cannot be executed without authorization.
I know in phalcon we can remove the "Controller" suffix, I'm not sure about that in this project, is there anyway I can get the underlying dispatcher and set it? Since we've got pretty good namespace, we really don't have to worry about having a "Controller" suffix! I'm not requesting to remove it, I'm just requesting the option to remove the suffix.
Add functions from this page: laravel helpers
It will be great)
Right now, we are relying on the default way to run the phalcon application. What I am planning is to execute our own dispatcher and re-call all existing events it has.
But we also need to consider about Route Middleware and Controller Middleware.
As of now controllers can return string, view or a response (we can't even return a model, which is shame). Since PHP doesn't support generic type, we don't know return type of controller just by looking at the doc block.
My proposal: if a controller returns something other than view or a string, we wrap it ourselves in a response and return that. Which will allow me to do something like this:
class IUser {
public $name;
public $email;
public $id
}
class Users extends Controller {
/**
* @return IUser
*/
public function getById() {
$user = new IUser();
$user->email = "[email protected]";
$user->name = "Something";
$user->id = 3;
return $user;
}
}
In this case, we have a lot of information right there. Or anything actually, a model, a collection, anything should do.
In order to do this, we'll need to overwrite the handle method of application and should tackle the response type. I do think this handle method is way too long and it should really separate the handling of response separately in a method instead of writing a thousand lines of code (easy to test if we separated two different things to two different methods). Benefit of separating would include user being able to overwrite smaller pieces of component rather than having to overwrite the whole big method.
In master branch, we should have only passing build, need to make all the tests pass :)
Instead provide some functions to set configurations or similar
https://github.com/techpivot/phalcon-ci-installer
It would have saved us from not need work
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.