小编Aar*_*ley的帖子

OOP PHP First Class Mysql数据库连接

我正在上一个测试课,主要是自学.以下是课程:

class Connection
{   
    public $con;
    public $dbSelected;
    public $activeConnection;
    public $dataBaseName;
    function __contruct($dbUserName, $dbPassword, $server = "localhost")
    {
        $this->con = mysql_connect($server,$dbUserName,$dbPassword);
        if(!$this->$con)
        {
            $this->activeConnection = false;
        }
        else
        {
            $this->activeConnection = true;
        }
    }

    public function dbConnect($dbName, $identifyer = null)
    {   
        if ($identifyer === null)
        {
            $identifyer = $this->con;
        }
        $this->dbSelected = mysql_select_db($dbName, $identifyer);
        $this->dataBaseName = $dbName;
        if($this->dbSelected != true)
        {
            $this->connectionErrorReport(__LINE__);
        }
    }


    public function cleanData( array $submission)
    {
        unset($submission["throughTheCleaners"]);
        foreach($submission as $key => $value)
        {

            if(is_array($value))
            { …
Run Code Online (Sandbox Code Playgroud)

php oop database-connection class

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

Vagrant Shell Provisioning运行但失败

在学习教程时,我有一个正在构建的简单的无用信息框。我已经在盒子上建立了,这是我的流浪文件。

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "precise32"
  config.vm.box_url = "http://files.vagrantup.com/precise32.box"
  config.vm.provision :shell, :path => "bootstrap.sh"

  #config.vm.network "forwarded_port", guest: 80, host: 8080



end
Run Code Online (Sandbox Code Playgroud)

这似乎工作正常,并且正在等待其他配置,但是配置存在问题。

它发现Shell脚本很好,没有错误。它甚至可以构建无聊的盒子。但是,当完成时,我会收到此错误

==> default: stdin: is not a tty
==> default: bash: /tmp/vagrant-shell: /user/bin/env: bad interpreter: No such file or directory
The following SSH command responded with a non-zero exit status.
Vagrant assumes …
Run Code Online (Sandbox Code Playgroud)

linux bash shell vagrant

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

标签 统计

bash ×1

class ×1

database-connection ×1

linux ×1

oop ×1

php ×1

shell ×1

vagrant ×1