Skip to content
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

T13578 setup phalcon environment #13628

Merged
merged 231 commits into from
Dec 5, 2018
Merged

T13578 setup phalcon environment #13628

merged 231 commits into from
Dec 5, 2018

Conversation

niden
Copy link
Member

@niden niden commented Dec 4, 2018

Hello!

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the Contributing Guidelines?
  • I have checked that another pull request for this purpose does not exist.
  • I wrote some tests for this PR.

Container base environment for running tests locally.

Thanks

niden added 30 commits November 3, 2018 19:47
* 4.0.x: (33 commits)
  Updated stale to not close issues labelled as bugs
  Use latest Zephir Parser
  [#11608] - Removed unused variables
  [#11608] - Reverting instantiation of the client
  [#11608] - Removed '_' from variables and methods
  [#11608] - Refactoring on the connect to check if the object is already initialized/connected
  [#11608] - Refactoring of the getClient()
  [#11608] - Fixed tabs
  [#11608] - Corrections based on review
  [#10532] - Corrected variable
  [#10532] - Updated changelog
  [#10532] - Added case insensitive column map in model
  [#11608] - Corrected variable name
  [#11608] - Corrected costructor and changelog
  [#11608] - Updated the changelog
  [#11608] - Corrected tests
  [#11608] - Fixed typos
  [#11608] - More corrections
  [#11608] - Modifications to the class; Adjusted tests
  [#11608] - Changed the comparison for the key on save
  ...
Copy link
Contributor

@sergeyklay sergeyklay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I paused at phalcon/db/adapter/pdo/postgresql.zep. I will continue a bit later

CHANGELOG-4.0.md Outdated
- Removed deprecated `Phalcon\Cache/Backend/Xcache`
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Apc`
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Memcache`
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Xcache`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Xcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Xcache`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

CHANGELOG-4.0.md Outdated
- Removed deprecated `Phalcon\Cache/Backend/Memcache`
- Removed deprecated `Phalcon\Cache/Backend/Xcache`
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Apc`
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Memcache`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Memcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Memcache`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

CHANGELOG-4.0.md Outdated
- Removed deprecated `Phalcon\Cache/Backend/Apc`
- Removed deprecated `Phalcon\Cache/Backend/Memcache`
- Removed deprecated `Phalcon\Cache/Backend/Xcache`
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Apc`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Removed deprecated `Phalcon\Mvc/Model/Metadata/Apc`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Apc`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

CHANGELOG-4.0.md Outdated
- Removed deprecated `Phalcon\Annotations/Adapter/Xcache`
- Removed deprecated `Phalcon\Cache/Backend/Apc`
- Removed deprecated `Phalcon\Cache/Backend/Memcache`
- Removed deprecated `Phalcon\Cache/Backend/Xcache`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Removed deprecated `Phalcon\Cache/Backend/Xcache`
- Removed deprecated `Phalcon\Cache\Backend\Xcache`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

CHANGELOG-4.0.md Outdated
- Removed deprecated `Phalcon\Annotations/Adapter/Apc`
- Removed deprecated `Phalcon\Annotations/Adapter/Xcache`
- Removed deprecated `Phalcon\Cache/Backend/Apc`
- Removed deprecated `Phalcon\Cache/Backend/Memcache`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Removed deprecated `Phalcon\Cache/Backend/Memcache`
- Removed deprecated `Phalcon\Cache\Backend\Memcache`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

{
var prefixedKey, cachedContent;

if lifetime < 1 {
throw new Exception("The lifetime must be at least 1 second");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is strange because this method does not use lifetime at all

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this needs to be removed, and it will once we refactor the cache

@@ -45,7 +45,7 @@ class Factory extends BaseFactory
/**
* @param \Phalcon\Config|array config
*/
public static function load(var config) -> <BackendInterface>
public static function load(var config) -> object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I don't think we can change it to the BackendInterface because it inherits from FactoryInterface which is used for other factory classes (say Config, Paginator etc.) If this is not object then we have interface problems in compilation

@@ -80,8 +80,8 @@ class File extends Backend
}

if fetch safekey, options["safekey"] {
if typeof safekey !== "boolean" {
throw new Exception("safekey option should be a boolean.");
if typeof safekey !== "bool" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that typeof returns exactly "bool" not "boolean"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the bool/boolean

if typeof safekey !== "boolean" {
throw new Exception("safekey option should be a boolean.");
if typeof safekey !== "bool" {
throw new Exception("safekey option should be a bool.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we can safely use full type name in the human readable messages, eg bool -> boolean.

@@ -100,7 +100,7 @@ class File extends Backend
/**
* Returns a cached content
*/
public function get(string keyName, var lifetime = null) -> var | null
public function get(string keyName, var lifetime = 1) -> var | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact I can't realize why

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo that I missed. I was trying to correct the interface so changed the lifetime to int but that did not work in the end. This has been corrected.

sergeyklay
sergeyklay previously approved these changes Dec 4, 2018
@niden niden merged commit cc36024 into phalcon:4.0.x Dec 5, 2018
Copy link

@danhunsaker danhunsaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor tweaks?


The testing suite can be run on your own machine. The main dependency is [Codeception][1] which can be installed using [Composer][6]:
The testing suite can be run on your own machine. The only dependencies for running the testing suite or even developing on Phalcon is [nanobox][9]`. Installation instructions for nanobox can be found [here][10]. Also, the main dependency is [Codeception][1] which can be installed using [Composer][6]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is phrased a bit awkwardly... Maybe .... The only dependencies for running the testing suite are [nanobox][9] and [Codeception][1]. Nanobox can also be used for developing Phalcon, and its installation instructions can be found [in the Nanobox documentation][10]. Codeception can be installed using [Composer][6]: or something similar? (also, the [nanobox][9] here isn't rendering as a link...)

@@ -196,3 +214,5 @@ Phalcon Framework Team<br>2017
[6]: http://getcomposer.org
[7]: https://github.com/phalcon/cphalcon/tree/master/tests/_proxies
[8]: https://wiki.archlinux.org/index.php/Environment_variables
[8]: https://nanobox.io/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this link isn't working because it's supposed to be a [9], here?

```sh
# run this command from project root
/app $ composer install --dev --prefer-source
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done automatically via nanobox build, which the first nanobox run will always call...

```bash
/app $ wget --no-clobber -O /opt/gonano/bin/zephir https://github.com/phalcon/zephir/releases/download/0.11.7/zephir.phar
/app $ chmod +x /opt/gonano/bin/zephir
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps are already in the boxfile...

@niden niden deleted the T13578-setup-phalcon-environment branch December 5, 2018 03:11
@niden niden mentioned this pull request Dec 11, 2018
@niden niden added the documentation Documentation required label Apr 9, 2019
@niden niden added 4.0 enhancement Enhancement to the framework testing Tests related issue and removed documentation Documentation required labels Oct 13, 2019
@niden niden removed this from the 4.0.0 milestone Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to the framework testing Tests related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants