小编Sve*_*ven的帖子

Composer 从 bitbucket 创建项目

我的 bitbucket 存储库中有一个项目,我是 Composer 的新手

在这个项目中,我有我所有的要求和设置的 composer.json。

我正在尝试直接从我的 bitbucket 存储库安装我的项目,我想做的事情与我们可以用 github 项目做的事情相同。

例如:

composer create-project thelia/thelia-project path/ 2.2.0
Run Code Online (Sandbox Code Playgroud)

但是如果我执行这个命令:

composer create-project vendor/name .--repository-url=https://vendor@bitbucket.org/vendor/name.git
Run Code Online (Sandbox Code Playgroud)

结果是:

https://vendor@bitbucket.org/vendor/name.git/packages.json could not be downloaded
Run Code Online (Sandbox Code Playgroud)

我已经在 bitbucket 上插入了我的 ssh 密钥以进行部署

我提交了一个 packages.json 到 name.git 存储库,但它不起作用。

这个命令显然是错误的:

composer create-project vendor/name . --repository-url=git@bitbucket.org:vendor/name.git
Run Code Online (Sandbox Code Playgroud)

结果是:

Invalid repository url given. Has to be a .json file or an http url
Run Code Online (Sandbox Code Playgroud)

我在某处读到 composer create-project 充当 git clone 和 composer install ,但我无法让它以正确的方式工作。

怎么了?我在这里找到了很多答案,但我无法让它们起作用。

git bitbucket composer-php

4
推荐指数
1
解决办法
2169
查看次数

spl_autoload_register - 如何防止致命错误

我有以下函数来加载我的库:

