phalcon | Whoops 2 provider for Phalcon | Model View Controller library
kandi X-RAY | phalcon Summary
kandi X-RAY | phalcon Summary
The provider uses the default Phalcon DI unless you pass a DI instance into the constructor.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of phalcon
phalcon Key Features
phalcon Examples and Code Snippets
Community Discussions
Trending Discussions on phalcon
QUESTION
I need to initialize new class Safe with constructor call.
The way it works:
...ANSWER
Answered 2022-Apr-01 at 16:51What about the namespace? if you are using an IDE it may have deleted the namespace. Check that.
Regards
QUESTION
When I run a simple project with Phalcon, It is Ok. But I'm going to run another Phalcon project that wrote by another person but I get an error: Fatal error: Declaration of Core\Config::toArray() must be compatible with Phalcon\Config::toArray(): array in C:\xampp\htdocs\phalcon\phalcon\apps\Core\Config.php
I searched a lot but could not solve this problem.
Core\Config code:
...ANSWER
Answered 2022-Mar-30 at 04:07Your issue is only partially related to Phalcon. The error itself is a sub error of PHP directly. https://3v4l.org/F8EfM
QUESTION
I installed Phalcon PHP version 5.0.0beta3 in my Ubuntu, because it's compatible with PHP 8.0, but when I run my application some Phalcon classes are not found, I already installed the psr module using the following command:
...ANSWER
Answered 2022-Mar-25 at 02:59Phalcon 5 has a number of backwards incompatible changes. Most prominent is all the classes in the base Phalcon namespace were moved to more accurate locations.
- Phalcon\Config -> Phalcon\Config\Config
- Phalcon\Di -> Phalcon\Di\Di
Etc
Check the release notes at https://github.com/phalcon/cphalcon/blob/master/CHANGELOG-5.0.md for specific changes.
QUESTION
I'm using a docker setup with php 8.0.15 + phalcon 5.0.0beta2 and i'm trying to do a simple post request using the fetch api to a route.
...ANSWER
Answered 2022-Mar-02 at 12:32The documentation for Phalcon's Request object explains that it is primarily a wrapper around PHP's native "superglobals", such as $_POST
. In particular:
The $_POST superglobal contains an associative array that contains the variables passed to the current script via the HTTP POST method when using
application/x-www-form-urlencoded
ormultipart/form-data
as the HTTPContent-Type
in the request. You can retrieve the data stored in the array by calling thegetPost()
method
Note that important caveat that this array is only populated when using two specific content types - specifically, the two content types that browsers use when submitting HTML forms. Form processing is the original task PHP was built for, and it can handle things like file uploads; but it doesn't natively do anything with JSON, XML, or other input types.
(As an aside, that documentation is subtly wrong: despite its name, $_POST
will be populated for any HTTP method with an appropriate request body, e.g. PUT
, just as $_GET
is populated even when the method is POST
.)
In your request, you're not using those content types, because you're posting a JSON string, so PHP doesn't populate $_POST
, and Phalcon doesn't have anything to read with getPost()
.
As you've discovered, there's a separate method which allows you to decode the JSON body to a PHP array:
getJsonRawBody(): Gets decoded JSON HTTP raw request body
There's no mention of JSON at all in the Phalcon 3.4 Request documentation so I'm not sure whether that functionality has changed, you've misremembered, or you were using some additional plugin or configuration.
The REST tutorial shows usage of getJsonRawBody()
in both the 5.0 version and the 3.4 version.
QUESTION
I'm using Phalcon v.4 and I have seen that are two ways to create the session inside a controller:
...ANSWER
Answered 2021-Oct-26 at 11:46if you created your project using phalcon's cli devtools then the session service would be created by default in app/config/services.php
that being said in your controller when you access the instance's property session
aka $this->session
this would look for a service called session
and by default it would setup session using file adapter and starts it and $this->session
would return an instance of Phalcon\Session\Manager
QUESTION
I need help with my rhyme; Working in Robo3T db.getCollection('aa').find({aa_id: ObjectId('5f10f1c013d7c9e017000033'),loai: 'mamnon'})
In phalcon not working
...ANSWER
Answered 2021-Jul-04 at 13:09Can you just remove new
and try?
QUESTION
I have millions of customers and when I use left join and then I sort by a column it takes 4-5sec here is my query:
...ANSWER
Answered 2021-Jun-30 at 23:38An explanation...
Your faster query can find the 10 rows before looking in documents
. So, it needs only 10 probes into that table.
In the original query, the Optimizer was not too smart. It planned to execute the query as if there were no LIMIT
. Instead, it decided to optimizer the join to documents
by fetching the entire table into the "join buffer" into RAM and built a hash index into it. While this would help some queries like yours, it was a big waste for the mere 10 rows that you needed.
So, your reformulation convinced the Optimizer to do it a better way.
If you had needed only one column from d
, there is another way:
QUESTION
I followed those step to install phalcon on my mac m1, my php version is 7.4.20
step1: brew tap tigerstrikemedia/homebrew-phalconphp
step2: brew install php72-phalcon
step3: add this line to php.ini
...ANSWER
Answered 2021-Jun-19 at 09:50The "72" in "php72-phalcon" refers to PHP 7.2, but you are using PHP 7.4, so it's not going to be compatible - extensions need to be built against the correct version of PHP in order to run. The version of Phalcon it's installing (3.4.2) is also out of date, because that was the last version supported on that version of PHP.
The instructions for installing Phalcon 4.0 on a Mac are here: https://docs.phalcon.io/4.0/en/installation#macos
They refer to a different homebrew repository:
QUESTION
I'm new to phalcon and I'm having issues with phalcon dev tool commands.
When I type phalcon serve
I get the following error.
ANSWER
Answered 2021-Jun-13 at 10:59The issue was that I did not install phalconphp dev tools properly in the first place. I had multiple versions of php installed on my machine. So I uninstalled all unwanted versions of php and stuck with php7.2 and reinstalled phalcon and the dev-tools and everything worked fine.
Leaving it out there for someone in the future.
QUESTION
I'm trying to implement Sentry in our application.
I've used sentry/sdk
but got some errors (probably due to some PHP settings), so I'm now trying to switch the transport method.
I removed sentry/sdk
from my composer.json file and replaced it with sentry/sentry
and php-http/guzzle7-adapter
. Please note that in the documentation, they use the guzzle6-adapter
, but that gave dependency errors (I was already using "guzzlehttp/guzzle": "^7.3"
, so I need to use version 7).
When now trying to initialize Sentry, I get the following error:
...ANSWER
Answered 2021-May-26 at 14:23The docs are incorrect at the moment and reference the old dependencies required.
In case that you want to use Guzzle the following should work:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install phalcon
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page