zoukankan      html  css  js  c++  java
  • php框架之phalcon

       

     1.开发助手

           1) 下载

    git clone https://github.com/phalcon/cphalcon.git
    
    git clone https://github.com/phalcon/phalcon-devtools.git

             2)修改目录下的ide/gen-stubs.php文件

    // define('CPHALCON_DIR' , '/Users/micate/Code/cphalcon/ext/php');
    define('CPHALCON_DIR' , 'E:xampphtdocsphalcon-devtools');
    
    // if (!file_exists(CPHALCON_DIR)) {
    //     throw new Exception("CPHALCON directory does not exist");
    // }
    
    
    //需要将文件的目录改成开发包的目录地址

              3) 生成phalcon语法文件

    php gen-stub.php

                

        4)配置PHPstorm支持phalcon语法(指定包的地址即可)

      常见错误汇总:

        1.  Scanner: Unknown opcode 58

     $condition = 'username = :username:';
                $params    = [
                    'username'  =>  $username,
                ];
    
                $row = SysUser::findFirst(
                    [
                        $condition,
                        'bind'  =>  $params
                    ]
                );
    
    //执行数据查询的时候, 错误的原因是 绑定的参数 :username  注意两点都有冒号

        2. 

    Fatal error: Uncaught Error: Access to undeclared static property: PhalconDi::$_default in E:xampphtdocsdajiala_mainpublicindex.php:18 Stack trace: #0 [internal function]: PhalconDi->__construct() #1 E:xampphtdocsdajiala_mainpublicindex.php(18): PhalconDiFactoryDefault->__construct() #2 {main} Next Error: Access to undeclared static property: PhalconDi::$_default in E:xampphtdocsdajiala_mainpublicindex.php:18 Stack trace: #0 [internal function]: PhalconDi->__construct() #1 E:xampphtdocsdajiala_mainpublicindex.php(18): PhalconDiFactoryDefault->__construct() #2 {main} thrown in E:xampphtdocsdajiala_mainpublicindex.php on line 18

                     php扩展版本对应的有问题,一定要下载对应的版本https://github.com/phalcon/cphalcon

  • 相关阅读:
    最新macOS 11.4+Xcode 12.5+iOS 14.6 编译安装WebDriverAgent填坑记
    python +pytest +yaml + Allure 实现接口自动化框架
    DNS原理及其解析过程
    jmeter性能测试--ramp_up和同步定时器的区别
    jmeter常用定时器
    基本sql语句
    MySQL连表查询
    MySQL约束条件
    MySQL单表查询
    linux 查看文件的前几行 或者 某些行
  • 原文地址:https://www.cnblogs.com/xingxia/p/php_phalcon.html
Copyright © 2011-2022 走看看