forked from claroline/CoreBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change update strategy (use diff of local repos)
- Loading branch information
Showing
14 changed files
with
561 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Claroline Connect package. | ||
* | ||
* (c) Claroline Consortium <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Claroline\CoreBundle\Library\Installation; | ||
|
||
class ExecutorException extends \Exception | ||
{ | ||
const REPO_NOT_FOUND = 11; | ||
const REPO_NOT_JSON = 12; | ||
const REPO_NOT_ARRAY = 13; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Claroline Connect package. | ||
* | ||
* (c) Claroline Consortium <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Claroline\CoreBundle\Library\Installation; | ||
|
||
/** | ||
* Holds the details of an install/update operation, such as the type | ||
* of the operation, the package name, the target version, etc. | ||
*/ | ||
class Operation | ||
{ | ||
const INSTALL = 'install'; | ||
const UPDATE = 'update'; | ||
|
||
private $type; | ||
private $package; | ||
private $bundleFqcn; | ||
private $fromVersion; | ||
private $toVersion; | ||
|
||
public function __construct($type, \stdClass $package, $bundleFqcn) | ||
{ | ||
if (!in_array($type, [self::INSTALL, self::UPDATE])) { | ||
throw new \InvalidArgumentException( | ||
'Operation type must be an Operation::* class constant' | ||
); | ||
} | ||
|
||
$this->type = $type; | ||
$this->package = $package; | ||
$this->bundleFqcn = $bundleFqcn; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function getPackageName() | ||
{ | ||
return $this->package->name; | ||
} | ||
|
||
public function getPackageType() | ||
{ | ||
return $this->package->type; | ||
} | ||
|
||
public function getBundleFqcn() | ||
{ | ||
return $this->bundleFqcn; | ||
} | ||
|
||
public function setFromVersion($version) | ||
{ | ||
$this->fromVersion = $version; | ||
} | ||
|
||
public function getFromVersion() | ||
{ | ||
return $this->fromVersion; | ||
} | ||
|
||
public function setToVersion($version) | ||
{ | ||
$this->toVersion = $version; | ||
} | ||
|
||
public function getToVersion() | ||
{ | ||
return $this->toVersion; | ||
} | ||
|
||
public function getRawPackage() | ||
{ | ||
return $this->package; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.