如何在不使用ZF2中的SkeletonApp的情况下安装(正确)ScnSocialAuth

时间:2015-07-07 10:43:29

标签: zend-framework2 hybridauth zfcuser

我从https://github.com/SocalNick/ScnSocialAuth读了自述文件。我不能使用ZendSkeleton,因为我想将它集成到现有项目中。

我很安静,README没有回答一些问题,比如

  1. 如何将其与我的zfc-user / login.phtml / register.phtml等集成?
  2. 自述文件的最后一步后我该怎么办?
  3. 如果有效,我需要访问哪个页面进行测试?
  4. 我的问题是README有一个突然的结束,让我对如何使用/访问它一无所知。

    但是,我按照自述文件中的所有步骤操作,最终出现以下错误:

    PHP Fatal error: Call to a member function getEnabledProviders() on a non-object in /view/zfc-user/user/login.phtml on line 3

    我的zfc-user / login.phtml

    <?php
    $socialSignIn = true;
    foreach ($this->options->getEnabledProviders() as $provider) {
    if ($socialSignIn) {
        echo '<h1>Social Sign In</h1>';
        $socialSignIn = false;
    }
    echo '<dd>' . $this->socialSignInButton($provider, $this->redirect) . '</dd>';
    }
    if ($this->options->getSocialLoginOnly() == false) {
    echo $this->zfcUserLogin;
    }
    ?>
    

    application.config.php

    'modules' => array(
        'Application',
        'ScnSocialAuth',
        'ZfcBase',
        'ZfcUser'
        ...
    

    composer.json

    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.*",
        "zendframework/zend-diactoros": "*",
        "zf-commons/zfc-base": "*",
        "zf-commons/zfc-user": "1.2.*",
        "neilime/zf2-twb-bundle": "*",
        "symfony/yaml": "*",
        "snapshotpl/zf-snap-jquery": "dev-master",
        "zendframework/zendservice-recaptcha": "2.*",
        "socalnick/scn-social-auth": "1.*"
    },
    "autoload": {
        "psr-0": {
            "Hybrid": "vendor/hybridauth/hybridauth/hybridauth/"
        }
    }
    

    composers autoload_namespaces.php

    return array(
    'phpDocumentor' => array($vendorDir . '/phpdocumentor/reflection-docblock/src'),
    'ZfcUser' => array($vendorDir . '/zf-commons/zfc-user/src'),
    'ZfcBase' => array($vendorDir . '/zf-commons/zfc-base/src'),
    'ZfSnapJquery' => array($vendorDir . '/snapshotpl/zf-snap-jquery/src'),
    'ZendXml' => array($vendorDir . '/zendframework/zendxml/library'),
    'ZendService' => array($vendorDir . '/zendframework/zendservice-recaptcha/library'),
    'TwbBundle' => array($vendorDir . '/neilime/zf2-twb-bundle/src'),
    'ScnSocialAuthTest' => array($vendorDir . '/socalnick/scn-social-auth/test'),
    'ScnSocialAuth' => array($vendorDir . '/socalnick/scn-social-auth/src'),
    'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'),
    'Hybrid' => array($vendorDir . '/hybridauth/hybridauth/hybridauth', $vendorDir . '/hybridauth/hybridauth/hybridauth'),
    );
    

    我是否会错过文档中的某些内容,或者只是因为我头上的热量?

0 个答案:

没有答案