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

  • 相关阅读:
    linux查看日志文件内容命令tail、cat、tac、head、echo
    改变自己的128种方法,教你变得更优秀!
    php 23种设计模式
    Swoole消息推送
    PHP 出现 502 解决方案
    【centos7】添加开机启动服务/脚本
    curl 参数配置详解
    i系列标准-互联网周刊
    MySQL 设计与开发规范2
    Cocos Creator webviw网页置顶增加返回键的方法
  • 原文地址:https://www.cnblogs.com/xingxia/p/php_phalcon.html
Copyright © 2011-2022 走看看