Skip to content

Commit ee13e2c

Browse files
authored
Merge pull request #1308 from phalcon/3.4.x
3.4.2
2 parents 5ec8a37 + 83a4ad9 commit ee13e2c

File tree

29 files changed

+452
-76
lines changed

29 files changed

+452
-76
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ install:
6060
- if [ "$PHP_MAJOR" == "7" ]; then composer require --dev phpstan/phpstan:^0.9; fi;
6161

6262
before_script:
63-
- ln -s $PWD/phalcon.php ~/bin/phalcon
63+
- ln -s $PWD/phalcon ~/bin/phalcon
6464

6565
script:
6666
- vendor/bin/phpcs

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ cd phalcon-devtools
8686
```
8787

8888
This method requires a little bit more of setup. Probably the best way would be to symlink
89-
the `phalcon.php` to a directory in your `PATH`, so you can issue phalcon commands in each directory
89+
the `phalcon` file to a directory in your `PATH`, so you can issue phalcon commands in each directory
9090
where a phalcon project resides.
9191

9292
```bash
9393
cd phalcon-devtools
94-
ln -s $(pwd)/phalcon.php /usr/bin/phalcon
94+
ln -s $(pwd)/phalcon /usr/bin/phalcon
9595
chmod ugo+x /usr/bin/phalcon
9696
```
9797

9898
If you get a `"phalcon: command not found"` message while creating the symlink, make an alias.
9999

100100
```bash
101-
alias phalcon=/home/[USERNAME]/phalcon-devtools/phalcon.php
101+
alias phalcon=/home/[USERNAME]/phalcon-devtools/phalcon
102102
```
103103

104104
## Usage

box.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"main": "phalcon.php",
2+
"main": "phalcon",
33
"output": "phalcon.phar",
44
"chmod": "0755",
55
"directories": [

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"forum": "https://forum.phalconphp.com/"
2323
},
2424
"require": {
25-
"php": ">=5.5",
25+
"php": ">=5.5 < 7.3.2 || >7.3.3",
2626
"ext-phalcon": "~3.3",
2727
"psy/psysh": "~0.9",
2828
"nikic/php-parser": "^3.1"
@@ -52,5 +52,5 @@
5252
"tests/_support/helpers.php"
5353
]
5454
},
55-
"bin": ["phalcon.php"]
55+
"bin": ["phalcon"]
5656
}

ide/gen-stubs.php

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,44 @@
33
/**
44
* This scripts generates the stubs to be used on IDEs
55
*
6-
* Change the CPHALCON_DIR constant to point to the dev/ directory in the Phalcon source code
6+
* Specify CPHALCON_DIR env variable to point to the dev/ directory in the Phalcon source code
77
*
8-
* php ide/gen-stubs.php
8+
* *nix: CPHALCON_DIR=/path/to/cphalcon/ext/ php ide/gen-stubs.php
9+
* Win: set CPHALCON_DIR=C:\Path\To\cphalcon\ext\ php ide/gen-stubs.php
10+
*
11+
* Alternative stubs generation
12+
*
13+
* cd cphalcon
14+
* zephir stubs
915
*/
1016

1117
if (!extension_loaded('phalcon')) {
1218
throw new Exception("phalcon extension isn't installed");
1319
}
1420

15-
define('CPHALCON_DIR' , '/Users/micate/Code/cphalcon/ext/');
21+
if (getenv('CPHALCON_DIR') === false) {
22+
throw new Exception(<<<TEXT
23+
24+
25+
Specify CPHALCON_DIR env variable
26+
27+
*nix: CPHALCON_DIR=/path/to/cphalcon/ext/ php ide/gen-stubs.php
28+
Win: set CPHALCON_DIR=C:\Path\To\cphalcon\ext\ php ide/gen-stubs.php
29+
1630
17-
if (!file_exists(CPHALCON_DIR)) {
31+
TEXT
32+
);
33+
}
34+
35+
if (!file_exists(getenv('CPHALCON_DIR'))) {
1836
throw new Exception("CPHALCON directory does not exist");
1937
}
2038

39+
/**
40+
* Class Stubs_Generator
41+
*
42+
* @deprecated In version 4.x current class will be removed
43+
*/
2144
class Stubs_Generator
2245
{
2346

@@ -123,7 +146,7 @@ public function getClassDocs()
123146
$versionPieces = explode(' ', $version);
124147
$genVersion = $versionPieces[0];
125148

126-
$api = new Stubs_Generator(CPHALCON_DIR);
149+
$api = new Stubs_Generator(getenv('CPHALCON_DIR'));
127150

128151
$classDocs = $api->getClassDocs();
129152
$docs = $api->getDocs();

ide/phpstorm/phalcon.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@echo off
22

33
set PTOOLSPATH=.
4-
php %PTOOLSPATH%\phalcon.php %*
4+
php %PTOOLSPATH%\phalcon %*

ide/phpstorm/phalcon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if [ -z "$PTOOLSPATH" ]; then
3737
fi
3838

3939
if [ ! -z "$PTOOLSPATH" ]; then
40-
php "$PTOOLSPATH/phalcon.php" $*
40+
php "$PTOOLSPATH/phalcon" $*
4141
else
4242
if [ -n "$ZSH_VERSION" ]; then
4343
echo "Error: Add environment variable PTOOLSPATH to your $HOME/.zsh"

phalcon.php renamed to phalcon

File renamed without changes.

phalcon.bat

Lines changed: 0 additions & 4 deletions
This file was deleted.

phalcon.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ check_install(){
9696
if [ -z "$PTOOLSPATH" ]; then
9797
printf "\n${YELLOW}Phalcon Developer Tools Installer${NC}"
9898
printf "\n"
99-
printf "\n${PURPLE}Make sure phalcon.sh is in the same dir as phalcon.php${NC}"
99+
printf "\n${PURPLE}Make sure phalcon.sh is in the same dir as phalcon file${NC}"
100100
printf "\n${PURPLE}and that you are running this with sudo or as root.${NC}"
101101
printf "\n"
102102
printf "\nInstalling Devtools..."
@@ -147,5 +147,5 @@ init
147147

148148
if check_install; then
149149
devtools=${PTOOLSPATH%/}
150-
php "$devtools/phalcon.php" $*
150+
php "$devtools/phalcon" $*
151151
fi

0 commit comments

Comments
 (0)