-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phalcon storage #743
base: develop
Are you sure you want to change the base?
Phalcon storage #743
Conversation
Hey this is really cool! Nice work. Looks like it's essentially an ORM for the models this library uses. A few things:
Does this only work for APIs or can it be used for local PDO as well? |
Hey, I tried to adhere as closely as I could to the PDO Storage code. Could point out some places were I should make the code more consistent with the rest of the library? By boilerplate code, do you mean the model files? Those are needed for the library to function. I don't think there is anyway to get around having those model files. I can tone down the PHPDoc if that helps at all. This library works with PDO inherently. Really, it works with a ton of storage options (MySQL, PostgreSQL, SQLite, and Oracle). |
For reference, here is the Phalcon documentation about the models and how to use them. The other option could be to use PHQL (Phalcon's dialect of SQL) to use in the library instead of all the |
* @param mixed $parameters | ||
* @return OauthUsers | ||
*/ | ||
public function getUser($parameters = null){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brace should be on a new line
Thanks again for your work on this! It would definitely be preferable to only have the single Also, add the Phalcon storage class to BaseTest and it'll receive all the same testing as the rest of the storage classes. |
Even with PHQL, there still needs to be a model class defined for each table, even though it would be significantly cut down (only the public vars would need to be defined and the |
I believe the test is going to fail straight-up right now. I have to add the TravisCI config for Phalcon since it's a PHP extension. Also, it's not compatible with PHP7. |
No need to add them all to the same file! If we need them then we'll keep them. You can skip the tests in PHP7 and add the extension in |
* Added Travis CI installer for Phalcon * Travis CI config for phalcon * Refactored to the corresponding directory for the Phalcon classes * Added phalcon autoload tests * Test test * Get client details test * Init DB for phalcon test * Refactored di connection * More tests * Disabled throwing an exception * Setup methods * Fixed table names * Finalize tests
@bshaffer Hope you enjoyed the holiday! I'm working with one of the Phalcon dev's to get PHP 5.3 build working in Travis CI. Seems to be a travis problem about not installing the Phalcon extension. Otherwise, the tests should work fine. The library will work on any Phalcon 2.x.x and up installation, and that includes PHP >= 5.3 |
This reverts commit f18eb47.
* Added Travis CI installer for Phalcon * Travis CI config for phalcon * Refactored to the corresponding directory for the Phalcon classes * Added phalcon autoload tests * Test test * Get client details test * Init DB for phalcon test * Refactored di connection * More tests * Disabled throwing an exception * Setup methods * Fixed table names * Finalize tests * Min php version set to 5.3.21 * Removed manually setting the phalcon version * Php 5.3.29 for Phalcon Zephir * Added dev packages * using sudo * Installing 2.0.x of phalcon * Removed PHP7 and HHVM from config * Using dynamic table names for the library * Using getShared instead of getRaw * Fixed recursion depth * Using get instead of getShared * Using function * Using special config class * Added special phalcon conf class * Using containerbased infrastructure * Fixed not sending the class in the di * Moved the conf class back to the Phalcon main class
- phpenv config-rm xdebug.ini || return 0 | ||
- composer install --prefer-source --no-interaction | ||
- vendor/bin/install-phalcon.sh 2.0.x | ||
- phpenv config-rm xdebug.ini || return 0 | ||
install: | ||
- composer install --no-interaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is composer install
also in install
? How about you move the phalcon installation to install
instead?
* Using array instead of class * Removed unused PhalconConf class
Stumbling through the documentation, I found that you can use a function instead of a class. This allows the |
Fixed all tests. |
Hi @bshaffer I finally finished the tests and logic for this PR. What do you think about merging? |
Hi, I’ve created an integration between your library and a popular REST framework called Phalcon. I personally use the code that I’ve created in my own API, so I can attest to the fact that it works. I’m doing this to share with everyone else who uses Phalcon. Please consider adding this to your library. I know this would have saved me a huge headache when implementing this into my API.