function load_class($name) {
    $namePath = explode('_', $name);
    $filePath = '';
    if (is_array($namePath)) {
        for ($i=0; $i<sizeof($namePath); $i++) {
            $filePath .= $namePath[$i];
            if ($i != sizeof($namePath) - 1) $filePath .= '/';
        }
    } else $filePath = $name;
    if (is_file($filePath . '.php')) require_once($filePath . '.php'); 
    else if (is_file($filePath . '.class.php')) require_once($filePath . '.class.php');
    else throw new Exception('Unable to load class: ' . $name . '. No such file or a directory. ');
    if (!class_exists($name)) throw new Exception('Class: ' . $name . …
Run Code Online (Sandbox Code Playgroud)

php oop class

2
推荐指数
1
解决办法
2991
查看次数

GIT无法恢复到先前的提交 - 远程不接受推送

我只是从Git开始,我有一些东西,我需要扭转到以前的提交.我可以在本地做这个没问题.

git reset --hard hashcode(或使用sourcetree)

然而,当我尝试推送到bitbucket时,souretree给了我一个错误,直到我拉下先前的提交,然后我回到了我开始无法恢复到之前的commit.l

如何在本地恢复到先前的提交,然后推送到bitbucket覆盖并删除在我恢复到之后的所有提交?

错误消息是:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin Development:Development
Pushing to git@bitbucket.org:Username/project.git

To git@bitbucket.org:Username/project.git
 ! [rejected]        Development -> Development (non-fast-forward)
error: failed to push some refs to 'git@bitbucket.org:Username/project.git'

hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)

git git-commit atlassian-sourcetree

2
推荐指数
1
解决办法
932
查看次数

php array_multisort()由2个字段组成

我使用array_multisort()函数按字段值对数组进行排序.我需要的是按日期和时间按2个字段值对其进行排序.这是数组的结构:

Array
(
    [0] => Array
        (
            [id_art] => 5292
            [free_art] => 0
            [apero_art] => 0
            [name_cat] => Teatro
            [date_dat] => 2010-11-24
            [date2_dat] => 0000-00-00
            [name_spa] => Cinema Teatro
            [title_int] => Il piacere dell'onestà 
            [id_cat] => 2
            [time_tim] => 20:30:00
            [intro_int] => Una produzione Teatro Eliseo di Roma - ChiassoCultura 
            [image_art] => noimage.png
        )

    [1] => Array
        (
            [id_art] => 4983
            [free_art] => 0
            [apero_art] => 0
            [name_cat] => Cinema
            [date_dat] => 2011-04-20
            [date2_dat] => 2011-04-20
            [name_spa] => Cinema Morettina …
Run Code Online (Sandbox Code Playgroud)

php arrays sorting

1
推荐指数
1
解决办法
1336
查看次数

如何在一个锚标记的href中声明的函数中获取$(this)

我在表格中的td中有以下锚标记:

<a  href="javascript:editAccount()" class="edit">edit</a>
Run Code Online (Sandbox Code Playgroud)

我想在editAccount()函数中找到这个td的父节点,执行以下操作:

function editAccount(){ console.log($(this).parent().parent()); }
Run Code Online (Sandbox Code Playgroud)

但是,我在控制台中一直变为null

ajax jquery

1
推荐指数
2
解决办法
100
查看次数

如何使用 Sugarcrm 中的模块加载器在 config_override.php 中添加自定义代码?

我只想在config_override.phpSugarCRM 中添加一些额外的配置代码。是否可以写入manifest.php文件并通过模块加载器附加它。当我在$installdefs清单文件中使用复制数组添加时,糖会用 file 替换我的文件config_override.php

$installdefs = array(
              'copy' => array(  
                   0 => array(
                'from' => '<basepath>/moduleName/myconfg.php',
                'to' => 'config_override.php',
            ), ), );
Run Code Online (Sandbox Code Playgroud)

我只想附加到 config_override.php 而不是替换整个文件。任何帮助将不胜感激 。

php sugarcrm

1
推荐指数
1
解决办法
1327
查看次数

如何在詹金斯并行管道中汇总测试结果?

我有一个Jenkinsfile用于并行测试执行的定义,任务是从这两者中获取测试结果,以便在post某个地方的一步中对其进行处理。

问题是:该怎么做?搜索作为一个示例代码什么不会带来任何东西-无论是例子处理解释parallel,或者他们解释postjunit

pipeline {
    agent { node { label 'swarm' } }

    stages {
        stage('Testing') {
            parallel {
                stage('Unittest') {
                    agent { node { label 'swarm' } }

                    steps {
                        sh 'unittest.sh'
                    }
                }

                stage ('Integrationtest') {
                    agent { node { label 'swarm' } }

                    steps {
                        sh 'integrationtest.sh'
                    }
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

post {always{junit(...)}}在两个并行阶段都定义了一个步骤,BlueOcean GUI产生了积极的反应,但是测试报告记录的测试量接近两倍-非常奇怪,某些文件必须被扫描两次。将这一post步骤添加到周围的“测试”阶段会产生错误。

我缺少一个示例,该示例详细说明了如何对parallel块中创建的测试结果进行后处理。

jenkins jenkins-pipeline

1
推荐指数
1
解决办法
3244
查看次数

如何在Wordpress中使用Ajax期间加载Visual Composer

我在Wordpress中使用了ajax请求来获取帖子的内容,在该帖子中,我使用了Visual Composer。但是内容仅显示VC短代码,而未将其更改为真实内容。.那就是我使用的代码

add_action( 'wp_ajax_drpk_custom','drpk_custom' );
add_action( 'wp_ajax_nopriv_drpk_custom','drpk_custom' );
function drpk_custom(){
if(isset($_REQUEST)){
    $id = $_REQUEST['id'];

    $query = new WP_Query(array('p'=>$id));
    if($query->have_posts()):
        while($query->have_posts()): $query->the_post();?>
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><?php the_title() ?></h4>
      </div>
      <div class="modal-body">
         <?php the_content() ?>
      </div>
        <?php endwhile;

    endif;
}
wp_die();  }
Run Code Online (Sandbox Code Playgroud)

而这个jQuery代码

    $('.cart-item').find('a').on('click',function(){
    var postID      = $(this).data('id'),
        ajaxContent = $('.modal-content');
        $.ajax({
            url: ajaxUrl.url,
            data: {
                'action' : 'drpk_custom',
                'id': postID
            },
            beforeSend: function(){
                // $load.fadeIn(500);
            },
            success: function(data){
                // $load.hide();
                ajaxContent.html(data);
            }
        }); 
    }); …
Run Code Online (Sandbox Code Playgroud)

php ajax wordpress jquery visual-composer

0
推荐指数
1
解决办法
3016
查看次数

PHP速记if else条件问题

我无法理解我正在做什么,如果没有其他简写代码

$item  = '<li '. ($avatar_size > 50) ? .'style="overflow:hidden">';
Run Code Online (Sandbox Code Playgroud)

我只想检查条件是否为真,而不是添加内联样式.

编辑:当然在上面的语句中,>当条件为假时它也将被删除所以我尝试了其他语句但没有工作.我相信我一定是犯了愚蠢的错误,但无法弄清楚.

$item  = '<li '. ($avatar_size > 50) ? .'style="overflow:hidden"'.:. '' .'>';
Run Code Online (Sandbox Code Playgroud)

php if-statement

-1
推荐指数
1
解决办法
3054
查看次数